package com.saye.hospitalgd.commons.page;

import com.github.pagehelper.PageInfo;

import java.util.List;

public class PageUtil {
	
	public static TemplatePage loadJsonPage(PageInfo pageInfo){
		TemplatePage templetJson = new TemplatePage();
		try {
			List list = pageInfo.getList();
			int i = (int) pageInfo.getTotal();
			templetJson.setCount(i);
			templetJson.setCode(0);
			templetJson.setMsg("");
			templetJson.setData(list);
		} catch (Exception e) {
			templetJson.setCode(1);
		}
		return templetJson;
	}
}
