From 5ce8bef53e78a2bcd1549fb398e60d69c2d2b33a Mon Sep 17 00:00:00 2001 From: 张天森 <1292933220@qq.com> Date: 星期日, 09 十月 2022 10:17:09 +0800 Subject: [PATCH] update --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSanShuoExpertApi.java | 9 +++------ 1 files changed, 3 insertions(+), 6 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 8947001..cdf9908 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 @@ -46,7 +46,7 @@ @PostMapping public R add(@RequestBody ComSanshuoExpertDTO comSanshuoExpertDTO){ comSanshuoExpertDTO.setCreateBy(this.getLoginUserInfo().getName()); - return comSanShuoExpertService.addExpert(comSanshuoExpertDTO); + return comSanShuoExpertService.addOrUpdateExpert(comSanshuoExpertDTO); } @GetMapping("/detail") @@ -58,7 +58,7 @@ * 小程序获取可选择专家 * */ @GetMapping("/appletsList") - public R appList(@RequestParam ("type")Integer type,@RequestParam("id")Long id){ + public R appList(@RequestParam (value = "type",required = false)Integer type,@RequestParam(value = "id",required = false)Long id){ return comSanShuoExpertService.selectExpertList(type, id,this.getLoginUserInfo().getCommunityId()); } @@ -67,10 +67,7 @@ * */ @PutMapping public R update(@RequestBody ComSanshuoExpertDTO comSanshuoExpertDTO){ - ComSanshuoExpert expert=new ComSanshuoExpert(); - BeanUtil.copyProperties(comSanshuoExpertDTO,expert); - expert.setUpdateTime(new Date()); - return R.ok(comSanShuoExpertService.updateById(expert)); + return R.ok(comSanShuoExpertService.addOrUpdateExpert(comSanshuoExpertDTO)); } /** -- Gitblit v1.7.1