diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/RegionsController.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/RegionsController.java index 769b866..4a0e3ba 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/RegionsController.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/RegionsController.java @@ -1,7 +1,9 @@ package com.lyms.talkonlineweb.controller; import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.lyms.talkonlineweb.domain.LymsDict; +import com.lyms.talkonlineweb.domain.LymsHdepart; import com.lyms.talkonlineweb.domain.Regions; import com.lyms.talkonlineweb.result.BaseResponse; import com.lyms.talkonlineweb.service.LymsDictService; @@ -45,4 +47,40 @@ public class RegionsController { return baseResponse; } + /** + * 添加或修改字典数据 + * @param dict + * @return + */ + @GetMapping("saveDict") + public BaseResponse saveDict(LymsDict dict){ + BaseResponse baseResponse=new BaseResponse(); + boolean f=lymsDictService.save(dict); + baseResponse.setErrorcode(f==true?0:1); + return baseResponse; + } + + /** + * 删除字典数据 + * @param did + * @return + */ + @GetMapping("delDict") + public BaseResponse saveDict(int did){ + BaseResponse baseResponse=new BaseResponse(); + boolean f=lymsDictService.removeById(did); + baseResponse.setErrorcode(f==true?0:1); + return baseResponse; + } + + @GetMapping("sltDict") + public BaseResponse sltDepartLst(LymsDict dict, int current, int size){ + BaseResponse baseResponse=new BaseResponse(); + Page page=new Page<>(current,size); + Page departPage=lymsDictService.page(page, Wrappers.query(dict).orderByDesc("sort")); + baseResponse.setObject(departPage); + + return baseResponse; + } + }