首页>代码>SpringBoot医药管理系统>/springboot-drugs/src/main/java/com/simon/springbootdrugs/common/ResultMapUtil.java
package com.simon.springbootdrugs.common; import com.baomidou.mybatisplus.core.metadata.IPage; import java.util.HashMap; import java.util.List; /** * @author Simon */ public class ResultMapUtil { public static HashMap<String, Object> getHashMapLogin(String msg, String code) { HashMap<String, Object> resultMap = new HashMap<>(); resultMap.put("msg", msg); resultMap.put("code", code); if ("1".equals(code)) { resultMap.put("icon", 1); } else { resultMap.put("icon", 3); } resultMap.put("anim", 4); return resultMap; } public static HashMap<String, Object> getHashMapMysqlPage(IPage<?> object) { HashMap<String, Object> resultMap = new HashMap<>(); resultMap.put("code", 0); resultMap.put("msg", ""); resultMap.put("count", object.getTotal()); resultMap.put("data", object.getRecords()); resultMap.put("pages", object.getPages()); resultMap.put("pageNum", object.getCurrent()); resultMap.put("pageSize", object.getSize()); return resultMap; } public static HashMap<String, Object> getHashMapException(Exception e) { HashMap<String, Object> resultMap = new HashMap<>(); resultMap.put("code", 0); resultMap.put("msg", e.getMessage()); return resultMap; } public static HashMap<String, Object> getHashMapSave(int i) { HashMap<String, Object> resultMap = new HashMap<>(); if (i == 0) { resultMap.put("msg", "保存失败"); resultMap.put("code", 1); resultMap.put("icon", 5); resultMap.put("anim", 6); } else { resultMap.put("msg", "保存成功"); resultMap.put("code", 0); resultMap.put("icon", 1); resultMap.put("anim", 4); } return resultMap; } public static HashMap<String, Object> getHashMapDel(int i) { HashMap<String, Object> resultMap = new HashMap<>(); if (i == 0) { resultMap.put("msg", "删除失败"); resultMap.put("code", 1); resultMap.put("icon", 5); resultMap.put("anim", 6); } else { resultMap.put("msg", "删除成功"); resultMap.put("code", 0); resultMap.put("icon", 1); resultMap.put("anim", 4); } return resultMap; } public static HashMap<String, Object> getHashMapList(List<?> list) { HashMap<String, Object> resultMap = new HashMap<>(); resultMap.put("code", 0); if (list != null && list.size() > 0) { resultMap.put("msg", ""); } else { resultMap.put("msg", "没有查询到数据!"); } resultMap.put("data", list); return resultMap; } }

Yj123456k LV2
5月10日
王愉悦 LV4
2024年12月3日
zolscy LV24
2024年11月26日
xinxin23383 LV7
2024年9月13日
微信网友_7134912998903808 LV15
2024年8月29日
sweetlove LV20
2024年7月30日
樱花味小然子 LV5
2024年7月3日
破剑茶寮 LV4
2024年6月26日
TY0165 LV20
2024年6月16日
2775645521 LV7
2024年6月16日

haitianjiaoyu0 LV8
5月27日
Yj123456k LV2
5月10日
gann2015 LV25
4月11日
zhao44413
2月21日
暂无贡献等级
微信网友_7371218154688512 LV4
2月5日
zhangtian1997 LV10
2月5日
wangjinhao
1月20日
暂无贡献等级
geekcjj LV18
2024年12月23日
苯科仔
2024年12月16日
暂无贡献等级
lovedy LV2
2024年12月16日