update
This commit is contained in:
@@ -17,5 +17,9 @@
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.8.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: redis.clients:jedis:2.8.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tika:tika-core:1.9" level="project" />
|
||||
<orderEntry type="library" name="Maven: xerces:xercesImpl:2.11.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: xml-apis:xml-apis:1.4.01" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.30" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -41,6 +41,19 @@
|
||||
<groupId>redis.clients</groupId>
|
||||
<artifactId>jedis</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.tika</groupId>
|
||||
<artifactId>tika-core</artifactId>
|
||||
<version>1.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>xerces</groupId>
|
||||
<artifactId>xercesImpl</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.cool.store.constants;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: CommonConstatns
|
||||
* @Description:
|
||||
* @date 2023-05-18 14:47
|
||||
*/
|
||||
public class CommonConstants {
|
||||
|
||||
public static final String DEFAULT_DB = "coolcollege_intelligent_config";
|
||||
|
||||
public static final String REQUEST_ID = "requestId";
|
||||
|
||||
public static final int ACTION_TOKEN_EXPIRE = 14400;
|
||||
|
||||
public static final int ZERO = 0;
|
||||
public static final int ONE = 1;
|
||||
public static final int TWO = 2;
|
||||
public static final int THREE = 3;
|
||||
public static final int FOUR = 4;
|
||||
public static final int FIVE = 5;
|
||||
public static final int SIX = 6;
|
||||
public static final int SEVEN = 7;
|
||||
public static final int EIGHT = 8;
|
||||
public static final int NINE = 9;
|
||||
public static final int TEN = 10;
|
||||
public static final int TWENTY = 20;
|
||||
public static final int THIRTY = 30;
|
||||
public static final int FORTY = 40;
|
||||
public static final int FIFTY = 50;
|
||||
public static final int SIXTY = 60;
|
||||
public static final int SEVENTY = 70;
|
||||
public static final int EIGHTY = 80;
|
||||
public static final int NINETY = 90;
|
||||
public static final int HUNDRED = 100;
|
||||
|
||||
|
||||
|
||||
|
||||
public static final String ZERO_STR = "0";
|
||||
public static final String ONE_STR = "1";
|
||||
public static final String TWO_STR = "2";
|
||||
public static final String THREE_STR = "3";
|
||||
public static final String FOUR_STR = "4";
|
||||
public static final String FIVE_STR = "5";
|
||||
public static final String SIX_STR = "6";
|
||||
public static final String SEVEN_STR = "7";
|
||||
public static final String EIGHT_STR = "8";
|
||||
public static final String NINE_STR = "9";
|
||||
public static final String TEN_STR = "10";
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.cool.store.enums;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* * 通用错误返回处理,后续全部将使用这个返回,请遵守以下规范。
|
||||
* * 1.枚举名必须要大写。
|
||||
* * 2.枚举中包含属性:code,msg,en(英文尽量写)
|
||||
* * 3.code的命名以系统模块划分,前三位为模块划分。逐级细分。(7位数字先到先取原则,细化不浪费)
|
||||
* @author zhangchenbiao
|
||||
* @FileName: ErrorCodeEnum
|
||||
* @Description: 返回响应状态和文案枚举
|
||||
* @date 2023-05-19 04:30
|
||||
*/
|
||||
public enum ErrorCodeEnum {
|
||||
|
||||
/**
|
||||
* 000000 未知错误
|
||||
*/
|
||||
UNKNOWN(000000, "未知错误", null),
|
||||
/**
|
||||
* 2000001 token与当前登录企业不匹配
|
||||
*/
|
||||
TOKEN_ERROR(2000001,"请求异常,与当前登录企业不匹配",null),
|
||||
FAIL(400000, "FAIL", null),
|
||||
ACCESS_TOKEN_INVALID(400005, "Invalid token", null),
|
||||
PARAMS_VALIDATE_ERROR(400003, "参数校验失败!", null),
|
||||
;
|
||||
|
||||
|
||||
|
||||
protected static final Map<Integer, ErrorCodeEnum> map = Arrays.stream(values()).collect(
|
||||
Collectors.toMap(ErrorCodeEnum::getCode, Function.identity(), (a, b)->a));
|
||||
private int code;
|
||||
|
||||
private String message;
|
||||
private String en;
|
||||
|
||||
ErrorCodeEnum(int code, String message, String en) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
this.en=en;
|
||||
}
|
||||
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public static ErrorCodeEnum getByCode(Integer code) {
|
||||
return map.get(code);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.cool.store.enums;
|
||||
|
||||
|
||||
/**
|
||||
* @author Aaron
|
||||
* @Description 业务统一返回码
|
||||
* @date 2019/12/20
|
||||
*/
|
||||
public enum ResponseCodeEnum {
|
||||
/**
|
||||
* 成功返回
|
||||
*/
|
||||
SUCCESS(200000, "SUCCESS");
|
||||
|
||||
/**
|
||||
* 返回码
|
||||
*/
|
||||
private int code;
|
||||
|
||||
/**
|
||||
* 返回信息
|
||||
*/
|
||||
private String message;
|
||||
|
||||
ResponseCodeEnum(int code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.cool.store.exception;
|
||||
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import lombok.Data;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
|
||||
/**
|
||||
* @Description 业务异常类返回
|
||||
* @author Aaron
|
||||
* @date 2019/12/20
|
||||
*/
|
||||
@Data
|
||||
public class ServiceException extends RuntimeException{
|
||||
private static final long serialVersionUID = -5068776742356414959L;
|
||||
|
||||
/**
|
||||
* 返回码
|
||||
*/
|
||||
private Integer errorCode;
|
||||
|
||||
/**
|
||||
* 返回信息
|
||||
*/
|
||||
private String errorMessage;
|
||||
|
||||
private Object data;
|
||||
|
||||
/**
|
||||
* 构造函数
|
||||
* @param errorCode
|
||||
* @param errorMessage
|
||||
*/
|
||||
@Deprecated
|
||||
public ServiceException(Integer errorCode, String errorMessage) {
|
||||
super(errorMessage);
|
||||
this.errorCode = errorCode;
|
||||
this.errorMessage = errorMessage;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 构造函数
|
||||
* @param errorCode
|
||||
* @param errorMessage
|
||||
*/
|
||||
@Deprecated
|
||||
public ServiceException(Integer errorCode, String errorMessage, Object data) {
|
||||
super(errorMessage);
|
||||
this.errorCode = errorCode;
|
||||
this.errorMessage = errorMessage;
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 构造函数
|
||||
* @param errorMessage
|
||||
*/
|
||||
@Deprecated
|
||||
public ServiceException(String errorMessage) {
|
||||
super(errorMessage);
|
||||
this.errorMessage = errorMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* 构造函数
|
||||
* @param errorCode
|
||||
* @param errorMessage
|
||||
* @param cause
|
||||
*/
|
||||
@Deprecated
|
||||
public ServiceException(Integer errorCode, String errorMessage, Throwable cause) {
|
||||
super(errorMessage, cause);
|
||||
this.errorCode = errorCode;
|
||||
this.errorMessage = errorMessage;
|
||||
}
|
||||
|
||||
public ServiceException(ErrorCodeEnum responseEnum) {
|
||||
super(responseEnum.getMessage());
|
||||
this.errorCode = responseEnum.getCode();
|
||||
this.errorMessage = responseEnum.getMessage();
|
||||
}
|
||||
|
||||
public ServiceException(ErrorCodeEnum responseEnum, Object... objects) {
|
||||
super(responseEnum.getMessage());
|
||||
String message = MessageFormat.format(responseEnum.getMessage(), objects);
|
||||
this.errorCode = responseEnum.getCode();
|
||||
this.errorMessage = message;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package com.cool.store.model.constants;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: CommonConstatns
|
||||
* @Description:
|
||||
* @date 2023-05-18 14:47
|
||||
*/
|
||||
public class CommonConstants {
|
||||
|
||||
public static final String DEFAULT_DB = "coolcollege_intelligent_config";
|
||||
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
package com.cool.store.response;
|
||||
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.ResponseCodeEnum;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
import org.slf4j.MDC;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
|
||||
/**
|
||||
* 统一返回结果
|
||||
*
|
||||
* @author Aaron
|
||||
* @date 2019/12/20
|
||||
*/
|
||||
@Data
|
||||
@ToString
|
||||
public class ResponseResult<T> implements Result {
|
||||
private static final long serialVersionUID = -2217360460304088285L;
|
||||
|
||||
public ResponseResult(int code, String message, T data) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
this.data = data;
|
||||
this.requestId = MDC.get(CommonConstants.REQUEST_ID);
|
||||
}
|
||||
|
||||
public ResponseResult(int code, String message, T data, String stackTrace) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
this.data = data;
|
||||
this.stackTrace = stackTrace;
|
||||
this.requestId = MDC.get(CommonConstants.REQUEST_ID);
|
||||
}
|
||||
|
||||
public ResponseResult(int code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
this.requestId = MDC.get(CommonConstants.REQUEST_ID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回码
|
||||
*/
|
||||
private int code;
|
||||
|
||||
/**
|
||||
* 返回信息
|
||||
*/
|
||||
private String message;
|
||||
|
||||
/**
|
||||
* 返回数据
|
||||
*/
|
||||
private T data;
|
||||
|
||||
/**
|
||||
* 异常堆栈信息
|
||||
*/
|
||||
private String stackTrace;
|
||||
|
||||
private String requestId;
|
||||
|
||||
public long getSystemCurrentTime() {
|
||||
return System.currentTimeMillis();
|
||||
}
|
||||
|
||||
public static<T> ResponseResult<T> success(T data) {
|
||||
return new ResponseResult(ResponseCodeEnum.SUCCESS.getCode(), "操作成功", data);
|
||||
}
|
||||
|
||||
public static ResponseResult success() {
|
||||
return new ResponseResult(ResponseCodeEnum.SUCCESS.getCode(), "操作成功");
|
||||
}
|
||||
|
||||
public static ResponseResult fail(int code, String msg) {
|
||||
return new ResponseResult(code, msg, false);
|
||||
}
|
||||
|
||||
public static ResponseResult fail(int code, String msg, String stackTrace) {
|
||||
return new ResponseResult(code, msg, false, stackTrace);
|
||||
}
|
||||
|
||||
public static ResponseResult fail(ErrorCodeEnum responseEnum){
|
||||
return new ResponseResult(responseEnum.getCode(), responseEnum.getMessage(), false);
|
||||
}
|
||||
|
||||
public static ResponseResult fail(ErrorCodeEnum responseEnum, Object... objects){
|
||||
String message = MessageFormat.format(responseEnum.getMessage(), objects);
|
||||
return new ResponseResult(responseEnum.getCode(), message, false);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.cool.store.response;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Description 响应格式父接口
|
||||
* @author Aaron
|
||||
* @date 2019/12/20
|
||||
*/
|
||||
public interface Result extends Serializable {
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.cool.store.model.utils;
|
||||
package com.cool.store.utils;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import redis.clients.jedis.*;
|
||||
@@ -20,12 +20,12 @@
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-core:2.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.javassist:javassist:3.25.0-GA" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.swagger:swagger-models:1.5.22" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.13.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.10.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.swagger:swagger-annotations:1.5.22" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger2:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-spi:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-core:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.bytebuddy:byte-buddy:1.12.23" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.bytebuddy:byte-buddy:1.10.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-schema:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger-common:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-spring-web:2.9.2" level="project" />
|
||||
@@ -37,25 +37,25 @@
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-bean-validators:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring-ui:2.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:3.0.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.7.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.7.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.7.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.12" level="project" />
|
||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.12" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.17.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.17.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.36" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.12.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.12.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: jakarta.annotation:jakarta.annotation-api:1.3.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:4.0.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: org.yaml:snakeyaml:1.25" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:3.4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="module" module-name="coolstore-partner-common" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.12.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.projectlombok:lombok:1.18.6" level="project" />
|
||||
@@ -63,12 +63,15 @@
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.8.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: redis.clients:jedis:2.8.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tika:tika-core:1.9" level="project" />
|
||||
<orderEntry type="library" name="Maven: xerces:xercesImpl:2.11.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: xml-apis:xml-apis:1.4.01" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: mysql:mysql-connector-java:8.0.18" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.protobuf:protobuf-java:3.6.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:druid-spring-boot-starter:1.1.20" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:druid:1.1.20" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.36" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.7.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.mybatis.generator:mybatis-generator-core:1.3.7" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-starter:1.4.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:2.2.2" level="project" />
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.mapper.EnterpriseConfigMapper;
|
||||
import com.cool.store.model.entity.EnterpriseConfigDO;
|
||||
import com.cool.store.entity.EnterpriseConfigDO;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-19 02:58
|
||||
*/
|
||||
@Service
|
||||
public class EnterpriseUserDAO {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-19 02:59
|
||||
*/
|
||||
@Service
|
||||
public class EnterpriseUserRoleDAO {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-19 02:59
|
||||
*/
|
||||
@Service
|
||||
public class RegionDAO {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-19 03:00
|
||||
*/
|
||||
@Service
|
||||
public class SysDepartmentDAO {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-19 03:00
|
||||
*/
|
||||
@Service
|
||||
public class SysRoleDAO {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-19 03:01
|
||||
*/
|
||||
@Service
|
||||
public class SysRoleMenuDAO {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-19 02:54
|
||||
*/
|
||||
@Service
|
||||
public class UserAuthMappingDAO {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-19 03:00
|
||||
*/
|
||||
@Service
|
||||
public class UserRegionMappingDAO {
|
||||
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.model.entity.EnterpriseConfigDO;
|
||||
import com.cool.store.entity.EnterpriseConfigDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.model.entity.EnterpriseUserDO;
|
||||
import com.cool.store.entity.EnterpriseUserDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.model.entity.EnterpriseUserRoleDO;
|
||||
import com.cool.store.entity.EnterpriseUserRoleDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.model.entity.RegionDO;
|
||||
import com.cool.store.entity.RegionDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.model.entity.SysDepartmentDO;
|
||||
import com.cool.store.entity.SysDepartmentDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.model.entity.SysRoleDO;
|
||||
import com.cool.store.entity.SysRoleDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.model.entity.SysRoleMenuDO;
|
||||
import com.cool.store.entity.SysRoleMenuDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.model.entity.UserAuthMappingDO;
|
||||
import com.cool.store.entity.UserAuthMappingDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.model.entity.UserRegionMappingDO;
|
||||
import com.cool.store.entity.UserRegionMappingDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?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.cool.store.mapper.EnterpriseConfigMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.model.entity.EnterpriseConfigDO">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.EnterpriseConfigDO">
|
||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||
<result column="current_package" jdbcType="BIGINT" property="currentPackage"/>
|
||||
<result column="enterprise_id" jdbcType="VARCHAR" property="enterpriseId"/>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?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.cool.store.mapper.EnterpriseUserMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.model.entity.EnterpriseUserDO">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.EnterpriseUserDO">
|
||||
<id column="id" jdbcType="VARCHAR" property="id"/>
|
||||
<result column="user_id" jdbcType="VARCHAR" property="userId"/>
|
||||
<result column="name" jdbcType="VARCHAR" property="name"/>
|
||||
@@ -34,7 +34,7 @@
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
||||
<result column="subordinate_range" jdbcType="VARCHAR" property="subordinateRange"/>
|
||||
</resultMap>
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.cool.store.model.entity.EnterpriseUserDO">
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.cool.store.entity.EnterpriseUserDO">
|
||||
<result column="is_leader_in_depts" jdbcType="LONGVARCHAR" property="isLeaderInDepts"/>
|
||||
<result column="department" jdbcType="LONGVARCHAR" property="department"/>
|
||||
<result column="jobnumber" jdbcType="LONGVARCHAR" property="jobnumber"/>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?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.cool.store.mapper.EnterpriseUserRoleMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.model.entity.EnterpriseUserRoleDO">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.EnterpriseUserRoleDO">
|
||||
<id column="id" jdbcType="INTEGER" property="id"/>
|
||||
<result column="role_id" jdbcType="BIGINT" property="roleId"/>
|
||||
<result column="user_id" jdbcType="VARCHAR" property="userId"/>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?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.cool.store.mapper.RegionMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.model.entity.RegionDO">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.RegionDO">
|
||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||
<result column="region_id" jdbcType="VARCHAR" property="regionId"/>
|
||||
<result column="name" jdbcType="VARCHAR" property="name"/>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?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.cool.store.mapper.SysDepartmentMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.model.entity.SysDepartmentDO">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.SysDepartmentDO">
|
||||
<id column="id" jdbcType="VARCHAR" property="id"/>
|
||||
<result column="name" jdbcType="VARCHAR" property="name"/>
|
||||
<result column="parent_id" jdbcType="VARCHAR" property="parentId"/>
|
||||
@@ -19,7 +19,7 @@
|
||||
<result column="user_count" jdbcType="INTEGER" property="userCount"/>
|
||||
<result column="unactive_user_count" jdbcType="INTEGER" property="unactiveUserCount"/>
|
||||
</resultMap>
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.cool.store.model.entity.SysDepartmentDO">
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.cool.store.entity.SysDepartmentDO">
|
||||
<result column="parent_ids" jdbcType="LONGVARCHAR" property="parentIds"/>
|
||||
<result column="sub_ids" jdbcType="LONGVARCHAR" property="subIds"/>
|
||||
</resultMap>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?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.cool.store.mapper.SysRoleMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.model.entity.SysRoleDO">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.SysRoleDO">
|
||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||
<result column="role_name" jdbcType="VARCHAR" property="roleName"/>
|
||||
<result column="is_internal" jdbcType="BIT" property="isInternal"/>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?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.cool.store.mapper.SysRoleMenuMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.model.entity.SysRoleMenuDO">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.SysRoleMenuDO">
|
||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||
<result column="menu_id" jdbcType="BIGINT" property="menuId"/>
|
||||
<result column="role_id" jdbcType="BIGINT" property="roleId"/>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?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.cool.store.mapper.UserAuthMappingMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.model.entity.UserAuthMappingDO">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.UserAuthMappingDO">
|
||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||
<result column="user_id" jdbcType="VARCHAR" property="userId"/>
|
||||
<result column="mapping_id" jdbcType="VARCHAR" property="mappingId"/>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?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.cool.store.mapper.UserRegionMappingMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.model.entity.UserRegionMappingDO">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.UserRegionMappingDO">
|
||||
<id column="id" jdbcType="INTEGER" property="id"/>
|
||||
<result column="region_id" jdbcType="VARCHAR" property="regionId"/>
|
||||
<result column="user_id" jdbcType="VARCHAR" property="userId"/>
|
||||
|
||||
@@ -4,9 +4,6 @@
|
||||
<output url="file://$MODULE_DIR$/target/classes" />
|
||||
<output-test url="file://$MODULE_DIR$/target/test-classes" />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
|
||||
@@ -18,32 +18,35 @@
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.8.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: redis.clients:jedis:2.8.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tika:tika-core:1.9" level="project" />
|
||||
<orderEntry type="library" name="Maven: xerces:xercesImpl:2.11.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: xml-apis:xml-apis:1.4.01" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring-boot-starter:2.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring-boot-autoconfigure:2.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring:2.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-annotations:2.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-core:2.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.36" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.javassist:javassist:3.25.0-GA" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.swagger:swagger-models:1.5.22" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.13.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.10.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.swagger:swagger-annotations:1.5.22" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger2:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-spi:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-core:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.bytebuddy:byte-buddy:1.12.23" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.bytebuddy:byte-buddy:1.10.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-schema:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger-common:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-spring-web:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:guava:20.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.5.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:1.2.0.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mapstruct:mapstruct:1.2.0.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-bean-validators:2.9.2" level="project" />
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.cool.store.model.dto;
|
||||
package com.cool.store.dto;
|
||||
|
||||
import com.cool.store.model.entity.EnterpriseConfigDO;
|
||||
import com.cool.store.entity.EnterpriseConfigDO;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.cool.store.dto.login;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: FeiShuLoginDTO
|
||||
* @Description:
|
||||
* @date 2023-05-19 19:25
|
||||
*/
|
||||
@Data
|
||||
public class FeiShuLoginDTO {
|
||||
|
||||
@ApiModelProperty("code")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty("应用id")
|
||||
private String appId;
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.cool.store.model.entity;
|
||||
package com.cool.store.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.cool.store.model.entity;
|
||||
package com.cool.store.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.Serializable;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.cool.store.model.entity;
|
||||
package com.cool.store.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.Serializable;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.cool.store.model.entity;
|
||||
package com.cool.store.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.Serializable;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.cool.store.model.entity;
|
||||
package com.cool.store.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.Serializable;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.cool.store.model.entity;
|
||||
package com.cool.store.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.Serializable;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.cool.store.model.entity;
|
||||
package com.cool.store.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.Serializable;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.cool.store.model.entity;
|
||||
package com.cool.store.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.Serializable;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.cool.store.model.entity;
|
||||
package com.cool.store.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.Serializable;
|
||||
@@ -18,33 +18,36 @@
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.8.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: redis.clients:jedis:2.8.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tika:tika-core:1.9" level="project" />
|
||||
<orderEntry type="library" name="Maven: xerces:xercesImpl:2.11.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: xml-apis:xml-apis:1.4.01" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.30" level="project" />
|
||||
<orderEntry type="module" module-name="coolstore-partner-dao" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:3.0.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.7.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.7.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.7.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.12" level="project" />
|
||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.12" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.17.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.17.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.36" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.12.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.12.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: jakarta.annotation:jakarta.annotation-api:1.3.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:4.0.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: org.yaml:snakeyaml:1.25" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:3.4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: mysql:mysql-connector-java:8.0.18" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.protobuf:protobuf-java:3.6.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:druid-spring-boot-starter:1.1.20" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:druid:1.1.20" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.36" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.7.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-starter:1.4.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:2.2.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:2.2.2" level="project" />
|
||||
@@ -61,12 +64,12 @@
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-core:2.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.javassist:javassist:3.25.0-GA" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.swagger:swagger-models:1.5.22" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.13.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.10.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.swagger:swagger-annotations:1.5.22" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger2:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-spi:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-core:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.bytebuddy:byte-buddy:1.12.23" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.bytebuddy:byte-buddy:1.10.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-schema:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger-common:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-spring-web:2.9.2" level="project" />
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
|
||||
import com.cool.store.model.entity.EnterpriseConfigDO;
|
||||
import com.cool.store.entity.EnterpriseConfigDO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.cool.store.service.config.redis;
|
||||
|
||||
import com.cool.store.model.utils.RedisUtilPool;
|
||||
import com.cool.store.utils.RedisUtilPool;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -8,6 +8,8 @@ public class CurrentUser {
|
||||
|
||||
private String userId;
|
||||
|
||||
private String name;
|
||||
|
||||
private String enterpriseId;
|
||||
|
||||
private String dingCorpId;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import com.cool.store.dao.EnterpriseConfigDAO;
|
||||
import com.cool.store.model.entity.EnterpriseConfigDO;
|
||||
import com.cool.store.entity.EnterpriseConfigDO;
|
||||
import com.cool.store.service.EnterpriseConfigService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -19,16 +19,19 @@
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.8.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: redis.clients:jedis:2.8.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tika:tika-core:1.9" level="project" />
|
||||
<orderEntry type="library" name="Maven: xerces:xercesImpl:2.11.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: xml-apis:xml-apis:1.4.01" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.30" level="project" />
|
||||
<orderEntry type="module" module-name="coolstore-partner-dao" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:3.0.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:4.0.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:3.4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: mysql:mysql-connector-java:8.0.18" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.protobuf:protobuf-java:3.6.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:druid-spring-boot-starter:1.1.20" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:druid:1.1.20" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.36" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-starter:1.4.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:2.2.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:2.2.2" level="project" />
|
||||
@@ -49,47 +52,51 @@
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger2:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-spi:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-core:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.bytebuddy:byte-buddy:1.12.23" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.bytebuddy:byte-buddy:1.10.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-schema:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger-common:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-spring-web:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:guava:20.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.5.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:1.2.0.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mapstruct:mapstruct:1.2.0.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-bean-validators:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring-ui:2.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.7.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.7.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.7.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.7.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.7.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.12" level="project" />
|
||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.12" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.17.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.17.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.36" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.12.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.12.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: jakarta.annotation:jakarta.annotation-api:1.3.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.7.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.13.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.13.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.13.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.13.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.13.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:2.7.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:9.0.74" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-el:9.0.74" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:9.0.74" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-web:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: org.yaml:snakeyaml:1.25" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.10.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.10.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.10.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.10.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.10.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.10.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:9.0.33" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-el:9.0.33" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:9.0.33" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-validation:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: jakarta.validation:jakarta.validation-api:2.0.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.hibernate.validator:hibernate-validator:6.0.18.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.4.1.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.5.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-web:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.2.5.RELEASE" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -2,7 +2,7 @@ package com.cool.store.config;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.config.datasource.DynamicDataSourceServiceImpl;
|
||||
import com.cool.store.model.dto.DatasourceInfoDTO;
|
||||
import com.cool.store.dto.DatasourceInfoDTO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -15,7 +15,7 @@ import java.util.List;
|
||||
* @author zhangchenbiao
|
||||
* @FileName: CommonBeanConfig
|
||||
* @Description:
|
||||
* @date 2022-01-25 18:41
|
||||
* @date 2023-05-19 18:41
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
package com.cool.store.config;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.entity.SysRoleDO;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.mapper.SysRoleMapper;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.context.DataSourceContext;
|
||||
import com.cool.store.service.context.UserContext;
|
||||
import com.cool.store.service.utils.DataSourceHelper;
|
||||
import com.cool.store.utils.RedisUtilPool;
|
||||
import com.cool.store.service.context.CurrentUser;
|
||||
import com.google.common.collect.Lists;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.AntPathMatcher;
|
||||
|
||||
import javax.servlet.*;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author ydw
|
||||
* @Description 权限校验
|
||||
* @date 2020/1/15
|
||||
*/
|
||||
@Component
|
||||
@Order(3)
|
||||
@Slf4j
|
||||
public class TokenValidateFilter implements Filter {
|
||||
|
||||
@Autowired
|
||||
private RedisUtilPool redisUtilPool;
|
||||
|
||||
private static AntPathMatcher matcher = new AntPathMatcher();
|
||||
|
||||
private static List<String> patternList =
|
||||
|
||||
Lists.newArrayList("/web/check/ok","/check/ok", "/partner/doc.html",
|
||||
"/**/swagger*/**",
|
||||
"/**/webjars/**");
|
||||
|
||||
|
||||
/**
|
||||
* @param uri
|
||||
* @return boolean
|
||||
* @throws
|
||||
* @Title excludePath
|
||||
* @Description 是否是放行的请求
|
||||
*/
|
||||
private boolean excludePath(String uri) {
|
||||
for (String pattern : patternList) {
|
||||
if (matcher.match(pattern, uri)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FilterConfig filterConfig) throws ServletException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
|
||||
HttpServletResponse response = (HttpServletResponse) servletResponse;
|
||||
HttpServletRequest reqs = (HttpServletRequest) servletRequest;
|
||||
String uri = reqs.getRequestURI();
|
||||
String method = reqs.getMethod();
|
||||
String userStr = "";
|
||||
CurrentUser currentUser = null;
|
||||
boolean isInWhiteList = excludePath(uri);
|
||||
String accessToken = reqs.getParameter("access_token");
|
||||
String key = "access_token:" + accessToken;
|
||||
if(StringUtils.isNotBlank(accessToken)){
|
||||
userStr = redisUtilPool.getString(key);
|
||||
if(StringUtils.isNotBlank(userStr)){
|
||||
currentUser = JSON.parseObject(userStr, CurrentUser.class);
|
||||
}
|
||||
}
|
||||
log.info("url:{}", uri);
|
||||
if ( !isInWhiteList && !method.equals("OPTIONS")) {
|
||||
if (StringUtils.isEmpty(accessToken)) {
|
||||
response.setStatus(HttpStatus.OK.value());
|
||||
response.getWriter().write(JSON.toJSONString(
|
||||
ResponseResult.fail(ErrorCodeEnum.ACCESS_TOKEN_INVALID)));
|
||||
return;
|
||||
}
|
||||
if (Objects.isNull(currentUser)) {
|
||||
response.setStatus(HttpStatus.OK.value());
|
||||
response.getWriter().write(JSON.toJSONString(
|
||||
ResponseResult.fail(ErrorCodeEnum.ACCESS_TOKEN_INVALID)));
|
||||
return;
|
||||
}
|
||||
log.info("url:{}, access_token:{}, userId:{}, username:{}, enterpriseId:{}", uri, accessToken, currentUser.getUserId(), currentUser.getName(), currentUser.getEnterpriseId());
|
||||
}
|
||||
if(StringUtils.isBlank(userStr) && !isInWhiteList){
|
||||
response.setStatus(HttpStatus.OK.value());
|
||||
response.getWriter().write(JSON.toJSONString(
|
||||
ResponseResult.fail(ErrorCodeEnum.ACCESS_TOKEN_INVALID)));
|
||||
return;
|
||||
}
|
||||
try {
|
||||
UserContext.setUser(userStr);
|
||||
DataSourceHelper.changeToMy();
|
||||
filterChain.doFilter(servletRequest, servletResponse);
|
||||
} finally {
|
||||
UserContext.removeUser();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.cool.store.config.datasource;
|
||||
|
||||
import com.cool.store.model.constants.CommonConstants;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.service.context.DataSourceContext;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.cool.store.config.datasource;
|
||||
|
||||
import com.cool.store.model.constants.CommonConstants;
|
||||
import com.cool.store.model.dto.DatasourceInfoDTO;
|
||||
import com.cool.store.model.entity.EnterpriseConfigDO;
|
||||
import com.cool.store.model.utils.RedisUtilPool;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.dto.DatasourceInfoDTO;
|
||||
import com.cool.store.entity.EnterpriseConfigDO;
|
||||
import com.cool.store.utils.RedisUtilPool;
|
||||
import com.cool.store.service.EnterpriseConfigService;
|
||||
import com.cool.store.service.context.DataSourceContext;
|
||||
import com.github.pagehelper.Page;
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
package com.cool.store.config.swagger;
|
||||
|
||||
import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.base.Predicates;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Profile;
|
||||
import springfox.documentation.RequestHandler;
|
||||
import springfox.documentation.builders.ApiInfoBuilder;
|
||||
import springfox.documentation.builders.ParameterBuilder;
|
||||
import springfox.documentation.builders.PathSelectors;
|
||||
import springfox.documentation.builders.RequestHandlerSelectors;
|
||||
import springfox.documentation.schema.ModelRef;
|
||||
import springfox.documentation.service.ApiInfo;
|
||||
import springfox.documentation.service.Parameter;
|
||||
import springfox.documentation.spi.DocumentationType;
|
||||
import springfox.documentation.spring.web.plugins.Docket;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @description:
|
||||
* @date 2023/05/15 02:52
|
||||
*/
|
||||
@Profile({"local", "dev", "ab", "test"})
|
||||
@Configuration
|
||||
@EnableSwagger2
|
||||
@EnableKnife4j
|
||||
public class Swagger2Config {
|
||||
|
||||
/**
|
||||
* 扫描接口地址的包名
|
||||
*/
|
||||
public static final String BASE_PACKAGE = "com.cool.store.controller";
|
||||
|
||||
private ApiInfo getApiInfo() {
|
||||
return new ApiInfoBuilder()
|
||||
.title("coolstore-partner-manage")
|
||||
.description("接口文档")
|
||||
.version("1.0")
|
||||
.build();
|
||||
}
|
||||
|
||||
private Docket createDocket (String groupName, String... packages){
|
||||
List<Parameter> pars = getParameters();
|
||||
return new Docket(DocumentationType.SWAGGER_2)
|
||||
.enable(Boolean.TRUE)
|
||||
.apiInfo(this.getApiInfo())
|
||||
.groupName(groupName)
|
||||
.select()
|
||||
.apis(this.scanBasePackage(packages))
|
||||
.build()
|
||||
.globalOperationParameters(pars);
|
||||
}
|
||||
|
||||
private Docket createDocketByPath (String groupName, String... paths){
|
||||
List<Parameter> pars = getParameters();
|
||||
return new Docket(DocumentationType.SWAGGER_2)
|
||||
.enable(Boolean.TRUE)
|
||||
.apiInfo(this.getApiInfo())
|
||||
.groupName(groupName)
|
||||
.select()
|
||||
.paths(this.scanPath(paths))
|
||||
.build()
|
||||
.globalOperationParameters(pars);
|
||||
}
|
||||
|
||||
private List<Parameter> getParameters() {
|
||||
List<Parameter> pars = new ArrayList<>();
|
||||
pars.add(new ParameterBuilder().name("access_token").description("令牌").required(true)
|
||||
.modelRef(new ModelRef("string"))
|
||||
.defaultValue("{{access_token}}")
|
||||
.parameterType("query").build());
|
||||
pars.add(new ParameterBuilder().name("enterprise-id").required(true)
|
||||
.modelRef(new ModelRef("string"))
|
||||
.defaultValue("45f92210375346858b6b6694967f44de")
|
||||
.parameterType("path").build());
|
||||
return pars;
|
||||
}
|
||||
|
||||
private Predicate<RequestHandler> scanBasePackage(final String... controllerPack) {
|
||||
Predicate<RequestHandler> predicate = null;
|
||||
for (String strBasePackage : controllerPack) {
|
||||
if(StringUtils.isNotBlank(strBasePackage)){
|
||||
Predicate<RequestHandler> tempPredicate = RequestHandlerSelectors.basePackage(strBasePackage);
|
||||
predicate = predicate == null ? tempPredicate : Predicates.or(tempPredicate,predicate);
|
||||
}
|
||||
}
|
||||
return predicate;
|
||||
}
|
||||
|
||||
private Predicate<String> scanPath(final String... paths) {
|
||||
Predicate<String> predicate = null;
|
||||
for (String path : paths) {
|
||||
if(StringUtils.isNotBlank(path)){
|
||||
Predicate<String> tempPredicate = PathSelectors.ant(path);
|
||||
predicate = predicate == null ? tempPredicate : Predicates.or(tempPredicate,predicate);
|
||||
}
|
||||
}
|
||||
return predicate;
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
public Docket allApi() {
|
||||
return this.createDocket("全部", BASE_PACKAGE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.cool.store.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.dto.login.FeiShuLoginDTO;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.google.protobuf.ServiceException;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: LoginController
|
||||
* @Description:登录
|
||||
* @date 2023-05-19 17:22
|
||||
*/
|
||||
@RestController
|
||||
@Slf4j
|
||||
public class LoginController {
|
||||
|
||||
/*@PostMapping(value = "/v3/feiShuLogin")
|
||||
public Object feiShuLogin(@RequestBody FeiShuLoginDTO param) {
|
||||
log.info("isvLoginV2 data={}", JSONObject.toJSONString(param));
|
||||
String code = param.getCode();
|
||||
String appId = param.getAppId();
|
||||
|
||||
String userId = "", corpId = "", appType = AppTypeEnum.FEI_SHU.getValue();
|
||||
try {
|
||||
String value = "code=" + code + "&appType=" + appType + "&appId=" + appId;
|
||||
log.info("url:{}", ding_token_userId + value);
|
||||
JSONObject userInfo = JSON.parseObject(HttpRequest.sendGet(ding_token_userId, value));
|
||||
logger.info("userInfo:{}", JSONObject.toJSONString(userInfo));
|
||||
userId = userInfo.getString("openId");
|
||||
corpId = userInfo.getString("corpId");
|
||||
String errorCode = userInfo.getString("error_code");
|
||||
if (StringUtils.isBlank(userId) && StringUtils.isNotBlank(errorCode)) {
|
||||
DingLoginErrorEnum dingLoginErrorEnum = DingLoginErrorEnum.getByCode(Integer.getInteger(errorCode));
|
||||
if (dingLoginErrorEnum != null) {
|
||||
throw new ServiceException(dingLoginErrorEnum.getCode(), dingLoginErrorEnum.getMsg());
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
if (e instanceof ServiceException) {
|
||||
throw e;
|
||||
} else {
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR.getCode(), "用户不存在");
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
return loginService.isvLogin(userId, corpId, Boolean.TRUE, appType, StringUtils.EMPTY);
|
||||
} catch (ServiceException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new ServiceException(e.getErrorCode(), e.getErrorMessage());
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR.getCode(), "登陆失败");
|
||||
}
|
||||
}*/
|
||||
|
||||
}
|
||||
@@ -19,16 +19,19 @@
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.8.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: redis.clients:jedis:2.8.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tika:tika-core:1.9" level="project" />
|
||||
<orderEntry type="library" name="Maven: xerces:xercesImpl:2.11.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: xml-apis:xml-apis:1.4.01" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.30" level="project" />
|
||||
<orderEntry type="module" module-name="coolstore-partner-dao" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:3.0.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:4.0.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:3.4.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: mysql:mysql-connector-java:8.0.18" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.protobuf:protobuf-java:3.6.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:druid-spring-boot-starter:1.1.20" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:druid:1.1.20" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.36" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-starter:1.4.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:2.2.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:2.2.2" level="project" />
|
||||
@@ -49,47 +52,51 @@
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger2:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-spi:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-core:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.bytebuddy:byte-buddy:1.12.23" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.bytebuddy:byte-buddy:1.10.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-schema:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger-common:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-spring-web:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:guava:20.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.5.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:1.2.0.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mapstruct:mapstruct:1.2.0.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-bean-validators:2.9.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.xiaoymin:knife4j-spring-ui:2.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.7.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.7.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.13.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.13.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.13.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.13.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.13.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:2.7.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:9.0.74" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-el:9.0.74" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:9.0.74" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-web:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.7.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.7.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.7.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.7.11" level="project" />
|
||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.12" level="project" />
|
||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.12" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.17.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.17.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.36" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.10.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.10.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.10.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.10.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.10.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.10.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:9.0.33" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-el:9.0.33" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:9.0.33" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-validation:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: jakarta.validation:jakarta.validation-api:2.0.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.hibernate.validator:hibernate-validator:6.0.18.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.4.1.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.5.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-web:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.12.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.12.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: jakarta.annotation:jakarta.annotation-api:1.3.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.3.27" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.30" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: org.yaml:snakeyaml:1.25" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -2,7 +2,7 @@ package com.cool.store.config;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.config.datasource.DynamicDataSourceServiceImpl;
|
||||
import com.cool.store.model.dto.DatasourceInfoDTO;
|
||||
import com.cool.store.dto.DatasourceInfoDTO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -15,7 +15,7 @@ import java.util.List;
|
||||
* @author zhangchenbiao
|
||||
* @FileName: CommonBeanConfig
|
||||
* @Description:
|
||||
* @date 2022-01-25 18:41
|
||||
* @date 2023-05-19 18:41
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
package com.cool.store.config;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.response.ResponseResult;
|
||||
import com.cool.store.service.context.CurrentUser;
|
||||
import com.cool.store.service.context.UserContext;
|
||||
import com.cool.store.service.utils.DataSourceHelper;
|
||||
import com.cool.store.utils.RedisUtilPool;
|
||||
import com.google.common.collect.Lists;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.AntPathMatcher;
|
||||
|
||||
import javax.servlet.*;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author ydw
|
||||
* @Description 权限校验
|
||||
* @date 2020/1/15
|
||||
*/
|
||||
@Component
|
||||
@Order(3)
|
||||
@Slf4j
|
||||
public class TokenValidateFilter implements Filter {
|
||||
|
||||
@Autowired
|
||||
private RedisUtilPool redisUtilPool;
|
||||
|
||||
private static AntPathMatcher matcher = new AntPathMatcher();
|
||||
|
||||
private static List<String> patternList =
|
||||
|
||||
Lists.newArrayList("/web/check/ok","/check/ok", "/partner/doc.html",
|
||||
"/**/swagger*/**",
|
||||
"/**/webjars/**");
|
||||
|
||||
|
||||
/**
|
||||
* @param uri
|
||||
* @return boolean
|
||||
* @throws
|
||||
* @Title excludePath
|
||||
* @Description 是否是放行的请求
|
||||
*/
|
||||
private boolean excludePath(String uri) {
|
||||
for (String pattern : patternList) {
|
||||
if (matcher.match(pattern, uri)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FilterConfig filterConfig) throws ServletException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
|
||||
HttpServletResponse response = (HttpServletResponse) servletResponse;
|
||||
HttpServletRequest reqs = (HttpServletRequest) servletRequest;
|
||||
String uri = reqs.getRequestURI();
|
||||
String method = reqs.getMethod();
|
||||
String userStr = "";
|
||||
CurrentUser currentUser = null;
|
||||
boolean isInWhiteList = excludePath(uri);
|
||||
String accessToken = reqs.getParameter("access_token");
|
||||
String key = "access_token:" + accessToken;
|
||||
if(StringUtils.isNotBlank(accessToken)){
|
||||
userStr = redisUtilPool.getString(key);
|
||||
if(StringUtils.isNotBlank(userStr)){
|
||||
currentUser = JSON.parseObject(userStr, CurrentUser.class);
|
||||
}
|
||||
}
|
||||
log.info("url:{}", uri);
|
||||
if ( !isInWhiteList && !method.equals("OPTIONS")) {
|
||||
if (StringUtils.isEmpty(accessToken)) {
|
||||
response.setStatus(HttpStatus.OK.value());
|
||||
response.getWriter().write(JSON.toJSONString(
|
||||
ResponseResult.fail(ErrorCodeEnum.ACCESS_TOKEN_INVALID)));
|
||||
return;
|
||||
}
|
||||
if (Objects.isNull(currentUser)) {
|
||||
response.setStatus(HttpStatus.OK.value());
|
||||
response.getWriter().write(JSON.toJSONString(
|
||||
ResponseResult.fail(ErrorCodeEnum.ACCESS_TOKEN_INVALID)));
|
||||
return;
|
||||
}
|
||||
log.info("url:{}, access_token:{}, userId:{}, username:{}, enterpriseId:{}", uri, accessToken, currentUser.getUserId(), currentUser.getName(), currentUser.getEnterpriseId());
|
||||
}
|
||||
if(StringUtils.isBlank(userStr) && !isInWhiteList){
|
||||
response.setStatus(HttpStatus.OK.value());
|
||||
response.getWriter().write(JSON.toJSONString(
|
||||
ResponseResult.fail(ErrorCodeEnum.ACCESS_TOKEN_INVALID)));
|
||||
return;
|
||||
}
|
||||
try {
|
||||
UserContext.setUser(userStr);
|
||||
DataSourceHelper.changeToMy();
|
||||
filterChain.doFilter(servletRequest, servletResponse);
|
||||
} finally {
|
||||
UserContext.removeUser();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.cool.store.config.datasource;
|
||||
|
||||
import com.cool.store.model.constants.CommonConstants;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.service.context.DataSourceContext;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.cool.store.config.datasource;
|
||||
|
||||
import com.cool.store.model.constants.CommonConstants;
|
||||
import com.cool.store.model.dto.DatasourceInfoDTO;
|
||||
import com.cool.store.model.entity.EnterpriseConfigDO;
|
||||
import com.cool.store.model.utils.RedisUtilPool;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.dto.DatasourceInfoDTO;
|
||||
import com.cool.store.entity.EnterpriseConfigDO;
|
||||
import com.cool.store.utils.RedisUtilPool;
|
||||
import com.cool.store.service.EnterpriseConfigService;
|
||||
import com.cool.store.service.context.DataSourceContext;
|
||||
import com.github.pagehelper.Page;
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
package com.cool.store.config.swagger;
|
||||
|
||||
import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.base.Predicates;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Profile;
|
||||
import springfox.documentation.RequestHandler;
|
||||
import springfox.documentation.builders.ApiInfoBuilder;
|
||||
import springfox.documentation.builders.ParameterBuilder;
|
||||
import springfox.documentation.builders.PathSelectors;
|
||||
import springfox.documentation.builders.RequestHandlerSelectors;
|
||||
import springfox.documentation.schema.ModelRef;
|
||||
import springfox.documentation.service.ApiInfo;
|
||||
import springfox.documentation.service.Parameter;
|
||||
import springfox.documentation.spi.DocumentationType;
|
||||
import springfox.documentation.spring.web.plugins.Docket;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @description:
|
||||
* @date 2023/05/15 02:52
|
||||
*/
|
||||
@Profile({"local", "dev", "ab", "test"})
|
||||
@Configuration
|
||||
@EnableSwagger2
|
||||
@EnableKnife4j
|
||||
public class Swagger2Config {
|
||||
|
||||
/**
|
||||
* 扫描接口地址的包名
|
||||
*/
|
||||
public static final String BASE_PACKAGE = "com.cool.store.controller";
|
||||
|
||||
private ApiInfo getApiInfo() {
|
||||
return new ApiInfoBuilder()
|
||||
.title("coolstore-partner-manage")
|
||||
.description("接口文档")
|
||||
.version("1.0")
|
||||
.build();
|
||||
}
|
||||
|
||||
private Docket createDocket (String groupName, String... packages){
|
||||
List<Parameter> pars = getParameters();
|
||||
return new Docket(DocumentationType.SWAGGER_2)
|
||||
.enable(Boolean.TRUE)
|
||||
.apiInfo(this.getApiInfo())
|
||||
.groupName(groupName)
|
||||
.select()
|
||||
.apis(this.scanBasePackage(packages))
|
||||
.build()
|
||||
.globalOperationParameters(pars);
|
||||
}
|
||||
|
||||
private Docket createDocketByPath (String groupName, String... paths){
|
||||
List<Parameter> pars = getParameters();
|
||||
return new Docket(DocumentationType.SWAGGER_2)
|
||||
.enable(Boolean.TRUE)
|
||||
.apiInfo(this.getApiInfo())
|
||||
.groupName(groupName)
|
||||
.select()
|
||||
.paths(this.scanPath(paths))
|
||||
.build()
|
||||
.globalOperationParameters(pars);
|
||||
}
|
||||
|
||||
private List<Parameter> getParameters() {
|
||||
List<Parameter> pars = new ArrayList<>();
|
||||
pars.add(new ParameterBuilder().name("access_token").description("令牌").required(true)
|
||||
.modelRef(new ModelRef("string"))
|
||||
.defaultValue("{{access_token}}")
|
||||
.parameterType("query").build());
|
||||
pars.add(new ParameterBuilder().name("enterprise-id").required(true)
|
||||
.modelRef(new ModelRef("string"))
|
||||
.defaultValue("45f92210375346858b6b6694967f44de")
|
||||
.parameterType("path").build());
|
||||
return pars;
|
||||
}
|
||||
|
||||
private Predicate<RequestHandler> scanBasePackage(final String... controllerPack) {
|
||||
Predicate<RequestHandler> predicate = null;
|
||||
for (String strBasePackage : controllerPack) {
|
||||
if(StringUtils.isNotBlank(strBasePackage)){
|
||||
Predicate<RequestHandler> tempPredicate = RequestHandlerSelectors.basePackage(strBasePackage);
|
||||
predicate = predicate == null ? tempPredicate : Predicates.or(tempPredicate,predicate);
|
||||
}
|
||||
}
|
||||
return predicate;
|
||||
}
|
||||
|
||||
private Predicate<String> scanPath(final String... paths) {
|
||||
Predicate<String> predicate = null;
|
||||
for (String path : paths) {
|
||||
if(StringUtils.isNotBlank(path)){
|
||||
Predicate<String> tempPredicate = PathSelectors.ant(path);
|
||||
predicate = predicate == null ? tempPredicate : Predicates.or(tempPredicate,predicate);
|
||||
}
|
||||
}
|
||||
return predicate;
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
public Docket allApi() {
|
||||
return this.createDocket("全部", BASE_PACKAGE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
12
pom.xml
12
pom.xml
@@ -20,7 +20,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.7.11</version>
|
||||
<version>2.2.6.RELEASE</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
@@ -111,6 +111,16 @@
|
||||
<artifactId>knife4j-spring-boot-starter</artifactId>
|
||||
<version>2.0.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
<version>1.7.30</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>xerces</groupId>
|
||||
<artifactId>xercesImpl</artifactId>
|
||||
<version>2.11.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user