新增病友圈模块
parent
56be67e722
commit
5e27be5d15
|
@ -12,8 +12,8 @@
|
|||
<artifactId>february-auth-common</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>20</maven.compiler.source>
|
||||
<maven.compiler.target>20</maven.compiler.target>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
<artifactId>february-auth-remote</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>20</maven.compiler.source>
|
||||
<maven.compiler.target>20</maven.compiler.target>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
<artifactId>february-auth-server</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>20</maven.compiler.source>
|
||||
<maven.compiler.target>20</maven.compiler.target>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
<artifactId>february-file-common</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>20</maven.compiler.source>
|
||||
<maven.compiler.target>20</maven.compiler.target>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
<artifactId>february-file-remote</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>20</maven.compiler.source>
|
||||
<maven.compiler.target>20</maven.compiler.target>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
<artifactId>february-file-server</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>20</maven.compiler.source>
|
||||
<maven.compiler.target>20</maven.compiler.target>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
<dependencies>
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
<artifactId>february-gen-common</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>20</maven.compiler.source>
|
||||
<maven.compiler.target>20</maven.compiler.target>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
<artifactId>february-gen-remote</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>20</maven.compiler.source>
|
||||
<maven.compiler.target>20</maven.compiler.target>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
<artifactId>february-gen-server</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>20</maven.compiler.source>
|
||||
<maven.compiler.target>20</maven.compiler.target>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
<artifactId>february-job-common</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>20</maven.compiler.source>
|
||||
<maven.compiler.target>20</maven.compiler.target>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
<artifactId>february-job-remote</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>20</maven.compiler.source>
|
||||
<maven.compiler.target>20</maven.compiler.target>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
<artifactId>february-job-server</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>20</maven.compiler.source>
|
||||
<maven.compiler.target>20</maven.compiler.target>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
<artifactId>february-system-common</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>20</maven.compiler.source>
|
||||
<maven.compiler.target>20</maven.compiler.target>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
<artifactId>february-system-remote</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>20</maven.compiler.source>
|
||||
<maven.compiler.target>20</maven.compiler.target>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
<artifactId>february-system-server</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>20</maven.compiler.source>
|
||||
<maven.compiler.target>20</maven.compiler.target>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
!**/src/main/**/target/
|
||||
!**/src/test/**/target/
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea/modules.xml
|
||||
.idea/jarRepositories.xml
|
||||
.idea/compiler.xml
|
||||
.idea/libraries/
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### Eclipse ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
build/
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
|
||||
### Mac OS ###
|
||||
.DS_Store
|
|
@ -0,0 +1,38 @@
|
|||
target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
!**/src/main/**/target/
|
||||
!**/src/test/**/target/
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea/modules.xml
|
||||
.idea/jarRepositories.xml
|
||||
.idea/compiler.xml
|
||||
.idea/libraries/
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### Eclipse ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
build/
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
|
||||
### Mac OS ###
|
||||
.DS_Store
|
|
@ -0,0 +1,38 @@
|
|||
target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
!**/src/main/**/target/
|
||||
!**/src/test/**/target/
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea/modules.xml
|
||||
.idea/jarRepositories.xml
|
||||
.idea/compiler.xml
|
||||
.idea/libraries/
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### Eclipse ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
build/
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
|
||||
### Mac OS ###
|
||||
.DS_Store
|
|
@ -0,0 +1,73 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.february</groupId>
|
||||
<artifactId>february-patient-circle</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>february-patient-circle-common</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<!-- lombok依赖 -->
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.february</groupId>
|
||||
<artifactId>february-common-core</artifactId>
|
||||
</dependency>
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Sentinel -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Swagger UI -->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
<version>${swagger.fox.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Mysql Connector -->
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common Swagger -->
|
||||
<dependency>
|
||||
<groupId>com.february</groupId>
|
||||
<artifactId>february-common-swagger</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -0,0 +1,18 @@
|
|||
package com.february.patient.circle.constants;
|
||||
|
||||
/**
|
||||
* @description: 系统常量
|
||||
* @author DongZl
|
||||
*/
|
||||
public class Constants {
|
||||
/**
|
||||
* 成功标记
|
||||
*/
|
||||
public static final Integer SUCCESS = 200;
|
||||
public static final String SUCCESS_MSG = "操作成功";
|
||||
/**
|
||||
* 失败标记
|
||||
*/
|
||||
public static final Integer ERROR = 500;
|
||||
public static final String ERROR_MSG = "操作异常";
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package com.february.patient.circle.constants;
|
||||
|
||||
/**
|
||||
* @author DongZl
|
||||
* @description: Jwt常量
|
||||
*/
|
||||
public class JwtConstants {
|
||||
|
||||
/**
|
||||
* 用户ID字段
|
||||
*/
|
||||
public static final String DETAILS_USER_ID = "user_id";
|
||||
|
||||
/**
|
||||
* 用户名字段
|
||||
*/
|
||||
public static final String DETAILS_USERNAME = "username";
|
||||
|
||||
/**
|
||||
* 用户标识
|
||||
*/
|
||||
public static final String USER_KEY = "user_key";
|
||||
|
||||
/**
|
||||
* 令牌秘钥
|
||||
*/
|
||||
public final static String SECRET = "abcdefghijklmnopqrstuvwxyz";
|
||||
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package com.february.patient.circle.constants;
|
||||
|
||||
/**
|
||||
* @author DongZl
|
||||
* @description: 令牌常量
|
||||
*/
|
||||
public class TokenConstants {
|
||||
/**
|
||||
* 缓存有效期,默认720(分钟)
|
||||
*/
|
||||
public final static long EXPIRATION = 720;
|
||||
/**
|
||||
* 缓存刷新时间,默认120(分钟)
|
||||
*/
|
||||
public final static long REFRESH_TIME = 120;
|
||||
/**
|
||||
* 权限缓存前缀
|
||||
*/
|
||||
public final static String LOGIN_TOKEN_KEY = "login_tokens:";
|
||||
/**
|
||||
* token标识
|
||||
*/
|
||||
public static final String TOKEN = "token";
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package com.february.patient.circle.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @program: patient
|
||||
* @description: 收藏表
|
||||
* @author: Mr.Wang
|
||||
* @create: 2023-10-19 18:36
|
||||
**/
|
||||
@Data
|
||||
public class Collect {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Integer collectId;
|
||||
/**
|
||||
* 资讯id
|
||||
*/
|
||||
private Integer messageId;
|
||||
/**
|
||||
* 视频id
|
||||
*/
|
||||
private Integer videoId;
|
||||
/**
|
||||
* 病友圈id
|
||||
*/
|
||||
private Integer patientCommunityId;
|
||||
/**
|
||||
* 用户信息id
|
||||
*/
|
||||
private Integer userId;
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package com.february.patient.circle.domain;
|
||||
|
||||
import lombok.Data;
|
||||
/**
|
||||
* @program: patient
|
||||
* @description: 病例下拉框
|
||||
* @author: Mr.Wang
|
||||
* @create: 2023-10-18 20:39
|
||||
**/
|
||||
@Data
|
||||
public class Disease {
|
||||
/**
|
||||
* 病症详情id
|
||||
*/
|
||||
private Integer diseaseDetailId;
|
||||
/**
|
||||
* 病症id
|
||||
*/
|
||||
private Integer diseaseId;
|
||||
/**
|
||||
* 病理
|
||||
*/
|
||||
private String diseaseDetailPathology;
|
||||
/**
|
||||
* 病状
|
||||
*/
|
||||
private String diseaseDetailSymptom;
|
||||
/**
|
||||
* 宜与忌
|
||||
*/
|
||||
private String diseaseDetailAnnouncements;
|
||||
/**
|
||||
* 西药治疗
|
||||
*/
|
||||
private String diseaseDetailUsage;
|
||||
/**
|
||||
* 所属科目
|
||||
*/
|
||||
private String diseaseName;
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package com.february.patient.circle.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @program: patient
|
||||
* @description: 医生
|
||||
* @author: Mr.Wang
|
||||
* @create: 2023-10-18 20:06
|
||||
**/
|
||||
@Data
|
||||
public class Doctor {
|
||||
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
package com.february.patient.circle.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @program: patient
|
||||
* @description: 药品类
|
||||
* @author: Mr.Wang
|
||||
* @create: 2023-10-18 21:00
|
||||
**/
|
||||
@Data
|
||||
public class Drug {
|
||||
/**
|
||||
* 药品详情id
|
||||
*/
|
||||
private Integer drugDetailId;
|
||||
/**
|
||||
* 药品id
|
||||
*/
|
||||
private Integer drugId;
|
||||
/**
|
||||
* 药品成分
|
||||
*/
|
||||
private String drugDetailIngredient;
|
||||
/**
|
||||
* 用药禁忌
|
||||
*/
|
||||
private String drugDetailTaboo;
|
||||
/**
|
||||
* 功能主治
|
||||
*/
|
||||
private String drugDetailFunction;
|
||||
/**
|
||||
* 用法用量
|
||||
*/
|
||||
private String drugDetailUsage;
|
||||
/**
|
||||
* 药品形状
|
||||
*/
|
||||
private String drugDetailShape;
|
||||
/**
|
||||
* 包装规格
|
||||
*/
|
||||
private String drugDetailSpecification;
|
||||
/**
|
||||
* 不良反应
|
||||
*/
|
||||
private String drugDetailReaction;
|
||||
/**
|
||||
* 药品类型
|
||||
*/
|
||||
private String drugName;
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
package com.february.patient.circle.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @program: patient
|
||||
* @description: 患者信息表
|
||||
* @author: Mr.Wang
|
||||
* @create: 2023-10-18 11:16
|
||||
**/
|
||||
@Data
|
||||
public class Patient {
|
||||
/**
|
||||
* 患者id
|
||||
*/
|
||||
private Integer patientId;
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
private String avatar;
|
||||
/**
|
||||
* 昵称
|
||||
*/
|
||||
private String patientNickname;
|
||||
/**
|
||||
* 性别id
|
||||
*/
|
||||
private Integer sexId;
|
||||
/**
|
||||
* 体征id
|
||||
*/
|
||||
private Integer signId;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Integer userId;
|
||||
/**
|
||||
* 是否认证
|
||||
*/
|
||||
private Integer isAttestation;
|
||||
/**
|
||||
* 是否绑定
|
||||
*/
|
||||
private Integer isBind;
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package com.february.patient.circle.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @program: patient
|
||||
* @description: 病友圈类
|
||||
* @author: Mr.Wang
|
||||
* @create: 2023-10-18 13:56
|
||||
**/
|
||||
@Data
|
||||
public class PatientCircle {
|
||||
/**
|
||||
* 病友圈id
|
||||
*/
|
||||
private Integer patientCircleId;
|
||||
/**
|
||||
* 病友圈标题
|
||||
*/
|
||||
private String patientCircleTitle;
|
||||
/**
|
||||
* 发布时间
|
||||
*/
|
||||
private Date patientCircleTime;
|
||||
/**
|
||||
* 病友圈详情
|
||||
*/
|
||||
private String patientCircleDetails;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Integer userId;
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
package com.february.patient.circle.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @program: patient
|
||||
* @description: 评论表
|
||||
* @author: Mr.Wang
|
||||
* @create: 2023-10-18 19:54
|
||||
**/
|
||||
@Data
|
||||
public class Review {
|
||||
/**
|
||||
* 评论id
|
||||
*/
|
||||
private Integer reviewId;
|
||||
/**
|
||||
* 评论者
|
||||
*/
|
||||
private String reviewName;
|
||||
/**
|
||||
* 评论内容
|
||||
*/
|
||||
private String reviewDetail;
|
||||
/**
|
||||
* 评论时间
|
||||
*/
|
||||
private Date reviewTime;
|
||||
/**
|
||||
* 点赞数
|
||||
*/
|
||||
private Integer upvoteNum;
|
||||
/**
|
||||
* 嘲讽数
|
||||
*/
|
||||
private Integer negativeNum;
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
private String avatar;
|
||||
/**
|
||||
* 是否采纳
|
||||
*/
|
||||
private Integer isAdopt;
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package com.february.patient.circle.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @program: patient
|
||||
* @description: 性别
|
||||
* @author: Mr.Wang
|
||||
* @create: 2023-10-18 13:41
|
||||
**/
|
||||
@Data
|
||||
public class Sex {
|
||||
/**
|
||||
* 性别id
|
||||
*/
|
||||
private Integer sexId;
|
||||
/**
|
||||
* 性别名称
|
||||
*/
|
||||
private String sexName;
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package com.february.patient.circle.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @program: patient
|
||||
* @description: 体征表
|
||||
* @author: Mr.Wang
|
||||
* @create: 2023-10-18 13:42
|
||||
**/
|
||||
@Data
|
||||
public class Sign {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Integer signId;
|
||||
/**
|
||||
* 身高
|
||||
*/
|
||||
private Integer signHeight;
|
||||
/**
|
||||
* 体重
|
||||
*/
|
||||
private Integer signWeight;
|
||||
/**
|
||||
* 年龄
|
||||
*/
|
||||
private Integer signAge;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Integer userId;
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package com.february.patient.circle.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @program: patient
|
||||
* @description:
|
||||
* @author: Mr.Wang
|
||||
* @create: 2023-10-18 13:44
|
||||
**/
|
||||
@Data
|
||||
public class User {
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Integer userId;
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
private String userName;
|
||||
/**
|
||||
* 用户邮箱
|
||||
*/
|
||||
private String userEmail;
|
||||
/**
|
||||
* 用户邮箱账号
|
||||
*/
|
||||
private String userEmailNumber;
|
||||
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
package com.february.patient.circle.domain.request;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @program: patient
|
||||
* @description: 病友圈表
|
||||
* @author: Mr.Wang
|
||||
* @create: 2023-10-18 21:50
|
||||
**/
|
||||
@Data
|
||||
public class PatientCircleRequest {
|
||||
/**
|
||||
* 病友圈标题
|
||||
*/
|
||||
private String patientCircleTitle;
|
||||
/**
|
||||
* 科诊室id
|
||||
*/
|
||||
private Integer diseaseId;
|
||||
/**
|
||||
* 药物id
|
||||
*/
|
||||
private Integer drugId;
|
||||
/**
|
||||
* 病症详情
|
||||
*/
|
||||
private String patientCircleDetail;
|
||||
/**
|
||||
* 医院名称
|
||||
*/
|
||||
private String hospital;
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private Date patientCircleStartTime;
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private Date patientCircleEndTime;
|
||||
/**
|
||||
* 治疗过程
|
||||
*/
|
||||
private String patientCircleProcess;
|
||||
/**
|
||||
* 病友圈图片
|
||||
*/
|
||||
private String patientCirclePicture;
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package com.february.patient.circle.domain.request;
|
||||
|
||||
|
||||
import com.february.patient.circle.domain.Patient;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @program: patient
|
||||
* @description: 患者信息
|
||||
* @author: Mr.Wang
|
||||
* @create: 2023-10-18 15:11
|
||||
**/
|
||||
@Data
|
||||
public class PatientRequest extends Patient {
|
||||
/**
|
||||
* 性别名称
|
||||
*/
|
||||
private String sexName;
|
||||
/**
|
||||
* 体重
|
||||
*/
|
||||
private Integer signWeight;
|
||||
/**
|
||||
* 身高
|
||||
*/
|
||||
private Integer signHeight;
|
||||
/**
|
||||
* 年龄
|
||||
*/
|
||||
private Integer signAge;
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
private String userName;
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package com.february.patient.circle.domain.request;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @program: february
|
||||
* @description: 病人发表评论
|
||||
* @author: Mr.Wang
|
||||
* @create: 2023-10-20 15:57
|
||||
**/
|
||||
@Data
|
||||
public class ReviewPatientRequest {
|
||||
/**
|
||||
* 病友圈id
|
||||
*/
|
||||
private Integer reviewId;
|
||||
/**
|
||||
* 病友圈详情
|
||||
*/
|
||||
private String reviewDetail;
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package com.february.patient.circle.result;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author DongZl
|
||||
* @description: 列表返回结果集
|
||||
*/
|
||||
@Data
|
||||
public class PageResult<T> implements Serializable {
|
||||
/**
|
||||
* 总条数
|
||||
*/
|
||||
private long total;
|
||||
/**
|
||||
* 结果集合
|
||||
*/
|
||||
private List<T> list;
|
||||
public PageResult() {
|
||||
}
|
||||
public PageResult(long total, List<T> list) {
|
||||
this.total = total;
|
||||
this.list = list;
|
||||
}
|
||||
public static <T> PageResult<T> toPageResult(long total, List<T> list){
|
||||
return new PageResult(total , list);
|
||||
}
|
||||
public static <T> Result<PageResult<T>> toResult(long total, List<T> list){
|
||||
return Result.success(PageResult.toPageResult(total,list));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,77 @@
|
|||
package com.february.patient.circle.result;
|
||||
|
||||
|
||||
import com.february.patient.circle.constants.Constants;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author DongZl
|
||||
* @description: 响应信息主体
|
||||
*/
|
||||
@Data
|
||||
public class Result<T> implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* 成功
|
||||
*/
|
||||
public static final int SUCCESS = Constants.SUCCESS;
|
||||
/**
|
||||
* 失败
|
||||
*/
|
||||
public static final int FAIL = Constants.ERROR;
|
||||
/**
|
||||
* 返回状态码
|
||||
*/
|
||||
private int code;
|
||||
/**
|
||||
* 响应信息
|
||||
*/
|
||||
private String msg;
|
||||
/**
|
||||
* 响应数据
|
||||
*/
|
||||
private T data;
|
||||
|
||||
public static <T> Result<T> success() {
|
||||
return restResult(null, SUCCESS, Constants.SUCCESS_MSG);
|
||||
}
|
||||
|
||||
public static <T> Result<T> success(T data) {
|
||||
return restResult(data, SUCCESS, Constants.SUCCESS_MSG);
|
||||
}
|
||||
|
||||
public static <T> Result<T> success(T data, String msg) {
|
||||
return restResult(data, SUCCESS, msg);
|
||||
}
|
||||
|
||||
public static <T> Result<T> error() {
|
||||
return restResult(null, FAIL, Constants.ERROR_MSG);
|
||||
}
|
||||
|
||||
public static <T> Result<T> error(String msg) {
|
||||
return restResult(null, FAIL, msg);
|
||||
}
|
||||
|
||||
public static <T> Result<T> error(T data) {
|
||||
return restResult(data, FAIL, Constants.ERROR_MSG);
|
||||
}
|
||||
|
||||
public static <T> Result<T> error(T data, String msg) {
|
||||
return restResult(data, FAIL, msg);
|
||||
}
|
||||
|
||||
public static <T> Result<T> error(int code, String msg) {
|
||||
return restResult(null, code, msg);
|
||||
}
|
||||
|
||||
private static <T> Result<T> restResult(T data, int code, String msg) {
|
||||
Result<T> apiResult = new Result<>();
|
||||
apiResult.setCode(code);
|
||||
apiResult.setData(data);
|
||||
apiResult.setMsg(msg);
|
||||
return apiResult;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,109 @@
|
|||
package com.february.patient.circle.utils;
|
||||
|
||||
import com.february.patient.circle.constants.JwtConstants;
|
||||
import io.jsonwebtoken.Claims;
|
||||
import io.jsonwebtoken.Jwts;
|
||||
import io.jsonwebtoken.SignatureAlgorithm;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @description: Jwt工具类
|
||||
* @author DongZl
|
||||
*/
|
||||
public class JwtUtils {
|
||||
|
||||
/**
|
||||
* 秘钥
|
||||
*/
|
||||
public static String secret = JwtConstants.SECRET;
|
||||
|
||||
/**
|
||||
* 从数据声明生成令牌
|
||||
*
|
||||
* @param claims 数据声明
|
||||
* @return 令牌
|
||||
*/
|
||||
public static String createToken(Map<String, Object> claims){
|
||||
String token = Jwts.builder().setClaims(claims).signWith(SignatureAlgorithm.HS512, secret).compact();
|
||||
return token;
|
||||
}
|
||||
|
||||
/**
|
||||
* 从令牌中获取数据声明
|
||||
*
|
||||
* @param token 令牌
|
||||
* @return 数据声明
|
||||
*/
|
||||
public static Claims parseToken(String token){
|
||||
return Jwts.parser().setSigningKey(secret).parseClaimsJws(token).getBody();
|
||||
}
|
||||
/**
|
||||
* 根据令牌获取用户标识
|
||||
*
|
||||
* @param token 令牌
|
||||
* @return 用户ID
|
||||
*/
|
||||
public static String getUserKey(String token){
|
||||
Claims claims = parseToken(token);
|
||||
return getValue(claims, JwtConstants.USER_KEY);
|
||||
}
|
||||
/**
|
||||
* 根据令牌获取用户标识
|
||||
*
|
||||
* @param claims 身份信息
|
||||
* @return 用户ID
|
||||
*/
|
||||
public static String getUserKey(Claims claims){
|
||||
return getValue(claims, JwtConstants.USER_KEY);
|
||||
}
|
||||
/**
|
||||
* 根据令牌获取用户ID
|
||||
*
|
||||
* @param token 令牌
|
||||
* @return 用户ID
|
||||
*/
|
||||
public static String getUserId(String token){
|
||||
Claims claims = parseToken(token);
|
||||
return getValue(claims, JwtConstants.DETAILS_USER_ID);
|
||||
}
|
||||
/**
|
||||
* 根据身份信息获取用户ID
|
||||
*
|
||||
* @param claims 身份信息
|
||||
* @return 用户ID
|
||||
*/
|
||||
public static String getUserId(Claims claims){
|
||||
return getValue(claims, JwtConstants.DETAILS_USER_ID);
|
||||
}
|
||||
/**
|
||||
* 根据令牌获取用户名
|
||||
*
|
||||
* @param token 令牌
|
||||
* @return 用户名
|
||||
*/
|
||||
public static String getUserName(String token){
|
||||
Claims claims = parseToken(token);
|
||||
return getValue(claims, JwtConstants.DETAILS_USERNAME);
|
||||
}
|
||||
/**
|
||||
* 根据身份信息获取用户名
|
||||
*
|
||||
* @param claims 身份信息
|
||||
* @return 用户名
|
||||
*/
|
||||
public static String getUserName(Claims claims){
|
||||
return getValue(claims, JwtConstants.DETAILS_USERNAME);
|
||||
}
|
||||
/**
|
||||
* 根据身份信息获取键值
|
||||
*
|
||||
* @param claims 身份信息
|
||||
* @param key 键
|
||||
* @return 值
|
||||
*/
|
||||
public static String getValue(Claims claims, String key){
|
||||
Object obj = claims.get(key);
|
||||
return obj == null ? "" : obj.toString();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
package com.february.patient.circle.utils;
|
||||
|
||||
import org.springframework.util.AntPathMatcher;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author DongZl
|
||||
* @description: 字符串处理工具类
|
||||
*/
|
||||
public class StringUtils extends org.apache.commons.lang3.StringUtils {
|
||||
|
||||
/**
|
||||
* * 判断一个对象是否为空
|
||||
*
|
||||
* @param object Object
|
||||
* @return true:为空 false:非空
|
||||
*/
|
||||
public static boolean isNull(Object object) {
|
||||
return object == null;
|
||||
}
|
||||
|
||||
/**
|
||||
* * 判断一个Collection是否为空, 包含List,Set,Queue
|
||||
*
|
||||
* @param coll 要判断的Collection
|
||||
* @return true:为空 false:非空
|
||||
*/
|
||||
public static boolean isEmpty(Collection<?> coll) {
|
||||
return isNull(coll) || coll.isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查找指定字符串是否匹配指定字符串列表中的任意一个字符串
|
||||
*
|
||||
* @param str 指定字符串
|
||||
* @param strs 需要检查的字符串数组
|
||||
* @return 是否匹配
|
||||
*/
|
||||
public static boolean matches(String str, List<String> strs) {
|
||||
if (isEmpty(str) || isEmpty(strs)) {
|
||||
return false;
|
||||
}
|
||||
for (String pattern : strs) {
|
||||
if (isMatch(pattern, str))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断url是否与规则配置:
|
||||
* ? 表示单个字符;
|
||||
* * 表示一层路径内的任意字符串,不可跨层级;
|
||||
* ** 表示任意层路径;
|
||||
*
|
||||
* @param pattern 匹配规则
|
||||
* @param url 需要匹配的url
|
||||
* @return
|
||||
*/
|
||||
public static boolean isMatch(String pattern, String url) {
|
||||
AntPathMatcher matcher = new AntPathMatcher();
|
||||
return matcher.match(pattern, url);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
!**/src/main/**/target/
|
||||
!**/src/test/**/target/
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea/modules.xml
|
||||
.idea/jarRepositories.xml
|
||||
.idea/compiler.xml
|
||||
.idea/libraries/
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### Eclipse ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
build/
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
|
||||
### Mac OS ###
|
||||
.DS_Store
|
|
@ -0,0 +1,26 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.february</groupId>
|
||||
<artifactId>february-patient-circle</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>february-patient-circle-remote</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.february</groupId>
|
||||
<artifactId>february-patient-circle-common</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
|
@ -0,0 +1,38 @@
|
|||
target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
!**/src/main/**/target/
|
||||
!**/src/test/**/target/
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea/modules.xml
|
||||
.idea/jarRepositories.xml
|
||||
.idea/compiler.xml
|
||||
.idea/libraries/
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### Eclipse ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
build/
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
|
||||
### Mac OS ###
|
||||
.DS_Store
|
|
@ -0,0 +1,69 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.february</groupId>
|
||||
<artifactId>february-patient-circle</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>february-patient-circle-server</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.february</groupId>
|
||||
<artifactId>february-patient-circle-common</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.february</groupId>
|
||||
<artifactId>february-patient-circle-remote</artifactId>
|
||||
</dependency>
|
||||
<!-- RuoYi Common Log -->
|
||||
<dependency>
|
||||
<groupId>com.february</groupId>
|
||||
<artifactId>february-common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common DataScope -->
|
||||
<dependency>
|
||||
<groupId>com.february</groupId>
|
||||
<artifactId>february-common-datascope</artifactId>
|
||||
</dependency>
|
||||
<!-- RuoYi Common DataSource -->
|
||||
<dependency>
|
||||
<groupId>com.february</groupId>
|
||||
<artifactId>february-common-datasource</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.tobato</groupId>
|
||||
<artifactId>fastdfs-client</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
|
@ -0,0 +1,24 @@
|
|||
package com.february.patient.circle;
|
||||
|
||||
import com.february.common.security.annotation.EnableCustomConfig;
|
||||
import com.february.common.security.annotation.EnableRyFeignClients;
|
||||
import com.february.common.swagger.annotation.EnableCustomSwagger2;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* @program: february-patient
|
||||
* @description: 病友圈启动类
|
||||
* @author: Mr.Wang
|
||||
* @create: 2023-10-20 13:37
|
||||
**/
|
||||
|
||||
@EnableCustomConfig
|
||||
@EnableCustomSwagger2
|
||||
@EnableRyFeignClients
|
||||
@SpringBootApplication
|
||||
public class PatientCircleApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(PatientCircleApplication.class);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,133 @@
|
|||
package com.february.patient.circle.controller;
|
||||
|
||||
|
||||
import com.february.patient.circle.domain.*;
|
||||
import com.february.patient.circle.domain.request.PatientCircleRequest;
|
||||
import com.february.patient.circle.domain.request.PatientRequest;
|
||||
import com.february.patient.circle.domain.request.ReviewPatientRequest;
|
||||
import com.february.patient.circle.result.Result;
|
||||
import com.february.patient.circle.service.PatientService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
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
|
||||
private PatientService patientService;
|
||||
/**
|
||||
* 病友圈列表信息
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/patientCircleList")
|
||||
public Result<List<PatientCircle>> patientCircleList(Integer userId){
|
||||
return patientService.patientCircleList(userId);
|
||||
}
|
||||
/**
|
||||
* 个人信息展示
|
||||
*/
|
||||
@PostMapping("/patientList")
|
||||
public Result<List<PatientRequest>> patientList(String patientNickname){
|
||||
return patientService.patientList(patientNickname);
|
||||
}
|
||||
/**
|
||||
* 评论列表
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/reviewList")
|
||||
public Result<List<Review>> reviewList(){
|
||||
return patientService.reviewList();
|
||||
}
|
||||
/**
|
||||
* 病友圈搜索功能
|
||||
* @param patientCircle
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/findPatientCircle")
|
||||
public Result<List<PatientCircle>> findPatientCircle(String patientCircle){
|
||||
return patientService.findPatientCircle(patientCircle);
|
||||
}
|
||||
|
||||
/**
|
||||
* 病症级联查询
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("diseaseList")
|
||||
public Result<List<Disease>> diseaseList(){
|
||||
return patientService.diseaseList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 药品级联查询
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/drugList")
|
||||
public Result<List<Drug>> drugList(){
|
||||
return patientService.drugList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 发布病友圈
|
||||
* @param patientCircleRequest
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/addPatientCircle")
|
||||
public Result addPatientCircle(PatientCircleRequest patientCircleRequest){
|
||||
return patientService.addPatientCircle(patientCircleRequest);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发布的病友圈发布者信息
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/findPatientCircleList")
|
||||
public Result<List<PatientCircle>> findPatientCircleList(@RequestParam Integer userId){
|
||||
return patientService.findPatientCircleList(userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询被采纳的建议
|
||||
* @param isAdopt
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/findAdoptReview")
|
||||
public Result<Review> findAdoptReview(@RequestParam Integer isAdopt){
|
||||
return patientService.findAdoptReview(isAdopt);
|
||||
}
|
||||
/**
|
||||
* 身份证照片上传
|
||||
* @param file
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/upload")
|
||||
public Result upload(@RequestParam("file")MultipartFile file){
|
||||
return patientService.upload(file);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据邮箱号查询
|
||||
* @param userEmailNumber
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/findByUserEmail")
|
||||
public Result<User> findByUserEmail(@RequestParam String userEmailNumber){
|
||||
return patientService.findByUserEmail(userEmailNumber);
|
||||
}
|
||||
/**
|
||||
* 患者病友圈发表评论
|
||||
*/
|
||||
@PostMapping("/patientToSick")
|
||||
public Result patientToSick(@RequestBody ReviewPatientRequest reviewPatientRequest){
|
||||
return patientService.patientToSick(reviewPatientRequest);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
package com.february.patient.circle.mapper;
|
||||
|
||||
|
||||
import com.february.patient.circle.domain.*;
|
||||
import com.february.patient.circle.domain.request.PatientCircleRequest;
|
||||
import com.february.patient.circle.domain.request.PatientRequest;
|
||||
import com.february.patient.circle.domain.request.ReviewPatientRequest;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @program: patient
|
||||
* @description:
|
||||
* @author: Mr.Wang
|
||||
* @create: 2023-10-18 11:14
|
||||
**/
|
||||
@Mapper
|
||||
public interface PatientMapper {
|
||||
List<PatientCircle> patientCircleList(@Param("userId") Integer userId);
|
||||
|
||||
|
||||
|
||||
List<Review> reviewList();
|
||||
|
||||
List<PatientCircle> findPatientCircle(@Param("patientCircle") String patientCircle);
|
||||
|
||||
List<Disease> diseaseList();
|
||||
|
||||
List<Drug> drugList();
|
||||
|
||||
Integer addPatientCircle(PatientCircleRequest patientCircleRequest);
|
||||
|
||||
List<PatientCircle> findPatientCircleList(@Param("userId") Integer userId);
|
||||
|
||||
Review findAdoptReview(@Param("isAdopt") Integer isAdopt);
|
||||
|
||||
User findByUserEmail(@Param("userEmailNumber") String userEmailNumber);
|
||||
|
||||
List<PatientRequest> patientList(@Param("patientNickname") String patientNickname);
|
||||
|
||||
Integer patientToSick(ReviewPatientRequest reviewPatientRequest);
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
package com.february.patient.circle.service;
|
||||
|
||||
|
||||
import com.february.patient.circle.domain.*;
|
||||
import com.february.patient.circle.domain.request.PatientCircleRequest;
|
||||
import com.february.patient.circle.domain.request.PatientRequest;
|
||||
import com.february.patient.circle.domain.request.ReviewPatientRequest;
|
||||
import com.february.patient.circle.result.Result;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @program: patient
|
||||
* @description:
|
||||
* @author: Mr.Wang
|
||||
* @create: 2023-10-18 11:14
|
||||
**/
|
||||
@Component
|
||||
public interface PatientService {
|
||||
Result<List<PatientCircle>> patientCircleList(Integer userId);
|
||||
|
||||
Result<List<PatientRequest>> patientList(String patientNickname);
|
||||
|
||||
Result<List<Review>> reviewList();
|
||||
|
||||
Result<List<PatientCircle>> findPatientCircle(String patientCircle);
|
||||
|
||||
Result<List<Disease>> diseaseList();
|
||||
|
||||
Result<List<Drug>> drugList();
|
||||
|
||||
Result addPatientCircle(PatientCircleRequest patientCircleRequest);
|
||||
|
||||
Result<List<PatientCircle>> findPatientCircleList(Integer userId);
|
||||
|
||||
Result<Review> findAdoptReview(Integer isAdopt);
|
||||
|
||||
Result upload(MultipartFile file);
|
||||
|
||||
Result<User> findByUserEmail(String userEmailNumber);
|
||||
|
||||
Result patientToSick(ReviewPatientRequest reviewPatientRequest);
|
||||
|
||||
}
|
|
@ -0,0 +1,111 @@
|
|||
package com.february.patient.circle.service.impl;
|
||||
|
||||
|
||||
import com.february.patient.circle.constants.JwtConstants;
|
||||
import com.february.patient.circle.domain.*;
|
||||
import com.february.patient.circle.domain.request.PatientCircleRequest;
|
||||
import com.february.patient.circle.domain.request.PatientRequest;
|
||||
import com.february.patient.circle.domain.request.ReviewPatientRequest;
|
||||
import com.february.patient.circle.mapper.PatientMapper;
|
||||
import com.february.patient.circle.result.Result;
|
||||
import com.february.patient.circle.service.PatientService;
|
||||
import com.february.patient.circle.util.FastUtil;
|
||||
import io.swagger.models.auth.In;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @program: patient
|
||||
* @description:
|
||||
* @author: Mr.Wang
|
||||
* @create: 2023-10-18 11:14
|
||||
**/
|
||||
@Service
|
||||
public class PatientServiceImpl implements PatientService {
|
||||
@Autowired
|
||||
private PatientMapper patientMapper;
|
||||
@Autowired
|
||||
private FastUtil fastUtil;
|
||||
@Override
|
||||
public Result<List<PatientCircle>> patientCircleList(Integer userId) {
|
||||
List<PatientCircle> list=patientMapper.patientCircleList(userId);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<List<PatientRequest>> patientList(String patientNickname) {
|
||||
List<PatientRequest> list=patientMapper.patientList(patientNickname);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<List<Review>> reviewList() {
|
||||
List<Review> list=patientMapper.reviewList();
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<List<PatientCircle>> findPatientCircle(String patientCircle) {
|
||||
List<PatientCircle> list=patientMapper.findPatientCircle(patientCircle);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<List<Disease>> diseaseList() {
|
||||
List<Disease> list=patientMapper.diseaseList();
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<List<Drug>> drugList() {
|
||||
List<Drug> list=patientMapper.drugList();
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result addPatientCircle(PatientCircleRequest patientCircleRequest) {
|
||||
Integer i=patientMapper.addPatientCircle(patientCircleRequest);
|
||||
return Result.success(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<List<PatientCircle>> findPatientCircleList(Integer userId) {
|
||||
List<PatientCircle> list=patientMapper.findPatientCircleList(userId);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<Review> findAdoptReview(Integer isAdopt) {
|
||||
Review review=patientMapper.findAdoptReview(isAdopt);
|
||||
return Result.success(review);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result upload(MultipartFile file) {
|
||||
try {
|
||||
String upload = fastUtil.upload(file);
|
||||
return Result.success("http://192.168.192.128:8888/"+upload,"上传成功");
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
return Result.error("上传失败");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<User> findByUserEmail(String userEmailNumber) {
|
||||
User user=patientMapper.findByUserEmail(userEmailNumber);
|
||||
return Result.success(user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result patientToSick(ReviewPatientRequest reviewPatientRequest) {
|
||||
Integer i=patientMapper.patientToSick(reviewPatientRequest);
|
||||
if(i>0){
|
||||
return Result.success("评论成功");
|
||||
}
|
||||
return Result.success("评论失败");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
package com.february.patient.circle.util;
|
||||
|
||||
|
||||
import com.github.tobato.fastdfs.domain.fdfs.StorePath;
|
||||
import com.github.tobato.fastdfs.service.FastFileStorageClient;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @BelongsProject: 0107day02
|
||||
* @BelongsPackage: com.bw.config
|
||||
* @Author: zhupengfei
|
||||
* @CreateTime: 2023-02-01 08:52
|
||||
*/
|
||||
@Component
|
||||
public class FastUtil {
|
||||
private static final Logger log = LoggerFactory.getLogger(FastUtil.class);
|
||||
|
||||
@Resource
|
||||
private FastFileStorageClient storageClient ;
|
||||
|
||||
/**
|
||||
* 上传文件
|
||||
*/
|
||||
public String upload(MultipartFile multipartFile) throws Exception{
|
||||
String originalFilename = multipartFile.getOriginalFilename().
|
||||
substring(multipartFile.getOriginalFilename().
|
||||
lastIndexOf(".") + 1);
|
||||
StorePath storePath = this.storageClient.uploadImageAndCrtThumbImage(
|
||||
multipartFile.getInputStream(),
|
||||
multipartFile.getSize(),originalFilename , null);
|
||||
return storePath.getFullPath() ;
|
||||
}
|
||||
/**
|
||||
* 删除文件
|
||||
*/
|
||||
public String deleteFile(String fileUrl) {
|
||||
if (StringUtils.isEmpty(fileUrl)) {
|
||||
log.info("fileUrl == >>文件路径为空...");
|
||||
return "文件路径不能为空";
|
||||
}
|
||||
try {
|
||||
StorePath storePath = StorePath.parseFromUrl(fileUrl);
|
||||
storageClient.deleteFile(storePath.getGroup(), storePath.getPath());
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
}
|
||||
return "删除成功";
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 9203
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
application:
|
||||
# 应用名称
|
||||
name: patient-circle
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 10.100.1.2:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 10.100.1.2:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
rabbitmq:
|
||||
host: 10.100.1.3
|
|
@ -0,0 +1,37 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.february.patient.circle.mapper.PatientMapper">
|
||||
<insert id="addPatientCircle">
|
||||
INSERT INTO `patient`.`t_patient_circle_log` (`patient_circle_title`, `disease_id`, `drug_id`, `patient_circle_detail`, `hospital`, `patient_circle_start_time`, `patient_circle_end_time`, `patient_circle_process`, `patient_circle_picture`) VALUES ( #{patientCircleTitle}, #{diseaseId}, #{drugId}, #{patientCircleDetail}, #{hospital}, #{patientCircleStartTime}, #{patientCircleEndTime}, #{patientCircleProcess}, #{patientCirclePicture})
|
||||
</insert>
|
||||
<insert id="patientToSick">
|
||||
INSERT INTO `ry-cloud`.`t_review` (`review_id`, `review_detail`) VALUES (#{reviewId},#{reviewDetail})
|
||||
</insert>
|
||||
<select id="patientCircleList" resultType="com.february.patient.circle.domain.PatientCircle">
|
||||
select * from t_patient_circle where user_id=#{userId}
|
||||
</select>
|
||||
<select id="reviewList" resultType="com.february.patient.circle.domain.Review">
|
||||
select * from t_review
|
||||
</select>
|
||||
<select id="findPatientCircle" resultType="com.february.patient.circle.domain.PatientCircle">
|
||||
select * from t_patient_circle where patient_circle_title like ('%',#{patientCircle},'%')
|
||||
</select>
|
||||
<select id="diseaseList" resultType="com.february.patient.circle.domain.Disease">
|
||||
SELECT t1.*,t3.disease_name from t_disease_detail t1 LEFT JOIN t_disease t2 on t1.disease_id=t2.disease_id LEFT JOIN t_disease t3 on t2.disease_parent_id=t3.disease_id
|
||||
</select>
|
||||
<select id="drugList" resultType="com.february.patient.circle.domain.Drug">
|
||||
SELECT t1.*,t3.drug_name from t_drug_detail t1 LEFT JOIN t_drug t2 on t1.drug_id=t2.drug_id LEFT JOIN t_drug t3 on t2.drug_parent_id=t3.drug_id
|
||||
</select>
|
||||
<select id="findPatientCircleList" resultType="com.february.patient.circle.domain.PatientCircle">
|
||||
select * from t_patient_circle where user_id=#{userId}
|
||||
</select>
|
||||
<select id="findAdoptReview" resultType="com.february.patient.circle.domain.Review">
|
||||
select * from t_review where is_adopt=#{isAdopt}
|
||||
</select>
|
||||
<select id="findByUserEmail" resultType="com.february.patient.circle.domain.User">
|
||||
select * from t_user where user_email_number=#{userEmailNumber}
|
||||
</select>
|
||||
<select id="patientList" resultType="com.february.patient.circle.domain.request.PatientRequest">
|
||||
select * from t_patient p LEFT JOIN t_sex s on p.sex_id=s.sex_id LEFT JOIN t_sign sg on p.sign_id=sg.sign_id LEFT JOIN t_user u on p.user_id=u.user_id where patient_nickname=#{patientNickname}
|
||||
</select>
|
||||
</mapper>
|
|
@ -0,0 +1,26 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.february</groupId>
|
||||
<artifactId>february-patient</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>february-patient-circle</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<modules>
|
||||
<module>february-patient-circle-common</module>
|
||||
<module>february-patient-circle-remote</module>
|
||||
<module>february-patient-circle-server</module>
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
</project>
|
|
@ -0,0 +1,29 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
|
||||
<parent>
|
||||
<groupId>com.february</groupId>
|
||||
<artifactId>february</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<version>3.6.3</version>
|
||||
|
||||
|
||||
<modules>
|
||||
<module>february-patient-circle</module>
|
||||
</modules>
|
||||
|
||||
<artifactId>february-patient</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<description>
|
||||
february-patient业务模块
|
||||
</description>
|
||||
|
||||
|
||||
</project>
|
14
pom.xml
14
pom.xml
|
@ -199,6 +199,19 @@
|
|||
<version>${february.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.february</groupId>
|
||||
<artifactId>february-patient-circle-common</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 缓存服务 -->
|
||||
<dependency>
|
||||
<groupId>com.february</groupId>
|
||||
<artifactId>february-patient-circle-remote</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 系统接口 -->
|
||||
|
||||
|
||||
|
@ -211,6 +224,7 @@
|
|||
<module>february-visual</module>
|
||||
<module>february-modules</module>
|
||||
<module>february-common</module>
|
||||
<module>february-patient</module>
|
||||
</modules>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
|
|
Loading…
Reference in New Issue