Commit dd97927781715769723b8f18b2106f21b9269553

Authored by shiyang
1 parent 0ab25f3edc
Exists in master

小程序-用户添加关注记录

Showing 2 changed files with 20 additions and 5 deletions

talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java View file @ dd97927
... ... @@ -628,5 +628,21 @@
628 628 baseResponse.setObject(rs);
629 629 return baseResponse;
630 630 }
  631 + /**
  632 + * 小程序-用户关注医生保存关注记录
  633 + * @return
  634 + */
  635 + @PostMapping("saveAttention")
  636 + public BaseResponse saveAttention(@RequestBody LymsAttention lymsAttention){
  637 + BaseResponse baseResponse=new BaseResponse();
  638 + try {
  639 + lymsAttentionService.save(lymsAttention);
  640 + baseResponse.setErrormsg("成功");
  641 + } catch (Exception e) {
  642 + baseResponse.setErrormsg("失败");
  643 + e.printStackTrace();
  644 + }
  645 + return baseResponse;
  646 + }
631 647 }
talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsAttention.java View file @ dd97927
1 1 package com.lyms.talkonlineweb.domain;
2 2  
3   -import com.baomidou.mybatisplus.annotation.IdType;
4   -import com.baomidou.mybatisplus.annotation.TableField;
5   -import com.baomidou.mybatisplus.annotation.TableId;
6   -import com.baomidou.mybatisplus.annotation.TableName;
  3 +import com.baomidou.mybatisplus.annotation.*;
7 4 import lombok.Data;
8 5 import lombok.ToString;
  6 +import org.springframework.format.annotation.DateTimeFormat;
9 7  
10 8 import java.io.Serializable;
11 9 import java.util.Date;
... ... @@ -45,7 +43,8 @@
45 43 /**
46 44 * 创建时间
47 45 */
48   - @TableField(value = "createdtime")
  46 + @TableField(value = "createdtime",fill = FieldFill.INSERT)
  47 + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
49 48 private Date createdtime;
50 49  
51 50 }