From b4a814c5233885cc5df6ac76d6b8f9b5958c603c Mon Sep 17 00:00:00 2001 From: 张天森 <1292933220@qq.com> Date: 星期三, 28 九月 2022 11:20:06 +0800 Subject: [PATCH] bug修改 --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSanShuoExpertApi.java | 55 ++++++++++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 46 insertions(+), 9 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSanShuoExpertApi.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSanShuoExpertApi.java index b477027..ffb69d2 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSanShuoExpertApi.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSanShuoExpertApi.java @@ -4,7 +4,11 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.panzhihua.common.controller.BaseController; import com.panzhihua.common.model.dtos.community.sanshuo.ComSanshuoExpertDTO; +import com.panzhihua.common.model.vos.LoginUserInfoVO; import com.panzhihua.common.model.vos.R; +import com.panzhihua.common.model.vos.user.AdministratorsUserVO; +import com.panzhihua.common.service.user.UserService; +import com.panzhihua.common.utlis.Snowflake; import com.panzhihua.service_community.entity.ComSanshuoExpert; import com.panzhihua.service_community.service.ComSanShuoExpertService; import io.swagger.annotations.Api; @@ -25,6 +29,8 @@ @Resource private ComSanShuoExpertService comSanShuoExpertService; + @Resource + private UserService userService; /** * 添加专家 @@ -32,14 +38,20 @@ @PostMapping public R add(@RequestBody ComSanshuoExpertDTO comSanshuoExpertDTO){ comSanshuoExpertDTO.setCreateBy(this.getLoginUserInfo().getName()); - return R.ok(comSanShuoExpertService.addExpert(comSanshuoExpertDTO)); + return comSanShuoExpertService.addExpert(comSanshuoExpertDTO); + } + + @GetMapping("/detail") + public R detail(@RequestParam Long id){ + return R.ok(comSanShuoExpertService.getById(id)); } /** * 小程序获取可选择专家 * */ - @GetMapping("appletsList") + @GetMapping("/appletsList") public R appList(){ + comSanShuoExpertService.selectExpertList(); return R.ok(comSanShuoExpertService.list(new QueryWrapper<ComSanshuoExpert>().eq("status",1).eq("del_flag",1))); } @@ -58,20 +70,18 @@ * 后台获取列表 * */ @GetMapping("/backstageList") - public R backList(@RequestParam(value = "keyWord",required = false)@ApiParam("搜索关键字") String keyWord, + public R backList(@RequestParam(value = "keyWord",required = false) String keyWord, @RequestParam(value = "page",required = false)Integer page, @RequestParam(value = "size",required = false)Integer size){ - //TODO 获取当前账号级别确定范围 - Integer range=null; - Long id=null; - return R.ok(comSanShuoExpertService.expertPage(keyWord,page,size,range,id)); + LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); + return comSanShuoExpertService.expertPage(keyWord,page,size,loginUserInfo); } /** * 删除 * */ - @DeleteMapping("/remove/{id}") - public R remove(@PathVariable("id")Long id){ + @DeleteMapping("/remove") + public R remove(@RequestParam("id")Long id){ //TODO 是否有为解决事件 ComSanshuoExpert expert = comSanShuoExpertService.getById(id); expert.setStatus(0); @@ -88,4 +98,31 @@ expert.setPassword(comSanshuoExpertDTO.getPassword()); return R.ok(comSanShuoExpertService.updateById(expert)); } + + /** + * 专家风采 + * */ + @GetMapping("/expertShow") + public R expertShow(){ + return comSanShuoExpertService.expertShow(); + } + + + /** + * 专家范围 + * */ + @GetMapping("/expertRange") + public R expertRange(){ + LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); + return comSanShuoExpertService.expertRange(loginUserInfo); + } + + /** + * 专家风采列表 + * */ + @GetMapping("/expertShowList") + public R expertShowList(@RequestParam(value = "level",required = false)Integer level, + @RequestParam(value = "id",required = false)Long id){ + return comSanShuoExpertService.expertShowList(level,id); + } } -- Gitblit v1.7.1