Commit e2941441b26f373429cedd37d38c17a5614b8db1
1 parent
79d2da0006
Exists in
master
小程序用户端保存搜索记录
Showing 7 changed files with 156 additions and 4 deletions
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/SearchLogsController.java
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/TkRecordController.java
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsSearchlogs.java
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsSearchlogsMapper.java
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsSearchlogsService.java
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsSearchlogsServiceImpl.java
- talkonlineweb/src/main/resources/mapper/LymsSearchlogsMapper.xml
talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/SearchLogsController.java
View file @
e294144
| 1 | +package com.lyms.talkonlineweb.controller; | |
| 2 | + | |
| 3 | +import com.lyms.talkonlineweb.domain.LymsSearchlogs; | |
| 4 | +import com.lyms.talkonlineweb.result.BaseResponse; | |
| 5 | +import com.lyms.talkonlineweb.service.LymsSearchlogsService; | |
| 6 | +import lombok.extern.log4j.Log4j2; | |
| 7 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 8 | +import org.springframework.web.bind.annotation.*; | |
| 9 | + | |
| 10 | +@Log4j2 | |
| 11 | +@RestController | |
| 12 | +@RequestMapping("searchlogs") | |
| 13 | +public class SearchLogsController { | |
| 14 | + @Autowired | |
| 15 | + private LymsSearchlogsService lymsSearchlogsService; | |
| 16 | + | |
| 17 | + /** | |
| 18 | + * 小程序用户端保存搜索记录 | |
| 19 | + * @param lymsSearchlogs | |
| 20 | + * @return | |
| 21 | + */ | |
| 22 | + @PostMapping("saveSearchlogs") | |
| 23 | + public BaseResponse saveSearchlogs(@RequestBody LymsSearchlogs lymsSearchlogs){ | |
| 24 | + BaseResponse baseResponse=new BaseResponse(); | |
| 25 | + try { | |
| 26 | + lymsSearchlogsService.save(lymsSearchlogs); | |
| 27 | + baseResponse.setErrormsg("成功"); | |
| 28 | + } catch (Exception e) { | |
| 29 | + baseResponse.setErrormsg("失败"); | |
| 30 | + e.printStackTrace(); | |
| 31 | + } | |
| 32 | + return baseResponse; | |
| 33 | + } | |
| 34 | +} |
talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/TkRecordController.java
View file @
e294144
| 1 | 1 | package com.lyms.talkonlineweb.controller; |
| 2 | 2 | |
| 3 | -import com.baomidou.mybatisplus.core.conditions.Wrapper; | |
| 4 | -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |
| 5 | 3 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| 6 | -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |
| 7 | -import com.lyms.talkonlineweb.domain.LymsDoctor; | |
| 8 | 4 | import com.lyms.talkonlineweb.domain.LymsTkrecord; |
| 9 | 5 | import com.lyms.talkonlineweb.domain.TkrecordInfo; |
| 10 | 6 | import com.lyms.talkonlineweb.result.BaseResponse; |
| ... | ... | @@ -25,6 +21,11 @@ |
| 25 | 21 | @Autowired |
| 26 | 22 | private TkrecordInfoService tkrecordInfoService; |
| 27 | 23 | |
| 24 | + /** | |
| 25 | + * 保存问诊记录 | |
| 26 | + * @param tkrecord | |
| 27 | + * @return | |
| 28 | + */ | |
| 28 | 29 | @PostMapping("saveTkRecord") |
| 29 | 30 | public BaseResponse saveTkRecord(@RequestBody @Validated LymsTkrecord tkrecord){ |
| 30 | 31 | BaseResponse baseResponse=new BaseResponse(); |
| ... | ... | @@ -38,6 +39,12 @@ |
| 38 | 39 | |
| 39 | 40 | return baseResponse; |
| 40 | 41 | } |
| 42 | + | |
| 43 | + /** | |
| 44 | + * 删除问诊记录 | |
| 45 | + * @param tkid | |
| 46 | + * @return | |
| 47 | + */ | |
| 41 | 48 | @PostMapping("deleteTkRecord") |
| 42 | 49 | public BaseResponse deleteTkRecord(Integer tkid){ |
| 43 | 50 | BaseResponse baseResponse=new BaseResponse(); |
talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsSearchlogs.java
View file @
e294144
| 1 | +package com.lyms.talkonlineweb.domain; | |
| 2 | + | |
| 3 | +import com.baomidou.mybatisplus.annotation.*; | |
| 4 | + | |
| 5 | +import java.io.Serializable; | |
| 6 | +import java.util.Date; | |
| 7 | +import lombok.Data; | |
| 8 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * 用户小程序搜索记录 | |
| 12 | + * @TableName lyms_searchlogs | |
| 13 | + */ | |
| 14 | +@TableName(value ="lyms_searchlogs") | |
| 15 | +@Data | |
| 16 | +public class LymsSearchlogs implements Serializable { | |
| 17 | + /** | |
| 18 | + * | |
| 19 | + */ | |
| 20 | + @TableId(value = "id", type = IdType.AUTO) | |
| 21 | + private Integer id; | |
| 22 | + | |
| 23 | + /** | |
| 24 | + * 患者id | |
| 25 | + */ | |
| 26 | + @TableField(value = "pid") | |
| 27 | + private Integer pid; | |
| 28 | + | |
| 29 | + /** | |
| 30 | + * 搜索关键字 | |
| 31 | + */ | |
| 32 | + @TableField(value = "searchtxt") | |
| 33 | + private String searchtxt; | |
| 34 | + | |
| 35 | + /** | |
| 36 | + * 搜索时间 | |
| 37 | + */ | |
| 38 | + @TableField(value = "createdtime",fill = FieldFill.INSERT) | |
| 39 | + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") | |
| 40 | + private Date createdtime; | |
| 41 | + | |
| 42 | + @TableField(exist = false) | |
| 43 | + private static final long serialVersionUID = 1L; | |
| 44 | + | |
| 45 | + | |
| 46 | +} |
talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsSearchlogsMapper.java
View file @
e294144
| 1 | +package com.lyms.talkonlineweb.mapper; | |
| 2 | + | |
| 3 | +import com.lyms.talkonlineweb.domain.LymsSearchlogs; | |
| 4 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |
| 5 | + | |
| 6 | +/** | |
| 7 | + * @Entity com.lyms.talkonlineweb.domain.LymsSearchlogs | |
| 8 | + */ | |
| 9 | +public interface LymsSearchlogsMapper extends BaseMapper<LymsSearchlogs> { | |
| 10 | + | |
| 11 | +} |
talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsSearchlogsService.java
View file @
e294144
talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsSearchlogsServiceImpl.java
View file @
e294144
| 1 | +package com.lyms.talkonlineweb.service.impl; | |
| 2 | + | |
| 3 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
| 4 | +import com.lyms.talkonlineweb.domain.LymsSearchlogs; | |
| 5 | +import com.lyms.talkonlineweb.service.LymsSearchlogsService; | |
| 6 | +import com.lyms.talkonlineweb.mapper.LymsSearchlogsMapper; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | + | |
| 9 | +/** | |
| 10 | + * | |
| 11 | + */ | |
| 12 | +@Service | |
| 13 | +public class LymsSearchlogsServiceImpl extends ServiceImpl<LymsSearchlogsMapper, LymsSearchlogs> | |
| 14 | + implements LymsSearchlogsService{ | |
| 15 | + | |
| 16 | +} |
talkonlineweb/src/main/resources/mapper/LymsSearchlogsMapper.xml
View file @
e294144
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<!DOCTYPE mapper | |
| 3 | + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |
| 4 | + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
| 5 | +<mapper namespace="com.lyms.talkonlineweb.mapper.LymsSearchlogsMapper"> | |
| 6 | + | |
| 7 | + <resultMap id="BaseResultMap" type="com.lyms.talkonlineweb.domain.LymsSearchlogs"> | |
| 8 | + <id property="id" column="id" jdbcType="INTEGER"/> | |
| 9 | + <result property="pid" column="pid" jdbcType="INTEGER"/> | |
| 10 | + <result property="searchtxt" column="searchtxt" jdbcType="VARCHAR"/> | |
| 11 | + <result property="createdtime" column="createdtime" jdbcType="TIMESTAMP"/> | |
| 12 | + </resultMap> | |
| 13 | + | |
| 14 | + <sql id="Base_Column_List"> | |
| 15 | + id,pid, | |
| 16 | + searchtxt, | |
| 17 | + createdtime | |
| 18 | + </sql> | |
| 19 | +</mapper> |