From 86db4050fe9d5e3d22aa2d871f1820f262ab85b9 Mon Sep 17 00:00:00 2001 From: changpengfei Date: Sat, 18 Sep 2021 10:30:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E6=82=A3=E8=80=85=E6=84=9F=E5=85=B4=E8=B6=A3=E7=9A=84=E7=A7=91?= =?UTF-8?q?=E5=AE=A4json=E4=BC=A0=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/lyms/talkonlineweb/controller/FavorController.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/FavorController.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/FavorController.java index e1f667d..ad57f9e 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/FavorController.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/FavorController.java @@ -9,10 +9,9 @@ import com.lyms.talkonlineweb.service.LymsFavorService; import com.lyms.talkonlineweb.service.LymsHdepartService; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; /** * 患者感兴趣内容管理 @@ -33,17 +32,17 @@ public class FavorController { * @return */ @PostMapping("saveFavor") - public BaseResponse saveFavor(String pid,String dpids){ + public BaseResponse saveFavor(@RequestBody Map param){ BaseResponse baseResponse=new BaseResponse(); boolean f=false; - String[] dpidArr=dpids.split(","); + String[] dpidArr=param.get("dpids").toString().split(","); for (int i = 0; i < dpidArr.length; i++) { LymsFavor favor =new LymsFavor(); LymsHdepart depart=new LymsHdepart(); depart=lymsHdepartService.getById(dpidArr[i]); BeanUtils.copyProperties(depart,favor); - favor.setIid(Integer.parseInt(pid)); + favor.setIid(Integer.parseInt(param.get("pid").toString())); f=lymsFavorService.saveOrUpdate(favor); } -- 1.8.3.1