新增病友圈模块

master
王堂东 2023-10-20 16:33:19 +08:00
parent 56be67e722
commit 5e27be5d15
54 changed files with 1754 additions and 30 deletions

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

38
february-patient/.gitignore vendored 100644
View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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>

View File

@ -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 = "操作异常";
}

View File

@ -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";
}

View File

@ -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";
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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 {
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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));
}
}

View File

@ -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;
}
}

View File

@ -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();
}
}

View File

@ -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 ListSetQueue
*
* @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);
}
}

View File

@ -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

View File

@ -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>

View File

@ -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

View File

@ -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>

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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("评论失败");
}
}

View File

@ -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 "删除成功";
}
}

View File

@ -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

View File

@ -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>

View File

@ -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>

View File

@ -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
View File

@ -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>