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); }