Compare commits
44 Commits
master
...
test-modul
Author | SHA1 | Date |
---|---|---|
tiger_zhou | deb02d753e | |
tiger_zhou | 9080f7331c | |
tiger_zhou | 55a5b31dee | |
tiger_zhou | 6838e18531 | |
weizhihong | 0396b88c2b | |
weizhihong | b8cae4edfa | |
weizhihong | 01cd3adc46 | |
weizhihong | 0d1d726d69 | |
weizhihong | 5eeb1997b9 | |
weizhihong | 3490b1e7dc | |
weizhihong | 3371b87a43 | |
tiger_zhou | 5ab8b74e9b | |
tiger_zhou | 46ceb6599d | |
weizhihong | f1aeee553c | |
tiger_zhou | ecbcd20f0d | |
tiger_zhou | 1c745a4af3 | |
tiger_zhou | 4e4307d587 | |
tiger_zhou | ba90df0c21 | |
tiger_zhou | 135eef69e4 | |
tiger_zhou | 45bdd630d9 | |
tiger_zhou | 04db1a64f3 | |
tiger_zhou | 8e1e468b6b | |
tiger_zhou | 8704a5cbb8 | |
tiger_zhou | 853a2d80f2 | |
weizhihong | c7e5abcf57 | |
weizhihong | c5b31292a2 | |
weizhihong | 12c898cdd8 | |
tiger_zhou | 254bed7451 | |
tiger_zhou | 9b0af3f764 | |
tiger_zhou | e85106ec08 | |
tiger_zhou | dcaeea1b3d | |
tiger_zhou | a51274f20f | |
tiger_zhou | 566378c4f8 | |
weizhihong | b555ca2ac3 | |
weizhihong | 7e3bff68ff | |
weizhihong | e8438adcb7 | |
tiger_zhou | c095ab84c2 | |
tiger_zhou | eda2131f26 | |
tiger_zhou | 5b2a704468 | |
tiger_zhou | 1ce9312497 | |
tiger_zhou | 05fa2609b7 | |
weizhihong | bbb8c7588b | |
walker | e21af8c413 | |
walker | 8ff3e3218c |
|
@ -1,32 +0,0 @@
|
|||
name: 公网服务发布
|
||||
run-name: ${{ gitea.actor }} is testing out Gitea Actions
|
||||
on:
|
||||
schedule:
|
||||
- cron: '30 3 * * 1' # 每周一的凌晨3:30
|
||||
|
||||
jobs:
|
||||
Docker-Build-Push:
|
||||
runs-on: joylink-local233
|
||||
steps:
|
||||
- name: 发布到正式环境1
|
||||
uses: https://gitea.joylink.club/appleboy/ssh-action@v1.0.3
|
||||
with:
|
||||
host: ${{ secrets.PUB1_DOMAIN_SSH_HOST }}
|
||||
port: ${{ secrets.PUB1_DOMAIN_SSH_PORT }}
|
||||
username: ${{ secrets.PUB1_DOMAIN_SSH_USER }}
|
||||
password: ${{ secrets.PUB1_DOMAIN_SSH_PASSWORD }}
|
||||
script: |
|
||||
docker rm -f rt-sim-training-service || echo "rt-sim-training-service not exist"
|
||||
docker pull gitea.joylink.club/joylink/rt-sim-training-service:latest
|
||||
docker run --name rt-sim-training-service -it -u root --restart=always -d -e APP_ENV=prd -p 9000:9000 -p 19000:19000 -v /usr/local/joylink/logs/rtss:/usr/local/joylink/logs/rtss gitea.joylink.club/joylink/rt-sim-training-service:latest
|
||||
- name: 发布到正式环境2
|
||||
uses: https://gitea.joylink.club/appleboy/ssh-action@v1.0.3
|
||||
with:
|
||||
host: ${{ secrets.PUB2_DOMAIN_SSH_HOST }}
|
||||
port: ${{ secrets.PUB2_DOMAIN_SSH_PORT }}
|
||||
username: ${{ secrets.PUB2_DOMAIN_SSH_USER }}
|
||||
password: ${{ secrets.PUB2_DOMAIN_SSH_PASSWORD }}
|
||||
script: |
|
||||
docker rm -f rt-sim-training-service || echo "rt-sim-training-service not exist"
|
||||
docker pull gitea.joylink.club/joylink/rt-sim-training-service:latest
|
||||
docker run --name rt-sim-training-service -it -u root --restart=always -d -e APP_ENV=prd -p 9000:9000 -p 19000:19000 -v /usr/local/joylink/logs/rtss:/usr/local/joylink/logs/rtss gitea.joylink.club/joylink/rt-sim-training-service:latest
|
|
@ -1,61 +0,0 @@
|
|||
name: CI
|
||||
run-name: ${{ gitea.actor }} is testing out Gitea Actions
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- local-test
|
||||
|
||||
jobs:
|
||||
Docker-Build:
|
||||
runs-on: joylink-local233
|
||||
steps:
|
||||
- name: 检出代码
|
||||
uses: https://gitea.joylink.club/actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: 设置java环境
|
||||
uses: https://gitea.joylink.club/actions/setup-java@v4
|
||||
with:
|
||||
java-version: '11'
|
||||
distribution: 'zulu'
|
||||
cache: 'maven'
|
||||
cache-dependency-path: './pom.xml'
|
||||
- name: 设置Maven环境
|
||||
uses: https://gitea.joylink.club/actions/local-setup-maven@v0.1.1
|
||||
with:
|
||||
maven-version: 3.8.8
|
||||
- name: 构建
|
||||
run: |
|
||||
mvn -Dmaven.test.skip=true clean package
|
||||
- name: 设置 Docker
|
||||
uses: https://gitea.joylink.club/actions/local-setup-docker-cli-action@v0.1.1
|
||||
- name: 设置 Docker Buildx
|
||||
uses: https://gitea.joylink.club/actions/local-setup-buildx-action@v0.1.3
|
||||
- name: docker登录gitea.joylink.club
|
||||
uses: https://gitea.joylink.club/docker/login-action@v3
|
||||
with:
|
||||
registry: gitea.joylink.club
|
||||
username: shengxuqiang
|
||||
password: ${{ secrets.SHENGXUQIANG_PASSWORD }}
|
||||
- name: Docker Build and push
|
||||
uses: https://gitea.joylink.club/docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
push: true
|
||||
tags: |
|
||||
gitea.joylink.club/joylink/rt-sim-training-service:local-test
|
||||
- name: 发布到本地测试环境
|
||||
uses: https://gitea.joylink.club/appleboy/ssh-action@v1.0.3
|
||||
with:
|
||||
host: ${{ secrets.LOCAL_233_SSH_HOST }}
|
||||
port: ${{ secrets.LOCAL_233_SSH_PORT }}
|
||||
username: ${{ secrets.LOCAL_233_SSH_USER }}
|
||||
password: ${{ secrets.LOCAL_233_SSH_PASSWORD }}
|
||||
script: |
|
||||
docker rm -f rt-sim-training-service || echo "rt-sim-training-service not exist"
|
||||
docker pull gitea.joylink.club/joylink/rt-sim-training-service:local-test
|
||||
docker run --name rt-sim-training-service --restart=always --network net --ip 192.168.53.3 -d -e APP_ENV=local-test -p 9000:9000 -p 19000:19000 -v /usr/local/joylink/logs/rtss:/usr/local/joylink/logs/rtss gitea.joylink.club/joylink/rt-sim-training-service:local-test
|
||||
# - name: 清理tag为none的镜像
|
||||
# run: |
|
||||
# docker rmi $(docker images --filter "dangling=true" -q --no-trunc) 2>/dev/null || echo "No dangling images to remove"
|
|
@ -1,61 +0,0 @@
|
|||
name: 版本发布docker构建并上传
|
||||
run-name: ${{ gitea.actor }} is testing out Gitea Actions
|
||||
on:
|
||||
release:
|
||||
types: [ published ]
|
||||
|
||||
jobs:
|
||||
Docker-Build-Push:
|
||||
runs-on: joylink-local233
|
||||
steps:
|
||||
- name: 检出代码
|
||||
uses: https://gitea.joylink.club/actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: 设置java环境
|
||||
uses: https://gitea.joylink.club/actions/setup-java@v4
|
||||
with:
|
||||
java-version: '11'
|
||||
distribution: 'zulu'
|
||||
cache: 'maven'
|
||||
cache-dependency-path: './pom.xml'
|
||||
- name: 设置Maven环境
|
||||
uses: https://gitea.joylink.club/actions/local-setup-maven@v0.1.1
|
||||
with:
|
||||
maven-version: 3.8.8
|
||||
- name: 构建
|
||||
run: |
|
||||
mvn -Dmaven.test.skip=true clean package
|
||||
- name: 设置 Docker
|
||||
uses: https://gitea.joylink.club/actions/local-setup-docker-cli-action@v0.1.1
|
||||
- name: 设置 Docker Buildx
|
||||
uses: https://gitea.joylink.club/actions/local-setup-buildx-action@v0.1.3
|
||||
- name: docker登录gitea.joylink.club
|
||||
uses: https://gitea.joylink.club/docker/login-action@v3
|
||||
with:
|
||||
registry: gitea.joylink.club
|
||||
username: shengxuqiang
|
||||
password: ${{ secrets.SHENGXUQIANG_PASSWORD }}
|
||||
- name: Docker Build and push
|
||||
uses: https://gitea.joylink.club/docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
push: true
|
||||
tags: |
|
||||
gitea.joylink.club/joylink/rt-sim-training-service:${{ github.event.release.tag_name }}
|
||||
gitea.joylink.club/joylink/rt-sim-training-service:latest
|
||||
# - name: 清理tag为none的镜像
|
||||
# run: |
|
||||
# docker rmi $(docker images --filter "dangling=true" -q --no-trunc) 2>/dev/null || echo "No dangling images to remove"
|
||||
# - name: 发布到本地测试环境
|
||||
# uses: https://gitea.joylink.club/appleboy/ssh-action@v1.0.3
|
||||
# with:
|
||||
# host: ${{ secrets.LOCAL_233_SSH_HOST }}
|
||||
# port: ${{ secrets.LOCAL_233_SSH_PORT }}
|
||||
# username: ${{ secrets.LOCAL_233_SSH_USER }}
|
||||
# password: ${{ secrets.LOCAL_233_SSH_PASSWORD }}
|
||||
# script: |
|
||||
# docker rm -f rt-sim-training-service || echo "rt-sim-training-service not exist"
|
||||
# docker pull gitea.joylink.club/joylink/rt-sim-training-service:latest
|
||||
# docker run --name rt-sim-training-service --restart=always --network net --ip 192.168.53.3 -d -e APP_ENV=prd -p 9000:9000 -p 19000:19000 -v /usr/local/joylink/logs/rtss:/usr/local/joylink/logs/rtss gitea.joylink.club/joylink/rt-sim-training-service:latest
|
|
@ -1,3 +1,6 @@
|
|||
[submodule "rt-sim-training-message"]
|
||||
path = rt-sim-training-message
|
||||
url = http://120.46.212.6:3000/joylink/rt-sim-training-message.git
|
||||
[submodule "ecs"]
|
||||
path = ecs
|
||||
url = https://git.code.tencent.com/joylink-common/ecs.git
|
||||
[submodule "jl-rtss-simulation/NCC/ncc-message"]
|
||||
path = jl-rtss-simulation/NCC/ncc-message
|
||||
url = https://git.code.tencent.com/lian-cbtc/NCC/ncc-message.git
|
||||
|
|
|
@ -1,117 +0,0 @@
|
|||
/*
|
||||
* Copyright 2007-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import java.net.*;
|
||||
import java.io.*;
|
||||
import java.nio.channels.*;
|
||||
import java.util.Properties;
|
||||
|
||||
public class MavenWrapperDownloader {
|
||||
|
||||
private static final String WRAPPER_VERSION = "0.5.6";
|
||||
/**
|
||||
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
|
||||
*/
|
||||
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
|
||||
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
|
||||
|
||||
/**
|
||||
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
|
||||
* use instead of the default one.
|
||||
*/
|
||||
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
|
||||
".mvn/wrapper/maven-wrapper.properties";
|
||||
|
||||
/**
|
||||
* Path where the maven-wrapper.jar will be saved to.
|
||||
*/
|
||||
private static final String MAVEN_WRAPPER_JAR_PATH =
|
||||
".mvn/wrapper/maven-wrapper.jar";
|
||||
|
||||
/**
|
||||
* Name of the property which should be used to override the default download url for the wrapper.
|
||||
*/
|
||||
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
|
||||
|
||||
public static void main(String args[]) {
|
||||
System.out.println("- Downloader started");
|
||||
File baseDirectory = new File(args[0]);
|
||||
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
|
||||
|
||||
// If the maven-wrapper.properties exists, read it and check if it contains a custom
|
||||
// wrapperUrl parameter.
|
||||
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
|
||||
String url = DEFAULT_DOWNLOAD_URL;
|
||||
if(mavenWrapperPropertyFile.exists()) {
|
||||
FileInputStream mavenWrapperPropertyFileInputStream = null;
|
||||
try {
|
||||
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
|
||||
Properties mavenWrapperProperties = new Properties();
|
||||
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
|
||||
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
|
||||
} catch (IOException e) {
|
||||
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
|
||||
} finally {
|
||||
try {
|
||||
if(mavenWrapperPropertyFileInputStream != null) {
|
||||
mavenWrapperPropertyFileInputStream.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
// Ignore ...
|
||||
}
|
||||
}
|
||||
}
|
||||
System.out.println("- Downloading from: " + url);
|
||||
|
||||
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
|
||||
if(!outputFile.getParentFile().exists()) {
|
||||
if(!outputFile.getParentFile().mkdirs()) {
|
||||
System.out.println(
|
||||
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
|
||||
}
|
||||
}
|
||||
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
|
||||
try {
|
||||
downloadFileFromURL(url, outputFile);
|
||||
System.out.println("Done");
|
||||
System.exit(0);
|
||||
} catch (Throwable e) {
|
||||
System.out.println("- Error downloading");
|
||||
e.printStackTrace();
|
||||
System.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
|
||||
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
|
||||
String username = System.getenv("MVNW_USERNAME");
|
||||
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
|
||||
Authenticator.setDefault(new Authenticator() {
|
||||
@Override
|
||||
protected PasswordAuthentication getPasswordAuthentication() {
|
||||
return new PasswordAuthentication(username, password);
|
||||
}
|
||||
});
|
||||
}
|
||||
URL website = new URL(urlString);
|
||||
ReadableByteChannel rbc;
|
||||
rbc = Channels.newChannel(website.openStream());
|
||||
FileOutputStream fos = new FileOutputStream(destination);
|
||||
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
|
||||
fos.close();
|
||||
rbc.close();
|
||||
}
|
||||
|
||||
}
|
Binary file not shown.
|
@ -1,2 +0,0 @@
|
|||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
|
||||
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
|
11
Dockerfile
11
Dockerfile
|
@ -1,11 +0,0 @@
|
|||
FROM azul/zulu-openjdk-alpine:11
|
||||
|
||||
ADD target/rtss-0.0.1-SNAPSHOT.jar rtss-service.jar
|
||||
|
||||
ENV APP_ENV=prd
|
||||
EXPOSE 9000 19000/tcp
|
||||
|
||||
ENV TZ=Asia/Shanghai
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
|
||||
CMD java -jar -Dfile.encoding=UTF-8 -Dspring.profiles.active=$APP_ENV /rtss-service.jar
|
19
README.md
19
README.md
|
@ -1,7 +1,12 @@
|
|||
# CI、CD说明
|
||||
- 分支主要为develop,local-test,master
|
||||
- 本地233服务器部署方式为push到local-test分支即可触发
|
||||
- 公网服务器发布方式:
|
||||
1. push到master(虽然可以用别的分支,但不建议)
|
||||
2. 在版本发布处发布新版本,触发构建docker镜像
|
||||
3. 待docker镜像构建完成后,点击Actions中CD_pub_deploy.yaml,进入第一个任务,点击重新运行所有任务,进行服务发布
|
||||
# 项目说明
|
||||
轨道交通服务
|
||||
此项目有git子模块,拉取代码后需执行git submodule init && git submodule update来拉取更新ecs代码
|
||||
|
||||
# 开发运行说明
|
||||
代码修改可以直接使用IDEA的build工具(未测试),子模块的yml配置文件修改需要重新运行顶级的package,进行重新打包,否则不生效
|
||||
|
||||
# 路线图
|
||||
- jenkins打包发布需要调整
|
||||
- 登录相关代码重新在auth模块实现
|
||||
- 白名单数据库管理
|
||||
- 使用jwt实现免登录
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 26e482c846b3bdc21061c55036a446d21db00dbb
|
|
@ -0,0 +1,33 @@
|
|||
HELP.md
|
||||
target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
!**/src/main/**/target/
|
||||
!**/src/test/**/target/
|
||||
|
||||
### STS ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
build/
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
|
@ -0,0 +1,2 @@
|
|||
# 项目说明
|
||||
轨道交通认证
|
|
@ -0,0 +1,73 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>club.joylink.rtss</groupId>
|
||||
<artifactId>rtss-server</artifactId>
|
||||
<version>0.1</version>
|
||||
</parent>
|
||||
<groupId>club.joylink.rtss</groupId>
|
||||
<artifactId>auth</artifactId>
|
||||
<version>0.1</version>
|
||||
<name>auth</name>
|
||||
<description>轨道交通认证模块</description>
|
||||
<properties>
|
||||
<java.version>17</java.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-oauth2-resource-server</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-security</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Swagger UI -->
|
||||
<dependency>
|
||||
<groupId>org.springdoc</groupId>
|
||||
<artifactId>springdoc-openapi-ui</artifactId>
|
||||
<version>1.6.13</version>
|
||||
</dependency>
|
||||
|
||||
<!-- mybatis plus -->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-generator</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.velocity</groupId>
|
||||
<artifactId>velocity-engine-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<includes>
|
||||
<include>**/*.xml</include>
|
||||
<include>**/*.yml</include>
|
||||
<include>app.key</include>
|
||||
<include>app.pub</include>
|
||||
</includes>
|
||||
<filtering>false</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
</build>
|
||||
|
||||
</project>
|
|
@ -0,0 +1,27 @@
|
|||
package club.joylink.rtss.auth.configuration;
|
||||
|
||||
import org.springframework.beans.factory.config.YamlPropertiesFactoryBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
|
||||
/**
|
||||
* 此模块配置文件加载
|
||||
*/
|
||||
@Configuration
|
||||
public class AuthConfig {
|
||||
|
||||
@Bean
|
||||
public static PropertySourcesPlaceholderConfigurer properties() {
|
||||
PropertySourcesPlaceholderConfigurer configurer = new PropertySourcesPlaceholderConfigurer();
|
||||
YamlPropertiesFactoryBean yaml = new YamlPropertiesFactoryBean();
|
||||
yaml.setResources(new ClassPathResource("application-auth.yml"));
|
||||
configurer.setProperties(yaml.getObject());
|
||||
// yaml.getObject().forEach((k, v) -> {
|
||||
// System.out.println(String.format("%s->%s", k, v));
|
||||
// });
|
||||
return configurer;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
package club.joylink.rtss.auth.configuration;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.cors.CorsConfigurationSource;
|
||||
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
|
||||
import org.springframework.web.filter.CorsFilter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@Configuration
|
||||
public class CorsConfiguration {
|
||||
|
||||
private org.springframework.web.cors.CorsConfiguration buildConfig() {
|
||||
org.springframework.web.cors.CorsConfiguration corsConfiguration = new org.springframework.web.cors.CorsConfiguration();
|
||||
corsConfiguration.addAllowedOriginPattern("*");
|
||||
corsConfiguration.addAllowedHeader("*"); // 2
|
||||
corsConfiguration.addAllowedMethod("*"); // 3
|
||||
corsConfiguration.setAllowCredentials(true);
|
||||
// 暴露 header 中的其他属性给客户端应用程序
|
||||
corsConfiguration.setExposedHeaders(Arrays.asList(
|
||||
"Authorization",
|
||||
"Access-Control-Allow-Origin",
|
||||
"Access-Control-Allow-Credentials"
|
||||
));
|
||||
return corsConfiguration;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public CorsConfigurationSource corsConfigurationSource() {
|
||||
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
|
||||
source.registerCorsConfiguration("/**", buildConfig()); // 4
|
||||
return source;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public CorsFilter corsFilter() {
|
||||
return new CorsFilter(corsConfigurationSource());
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package club.joylink.rtss.auth.configuration;
|
||||
|
||||
import club.joylink.rtss.auth.util.EncryptUtil;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class EnctryptPassCode implements PasswordEncoder {
|
||||
@Override
|
||||
public String encode(CharSequence rawPassword) {
|
||||
return EncryptUtil.md5(rawPassword.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(CharSequence rawPassword, String encodedPassword) {
|
||||
|
||||
return Objects.equals(EncryptUtil.md5(rawPassword.toString()),encodedPassword);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package club.joylink.rtss.auth.configuration;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.security.core.AuthenticationException;
|
||||
import org.springframework.security.web.AuthenticationEntryPoint;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
|
||||
@Slf4j
|
||||
public class MyBasicAuthenticationEntryPoint implements AuthenticationEntryPoint {
|
||||
|
||||
@Override
|
||||
public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException, ServletException {
|
||||
log.error("登录认证异常", authException);
|
||||
response.addHeader("WWW-Authenticate", "Basic ");
|
||||
response.sendError(HttpStatus.UNAUTHORIZED.value(), authException.getMessage());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,155 @@
|
|||
package club.joylink.rtss.auth.configuration;
|
||||
|
||||
import club.joylink.rtss.auth.repository.IRtsAuthWhiteRepository;
|
||||
import club.joylink.rtss.auth.service.DbUserDetailsService;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.nimbusds.jose.jwk.JWK;
|
||||
import com.nimbusds.jose.jwk.JWKSet;
|
||||
import com.nimbusds.jose.jwk.RSAKey;
|
||||
import com.nimbusds.jose.jwk.source.ImmutableJWKSet;
|
||||
import com.nimbusds.jose.jwk.source.JWKSource;
|
||||
import com.nimbusds.jose.proc.SecurityContext;
|
||||
import lombok.SneakyThrows;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.security.config.Customizer;
|
||||
import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
||||
import org.springframework.security.config.annotation.web.configurers.AuthorizeHttpRequestsConfigurer;
|
||||
import org.springframework.security.config.annotation.web.configurers.oauth2.server.resource.OAuth2ResourceServerConfigurer;
|
||||
import org.springframework.security.config.http.SessionCreationPolicy;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
import org.springframework.security.oauth2.jwt.JwtDecoder;
|
||||
import org.springframework.security.oauth2.jwt.JwtEncoder;
|
||||
import org.springframework.security.oauth2.jwt.NimbusJwtDecoder;
|
||||
import org.springframework.security.oauth2.jwt.NimbusJwtEncoder;
|
||||
import org.springframework.security.oauth2.server.resource.authentication.JwtAuthenticationConverter;
|
||||
import org.springframework.security.oauth2.server.resource.authentication.JwtGrantedAuthoritiesConverter;
|
||||
import org.springframework.security.oauth2.server.resource.web.BearerTokenAuthenticationEntryPoint;
|
||||
import org.springframework.security.oauth2.server.resource.web.access.BearerTokenAccessDeniedHandler;
|
||||
import org.springframework.security.web.SecurityFilterChain;
|
||||
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
|
||||
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
|
||||
import org.springframework.web.cors.CorsConfigurationSource;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.security.interfaces.RSAPrivateKey;
|
||||
import java.security.interfaces.RSAPublicKey;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 安全、权限相关配置
|
||||
*/
|
||||
@Configuration
|
||||
@EnableMethodSecurity
|
||||
@EnableWebSecurity
|
||||
public class SpringSecurityConfiguration {
|
||||
|
||||
/**
|
||||
* JWT编解码器的PublicKey
|
||||
*/
|
||||
@Value("${jwt.public.key}")
|
||||
RSAPublicKey key;
|
||||
/**
|
||||
* JWT编解码器的PrivateKey
|
||||
*/
|
||||
@Value("${jwt.private.key}")
|
||||
RSAPrivateKey priv;
|
||||
|
||||
@Autowired
|
||||
CorsConfigurationSource corsConfigurationSource;
|
||||
|
||||
|
||||
@Bean
|
||||
public SecurityFilterChain securityFilterChain(HttpSecurity http, DbUserDetailsService userDetailsService, IRtsAuthWhiteRepository whiteRepository) throws Exception {
|
||||
// @formatter:off
|
||||
List<String> NoAuthList = whiteRepository.queryList().stream().map(d->d.getUri()).toList();
|
||||
http.authorizeHttpRequests((authorize) -> authorize
|
||||
.antMatchers(HttpMethod.OPTIONS).permitAll()
|
||||
.antMatchers(NoAuthList.toArray(String[]::new)).permitAll()
|
||||
.anyRequest().authenticated()
|
||||
)
|
||||
.formLogin(d->d.loginProcessingUrl("/testLogin").passwordParameter("password").usernameParameter("username")
|
||||
.successHandler(new AuthenticationSuccessHandler() {
|
||||
@Override
|
||||
public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException {
|
||||
|
||||
System.out.println(request.getParameter("project"));
|
||||
System.out.println("aaaaaaaaaaaaaaaaaaaaa");
|
||||
}
|
||||
})
|
||||
).userDetailsService(userDetailsService)
|
||||
.cors(corsConfig -> corsConfig.configurationSource(corsConfigurationSource))
|
||||
.csrf((csrf) -> csrf.disable())
|
||||
// .httpBasic(configure -> configure.authenticationEntryPoint(new MyBasicAuthenticationEntryPoint()))
|
||||
.oauth2ResourceServer(OAuth2ResourceServerConfigurer::jwt)
|
||||
|
||||
.sessionManagement((session) -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
|
||||
.exceptionHandling((exceptions) -> exceptions
|
||||
.authenticationEntryPoint(new BearerTokenAuthenticationEntryPoint())
|
||||
// .defaultAuthenticationEntryPointFor(new MyBasicAuthenticationEntryPoint(),
|
||||
// new AntPathRequestMatcher("/api/auth/token", null))
|
||||
.defaultAuthenticationEntryPointFor(new BearerTokenAuthenticationEntryPoint(),
|
||||
new AntPathRequestMatcher("/api/**", null))
|
||||
.accessDeniedHandler(new BearerTokenAccessDeniedHandler())
|
||||
);
|
||||
// @formatter:on
|
||||
SecurityFilterChain filterChain = http.build();
|
||||
return filterChain;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public JwtAuthenticationConverter jwtAuthenticationConverter() {
|
||||
JwtGrantedAuthoritiesConverter grantedAuthoritiesConverter = new JwtGrantedAuthoritiesConverter();
|
||||
grantedAuthoritiesConverter.setAuthorityPrefix("");//取消jwt的默认前缀SCOPE_
|
||||
|
||||
JwtAuthenticationConverter jwtAuthenticationConverter = new JwtAuthenticationConverter();
|
||||
jwtAuthenticationConverter.setJwtGrantedAuthoritiesConverter(grantedAuthoritiesConverter);
|
||||
return jwtAuthenticationConverter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Spring Security用户username/password认证使用的password编码器
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Bean
|
||||
public PasswordEncoder passwordEncoder() {
|
||||
// return new BCryptPasswordEncoder(13);
|
||||
return new EnctryptPassCode();
|
||||
}
|
||||
|
||||
/**
|
||||
* JWT解码器
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Bean
|
||||
public JwtDecoder jwtDecoder() {
|
||||
return NimbusJwtDecoder.withPublicKey(this.key).build();
|
||||
}
|
||||
|
||||
/**
|
||||
* JWT编码器
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Bean
|
||||
public JwtEncoder jwtEncoder() {
|
||||
JWK jwk = new RSAKey.Builder(this.key).privateKey(this.priv).build();
|
||||
JWKSource<SecurityContext> jwks = new ImmutableJWKSet<>(new JWKSet(jwk));
|
||||
return new NimbusJwtEncoder(jwks);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
package club.joylink.rtss.auth.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.oauth2.jwt.JwtClaimsSet;
|
||||
import org.springframework.security.oauth2.jwt.JwtEncoder;
|
||||
import org.springframework.security.oauth2.jwt.JwtEncoderParameters;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 权限接口
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/api/auth")
|
||||
@SecurityRequirement(name = "basic")
|
||||
public class AuthController {
|
||||
|
||||
final JwtEncoder jwtEncoder;
|
||||
|
||||
public AuthController(JwtEncoder jwtEncoder) {
|
||||
this.jwtEncoder = jwtEncoder;
|
||||
}
|
||||
|
||||
/**
|
||||
* 登录
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/token")
|
||||
public String getToken(Authentication authentication) {
|
||||
Instant now = Instant.now();
|
||||
long expiry = 3 * 24 * 60 * 60L;
|
||||
// @formatter:off
|
||||
String scope = authentication.getAuthorities().stream()
|
||||
.map(GrantedAuthority::getAuthority)
|
||||
.collect(Collectors.joining(" "));
|
||||
JwtClaimsSet claims = JwtClaimsSet.builder()
|
||||
.issuer("self")
|
||||
.issuedAt(now)
|
||||
.expiresAt(now.plusSeconds(expiry))
|
||||
.subject(authentication.getName())//此处实际为用户id(数据库记录id)
|
||||
.claim("scope", scope)
|
||||
.build();
|
||||
// @formatter:on
|
||||
try {
|
||||
final String token = this.jwtEncoder.encode(JwtEncoderParameters.from(claims)).getTokenValue();
|
||||
return token;
|
||||
} catch (Exception ex) {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
package club.joylink.rtss.auth.controller;
|
||||
|
||||
import club.joylink.rtss.auth.configuration.SpringSecurityConfiguration;
|
||||
import club.joylink.rtss.auth.dto.AutoWhiteDto;
|
||||
import club.joylink.rtss.auth.repository.IRtsAuthWhiteRepository;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.authorization.AuthorizationManager;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.config.annotation.web.configurers.AuthorizeHttpRequestsConfigurer;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.security.web.SecurityFilterChain;
|
||||
import org.springframework.security.web.access.intercept.AuthorizationFilter;
|
||||
import org.springframework.security.web.access.intercept.RequestMatcherDelegatingAuthorizationManager;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.Filter;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author walker
|
||||
* @since 2023-02-24
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/white")
|
||||
public class RtsAuthWhiteController {
|
||||
@Resource
|
||||
private IRtsAuthWhiteRepository whiteRepository;
|
||||
@PostMapping("/saveOrUpdate")
|
||||
public void saveOrUpdate(@RequestBody AutoWhiteDto dto){
|
||||
this.whiteRepository.saveOrUpdate(dto);
|
||||
}
|
||||
@DeleteMapping("/{id}")
|
||||
public void delete(@PathVariable Long id){
|
||||
this.whiteRepository.delete(id);
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
public List<AutoWhiteDto> list(){
|
||||
return this.whiteRepository.queryList();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,78 @@
|
|||
package club.joylink.rtss.auth.dto;
|
||||
|
||||
import club.joylink.rtss.auth.entity.RtsAuthWhite;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.google.common.collect.Lists;
|
||||
import lombok.Data;
|
||||
import org.springframework.cglib.beans.BeanCopier;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class AutoWhiteDto implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 8893978464402061683L;
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 过滤uri
|
||||
*/
|
||||
private String uri;
|
||||
|
||||
/**
|
||||
* uri类型
|
||||
*/
|
||||
private AuthUriType uriType;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
private Integer status;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String depict;
|
||||
public static AutoWhiteDto convertDto(RtsAuthWhite white){
|
||||
AutoWhiteDto dto = new AutoWhiteDto();
|
||||
BeanCopier bc = BeanCopier.create(white.getClass(),dto.getClass(),false);
|
||||
bc.copy(white,dto,null);
|
||||
return dto;
|
||||
}
|
||||
|
||||
public static List<AutoWhiteDto> convertDtoList(List<RtsAuthWhite> whiteList){
|
||||
List<AutoWhiteDto> dtoList = Lists.newArrayList();
|
||||
for (RtsAuthWhite white : whiteList) {
|
||||
dtoList.add(convertDto(white));
|
||||
}
|
||||
return dtoList;
|
||||
}
|
||||
|
||||
|
||||
public RtsAuthWhite convertBean(){
|
||||
RtsAuthWhite b = new RtsAuthWhite();
|
||||
BeanCopier bc = BeanCopier.create(this.getClass(),b.getClass(),false);
|
||||
bc.copy(this,b,null);
|
||||
return b;
|
||||
}
|
||||
|
||||
public enum AuthUriType{
|
||||
HTTP,WS
|
||||
}
|
||||
|
||||
public enum AuthStatus{
|
||||
VALID,INVALID
|
||||
}
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
package club.joylink.rtss.auth.entity;
|
||||
|
||||
import club.joylink.rtss.auth.dto.AutoWhiteDto;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author walker
|
||||
* @since 2023-02-24
|
||||
*/
|
||||
@TableName("rts_auth_white")
|
||||
@Data
|
||||
public class RtsAuthWhite implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 过滤uri
|
||||
*/
|
||||
private String uri;
|
||||
|
||||
/**
|
||||
* uri类型
|
||||
*/
|
||||
private AutoWhiteDto.AuthUriType uriType;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 0=可用,1=不可用
|
||||
*/
|
||||
@TableLogic(value = "0",delval = "1")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String depict;
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "RtsAuthWhite{" +
|
||||
"id = " + id +
|
||||
", uri = " + uri +
|
||||
", uriType = " + uriType +
|
||||
", createTime = " + createTime +
|
||||
", updateTime = " + updateTime +
|
||||
", status = " + status +
|
||||
", depict = " + depict +
|
||||
"}";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,271 @@
|
|||
package club.joylink.rtss.auth.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户
|
||||
* </p>
|
||||
*
|
||||
* @author walker
|
||||
* @since 2023-02-21
|
||||
*/
|
||||
@TableName("sys_account")
|
||||
public class SysAccount implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
private String account;
|
||||
|
||||
private String parentAccount;
|
||||
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 所属组织id
|
||||
*/
|
||||
private Long orgId;
|
||||
|
||||
private String name;
|
||||
|
||||
private String nickname;
|
||||
|
||||
private String avatarPath;
|
||||
|
||||
private String password;
|
||||
|
||||
private String mobile;
|
||||
|
||||
private String nationcode;
|
||||
|
||||
private String email;
|
||||
|
||||
private String wxId;
|
||||
|
||||
private String wxUnionId;
|
||||
|
||||
private String wmOpenId;
|
||||
|
||||
private String status;
|
||||
|
||||
private String roles;
|
||||
|
||||
private String source;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新用户id
|
||||
*/
|
||||
private Long updateUserId;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getAccount() {
|
||||
return account;
|
||||
}
|
||||
|
||||
public void setAccount(String account) {
|
||||
this.account = account;
|
||||
}
|
||||
|
||||
public String getParentAccount() {
|
||||
return parentAccount;
|
||||
}
|
||||
|
||||
public void setParentAccount(String parentAccount) {
|
||||
this.parentAccount = parentAccount;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public Long getOrgId() {
|
||||
return orgId;
|
||||
}
|
||||
|
||||
public void setOrgId(Long orgId) {
|
||||
this.orgId = orgId;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getNickname() {
|
||||
return nickname;
|
||||
}
|
||||
|
||||
public void setNickname(String nickname) {
|
||||
this.nickname = nickname;
|
||||
}
|
||||
|
||||
public String getAvatarPath() {
|
||||
return avatarPath;
|
||||
}
|
||||
|
||||
public void setAvatarPath(String avatarPath) {
|
||||
this.avatarPath = avatarPath;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getMobile() {
|
||||
return mobile;
|
||||
}
|
||||
|
||||
public void setMobile(String mobile) {
|
||||
this.mobile = mobile;
|
||||
}
|
||||
|
||||
public String getNationcode() {
|
||||
return nationcode;
|
||||
}
|
||||
|
||||
public void setNationcode(String nationcode) {
|
||||
this.nationcode = nationcode;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public String getWxId() {
|
||||
return wxId;
|
||||
}
|
||||
|
||||
public void setWxId(String wxId) {
|
||||
this.wxId = wxId;
|
||||
}
|
||||
|
||||
public String getWxUnionId() {
|
||||
return wxUnionId;
|
||||
}
|
||||
|
||||
public void setWxUnionId(String wxUnionId) {
|
||||
this.wxUnionId = wxUnionId;
|
||||
}
|
||||
|
||||
public String getWmOpenId() {
|
||||
return wmOpenId;
|
||||
}
|
||||
|
||||
public void setWmOpenId(String wmOpenId) {
|
||||
this.wmOpenId = wmOpenId;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getRoles() {
|
||||
return roles;
|
||||
}
|
||||
|
||||
public void setRoles(String roles) {
|
||||
this.roles = roles;
|
||||
}
|
||||
|
||||
public String getSource() {
|
||||
return source;
|
||||
}
|
||||
|
||||
public void setSource(String source) {
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
public LocalDateTime getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(LocalDateTime createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public Long getUpdateUserId() {
|
||||
return updateUserId;
|
||||
}
|
||||
|
||||
public void setUpdateUserId(Long updateUserId) {
|
||||
this.updateUserId = updateUserId;
|
||||
}
|
||||
|
||||
public LocalDateTime getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(LocalDateTime updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SysAccount{" +
|
||||
"id = " + id +
|
||||
", account = " + account +
|
||||
", parentAccount = " + parentAccount +
|
||||
", type = " + type +
|
||||
", orgId = " + orgId +
|
||||
", name = " + name +
|
||||
", nickname = " + nickname +
|
||||
", avatarPath = " + avatarPath +
|
||||
", password = " + password +
|
||||
", mobile = " + mobile +
|
||||
", nationcode = " + nationcode +
|
||||
", email = " + email +
|
||||
", wxId = " + wxId +
|
||||
", wxUnionId = " + wxUnionId +
|
||||
", wmOpenId = " + wmOpenId +
|
||||
", status = " + status +
|
||||
", roles = " + roles +
|
||||
", source = " + source +
|
||||
", createTime = " + createTime +
|
||||
", updateUserId = " + updateUserId +
|
||||
", updateTime = " + updateTime +
|
||||
"}";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,100 @@
|
|||
package club.joylink.rtss.auth.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户登陆信息表
|
||||
* </p>
|
||||
*
|
||||
* @author walker
|
||||
* @since 2023-02-21
|
||||
*/
|
||||
@TableName("sys_account_login")
|
||||
public class SysAccountLogin implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
private String client;
|
||||
|
||||
private String project;
|
||||
|
||||
private String device;
|
||||
|
||||
/**
|
||||
* 登陆时间
|
||||
*/
|
||||
private LocalDateTime loginTime;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getClient() {
|
||||
return client;
|
||||
}
|
||||
|
||||
public void setClient(String client) {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
public String getProject() {
|
||||
return project;
|
||||
}
|
||||
|
||||
public void setProject(String project) {
|
||||
this.project = project;
|
||||
}
|
||||
|
||||
public String getDevice() {
|
||||
return device;
|
||||
}
|
||||
|
||||
public void setDevice(String device) {
|
||||
this.device = device;
|
||||
}
|
||||
|
||||
public LocalDateTime getLoginTime() {
|
||||
return loginTime;
|
||||
}
|
||||
|
||||
public void setLoginTime(LocalDateTime loginTime) {
|
||||
this.loginTime = loginTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SysAccountLogin{" +
|
||||
"id = " + id +
|
||||
", userId = " + userId +
|
||||
", client = " + client +
|
||||
", project = " + project +
|
||||
", device = " + device +
|
||||
", loginTime = " + loginTime +
|
||||
"}";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
package club.joylink.rtss.auth.exception;
|
||||
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
public class BaseException extends RuntimeException {
|
||||
|
||||
private IExceptionMessage exceptionMessage;
|
||||
|
||||
public BaseException(IExceptionMessage exceptionMessage) {
|
||||
super(exceptionMessage.getMessage());
|
||||
this.exceptionMessage = exceptionMessage;
|
||||
}
|
||||
|
||||
public BaseException(IExceptionMessage exceptionMessage, String message) {
|
||||
super(message);
|
||||
this.exceptionMessage = exceptionMessage;
|
||||
}
|
||||
|
||||
public BaseException(IExceptionMessage exceptionMessage, Throwable cause) {
|
||||
super(exceptionMessage.getMessage(), cause);
|
||||
this.exceptionMessage = exceptionMessage;
|
||||
}
|
||||
|
||||
public BaseException(IExceptionMessage exceptionMessage, String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
this.exceptionMessage = exceptionMessage;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return this.exceptionMessage.getCode();
|
||||
}
|
||||
|
||||
public String getVoMessage() {
|
||||
if (StringUtils.hasText(super.getMessage())) {
|
||||
return super.getMessage();
|
||||
}
|
||||
return this.exceptionMessage.getMessage();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,228 @@
|
|||
package club.joylink.rtss.auth.exception;
|
||||
|
||||
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
public interface ExceptionAssert {
|
||||
|
||||
BaseException exception();
|
||||
|
||||
BaseException exception(Throwable t);
|
||||
|
||||
BaseException exception(String message);
|
||||
|
||||
BaseException exception(String message, Throwable t);
|
||||
|
||||
default void fail() {
|
||||
throw exception();
|
||||
}
|
||||
|
||||
default void fail(String message) {
|
||||
throw exception(message);
|
||||
}
|
||||
|
||||
default void assertNotNull(Object object) {
|
||||
if (object == null) {
|
||||
throw exception();
|
||||
}
|
||||
}
|
||||
|
||||
default void assertNotNull(Object object, String message) {
|
||||
if (object == null) {
|
||||
throw exception(message);
|
||||
}
|
||||
}
|
||||
default void assertNotNull(Object object, TextValue message) {
|
||||
if (object == null) {
|
||||
throw exception(message.text());
|
||||
}
|
||||
}
|
||||
|
||||
default void assertNull(Object object) {
|
||||
if (object != null) {
|
||||
throw exception();
|
||||
}
|
||||
}
|
||||
|
||||
default void assertNull(Object object, String message) {
|
||||
if (object != null) {
|
||||
throw exception(message);
|
||||
}
|
||||
}
|
||||
default void assertNull(Object object, TextValue message) {
|
||||
if (object != null) {
|
||||
throw exception(message.text());
|
||||
}
|
||||
}
|
||||
default void assertTrue(boolean expression) {
|
||||
if (!expression) {
|
||||
throw exception();
|
||||
}
|
||||
}
|
||||
|
||||
default void assertTrue(boolean expression, String message) {
|
||||
if (!expression) {
|
||||
throw exception(message);
|
||||
}
|
||||
}
|
||||
default void assertTrue(boolean expression, TextValue message) {
|
||||
if (!expression) {
|
||||
throw exception(message.text());
|
||||
}
|
||||
}
|
||||
|
||||
default void assertNotTrue(boolean expression) {
|
||||
if (expression) {
|
||||
throw exception();
|
||||
}
|
||||
}
|
||||
|
||||
default void assertNotTrue(boolean expression, String message) {
|
||||
if (expression) {
|
||||
throw exception(message);
|
||||
}
|
||||
}
|
||||
default void assertNotTrue(boolean expression, TextValue message) {
|
||||
if (expression) {
|
||||
throw exception(message.text());
|
||||
}
|
||||
}
|
||||
|
||||
default void assertCollectionEmpty(Collection<?> collection) {
|
||||
if (!CollectionUtils.isEmpty(collection)) {
|
||||
throw exception();
|
||||
}
|
||||
}
|
||||
|
||||
default void assertCollectionEmpty(Collection<?> collection, String message) {
|
||||
if (!CollectionUtils.isEmpty(collection)) {
|
||||
throw exception(message);
|
||||
}
|
||||
}
|
||||
default void assertCollectionEmpty(Collection<?> collection, TextValue message) {
|
||||
if (!CollectionUtils.isEmpty(collection)) {
|
||||
throw exception(message.text());
|
||||
}
|
||||
}
|
||||
default void assertCollectionNotEmpty(Collection<?> collection) {
|
||||
if (CollectionUtils.isEmpty(collection)) {
|
||||
throw exception();
|
||||
}
|
||||
}
|
||||
|
||||
default void assertCollectionNotEmpty(Collection<?> collection, String message) {
|
||||
if (CollectionUtils.isEmpty(collection)) {
|
||||
throw exception(message);
|
||||
}
|
||||
}
|
||||
default void assertCollectionNotEmpty(Collection<?> collection, TextValue message) {
|
||||
if (CollectionUtils.isEmpty(collection)) {
|
||||
throw exception(message.text());
|
||||
}
|
||||
}
|
||||
default void assertMapEmpty(Map<?, ?> map) {
|
||||
if (!CollectionUtils.isEmpty(map)) {
|
||||
throw exception();
|
||||
}
|
||||
}
|
||||
|
||||
default void assertMapEmpty(Map<?, ?> map, String message) {
|
||||
if (!CollectionUtils.isEmpty(map)) {
|
||||
throw exception(message);
|
||||
}
|
||||
}
|
||||
default void assertMapEmpty(Map<?, ?> map, TextValue message) {
|
||||
if (!CollectionUtils.isEmpty(map)) {
|
||||
throw exception(message.text());
|
||||
}
|
||||
}
|
||||
default void assertMapNotEmpty(Map<?, ?> map) {
|
||||
if (CollectionUtils.isEmpty(map)) {
|
||||
throw exception();
|
||||
}
|
||||
}
|
||||
|
||||
default void assertMapNotEmpty(Map<?, ?> map, String message) {
|
||||
if (CollectionUtils.isEmpty(map)) {
|
||||
throw exception(message);
|
||||
}
|
||||
}
|
||||
default void assertMapNotEmpty(Map<?, ?> map, TextValue message) {
|
||||
if (CollectionUtils.isEmpty(map)) {
|
||||
throw exception(message.text());
|
||||
}
|
||||
}
|
||||
default void assertEquals(Object o1, Object o2) {
|
||||
if (!Objects.equals(o1, o2)) {
|
||||
throw exception();
|
||||
}
|
||||
}
|
||||
|
||||
default void assertEquals(Object o1, Object o2, String message) {
|
||||
if (!Objects.equals(o1, o2)) {
|
||||
throw exception(message);
|
||||
}
|
||||
}
|
||||
default void assertEquals(Object o1, Object o2, TextValue message) {
|
||||
if (!Objects.equals(o1, o2)) {
|
||||
throw exception(message.text());
|
||||
}
|
||||
}
|
||||
default void assertNotEquals(Object o1, Object o2) {
|
||||
if (Objects.equals(o1, o2)) {
|
||||
throw exception();
|
||||
}
|
||||
}
|
||||
|
||||
default void assertNotEquals(Object o1, Object o2, String message) {
|
||||
if (Objects.equals(o1, o2)) {
|
||||
throw exception(message);
|
||||
}
|
||||
}
|
||||
default void assertNotEquals(Object o1, Object o2, TextValue message) {
|
||||
if (Objects.equals(o1, o2)) {
|
||||
throw exception(message.text());
|
||||
}
|
||||
}
|
||||
default void assertHasText(String str) {
|
||||
if (!StringUtils.hasText(str)) {
|
||||
throw exception();
|
||||
}
|
||||
}
|
||||
|
||||
default void assertHasText(String str, String message) {
|
||||
if (!StringUtils.hasText(str)) {
|
||||
throw exception(message);
|
||||
}
|
||||
}
|
||||
default void assertHasText(String str, TextValue message) {
|
||||
if (!StringUtils.hasText(str)) {
|
||||
throw exception(message.text());
|
||||
}
|
||||
}
|
||||
default void assertNotHasText(String str) {
|
||||
if (StringUtils.hasText(str)) {
|
||||
throw exception();
|
||||
}
|
||||
}
|
||||
|
||||
default void assertNotHasText(String str, String message) {
|
||||
if (StringUtils.hasText(str)) {
|
||||
throw exception(message);
|
||||
}
|
||||
}
|
||||
default void assertNotHasText(String str, TextValue message) {
|
||||
if (StringUtils.hasText(str)) {
|
||||
throw exception(message.text());
|
||||
}
|
||||
}
|
||||
@FunctionalInterface
|
||||
public static interface TextValue{
|
||||
String text();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package club.joylink.rtss.auth.exception;
|
||||
|
||||
public interface IExceptionMessage {
|
||||
|
||||
int getCode();
|
||||
|
||||
String getMessage();
|
||||
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package club.joylink.rtss.auth.exception;
|
||||
|
||||
public class ServerException extends BaseException {
|
||||
public ServerException(IExceptionMessage exceptionMessage) {
|
||||
super(exceptionMessage);
|
||||
}
|
||||
|
||||
public ServerException(IExceptionMessage exceptionMessage, String message) {
|
||||
super(exceptionMessage, message);
|
||||
}
|
||||
|
||||
public ServerException(IExceptionMessage exceptionMessage, Throwable cause) {
|
||||
super(exceptionMessage, cause);
|
||||
}
|
||||
|
||||
public ServerException(IExceptionMessage exceptionMessage, String message, Throwable cause) {
|
||||
super(exceptionMessage, message, cause);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package club.joylink.rtss.auth.exception;
|
||||
|
||||
public interface ServerExceptionAssert extends IExceptionMessage, ExceptionAssert {
|
||||
|
||||
default BaseException exception() {
|
||||
return new ServerException(this);
|
||||
}
|
||||
|
||||
default BaseException exception(Throwable t) {
|
||||
return new ServerException(this, t);
|
||||
}
|
||||
|
||||
default BaseException exception(String message) {
|
||||
return new ServerException(this, message);
|
||||
}
|
||||
|
||||
default BaseException exception(String message, Throwable t) {
|
||||
return new ServerException(this, message, t);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package club.joylink.rtss.auth.exception;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public enum ServerExceptionAssertEnum implements ServerExceptionAssert {
|
||||
DataNotExist(4000, "data not exist"),
|
||||
FieldMustUnique(4001, "the unique filed repeat"),
|
||||
RuntimeException(4002,"system runtime exception")
|
||||
;
|
||||
|
||||
int code;
|
||||
|
||||
String message;
|
||||
|
||||
ServerExceptionAssertEnum(int code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package club.joylink.rtss.auth.mapper;
|
||||
|
||||
import club.joylink.rtss.auth.entity.RtsAuthWhite;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author walker
|
||||
* @since 2023-02-24
|
||||
*/
|
||||
@Mapper
|
||||
public interface RtsAuthWhiteMapper extends BaseMapper<RtsAuthWhite> {
|
||||
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package club.joylink.rtss.auth.mapper;
|
||||
|
||||
import club.joylink.rtss.auth.entity.SysAccountLogin;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户登陆信息表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author walker
|
||||
* @since 2023-02-21
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysAccountLoginMapper extends BaseMapper<SysAccountLogin> {
|
||||
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package club.joylink.rtss.auth.mapper;
|
||||
|
||||
import club.joylink.rtss.auth.entity.SysAccount;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author walker
|
||||
* @since 2023-02-21
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysAccountMapper extends BaseMapper<SysAccount> {
|
||||
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package club.joylink.rtss.auth.repository;
|
||||
|
||||
import club.joylink.rtss.auth.dto.AutoWhiteDto;
|
||||
import club.joylink.rtss.auth.entity.RtsAuthWhite;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author walker
|
||||
* @since 2023-02-24
|
||||
*/
|
||||
public interface IRtsAuthWhiteRepository extends IService<RtsAuthWhite> {
|
||||
void saveOrUpdate(AutoWhiteDto dto);
|
||||
void delete(Long id);
|
||||
|
||||
AutoWhiteDto findById(Long id);
|
||||
List<AutoWhiteDto> queryList();
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package club.joylink.rtss.auth.repository;
|
||||
|
||||
import club.joylink.rtss.auth.entity.SysAccountLogin;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户登陆信息表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author walker
|
||||
* @since 2023-02-21
|
||||
*/
|
||||
public interface ISysAccountLoginRepository extends IService<SysAccountLogin> {
|
||||
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package club.joylink.rtss.auth.repository;
|
||||
|
||||
import club.joylink.rtss.auth.entity.SysAccount;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author walker
|
||||
* @since 2023-02-21
|
||||
*/
|
||||
public interface ISysAccountRepository extends IService<SysAccount> {
|
||||
|
||||
SysAccount queryBy(String login);
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
package club.joylink.rtss.auth.repository.impl;
|
||||
|
||||
import club.joylink.rtss.auth.dto.AutoWhiteDto;
|
||||
import club.joylink.rtss.auth.entity.RtsAuthWhite;
|
||||
import club.joylink.rtss.auth.exception.ServerExceptionAssertEnum;
|
||||
import club.joylink.rtss.auth.mapper.RtsAuthWhiteMapper;
|
||||
import club.joylink.rtss.auth.repository.IRtsAuthWhiteRepository;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author walker
|
||||
* @since 2023-02-24
|
||||
*/
|
||||
@Service
|
||||
public class RtsAuthWhiteRepository extends ServiceImpl<RtsAuthWhiteMapper, RtsAuthWhite> implements IRtsAuthWhiteRepository {
|
||||
|
||||
@Override
|
||||
public void saveOrUpdate(AutoWhiteDto dto) {
|
||||
RtsAuthWhite bean = dto.convertBean();
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
bean.setCreateTime(now);
|
||||
bean.setUpdateTime(now);
|
||||
bean.setStatus(AutoWhiteDto.AuthStatus.INVALID.ordinal());
|
||||
if(Objects.nonNull(bean.getId())){
|
||||
RtsAuthWhite tmp = this.find(bean.getId());
|
||||
tmp.setUpdateTime(now);
|
||||
this.updateById(tmp);
|
||||
}else{
|
||||
this.save(bean);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(Long id) {
|
||||
this.find(id);
|
||||
this.removeById(id);
|
||||
}
|
||||
|
||||
private RtsAuthWhite find(Long id){
|
||||
RtsAuthWhite white = this.getById(id);
|
||||
ServerExceptionAssertEnum.DataNotExist.assertTrue(Objects.nonNull(white),"未找到对应的数据");
|
||||
return white;
|
||||
}
|
||||
@Override
|
||||
public AutoWhiteDto findById(Long id) {
|
||||
RtsAuthWhite white = this.find(id);
|
||||
return AutoWhiteDto.convertDto(white);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AutoWhiteDto> queryList() {
|
||||
QueryWrapper<RtsAuthWhite> queryWrapper = new QueryWrapper<>();
|
||||
List<RtsAuthWhite> list = this.baseMapper.selectList(queryWrapper);
|
||||
return AutoWhiteDto.convertDtoList(list);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package club.joylink.rtss.auth.repository.impl;
|
||||
|
||||
import club.joylink.rtss.auth.entity.SysAccountLogin;
|
||||
import club.joylink.rtss.auth.mapper.SysAccountLoginMapper;
|
||||
import club.joylink.rtss.auth.repository.ISysAccountLoginRepository;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户登陆信息表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author walker
|
||||
* @since 2023-02-21
|
||||
*/
|
||||
@Service
|
||||
public class SysAccountLoginRepository extends ServiceImpl<SysAccountLoginMapper, SysAccountLogin> implements ISysAccountLoginRepository {
|
||||
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package club.joylink.rtss.auth.repository.impl;
|
||||
|
||||
import club.joylink.rtss.auth.entity.SysAccount;
|
||||
import club.joylink.rtss.auth.exception.ServerExceptionAssertEnum;
|
||||
import club.joylink.rtss.auth.mapper.SysAccountMapper;
|
||||
import club.joylink.rtss.auth.repository.ISysAccountRepository;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author walker
|
||||
* @since 2023-02-21
|
||||
*/
|
||||
@Service
|
||||
public class SysAccountRepository extends ServiceImpl<SysAccountMapper, SysAccount> implements ISysAccountRepository {
|
||||
|
||||
SysAccountMapper sysAccountMapper;
|
||||
|
||||
public SysAccountRepository(SysAccountMapper sysAccountMapper) {
|
||||
this.sysAccountMapper = sysAccountMapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysAccount queryBy(String login) {
|
||||
SysAccount account = this.getOne(Wrappers.<SysAccount>lambdaQuery().eq(SysAccount::getMobile, login));
|
||||
return account;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
package club.joylink.rtss.auth.service;
|
||||
|
||||
import club.joylink.rtss.auth.entity.SysAccount;
|
||||
import club.joylink.rtss.auth.repository.ISysAccountRepository;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.config.core.GrantedAuthorityDefaults;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.authority.AuthorityUtils;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||
import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Spring Security的UserDetailsService实现
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class DbUserDetailsService implements UserDetailsService {
|
||||
private ISysAccountRepository userRepository;
|
||||
public DbUserDetailsService(ISysAccountRepository userRepository) {
|
||||
this.userRepository = userRepository;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
|
||||
try {
|
||||
SysAccount userInfo = this.userRepository.queryBy(username);
|
||||
if (userInfo == null) {
|
||||
throw new UsernameNotFoundException(String.format("未找到mobile=%s的用户", username));
|
||||
}
|
||||
|
||||
return org.springframework.security.core.userdetails.User
|
||||
.withUsername(userInfo.getId().toString())
|
||||
.password(userInfo.getPassword())
|
||||
// .password(this.passwordEncoder.encode(userInfo.getPassword()))
|
||||
.authorities(AuthorityUtils.createAuthorityList("MOBILE"))
|
||||
.build();
|
||||
} catch (UsernameNotFoundException e) {
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
log.error("根据username加载用户异常", e);
|
||||
throw new UsernameNotFoundException("加载用户未知异常", e);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
package club.joylink.rtss.auth.service;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.oauth2.jwt.JwtClaimsSet;
|
||||
import org.springframework.security.oauth2.jwt.JwtEncoder;
|
||||
import org.springframework.security.oauth2.jwt.JwtEncoderParameters;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Component
|
||||
public class JwtService {
|
||||
final JwtEncoder jwtEncoder;
|
||||
|
||||
public JwtService(JwtEncoder jwtEncoder) {
|
||||
this.jwtEncoder = jwtEncoder;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class UserInfo {
|
||||
String id;
|
||||
List<String> roles;
|
||||
|
||||
public UserInfo(String id, List<String> roles) {
|
||||
this.id = id;
|
||||
this.roles = roles;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建jwt
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String buildToken(UserInfo userInfo) {
|
||||
Instant now = Instant.now();
|
||||
long expiry = 3 * 24 * 60 * 60L;
|
||||
// @formatter:off
|
||||
String scope = userInfo.getRoles().stream()
|
||||
.collect(Collectors.joining(" "));
|
||||
JwtClaimsSet claims = JwtClaimsSet.builder()
|
||||
.issuer("self")
|
||||
.issuedAt(now)
|
||||
.expiresAt(now.plusSeconds(expiry))
|
||||
.subject(userInfo.getId())//此处实际为用户id(数据库记录id)
|
||||
.claim("scope", scope)
|
||||
.claim("userinfo", userInfo)
|
||||
.build();
|
||||
// @formatter:on
|
||||
try {
|
||||
final String token = this.jwtEncoder.encode(JwtEncoderParameters.from(claims)).getTokenValue();
|
||||
return token;
|
||||
} catch (Exception ex) {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,131 @@
|
|||
package club.joylink.rtss.auth.util;
|
||||
|
||||
import javax.crypto.Mac;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
public class EncryptUtil {
|
||||
|
||||
public static final int DEFAULT_LEN = 32;
|
||||
|
||||
public static final char[] hexChar = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
|
||||
|
||||
public static final String[] hashTypes = new String[] { "MD2", "MD5", "SHA1", "SHA-256", "SHA-384", "SHA-512" };
|
||||
|
||||
public static MessageDigest getEncryptByName(String algorithm) throws NoSuchAlgorithmException {
|
||||
return MessageDigest.getInstance(algorithm);
|
||||
}
|
||||
|
||||
public static String md2(String str) {
|
||||
MessageDigest md;
|
||||
try {
|
||||
md = getEncryptByName(hashTypes[0]);
|
||||
return toHexString(md.digest(str.getBytes()));
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String md5(String str) {
|
||||
MessageDigest md;
|
||||
try {
|
||||
md = getEncryptByName(hashTypes[1]);
|
||||
return toHexString(md.digest(str.getBytes()));
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String md5(String str, String charsetName) {
|
||||
MessageDigest md;
|
||||
try {
|
||||
md = getEncryptByName(hashTypes[1]);
|
||||
return toHexString(md.digest(str.getBytes(charsetName)));
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
e.printStackTrace();
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String sha1(String str) {
|
||||
MessageDigest md;
|
||||
try {
|
||||
md = getEncryptByName(hashTypes[2]);
|
||||
return toHexString(md.digest(str.getBytes()));
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String sha256(String str) {
|
||||
MessageDigest md;
|
||||
try {
|
||||
md = getEncryptByName(hashTypes[3]);
|
||||
return toHexString(md.digest(str.getBytes()));
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String sha384(String str) {
|
||||
MessageDigest md;
|
||||
try {
|
||||
md = getEncryptByName(hashTypes[4]);
|
||||
return toHexString(md.digest(str.getBytes()));
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String sha512(String str) {
|
||||
MessageDigest md;
|
||||
try {
|
||||
md = getEncryptByName(hashTypes[5]);
|
||||
return toHexString(md.digest(str.getBytes()));
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String toHexString(byte[] b) {
|
||||
StringBuilder sb = new StringBuilder(b.length * 2);
|
||||
for (int i = 0; i < b.length; i++) {
|
||||
sb.append(hexChar[(b[i] & 0xf0) >>> 4]);
|
||||
sb.append(hexChar[b[i] & 0x0f]);
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public static String HMACSHA256(String data, String key) throws Exception {
|
||||
|
||||
Mac sha256_HMAC = Mac.getInstance("HmacSHA256");
|
||||
|
||||
SecretKeySpec secret_key = new SecretKeySpec(key.getBytes("UTF-8"), "HmacSHA256");
|
||||
|
||||
sha256_HMAC.init(secret_key);
|
||||
|
||||
byte[] array = sha256_HMAC.doFinal(data.getBytes("UTF-8"));
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
for (byte item : array) {
|
||||
|
||||
sb.append(Integer.toHexString((item & 0xFF) | 0x100).substring(1, 3));
|
||||
|
||||
}
|
||||
|
||||
return sb.toString().toUpperCase();
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
-----BEGIN PRIVATE KEY-----
|
||||
MIIEugIBADANBgkqhkiG9w0BAQEFAASCBKQwggSgAgEAAoIBAQCk16Ov5gy35qzQzVUkv44FQSJp+xD73eMh0NeETTboZ4SJyQ3AIfvNQAiTSvNA6lKY4gpPxSveddmRPIbp1gVM6CKzZF7EWs6ZR9UxM7RECLrloGiVRUv3q5vbtIxMNTyMLsLtc5+PE6ZsvoeOEAUzXtoPZXbg0enWfs/qfxVaEr3c7riSXF5S0Df0gUsquRF7+CNAdr2GEDMJjtEKl7pDRk8IsiMVpuupmfhOhSveiK316Uc1D8jLIugKHZ62jAPGXbkLML30gIILWKFFEZLabvw04fZUCJq01ijRbRwLJG9Z/AnIWTk1gMfH8oIZc5R0sI389IEAYyiL9r04joCFAgMBAAECgf8/fKzUifMJdakyLV7TL6ksZSeVwowOMyD46UjNp5SbDr9Tzbx55DmvY9Tx7efKXtgu6I1adg29vQj5wbT6g8nyK4YpmZM4uiOmSGtsatQn9G6bpv6xE4/gIhLIJDkN94N/cc1nnk3iEzeegOxhxmat+w/HKJMYLLharoTY8OeGQIb9XwDppt2y1+gFXJvEG9jGb/lIZ4xLMqQfOi0T9PHooLRgjqUQ07JZHPELlLLKohDwsRXMHkDmXiCYQ7P58+hjgBLzxNr3WmpuRISLewjjCa0XWbfxrFhY8HOYIQZNBjeNmVwANsAlMlqnjjv4sfCBlHg7LA6qMfEyONy2zlECgYEAziDvMEd3EHeUJMf+Macicdgfh29zWlyPYI7u5lzCjUqy6po7Q1uFYP7SPetO8mnX0j9pbZC3Zr05TCdXc4jdccKze58j1u+zPAYxX5I2LY0T5BsQOCT4/Oa11QBE0cJSA/wy+XLMpJ8+UIs7dirMFUMjWAMwvu4De7wfsu0IIf0CgYEAzLmKNS6EjeY1GhnZs8uuvtjr5XPQ3G22WAj5g/SjaDNZ5JC1+Ag5G5Iwd262Pa6LCPXRvVGnG3FvVqIk60aHoatqY5zJA+6cCdD1OHhGJTzrPfVmcWkiNpstHqD0w8l4QGhwd8O/0IDJm4NN7bW3WTttHIBz/ElqiWoG4YEG+ykCgYBSTrJTy+WOLMF54mXs+7j0ToFgei9MgLM7sjdQwu9ordA9f3J0lgHvVjErSl+OypbEPE/j0Sp6mspbT0ZLOvZ5q24xybzs4W/nYu2qJN7/V1r+9ZOHZ7QIgDNRJzdTrs1DDBxqoN14SqH+VWpb6ADv6IwfY76+LpozeU4LCzz5HQKBgHuuR/HzJX+4qTIYle5KSkrgMDuR6YeR/IxY960hmar1AwTT7CtphF7ExeURjKXdEgAayliOwN8Se8oh8R32oTApp/+AE+z9NWW0yMER4IbUs+XdoMM5WcMVon+Ti+vQhoaa0f940iQ7+hCqleTbWGZfQX7rl6a+D8/urzODSN1pAoGAdui4nehVY7HyH9JH/Td3ZhW4SAB9U4cfNUFt+MaEDdrtxgJ5tP5NEDjIa1q0f3tdfL/WssBT0ti9thjGn2cHROE/ZlaTQR0riwgbFgLpvtQh0t4nth8RPF17+XsMDL1VGSyartYc+g+dUVubyH2PMIxPfoZCWvQSYX13YfF2Zbk=
|
||||
-----END PRIVATE KEY-----
|
|
@ -0,0 +1,3 @@
|
|||
-----BEGIN PUBLIC KEY-----
|
||||
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApNejr+YMt+as0M1VJL+OBUEiafsQ+93jIdDXhE026GeEickNwCH7zUAIk0rzQOpSmOIKT8Ur3nXZkTyG6dYFTOgis2RexFrOmUfVMTO0RAi65aBolUVL96ub27SMTDU8jC7C7XOfjxOmbL6HjhAFM17aD2V24NHp1n7P6n8VWhK93O64klxeUtA39IFLKrkRe/gjQHa9hhAzCY7RCpe6Q0ZPCLIjFabrqZn4ToUr3oit9elHNQ/IyyLoCh2etowDxl25CzC99ICCC1ihRRGS2m78NOH2VAiatNYo0W0cCyRvWfwJyFk5NYDHx/KCGXOUdLCN/PSBAGMoi/a9OI6AhQIDAQAB
|
||||
-----END PUBLIC KEY-----
|
|
@ -0,0 +1,9 @@
|
|||
jwt:
|
||||
private.key: classpath:app.key
|
||||
public.key: classpath:app.pub
|
||||
|
||||
mybatis-plus:
|
||||
type-aliases-package: club.joylink.rtss.auth.mapper
|
||||
mapper-locations: classpath:mapper/auth/*.xml
|
||||
configuration:
|
||||
map-underscore-to-camel-case: true
|
|
@ -0,0 +1,5 @@
|
|||
<?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="club.joylink.rtss.auth.mapper.SysAccountLoginMapper">
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,5 @@
|
|||
<?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="club.joylink.rtss.auth.mapper.SysAccountMapper">
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,96 @@
|
|||
package club.joylink.rtss.auth;
|
||||
|
||||
import com.baomidou.mybatisplus.generator.FastAutoGenerator;
|
||||
import com.baomidou.mybatisplus.generator.config.DataSourceConfig;
|
||||
import com.baomidou.mybatisplus.generator.config.OutputFile;
|
||||
import com.baomidou.mybatisplus.generator.config.rules.DateType;
|
||||
import com.google.common.collect.Lists;
|
||||
import lombok.Builder;
|
||||
import lombok.NonNull;
|
||||
import lombok.Setter;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class MybatisPlusAutoGenerator {
|
||||
|
||||
public static final DataSourceConfig.Builder DATA_SOURCE_CONFIG = new DataSourceConfig
|
||||
.Builder("jdbc:mysql://192.168.3.233:3306/joylink?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai",
|
||||
"root", "joylink0503")
|
||||
;
|
||||
|
||||
public static void main(String[] args) {
|
||||
GeneratorModule generatorModule = GeneratorModule.SimulationNcc;
|
||||
String[] tableNames = new String[]{"rts_ncc_map_data"};
|
||||
// String baseDir = String.join(File.separator, Arrays.asList(System.getProperty("user.dir"), "jl-rtss-auth", "src", "main"));
|
||||
String baseDir = generatorModule.projectPath;
|
||||
String outBaseDir = baseDir + File.separator + "java";
|
||||
String xmlDir = baseDir + File.separator + "resources" + File.separator + "mapper";
|
||||
System.out.println(outBaseDir);
|
||||
FastAutoGenerator.create(DATA_SOURCE_CONFIG)
|
||||
.globalConfig(builder -> {
|
||||
builder.author("walker")
|
||||
.disableOpenDir() // 生成完毕不打开目录
|
||||
.dateType(DateType.TIME_PACK) // 使用java8的日期时间对象
|
||||
.outputDir(outBaseDir);
|
||||
})
|
||||
.packageConfig(builder -> {
|
||||
builder.parent(generatorModule.rootPackAges)
|
||||
.service("repository")
|
||||
.serviceImpl("repository.impl")
|
||||
.pathInfo(Collections.singletonMap(OutputFile.xml, xmlDir));
|
||||
})
|
||||
.strategyConfig(builder -> {
|
||||
|
||||
builder.addInclude(tableNames);
|
||||
// entity生成策略
|
||||
builder.entityBuilder()
|
||||
.enableLombok()
|
||||
.enableFileOverride(); // 覆盖旧文件
|
||||
// mapper生成策略
|
||||
builder.mapperBuilder()
|
||||
.mapperAnnotation(Mapper.class); // 生成Mapper注解
|
||||
//.enableFileOverride(); // 覆盖旧文件
|
||||
// service生成策略
|
||||
builder.serviceBuilder()
|
||||
// .enableFileOverride() // 覆盖旧文件
|
||||
.formatServiceFileName("I%sRepository")
|
||||
.formatServiceImplFileName("%sRepository")
|
||||
;
|
||||
// controller生成策略
|
||||
builder.controllerBuilder()
|
||||
.enableRestStyle(); // 改为使用RestController注解,支持Rest接口
|
||||
})
|
||||
// 可自定义模板
|
||||
// .templateConfig(builder -> {
|
||||
//
|
||||
// })
|
||||
.execute();
|
||||
}
|
||||
|
||||
enum GeneratorModule{
|
||||
Auth("club.joylink.rtss.auth",new String[]{"jl-rtss-auth"})
|
||||
,SimulationNcc("club.joylink.rtss.simulation.ncc",new String[]{"jl-rtss-simulation","ncc"});
|
||||
GeneratorModule(String d,String[] p){
|
||||
this.rootPackAges = d;
|
||||
List<String> projectDir = new ArrayList<>();
|
||||
for (String s : p) {
|
||||
projectDir.add(s);
|
||||
}
|
||||
projectDir.add(0,System.getProperty("user.dir"));
|
||||
projectDir.add("src");
|
||||
projectDir.add("main");
|
||||
this.projectPath = String.join(File.separator, projectDir);
|
||||
|
||||
}
|
||||
private String rootPackAges;
|
||||
private String projectPath;
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package club.joylink.rtss.auth;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Base64;
|
||||
|
||||
public class Tests {
|
||||
|
||||
@Test
|
||||
public void basicAuth() {
|
||||
String name = "17791995809";
|
||||
String password = "123456";
|
||||
String ba = Base64.getEncoder().encodeToString(String.format("%s:%s", name, password).getBytes(StandardCharsets.UTF_8));
|
||||
System.out.println(ba);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,228 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>club.joylink.rtss</groupId>
|
||||
<artifactId>rtss-server</artifactId>
|
||||
<version>0.1</version>
|
||||
</parent>
|
||||
<artifactId>manage</artifactId>
|
||||
<version>0.1</version>
|
||||
<name>manage</name>
|
||||
<description> Rail transit simulation system</description>
|
||||
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<properties>
|
||||
<java.version>17</java.version>
|
||||
<pagehelper.version>4.1.1</pagehelper.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>club.joylink.rtss</groupId>
|
||||
<artifactId>auth</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>club.joylink.rtss</groupId>
|
||||
<artifactId>NCC</artifactId>
|
||||
<version>0.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-mail</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-websocket</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.pagehelper</groupId>
|
||||
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- javax.validation -->
|
||||
<dependency>
|
||||
<groupId>javax.validation</groupId>
|
||||
<artifactId>validation-api</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--spring切面aop依赖 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-aop</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.netty</groupId>
|
||||
<artifactId>netty-all</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.digitalpetri.modbus</groupId>
|
||||
<artifactId>modbus-codec</artifactId>
|
||||
<version>1.1.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 硬件检测依赖 -->
|
||||
<dependency>
|
||||
<groupId>com.github.oshi</groupId>
|
||||
<artifactId>oshi-core-java11</artifactId>
|
||||
<version>5.7.5</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.wechatpay-apiv3</groupId>
|
||||
<artifactId>wechatpay-apache-httpclient</artifactId>
|
||||
<version>0.2.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>31.1-jre</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.minio</groupId>
|
||||
<artifactId>minio</artifactId>
|
||||
<version>8.4.4</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
<version>4.9.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>joda-time</groupId>
|
||||
<artifactId>joda-time</artifactId>
|
||||
<version>2.10.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.belerweb</groupId>
|
||||
<artifactId>pinyin4j</artifactId>
|
||||
<version>2.5.0</version>
|
||||
</dependency>
|
||||
<!-- iscs -->
|
||||
<dependency>
|
||||
<groupId>com.google.protobuf</groupId>
|
||||
<artifactId>protobuf-java</artifactId>
|
||||
<version>3.19.3</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<filtering>true</filtering>
|
||||
<directory>src/main/resources</directory>
|
||||
</resource>
|
||||
</resources>
|
||||
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>${maven-compiler-plugin.version}</version>
|
||||
<configuration>
|
||||
<source>${java.version}</source>
|
||||
<target>${java.version}</target>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>${maven.resources.plugin.version}</version>
|
||||
<configuration>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-resources</id>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>copy-resources</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${basedir}/target/classes</outputDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>${basedir}/../jl-rtss-auth/src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>${basedir}/../jl-rtss-simulation/ISCS/src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<mainClass>club.joylink.rtss.manage.RtssApplication</mainClass>
|
||||
<layout>ZIP</layout>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>com.github.shalousun</groupId>
|
||||
<artifactId>smart-doc-maven-plugin</artifactId>
|
||||
<version>2.1.9</version>
|
||||
<configuration>
|
||||
<!--指定生成文档的使用的配置文件,配置文件放在自己的项目中-->
|
||||
<configFile>./src/main/resources/smart-doc.json</configFile>
|
||||
<!--smart-doc实现自动分析依赖树加载第三方依赖的源码,如果一些框架依赖库加载不到导致报错,这时请使用excludes排除掉-->
|
||||
<!-- <excludes>-->
|
||||
<!-- <!–格式为:groupId:artifactId;参考如下–>-->
|
||||
<!-- <exclude>com.alibaba:fastjson</exclude>-->
|
||||
<!-- </excludes>-->
|
||||
<!-- <!–自1.0.8版本开始,插件提供includes支持,配置了includes后插件会按照用户配置加载而不是自动加载,因此使用时需要注意–>-->
|
||||
<!-- <!–smart-doc能自动分析依赖树加载所有依赖源码,原则上会影响文档构建效率,因此你可以使用includes来让插件加载你配置的组件–>-->
|
||||
<!-- <includes>-->
|
||||
<!-- <!–格式为:groupId:artifactId;参考如下–>-->
|
||||
<!-- <include>com.alibaba:fastjson</include>-->
|
||||
<!-- </includes>-->
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<!--如果不需要在执行编译时启动smart-doc,则将phase注释掉-->
|
||||
<!-- <phase>compile</phase>-->
|
||||
<goals>
|
||||
<!--smart-doc提供了html、openapi、markdown等goal,可按需配置-->
|
||||
<goal>html</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
|
@ -0,0 +1,21 @@
|
|||
package club.joylink.rtss.manage;
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cache.annotation.EnableCaching;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
@SpringBootApplication(scanBasePackages = {"club.joylink.rtss"})
|
||||
@EnableScheduling
|
||||
@EnableCaching
|
||||
@MapperScan(basePackages = {"club.joylink.rtss.manage.dao",
|
||||
"club.joylink.rtss.*.mapper","club.joylink.rtss.simulation.*.mapper"})
|
||||
//@EnableRetry
|
||||
public class RtssApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(RtssApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
package club.joylink.rtss.configuration;
|
||||
package club.joylink.rtss.manage.configuration;
|
||||
|
||||
import club.joylink.rtss.entity.project.Project;
|
||||
import club.joylink.rtss.manage.entity.project.Project;
|
||||
import org.springframework.cache.interceptor.KeyGenerator;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
|
@ -1,4 +1,4 @@
|
|||
package club.joylink.rtss.configuration;
|
||||
package club.joylink.rtss.manage.configuration;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.core.convert.converter.Converter;
|
|
@ -0,0 +1,52 @@
|
|||
package club.joylink.rtss.manage.configuration;
|
||||
|
||||
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.deser.LocalTimeDeserializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalTimeSerializer;
|
||||
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
||||
@Configuration
|
||||
public class LocalDateTimeSerializerConfig {
|
||||
/**
|
||||
* Date格式化字符串
|
||||
*/
|
||||
private static final String DATE_FORMAT = "yyyy-MM-dd";
|
||||
/**
|
||||
* DateTime格式化字符串
|
||||
*/
|
||||
private static final String DATETIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
|
||||
/**
|
||||
* Time格式化字符串
|
||||
*/
|
||||
private static final String TIME_FORMAT = "HH:mm:ss";
|
||||
|
||||
@Bean
|
||||
public Jackson2ObjectMapperBuilderCustomizer jackson2ObjectMapperBuilderCustomizer() {
|
||||
return builder -> {
|
||||
builder.serializerByType(LocalDateTime.class,
|
||||
new LocalDateTimeSerializer(DateTimeFormatter.ofPattern(DATETIME_FORMAT)));
|
||||
builder.deserializerByType(LocalDateTime.class,
|
||||
new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern(DATETIME_FORMAT)));
|
||||
|
||||
builder.serializerByType(LocalDate.class,
|
||||
new LocalDateSerializer(DateTimeFormatter.ofPattern(DATE_FORMAT)));
|
||||
builder.deserializerByType(LocalDate.class,
|
||||
new LocalDateDeserializer(DateTimeFormatter.ofPattern(DATE_FORMAT)));
|
||||
|
||||
builder.serializerByType(LocalTime.class,
|
||||
new LocalTimeSerializer(DateTimeFormatter.ofPattern(TIME_FORMAT)));
|
||||
builder.deserializerByType(LocalTime.class,
|
||||
new LocalTimeDeserializer(DateTimeFormatter.ofPattern(TIME_FORMAT)));
|
||||
};
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package club.joylink.rtss.configuration;
|
||||
package club.joylink.rtss.manage.configuration;
|
||||
|
||||
import io.minio.MinioClient;
|
||||
import lombok.Getter;
|
|
@ -1,6 +1,6 @@
|
|||
package club.joylink.rtss.configuration;
|
||||
package club.joylink.rtss.manage.configuration;
|
||||
|
||||
import club.joylink.rtss.wechat.converter.WxMappingJackson2HttpMessageConverter;
|
||||
import club.joylink.rtss.manage.wechat.converter.WxMappingJackson2HttpMessageConverter;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.client.ClientHttpRequestFactory;
|
|
@ -1,4 +1,4 @@
|
|||
package club.joylink.rtss.configuration;
|
||||
package club.joylink.rtss.manage.configuration;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
@ -75,19 +75,4 @@ public class TaskExecutorConfiguration {
|
|||
taskExecutor.initialize();
|
||||
return taskExecutor;
|
||||
}
|
||||
|
||||
/**
|
||||
* 语音识别业务处理线程
|
||||
*/
|
||||
@Bean("voiceDiscriminateExecutor")
|
||||
public TaskExecutor voiceDiscriminateExecutor(Environment env) {
|
||||
ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor();
|
||||
taskExecutor.setThreadNamePrefix("ns-voice-discriminate-executor-");
|
||||
taskExecutor.setCorePoolSize(2);
|
||||
taskExecutor.setMaxPoolSize(2);
|
||||
taskExecutor.setQueueCapacity(100);
|
||||
taskExecutor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
|
||||
taskExecutor.initialize();
|
||||
return taskExecutor;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,81 @@
|
|||
package club.joylink.rtss.manage.configuration;
|
||||
|
||||
import club.joylink.rtss.manage.controller.advice.AuthenticateInterceptor;
|
||||
import club.joylink.rtss.manage.controller.advice.LicenseInterceptor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.format.FormatterRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Configuration
|
||||
public class WebConfig implements WebMvcConfigurer {
|
||||
|
||||
@Autowired
|
||||
private AuthenticateInterceptor authenticateInterceptor;
|
||||
|
||||
@Autowired
|
||||
private LicenseInterceptor licenseInterceptor;
|
||||
|
||||
@Override
|
||||
public void addInterceptors(InterceptorRegistry registry) {
|
||||
List<String> licenseWhiteList = new ArrayList<>();
|
||||
licenseWhiteList.add("/api/license/validate");
|
||||
licenseWhiteList.add("/api/license/local");
|
||||
licenseWhiteList.add("/api/licensing/**");
|
||||
registry.addInterceptor(licenseInterceptor).excludePathPatterns(licenseWhiteList);
|
||||
List<String> whiteList = new ArrayList<>();
|
||||
whiteList.add("/doc/**");
|
||||
whiteList.add("/api/login/**");
|
||||
whiteList.add("/api/wxpat/**");
|
||||
whiteList.add("/api/sms/**");
|
||||
whiteList.add("/api/register/**");
|
||||
whiteList.add("/api/userinfo/**");
|
||||
whiteList.add("/api/wechatpay/receive");
|
||||
whiteList.add("/api/alipay/receive");
|
||||
whiteList.add("/api/applet/**");
|
||||
whiteList.add("/api/wxauth/**");
|
||||
whiteList.add("/api/distribute/permission");
|
||||
whiteList.add("/api/v1/jointTraining/permission");
|
||||
whiteList.add("/api/jointTraining/permission");
|
||||
whiteList.add("/api/user/bind/wm");
|
||||
// 运行图工具
|
||||
whiteList.add("/api/rpTools/**");
|
||||
whiteList.add("/api/license/validate");
|
||||
whiteList.add("/api/license/local");
|
||||
// 微信回调接口
|
||||
whiteList.add("/api/wechatPay/receive");
|
||||
// 成都工业留言板
|
||||
whiteList.add("/api/learn/cgy/message/create");
|
||||
whiteList.add("/api/learn/cgy/{messageId}/comment");
|
||||
whiteList.add("/api/learn/{postId}/message/pagedQuery/postId");
|
||||
whiteList.add("GET /api/learn/{messageId}/comment");
|
||||
whiteList.add("/api/learn/cgy/updateMessageTime");
|
||||
// 成都工业使用记录
|
||||
whiteList.add("/api/cgy/**");
|
||||
//项目域名查询
|
||||
whiteList.add("/api/projectServer/project/{project}");
|
||||
whiteList.add("/test/simulation/**");
|
||||
whiteList.add("/api/test/**");
|
||||
whiteList.add("/api/project/viewSetting/simple/all");
|
||||
whiteList.add("/api/project/viewSetting/project/{project}");
|
||||
//旧数据处理
|
||||
whiteList.add("/api/org/oldData/handle");
|
||||
whiteList.add("/api/mapFunction/oldDataHandle");
|
||||
whiteList.add("/api/v2/paper/composition/oldData/handle");
|
||||
whiteList.add("/api/user/sync");
|
||||
whiteList.add("/dataHandle");
|
||||
|
||||
registry.addInterceptor(authenticateInterceptor).excludePathPatterns(whiteList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addFormatters(FormatterRegistry registry) {
|
||||
registry.addConverter(new LocalDateConverter());
|
||||
WebMvcConfigurer.super.addFormatters(registry);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package club.joylink.rtss.configuration.configProp;
|
||||
package club.joylink.rtss.manage.configuration.configProp;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
|
@ -1,4 +1,4 @@
|
|||
package club.joylink.rtss.configuration.configProp;
|
||||
package club.joylink.rtss.manage.configuration.configProp;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
@ -11,5 +11,4 @@ import org.springframework.stereotype.Component;
|
|||
@Setter
|
||||
public class ModbusTcpConfig {
|
||||
private int port;
|
||||
private int afcTransferPort;
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package club.joylink.rtss.configuration.configProp;
|
||||
package club.joylink.rtss.manage.configuration.configProp;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import lombok.Getter;
|
|
@ -1,4 +1,4 @@
|
|||
package club.joylink.rtss.configuration.configProp;
|
||||
package club.joylink.rtss.manage.configuration.configProp;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
|
@ -1,4 +1,4 @@
|
|||
package club.joylink.rtss.configuration.configProp;
|
||||
package club.joylink.rtss.manage.configuration.configProp;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
|
@ -1,4 +1,4 @@
|
|||
package club.joylink.rtss.configuration.configProp;
|
||||
package club.joylink.rtss.manage.configuration.configProp;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
|
@ -1,4 +1,4 @@
|
|||
package club.joylink.rtss.configuration.configProp;
|
||||
package club.joylink.rtss.manage.configuration.configProp;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
|
@ -1,4 +1,4 @@
|
|||
package club.joylink.rtss.constants;
|
||||
package club.joylink.rtss.manage.constants;
|
||||
|
||||
public interface BusinessConsts {
|
||||
|
||||
|
@ -8,13 +8,11 @@ public interface BusinessConsts {
|
|||
* 状态 1-启用/有效
|
||||
*/
|
||||
String STATUS_USE = "1";
|
||||
int STATUS_USE_INT = 1;
|
||||
|
||||
/**
|
||||
* 状态 0-禁用/无效
|
||||
*/
|
||||
String STATUS_NOT_USE = "0";
|
||||
int STATUS_NOT_USE_INT = 0;
|
||||
|
||||
/**
|
||||
* 验证码有效期: 单位 分钟
|
|
@ -1,6 +1,6 @@
|
|||
package club.joylink.rtss.constants;
|
||||
package club.joylink.rtss.manage.constants;
|
||||
|
||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||
import club.joylink.rtss.manage.exception.BusinessExceptionAssertEnum;
|
||||
import lombok.Getter;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
package club.joylink.rtss.manage.constants;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
public interface Depart{
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package club.joylink.rtss.constants;
|
||||
package club.joylink.rtss.manage.constants;
|
||||
|
||||
/**
|
||||
* 方向标签枚举
|
|
@ -1,4 +1,4 @@
|
|||
package club.joylink.rtss.constants;
|
||||
package club.joylink.rtss.manage.constants;
|
||||
|
||||
import lombok.Getter;
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
package club.joylink.rtss.manage.constants;
|
||||
|
||||
public enum IscsSystem {
|
||||
PA,
|
||||
PIS,
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package club.joylink.rtss.constants;
|
||||
package club.joylink.rtss.manage.constants;
|
||||
|
||||
import lombok.Getter;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package club.joylink.rtss.constants;
|
||||
package club.joylink.rtss.manage.constants;
|
||||
|
||||
import lombok.Getter;
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package club.joylink.rtss.manage.constants;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public enum MapSystemType {
|
||||
|
||||
Lesson,
|
||||
Exam,
|
||||
Simulation,
|
||||
Plan,
|
||||
;
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package club.joylink.rtss.constants;
|
||||
package club.joylink.rtss.manage.constants;
|
||||
|
||||
import lombok.Getter;
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package club.joylink.rtss.manage.constants;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
@Getter
|
||||
public enum PermissionTypeEnum {
|
||||
|
||||
Lesson("01", "课程"),
|
||||
Exam("02", "考试"),
|
||||
Simulation("03", "仿真"),
|
||||
Teaching_Package("04", "实训平台教学权限包"),
|
||||
;
|
||||
|
||||
private String code;
|
||||
|
||||
private String msg;
|
||||
|
||||
PermissionTypeEnum(String code, String msg) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public static PermissionTypeEnum getPermissionTypeByCode(String code) {
|
||||
for (PermissionTypeEnum value : PermissionTypeEnum.values()) {
|
||||
if (Objects.equals(code, value.code)) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
throw new RuntimeException(String.format("code为[%s]的PermissionTypeEnum不存在", code));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,78 @@
|
|||
package club.joylink.rtss.manage.constants;
|
||||
|
||||
/**
|
||||
* 项目
|
||||
*/
|
||||
public enum Project {
|
||||
/** 自己项目 */
|
||||
DEFAULT,
|
||||
/** 无logo */
|
||||
NOLOGO,
|
||||
/** 西铁院项目 */
|
||||
XTY,
|
||||
/** 南铁院项目 */
|
||||
NTY,
|
||||
/** 南铁院云端定制项目 */
|
||||
NTYC,
|
||||
/** 南铁院本地定制项目 */
|
||||
NTYL,
|
||||
/** 西安地铁运营公司项目 */
|
||||
XADT,
|
||||
/** 苏州电子信息学院项目 */
|
||||
SDY,
|
||||
/** 贵州装备职业学院项目 */
|
||||
GZB,
|
||||
/** 哈尔滨项目 */
|
||||
HEB,
|
||||
/** 行调竞赛实训系统 */
|
||||
DRTS,
|
||||
/** 北京交通大学项目(客流量科研) */
|
||||
BJD,
|
||||
/** 成都工业职业技术学院 */
|
||||
CGY,
|
||||
/** 微机联锁 */
|
||||
WJLS,
|
||||
/** 郑州共赢 */
|
||||
ZZWW,
|
||||
/** 郑州共赢测试 */
|
||||
ZZWWTEST,
|
||||
/** 中航锐创(第三方教学合作,第三方登录) */
|
||||
RICHOR,
|
||||
/** 中航锐创(义乌现场)(实训室,连设备,设备登录) */
|
||||
RICHOR_JOINT,
|
||||
/** 中航-上饶沙盘 */
|
||||
SR_SANDBOX,
|
||||
/** 中航-江西工贸 */
|
||||
JXGM,
|
||||
/** 扬工院 */
|
||||
RICHOR_YGY,
|
||||
/** 苏安院 */
|
||||
SAY,
|
||||
/** 测试 */
|
||||
TEST,
|
||||
/** 中航-云南红河财经IBP盘项目 */
|
||||
RICHOR_HHCJ,
|
||||
/** 众合-陕铁院 */
|
||||
UNITTEC_STY,
|
||||
/** 通用教学 */
|
||||
TEACHING,
|
||||
/** 长兴技术学院 */
|
||||
RICHOR_CXJS,
|
||||
/** 哈盈达-铁路 */
|
||||
HYD_RAILWAY,
|
||||
/** 武汉8号线 */
|
||||
// WH,
|
||||
/** 武汉8号线 应急调度指挥系统*/
|
||||
YJDDZH,
|
||||
/** 京津冀职业技能发展联盟 */
|
||||
JJJLM,
|
||||
;
|
||||
|
||||
public static boolean isDefault(Project project) {
|
||||
return DEFAULT.equals(project);
|
||||
}
|
||||
|
||||
public static boolean isLoginWithCreateSimulation(Project project) {
|
||||
return Project.DRTS.equals(project) || Project.BJD.equals(project) || Project.WJLS.equals(project);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,90 @@
|
|||
package club.joylink.rtss.manage.constants;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 项目设备类型
|
||||
*/
|
||||
@Getter
|
||||
public enum ProjectDeviceType {
|
||||
|
||||
/* -----------plc device start---------- */
|
||||
/** 区段 */
|
||||
SECTION,
|
||||
/** 道岔 */
|
||||
SWITCH,
|
||||
/** 信号机 */
|
||||
SIGNAL,
|
||||
/** 屏蔽门控制柜 */
|
||||
PSC,
|
||||
/** 屏蔽门 */
|
||||
PSD,
|
||||
/** 端头控制盒(屏蔽门控制盒) */
|
||||
PSL,
|
||||
/** IBP盘 */
|
||||
IBP,
|
||||
/** PLC网关 */
|
||||
PLC_GATEWAY,
|
||||
/** 单元控制器 */
|
||||
DCU,
|
||||
/** UDP下位机 */
|
||||
UDP_LOW,
|
||||
/** UDP客户端 */
|
||||
UDP_CLIENT,
|
||||
/** 列车 */
|
||||
TRAIN,
|
||||
/* -----------plc device end---------- */
|
||||
|
||||
/* -----------client device start---------- */
|
||||
/** 教员机(instructor machine) */
|
||||
IM,
|
||||
/** 调度工作站(control workstation) */
|
||||
CW,
|
||||
/** 现地工作站(local workstation) */
|
||||
LW,
|
||||
/** 联锁工作站(interlock workstation) */
|
||||
ILW,
|
||||
/** 虚拟综合后备盘(Integrated Back-Up Panel) */
|
||||
VR_IBP,
|
||||
/** 大屏工作站(large screen workstation) */
|
||||
LSW,
|
||||
/** 列车驾驶终端 */
|
||||
DRIVE,
|
||||
/** 虚拟站台屏蔽门终端 */
|
||||
VR_PSD,
|
||||
/** 现地综合监控 */
|
||||
ISCS_LW,
|
||||
/** 中心综合监控 */
|
||||
ISCS_CW,
|
||||
/** 车辆段终端 */
|
||||
DEPOT,
|
||||
/** 虚拟CCTV */
|
||||
CCTV,
|
||||
/** 虚拟电子沙盘 */
|
||||
SANDBOX,
|
||||
/** 派班工作站 */
|
||||
SCHEDULING,
|
||||
|
||||
PIS_STAND,
|
||||
PIS_TRAIN,
|
||||
/* -----------client device end---------- */
|
||||
;
|
||||
|
||||
public static List<ProjectDeviceType> PlcDeviceList() {
|
||||
return Arrays.asList(PLC_GATEWAY,
|
||||
PSC,
|
||||
PSD,
|
||||
PSL,
|
||||
IBP,
|
||||
SECTION,
|
||||
SWITCH,
|
||||
SIGNAL,
|
||||
DCU,
|
||||
UDP_LOW,
|
||||
UDP_CLIENT,
|
||||
TRAIN);
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package club.joylink.rtss.constants;
|
||||
package club.joylink.rtss.manage.constants;
|
||||
|
||||
/**
|
||||
* 项目
|
|
@ -1,4 +1,4 @@
|
|||
package club.joylink.rtss.constants;
|
||||
package club.joylink.rtss.manage.constants;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
|
@ -1,4 +1,4 @@
|
|||
package club.joylink.rtss.constants;
|
||||
package club.joylink.rtss.manage.constants;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
|
@ -1,4 +1,4 @@
|
|||
package club.joylink.rtss.constants;
|
||||
package club.joylink.rtss.manage.constants;
|
||||
|
||||
import lombok.Getter;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package club.joylink.rtss.constants;
|
||||
package club.joylink.rtss.manage.constants;
|
||||
|
||||
import lombok.Getter;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package club.joylink.rtss.constants;
|
||||
package club.joylink.rtss.manage.constants;
|
||||
|
||||
import lombok.Getter;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package club.joylink.rtss.constants;
|
||||
package club.joylink.rtss.manage.constants;
|
||||
|
||||
import lombok.Getter;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package club.joylink.rtss.constants;
|
||||
package club.joylink.rtss.manage.constants;
|
||||
|
||||
import lombok.Getter;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package club.joylink.rtss.constants;
|
||||
package club.joylink.rtss.manage.constants;
|
||||
|
||||
import lombok.Getter;
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
package club.joylink.rtss.manage.constants;
|
||||
|
||||
public interface ServicePath {
|
||||
String MAIN = "https://joylink.club/jlcloud";
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package club.joylink.rtss.manage.constants;
|
||||
|
||||
public enum SortDirection {
|
||||
/**
|
||||
* 正序
|
||||
*/
|
||||
Asc,
|
||||
|
||||
/**
|
||||
* 逆序
|
||||
*/
|
||||
Desc
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
package club.joylink.rtss.constants;
|
||||
package club.joylink.rtss.manage.constants;
|
||||
|
||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||
import club.joylink.rtss.manage.exception.BusinessExceptionAssertEnum;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
|
@ -1,6 +1,6 @@
|
|||
package club.joylink.rtss.constants;
|
||||
package club.joylink.rtss.manage.constants;
|
||||
|
||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||
import club.joylink.rtss.manage.exception.BusinessExceptionAssertEnum;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Objects;
|
|
@ -1,4 +1,4 @@
|
|||
package club.joylink.rtss.constants;
|
||||
package club.joylink.rtss.manage.constants;
|
||||
|
||||
import lombok.Getter;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package club.joylink.rtss.constants;
|
||||
package club.joylink.rtss.manage.constants;
|
||||
|
||||
import lombok.Getter;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package club.joylink.rtss.constants;
|
||||
package club.joylink.rtss.manage.constants;
|
||||
|
||||
import lombok.Getter;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package club.joylink.rtss.constants;
|
||||
package club.joylink.rtss.manage.constants;
|
||||
|
||||
public interface WxConstants {
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
package club.joylink.rtss.controller;
|
||||
package club.joylink.rtss.manage.controller;
|
||||
|
||||
import club.joylink.rtss.services.CgyRecordService;
|
||||
import club.joylink.rtss.vo.client.CgyRecordVO;
|
||||
import club.joylink.rtss.manage.services.CgyRecordService;
|
||||
import club.joylink.rtss.manage.vo.client.CgyRecordVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
|
@ -1,15 +1,15 @@
|
|||
package club.joylink.rtss.controller;
|
||||
package club.joylink.rtss.manage.controller;
|
||||
|
||||
import club.joylink.rtss.constants.RoleEnum;
|
||||
import club.joylink.rtss.controller.advice.AuthenticateInterceptor;
|
||||
import club.joylink.rtss.controller.advice.Role;
|
||||
import club.joylink.rtss.services.org.*;
|
||||
import club.joylink.rtss.vo.AccountVO;
|
||||
import club.joylink.rtss.vo.LoginUserInfoVO;
|
||||
import club.joylink.rtss.vo.client.LessonVO;
|
||||
import club.joylink.rtss.vo.client.Node;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.client.org.*;
|
||||
import club.joylink.rtss.manage.constants.RoleEnum;
|
||||
import club.joylink.rtss.manage.controller.advice.AuthenticateInterceptor;
|
||||
import club.joylink.rtss.manage.controller.advice.Role;
|
||||
import club.joylink.rtss.manage.services.org.*;
|
||||
import club.joylink.rtss.manage.vo.AccountVO;
|
||||
import club.joylink.rtss.manage.vo.LoginUserInfoVO;
|
||||
import club.joylink.rtss.manage.vo.client.LessonVO;
|
||||
import club.joylink.rtss.manage.vo.client.Node;
|
||||
import club.joylink.rtss.manage.vo.client.PageVO;
|
||||
import club.joylink.rtss.manage.vo.client.org.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
@ -18,7 +18,7 @@ import java.util.List;
|
|||
|
||||
/**
|
||||
* 组织成员管理接口
|
||||
* 这些接口逐渐废弃,新接口加在这里{@link club.joylink.rtss.controller.org.OrgController}
|
||||
* 这些接口逐渐废弃,新接口加在这里{@link club.joylink.rtss.manage.controller.org.OrgController}
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/company")
|
||||
|
@ -281,14 +281,14 @@ public class CompanyController {
|
|||
return iOrgScoringRuleService.getOrgScoringRuleDetails(ruleId);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 获取评价规则的评分结果
|
||||
// */
|
||||
// @GetMapping("/orgScoringRule/score/{orgId}/{schoolYear}/{term}")
|
||||
// public List<OrgScoringResultVO> score(@PathVariable Long orgId, @PathVariable String schoolYear,
|
||||
// @PathVariable Integer term, @RequestAttribute LoginUserInfoVO loginInfo) {
|
||||
// return iOrgScoringRuleService.score(orgId, schoolYear, term, loginInfo);
|
||||
// }
|
||||
/**
|
||||
* 获取评价规则的评分结果
|
||||
*/
|
||||
@GetMapping("/orgScoringRule/score/{orgId}/{schoolYear}/{term}")
|
||||
public List<OrgScoringResultVO> score(@PathVariable Long orgId, @PathVariable String schoolYear,
|
||||
@PathVariable Integer term, @RequestAttribute LoginUserInfoVO loginInfo) {
|
||||
return iOrgScoringRuleService.score(orgId, schoolYear, term, loginInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除评分规则
|
|
@ -0,0 +1,105 @@
|
|||
package club.joylink.rtss.manage.controller;
|
||||
|
||||
import club.joylink.rtss.manage.constants.Project;
|
||||
import club.joylink.rtss.manage.controller.org.OrgProjectController;
|
||||
import club.joylink.rtss.manage.controller.paper.PaperCompositionController;
|
||||
import club.joylink.rtss.manage.controller.publish.MapFunctionController;
|
||||
import club.joylink.rtss.manage.controller.user.UserController;
|
||||
import club.joylink.rtss.manage.dao.MapDataDAO;
|
||||
import club.joylink.rtss.manage.dao.MapInfoDAO;
|
||||
import club.joylink.rtss.manage.dao.OrgDAO;
|
||||
import club.joylink.rtss.manage.entity.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 2023.01.10版本处理接口数据
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/dataHandle")
|
||||
public class DataHandleController {
|
||||
@Autowired
|
||||
private MapInfoDAO mapInfoDAO;
|
||||
@Autowired
|
||||
private MapDataDAO mapDataDAO;
|
||||
@Autowired
|
||||
private OrgProjectController orgProjectController;
|
||||
@Autowired
|
||||
private MapFunctionController mapFunctionController;
|
||||
@Autowired
|
||||
private PaperCompositionController paperCompositionController;
|
||||
@Autowired
|
||||
private UserController userController;
|
||||
@Autowired
|
||||
private OrgDAO orgDAO;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@PostMapping
|
||||
public List<String> handle(HttpServletResponse response) {
|
||||
correctMapVersion();
|
||||
|
||||
confirmDefaultOrgExist();
|
||||
|
||||
orgProjectController.oldDataHandle();
|
||||
|
||||
List<String> msgList = new ArrayList<>(mapFunctionController.oldDataHandle());
|
||||
|
||||
msgList.addAll(paperCompositionController.oldDataHandle());
|
||||
|
||||
msgList.addAll(userController.sync());
|
||||
return msgList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 纠正地图信息表的版本字段,使用地图数据的最后一个版本
|
||||
*/
|
||||
private void correctMapVersion() {
|
||||
MapInfoExample mapInfoExample = new MapInfoExample();
|
||||
mapInfoExample.createCriteria().andStatusEqualTo("1");
|
||||
List<MapInfo> onlineMaps = mapInfoDAO.selectByExample(mapInfoExample);
|
||||
Map<Long, MapInfo> onlineMapMap = onlineMaps.stream().collect(Collectors.toMap(MapInfo::getId, Function.identity()));
|
||||
MapDataExample mapDataExample = new MapDataExample();
|
||||
mapDataExample.createCriteria().andMapIdIn(new ArrayList<>(onlineMapMap.keySet()));
|
||||
|
||||
List<MapData> onlineMapDataList = mapDataDAO.selectByExample(mapDataExample);
|
||||
onlineMapDataList.stream()
|
||||
.collect(Collectors.toMap(MapData::getMapId, MapData::getVersion, (d1, d2) -> {
|
||||
float v1 = Float.parseFloat(d1);
|
||||
float v2 = Float.parseFloat(d2);
|
||||
return v1 > v2 ? d1 : d2;
|
||||
})).forEach((mapId, version) -> {
|
||||
MapInfo mapInfo = onlineMapMap.get(mapId);
|
||||
mapInfo.setVersion(version);
|
||||
mapInfoDAO.updateByPrimaryKey(mapInfo);
|
||||
});
|
||||
}
|
||||
|
||||
private void confirmDefaultOrgExist() {
|
||||
OrgExample orgExample = new OrgExample();
|
||||
orgExample.createCriteria().andNameEqualTo("默认组织");
|
||||
if (orgDAO.countByExample(orgExample) != 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
Org org = new Org();
|
||||
org.setName("默认组织");
|
||||
org.setProjectCode(Project.DEFAULT.name());
|
||||
org.setStatus("1");
|
||||
org.setCreateTime(LocalDateTime.now());
|
||||
org.setCreatorId(1L);
|
||||
orgDAO.insert(org);
|
||||
org.setRootId(org.getId());
|
||||
orgDAO.updateByPrimaryKey(org);
|
||||
}
|
||||
}
|
|
@ -1,10 +1,10 @@
|
|||
package club.joylink.rtss.controller;
|
||||
package club.joylink.rtss.manage.controller;
|
||||
|
||||
import club.joylink.rtss.services.file.IFileManagerService;
|
||||
import club.joylink.rtss.vo.AccountVO;
|
||||
import club.joylink.rtss.vo.client.file.FileBindingVO;
|
||||
import club.joylink.rtss.vo.client.file.FileQueryVO;
|
||||
import club.joylink.rtss.vo.client.file.FileVO;
|
||||
import club.joylink.rtss.manage.services.file.IFileManagerService;
|
||||
import club.joylink.rtss.manage.vo.AccountVO;
|
||||
import club.joylink.rtss.manage.vo.client.file.FileBindingVO;
|
||||
import club.joylink.rtss.manage.vo.client.file.FileQueryVO;
|
||||
import club.joylink.rtss.manage.vo.client.file.FileVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
|
@ -1,15 +1,15 @@
|
|||
package club.joylink.rtss.controller;
|
||||
package club.joylink.rtss.manage.controller;
|
||||
|
||||
import club.joylink.rtss.services.ILearnService;
|
||||
import club.joylink.rtss.vo.AccountVO;
|
||||
import club.joylink.rtss.vo.client.PageQueryVO;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.client.learn.*;
|
||||
import club.joylink.rtss.vo.client.post.LearnMessageCreateVO;
|
||||
import club.joylink.rtss.vo.client.post.LearnMessagePagedQueryVO;
|
||||
import club.joylink.rtss.vo.client.post.LearnMessageVO;
|
||||
import club.joylink.rtss.vo.client.post.LearnPostPagedQueryVO;
|
||||
import club.joylink.rtss.vo.client.validGroup.LearnCommentCreateCheck;
|
||||
import club.joylink.rtss.manage.services.ILearnService;
|
||||
import club.joylink.rtss.manage.vo.AccountVO;
|
||||
import club.joylink.rtss.manage.vo.client.PageQueryVO;
|
||||
import club.joylink.rtss.manage.vo.client.PageVO;
|
||||
import club.joylink.rtss.manage.vo.client.learn.*;
|
||||
import club.joylink.rtss.manage.vo.client.post.LearnMessageCreateVO;
|
||||
import club.joylink.rtss.manage.vo.client.post.LearnMessagePagedQueryVO;
|
||||
import club.joylink.rtss.manage.vo.client.post.LearnMessageVO;
|
||||
import club.joylink.rtss.manage.vo.client.post.LearnPostPagedQueryVO;
|
||||
import club.joylink.rtss.manage.vo.client.validGroup.LearnCommentCreateCheck;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue