diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/ArticleController.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/ArticleController.java index 5fb7941..bfc30dc 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/ArticleController.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/ArticleController.java @@ -1,5 +1,6 @@ package com.lyms.talkonlineweb.controller; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.lyms.talkonlineweb.domain.*; @@ -12,10 +13,7 @@ import lombok.extern.log4j.Log4j2; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.http.codec.multipart.Part; -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 org.springframework.web.multipart.MultipartFile; import java.io.File; @@ -198,5 +196,25 @@ public class ArticleController { } return baseResponse; } + /** + * 根据患者id,问诊id,状态类型1为已读更新推送文章记录 + */ + @PostMapping("updatePushedartlogs") + public BaseResponse updatePushedartlogs(@RequestBody LymsPushedart pushedart) { + BaseResponse baseResponse=new BaseResponse(); + try { + UpdateWrapper updateWrapper = new UpdateWrapper<>(); + updateWrapper.eq("pid",pushedart.getPid()).eq("aid", pushedart.getAid()); + boolean f=lymsPushedartService.update(pushedart,updateWrapper); + baseResponse.setErrorcode(f==true?0:1); + baseResponse.setErrormsg(f==true?"成功":"失败"); + } catch (Exception e) { + baseResponse.setErrorcode(1); + baseResponse.setErrormsg("失败"); + e.printStackTrace(); + } + + return baseResponse; + } }