diff --git a/february-auth/february-auth-server/src/main/resources/bootstrap.yml b/february-auth/february-auth-server/src/main/resources/bootstrap.yml index 058204f..72f4437 100644 --- a/february-auth/february-auth-server/src/main/resources/bootstrap.yml +++ b/february-auth/february-auth-server/src/main/resources/bootstrap.yml @@ -14,10 +14,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 10.100.1.2:8848 + server-addr: 47.120.41.50:8848 config: # 配置中心地址 - server-addr: 10.100.1.2:8848 + server-addr: 47.120.41.50:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/february-gateway/src/main/resources/bootstrap.yml b/february-gateway/src/main/resources/bootstrap.yml index 0d06e54..0fc6052 100644 --- a/february-gateway/src/main/resources/bootstrap.yml +++ b/february-gateway/src/main/resources/bootstrap.yml @@ -14,10 +14,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 10.100.1.2:8848 + server-addr: 47.120.41.50:8848 config: # 配置中心地址 - server-addr: 10.100.1.2:8848 + server-addr: 47.120.41.50:8848 # 配置文件格式 file-extension: yml # 共享配置 @@ -33,7 +33,7 @@ spring: datasource: ds1: nacos: - server-addr: 10.100.1.2:8848 + server-addr: 47.120.41.50:8848 dataId: sentinel-february-gateway groupId: DEFAULT_GROUP data-type: json diff --git a/february-modules/february-file/february-file-server/src/main/resources/bootstrap.yml b/february-modules/february-file/february-file-server/src/main/resources/bootstrap.yml index 7a49fdf..5d12fc7 100644 --- a/february-modules/february-file/february-file-server/src/main/resources/bootstrap.yml +++ b/february-modules/february-file/february-file-server/src/main/resources/bootstrap.yml @@ -14,10 +14,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 10.100.1.2:8848 + server-addr: 47.120.41.50:8848 config: # 配置中心地址 - server-addr: 10.100.1.2:8848 + server-addr: 47.120.41.50:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/february-modules/february-gen/february-gen-server/src/main/resources/bootstrap.yml b/february-modules/february-gen/february-gen-server/src/main/resources/bootstrap.yml index d799e0a..5e5c674 100644 --- a/february-modules/february-gen/february-gen-server/src/main/resources/bootstrap.yml +++ b/february-modules/february-gen/february-gen-server/src/main/resources/bootstrap.yml @@ -14,10 +14,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 10.100.1.2:8848 + server-addr: 47.120.41.50:8848 config: # 配置中心地址 - server-addr: 10.100.1.2:8848 + server-addr: 47.120.41.50:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/february-modules/february-job/february-job-server/src/main/resources/bootstrap.yml b/february-modules/february-job/february-job-server/src/main/resources/bootstrap.yml index d376cb2..3cb98f2 100644 --- a/february-modules/february-job/february-job-server/src/main/resources/bootstrap.yml +++ b/february-modules/february-job/february-job-server/src/main/resources/bootstrap.yml @@ -14,10 +14,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 10.100.1.2:8848 + server-addr: 47.120.41.50:8848 config: # 配置中心地址 - server-addr: 10.100.1.2:8848 + server-addr: 47.120.41.50:8848 # 配置文件格式 file-extension: yml # 共享配置 @@ -26,6 +26,6 @@ spring: datasource: driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://10.100.1.4:3306/ry-cloud?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + url: jdbc:mysql://47.113.231.62:3306/ry-cloud?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 username: root password: wuzu123... diff --git a/february-modules/february-system/february-system-server/src/main/resources/bootstrap.yml b/february-modules/february-system/february-system-server/src/main/resources/bootstrap.yml index 64be83a..29967f9 100644 --- a/february-modules/february-system/february-system-server/src/main/resources/bootstrap.yml +++ b/february-modules/february-system/february-system-server/src/main/resources/bootstrap.yml @@ -14,10 +14,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 10.100.1.2:8848 + server-addr: 47.120.41.50:8848 config: # 配置中心地址 - server-addr: 10.100.1.2:8848 + server-addr: 47.120.41.50:8848 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/february-patient/february-patient-circle/february-patient-circle-common/pom.xml b/february-patient/february-patient-circle/february-patient-circle-common/pom.xml index b41891c..99de0b6 100644 --- a/february-patient/february-patient-circle/february-patient-circle-common/pom.xml +++ b/february-patient/february-patient-circle/february-patient-circle-common/pom.xml @@ -69,5 +69,10 @@ com.february february-common-swagger + + com.aliyun + cloudauth20190307 + 2.1.0 + diff --git a/february-patient/february-patient-circle/february-patient-circle-common/src/main/java/com/february/patient/circle/domain/PatientCircle.java b/february-patient/february-patient-circle/february-patient-circle-common/src/main/java/com/february/patient/circle/domain/PatientCircle.java index f10b284..1a7f901 100644 --- a/february-patient/february-patient-circle/february-patient-circle-common/src/main/java/com/february/patient/circle/domain/PatientCircle.java +++ b/february-patient/february-patient-circle/february-patient-circle-common/src/main/java/com/february/patient/circle/domain/PatientCircle.java @@ -45,6 +45,10 @@ public class PatientCircle { * 病友圈id */ private Integer patientCircleId; + /** + * 病友圈标题 + */ + private String patientCircleTitle; /** * 用户ID */ @@ -77,4 +81,8 @@ public class PatientCircle { * 被采纳id */ private Integer adoptedId; + /** + * 评论状态 + */ + private Integer collectState; } diff --git a/february-patient/february-patient-circle/february-patient-circle-common/src/main/java/com/february/patient/circle/domain/ReviewLog.java b/february-patient/february-patient-circle/february-patient-circle-common/src/main/java/com/february/patient/circle/domain/ReviewLog.java new file mode 100644 index 0000000..bcd87ff --- /dev/null +++ b/february-patient/february-patient-circle/february-patient-circle-common/src/main/java/com/february/patient/circle/domain/ReviewLog.java @@ -0,0 +1,44 @@ +package com.february.patient.circle.domain; + +import io.swagger.models.auth.In; +import lombok.Data; + +import java.util.Date; + +/** + * @program: february + * @description: 评论信息记录表 + * @author: Mr.Wang + * @create: 2023-10-25 13:43 + **/ +@Data +public class ReviewLog { + /** + * 记录表id + */ + private Integer logId; + /** + * 评论id + */ + private Integer reviewId; + /** + * 用户id + */ + private Integer userId; + /** + * 状态id + */ + private Integer typeId; + /** + * 是否有效 + */ + private Integer status; + /** + * 开始时间 + */ + private Date createTime; + /** + * 取消时间 + */ + private Date updateTime; +} diff --git a/february-patient/february-patient-circle/february-patient-circle-common/src/main/java/com/february/patient/circle/domain/request/PatientCircleRequest.java b/february-patient/february-patient-circle/february-patient-circle-common/src/main/java/com/february/patient/circle/domain/request/PatientCircleRequest.java index bc8f548..b8ddd4b 100644 --- a/february-patient/february-patient-circle/february-patient-circle-common/src/main/java/com/february/patient/circle/domain/request/PatientCircleRequest.java +++ b/february-patient/february-patient-circle/february-patient-circle-common/src/main/java/com/february/patient/circle/domain/request/PatientCircleRequest.java @@ -5,11 +5,16 @@ import lombok.Data; import java.util.Date; /** + * * @program: patient * @description: 病友圈表 * @author: Mr.Wang * @create: 2023-10-18 21:50 **/ + +/** + * 病友圈表 + */ @Data public class PatientCircleRequest { /** diff --git a/february-patient/february-patient-circle/february-patient-circle-common/src/main/java/com/february/patient/circle/domain/response/PatientCircleResponse.java b/february-patient/february-patient-circle/february-patient-circle-common/src/main/java/com/february/patient/circle/domain/response/PatientCircleResponse.java new file mode 100644 index 0000000..31e7aad --- /dev/null +++ b/february-patient/february-patient-circle/february-patient-circle-common/src/main/java/com/february/patient/circle/domain/response/PatientCircleResponse.java @@ -0,0 +1,32 @@ +package com.february.patient.circle.domain.response; + +import com.february.patient.circle.domain.PatientCircle; +import lombok.Data; + +import java.util.Date; + +/** + * @program: february + * @description: + * @author: Mr.Wang + * @create: 2023-10-24 16:59 + **/ +@Data +public class PatientCircleResponse extends PatientCircle { + /** + * 医院名称 + */ + private String hospitalName; + /** + * 开始时间 + */ + private Date startTime; + /** + * 结束时间 + */ + private Date endTime; + /** + * 治疗经历 + */ + private String diseaseProcess; +} diff --git a/february-patient/february-patient-circle/february-patient-circle-server/src/main/java/com/february/patient/circle/controller/PatientController.java b/february-patient/february-patient-circle/february-patient-circle-server/src/main/java/com/february/patient/circle/controller/PatientController.java index 733cfec..ebd0829 100644 --- a/february-patient/february-patient-circle/february-patient-circle-server/src/main/java/com/february/patient/circle/controller/PatientController.java +++ b/february-patient/february-patient-circle/february-patient-circle-server/src/main/java/com/february/patient/circle/controller/PatientController.java @@ -17,12 +17,10 @@ import org.springframework.web.multipart.MultipartFile; import java.util.List; + /** - * @program: patient - * @description: - * @author: Mr.Wang - * @create: 2023-10-18 11:13 - **/ + * 病友圈控制层 + */ @RestController public class PatientController { @Autowired @@ -224,9 +222,9 @@ public class PatientController { /** * 病友圈详情列表 */ - @GetMapping("/patientCircleList") - public Result> patientCircleList(){ - return patientService.patientCircleList(); + @PostMapping("/patientCircleList") + public Result> patientCircleList(@RequestBody PatientCircleRequest patientCircleRequest){ + return patientService.patientCircleList(patientCircleRequest); } /** * 写评论 @@ -264,4 +262,42 @@ public class PatientController { public Result taunt(@RequestParam Integer reviewId){ return patientService.taunt(reviewId); } + + /** + * 收藏病友圈操作 + * @return + */ + @PostMapping("/toCollect") + public Result toCollect(@RequestParam Integer patientCircleId){ + return patientService.toCollect(patientCircleId); + } + + /** + * 根据病友圈id查询病友圈信息 + * @param patientCircleId + * @return + */ + @PostMapping("/findByPatientCircleId") + public Result findByPatientCircleId(@RequestParam Integer patientCircleId){ + return patientService.findByPatientCircleId(patientCircleId); + } + + /** + * 实现图片上传 + * @param file + * @return + */ + @PostMapping("/upload") + public Result upload(@RequestParam("file")MultipartFile file){ + return patientService.upload(file); + } + + /** + * 添加对应信息记录表 + * @return + */ + @PostMapping("/addReviewLog") + public Result addReviewLog(@RequestBody ReviewLog reviewLog){ + return patientService.addReviewLog(reviewLog); + } } diff --git a/february-patient/february-patient-circle/february-patient-circle-server/src/main/java/com/february/patient/circle/mapper/PatientMapper.java b/february-patient/february-patient-circle/february-patient-circle-server/src/main/java/com/february/patient/circle/mapper/PatientMapper.java index 4229c66..ce43ac3 100644 --- a/february-patient/february-patient-circle/february-patient-circle-server/src/main/java/com/february/patient/circle/mapper/PatientMapper.java +++ b/february-patient/february-patient-circle/february-patient-circle-server/src/main/java/com/february/patient/circle/mapper/PatientMapper.java @@ -35,7 +35,7 @@ public interface PatientMapper { Integer addDiseaseProcess(DiseaseProcess diseaseProcess); - List patientCircleList(); + List patientCircleList(PatientCircleRequest patientCircleRequest); Integer addReview(Review review); @@ -51,6 +51,14 @@ public interface PatientMapper { Integer findReviewNum(@Param("patientCircleId") Integer patientCircleId); + Integer toCollect(@Param("patientCircleId") Integer patientCircleId); + + PatientCircle findByPatientCircleId(@Param("patientCircleId") Integer patientCircleId); + + void disToCollect(@Param("patientCircleId") Integer patientCircleId); + + Integer addReviewLog(ReviewLog reviewLog); + // List patientCircleList(@Param("diseaseId") Integer diseaseId); // diff --git a/february-patient/february-patient-circle/february-patient-circle-server/src/main/java/com/february/patient/circle/service/PatientService.java b/february-patient/february-patient-circle/february-patient-circle-server/src/main/java/com/february/patient/circle/service/PatientService.java index 3bbd00c..24cf6a2 100644 --- a/february-patient/february-patient-circle/february-patient-circle-server/src/main/java/com/february/patient/circle/service/PatientService.java +++ b/february-patient/february-patient-circle/february-patient-circle-server/src/main/java/com/february/patient/circle/service/PatientService.java @@ -37,7 +37,7 @@ public interface PatientService { Result addDiseaseProcess(DiseaseProcess diseaseProcess); - Result> patientCircleList(); + Result> patientCircleList(PatientCircleRequest patientCircleRequest); Result addReview(Review review); @@ -46,6 +46,16 @@ public interface PatientService { Result findByReviewId(Integer reviewId); Result taunt(Integer reviewId); + + Result toCollect(Integer patientCircleId); + + Result findByPatientCircleId(Integer patientCircleId); + + Result upload(MultipartFile file); + + Result addReviewLog(ReviewLog reviewLog); + + // Result> patientCircleList(Integer diseaseId); // // Result> patientList(String patientNickname); diff --git a/february-patient/february-patient-circle/february-patient-circle-server/src/main/java/com/february/patient/circle/service/impl/PatientServiceImpl.java b/february-patient/february-patient-circle/february-patient-circle-server/src/main/java/com/february/patient/circle/service/impl/PatientServiceImpl.java index f1722c4..0e14c0d 100644 --- a/february-patient/february-patient-circle/february-patient-circle-server/src/main/java/com/february/patient/circle/service/impl/PatientServiceImpl.java +++ b/february-patient/february-patient-circle/february-patient-circle-server/src/main/java/com/february/patient/circle/service/impl/PatientServiceImpl.java @@ -26,6 +26,8 @@ import org.springframework.stereotype.Service; import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletRequest; +import java.io.InputStream; +import java.util.Date; import java.util.List; /** @@ -93,8 +95,8 @@ public class PatientServiceImpl implements PatientService { } @Override - public Result> patientCircleList() { - List list=patientMapper.patientCircleList(); + public Result> patientCircleList(PatientCircleRequest patientCircleRequest) { + List list=patientMapper.patientCircleList(patientCircleRequest); list.forEach(l->{ Integer patientCircleId = l.getPatientCircleId(); Integer i=patientMapper.findReviewNum(patientCircleId); @@ -121,12 +123,26 @@ public class PatientServiceImpl implements PatientService { @Override public Result upvote(Integer reviewId) { Review review = patientMapper.findByReviewId(reviewId); + User info = getInfo(); + ReviewLog reviewLog = new ReviewLog(); if(review.getApproveState()==0){ Integer i=patientMapper.upvote(reviewId); if(i>0){ + reviewLog.setReviewId(reviewId); + reviewLog.setUserId(info.getUserId()); + reviewLog.setTypeId(1); + reviewLog.setStatus(1); + reviewLog.setCreateTime(new Date()); + addReviewLog(reviewLog); return Result.success("点赞成功"); } } + reviewLog.setReviewId(reviewId); + reviewLog.setUserId(info.getUserId()); + reviewLog.setTypeId(1); + reviewLog.setStatus(2); + reviewLog.setUpdateTime(new Date()); + addReviewLog(reviewLog); patientMapper.disUpvote(reviewId); return Result.success("取消点赞操作成功"); } @@ -139,15 +155,79 @@ public class PatientServiceImpl implements PatientService { @Override public Result taunt(Integer reviewId) { Review review = patientMapper.findByReviewId(reviewId); + User info = getInfo(); + ReviewLog reviewLog = new ReviewLog(); if(review.getDisapproveState()==0){ Integer i=patientMapper.taunt(reviewId); if(i>0){ + reviewLog.setReviewId(reviewId); + reviewLog.setUserId(info.getUserId()); + reviewLog.setTypeId(2); + reviewLog.setStatus(1); + reviewLog.setCreateTime(new Date()); + addReviewLog(reviewLog); return Result.success("点踩成功"); } } + reviewLog.setReviewId(reviewId); + reviewLog.setUserId(info.getUserId()); + reviewLog.setTypeId(2); + reviewLog.setStatus(2); + reviewLog.setUpdateTime(new Date()); + addReviewLog(reviewLog); patientMapper.disTaunt(reviewId); return Result.success("取消点踩"); } + + @Override + public Result toCollect(Integer patientCircleId) { + PatientCircle patientCircle = patientMapper.findByPatientCircleId(patientCircleId); + if(patientCircle.getCollectState()==0) { + Integer i = patientMapper.toCollect(patientCircleId); + if (i > 0) { + return Result.success("收藏成功"); + } + } + patientMapper.disToCollect(patientCircleId); + return Result.error("取消收藏"); + } + + @Override + public Result findByPatientCircleId(Integer patientCircleId) { + PatientCircle patientCircle=patientMapper.findByPatientCircleId(patientCircleId); + return Result.success(patientCircle); + } + + @Override + public Result upload(MultipartFile file) { + try { + String upload = fastUtil.upload(file); + InputStream inputStream = file.getInputStream(); + IOUtils.closeQuietly(inputStream); + return Result.success("http://47.120.41.50:8888/"+upload,"上传成功"); + } catch (Exception e) { + e.printStackTrace(); + } + return Result.error("上传失败"); + } + + @Override + public Result addReviewLog(ReviewLog reviewLog) { + Integer i=patientMapper.addReviewLog(reviewLog); + if(i>0){ + return Result.success("信息记录成功"); + } + return Result.error("信息记录失败"); + } + + public User getInfo(){ + String token = request.getHeader(TokenConstants.TOKEN); + String userKey = JwtUtils.getUserKey(token); + String s = redisTemplate.opsForValue().get(TokenConstants.LOGIN_TOKEN_KEY + userKey); + User user = JSONObject.parseObject(s, User.class); + return user; + } + // @Override // public Result> patientCircleList(Integer diseaseId) { // String diseaseName = findDiseaseName(diseaseId); diff --git a/february-patient/february-patient-circle/february-patient-circle-server/src/main/resources/mapper/circle/PatientMapper.xml b/february-patient/february-patient-circle/february-patient-circle-server/src/main/resources/mapper/circle/PatientMapper.xml index 27ccf96..f65d93c 100644 --- a/february-patient/february-patient-circle/february-patient-circle-server/src/main/resources/mapper/circle/PatientMapper.xml +++ b/february-patient/february-patient-circle/february-patient-circle-server/src/main/resources/mapper/circle/PatientMapper.xml @@ -9,6 +9,10 @@ INSERT INTO `patient-circle`.`tb_review` ( `avatar`,`user_id`,`review_detail`, `review_time`, `approve_num`, `disapprove_num`, `is_adopted`,`approve_state`,`disapprove_state`) VALUES ( #{avatar},#{userId},#{reviewDetail}, now(), 0, 0, 0,0,0) + + INSERT INTO `patient-circle`.`tb_review_log` ( `review_id`, `user_id`, `type_id`, `status`, `create_time`, `update_time`) + VALUES ( #{reviewId}, #{userId}, #{typeId}, #{status}, #{createTime}, #{updateTime}) + UPDATE `patient-circle`.`tb_review` SET `approve_num` = approve_num+1,`approve_state`=1 WHERE `review_id` = #{reviewId} @@ -21,6 +25,12 @@ UPDATE `patient-circle`.`tb_review` SET `disapprove_num` = disapprove_num-1,`disapprove_state`=0 WHERE `review_id` = #{reviewId} + + UPDATE `patient-circle`.`tb_patient_circle` SET `collect_num` = collect_num+1 ,collect_state=1 WHERE `patient_circle_id` = #{patientCircleId} + + + UPDATE `patient-circle`.`tb_patient_circle` SET `collect_num` = collect_num-1,collect_state=0 WHERE `patient_circle_id` = #{patientCircleId} + @@ -80,6 +90,11 @@ SELECT COUNT(*) from tb_review WHERE patient_circle_id=#{patientCircleId} + + diff --git a/february-visual/february-monitor/src/main/resources/bootstrap.yml b/february-visual/february-monitor/src/main/resources/bootstrap.yml index 0c74d94..b157114 100644 --- a/february-visual/february-monitor/src/main/resources/bootstrap.yml +++ b/february-visual/february-monitor/src/main/resources/bootstrap.yml @@ -14,10 +14,10 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 10.100.1.2:8848 + server-addr: 47.120.41.50:8848 config: # 配置中心地址 - server-addr: 10.100.1.2:8848 + server-addr: 47.120.41.50:8848 # 配置文件格式 file-extension: yml # 共享配置