diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java index ed8484a..679ba5c 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java @@ -628,4 +628,20 @@ public class PatientController { baseResponse.setObject(rs); return baseResponse; } + /** + * 小程序-用户关注医生保存关注记录 + * @return + */ + @PostMapping("saveAttention") + public BaseResponse saveAttention(@RequestBody LymsAttention lymsAttention){ + BaseResponse baseResponse=new BaseResponse(); + try { + lymsAttentionService.save(lymsAttention); + baseResponse.setErrormsg("成功"); + } catch (Exception e) { + baseResponse.setErrormsg("失败"); + e.printStackTrace(); + } + return baseResponse; + } } diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsAttention.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsAttention.java index 6753fa4..e94e212 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsAttention.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsAttention.java @@ -1,11 +1,9 @@ package com.lyms.talkonlineweb.domain; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.*; import lombok.Data; import lombok.ToString; +import org.springframework.format.annotation.DateTimeFormat; import java.io.Serializable; import java.util.Date; @@ -45,7 +43,8 @@ public class LymsAttention implements Serializable { /** * 创建时间 */ - @TableField(value = "createdtime") + @TableField(value = "createdtime",fill = FieldFill.INSERT) + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date createdtime; }