Compare commits
1 Commits
master
...
sr-special
Author | SHA1 | Date |
---|---|---|
thesai | 10d2c3011e |
|
@ -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 +0,0 @@
|
|||
[submodule "rt-sim-training-message"]
|
||||
path = rt-sim-training-message
|
||||
url = http://120.46.212.6:3000/joylink/rt-sim-training-message.git
|
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
|
|
@ -1,10 +0,0 @@
|
|||
FROM openjdk:11
|
||||
|
||||
ADD target/rtss-0.0.1-SNAPSHOT.jar app.jar
|
||||
|
||||
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=local-test /app.jar
|
|
@ -1,7 +0,0 @@
|
|||
# CI、CD说明
|
||||
- 分支主要为develop,local-test,master
|
||||
- 本地233服务器部署方式为push到local-test分支即可触发
|
||||
- 公网服务器发布方式:
|
||||
1. push到master(虽然可以用别的分支,但不建议)
|
||||
2. 在版本发布处发布新版本,触发构建docker镜像
|
||||
3. 待docker镜像构建完成后,点击Actions中CD_pub_deploy.yaml,进入第一个任务,点击重新运行所有任务,进行服务发布
|
Binary file not shown.
Binary file not shown.
|
@ -161,7 +161,7 @@ fi
|
|||
|
||||
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
|
||||
|
||||
# traverses directory structure from mean work directory to filesystem root
|
||||
# traverses directory structure from process work directory to filesystem root
|
||||
# first directory with .mvn subdirectory is considered project base directory
|
||||
find_maven_basedir() {
|
||||
|
||||
|
|
396
pom.xml
396
pom.xml
|
@ -1,252 +1,178 @@
|
|||
<?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>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.3.5.RELEASE</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
<groupId>club.joylink</groupId>
|
||||
<artifactId>rtss</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<name>rtss</name>
|
||||
<description>Rail transit simulation system</description>
|
||||
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>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.3.5.RELEASE</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
<groupId>club.joylink</groupId>
|
||||
<artifactId>rtss</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<name>rtss</name>
|
||||
<description> Rail transit simulation system</description>
|
||||
|
||||
<properties>
|
||||
<java.version>11</java.version>
|
||||
<pagehelper.version>4.1.1</pagehelper.version>
|
||||
</properties>
|
||||
<properties>
|
||||
<java.version>11</java.version>
|
||||
<pagehelper.version>4.1.1</pagehelper.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<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>org.mybatis.spring.boot</groupId>
|
||||
<artifactId>mybatis-spring-boot-starter</artifactId>
|
||||
<version>2.1.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.pagehelper</groupId>
|
||||
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
||||
<version>1.3.0</version>
|
||||
</dependency>
|
||||
<dependencies>
|
||||
<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>org.mybatis.spring.boot</groupId>
|
||||
<artifactId>mybatis-spring-boot-starter</artifactId>
|
||||
<version>2.1.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.pagehelper</groupId>
|
||||
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
||||
<version>1.3.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- javax.validation -->
|
||||
<dependency>
|
||||
<groupId>javax.validation</groupId>
|
||||
<artifactId>validation-api</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>
|
||||
<!--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>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>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.junit.vintage</groupId>
|
||||
<artifactId>junit-vintage-engine</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.wechatpay-apiv3</groupId>
|
||||
<artifactId>wechatpay-apache-httpclient</artifactId>
|
||||
<version>0.2.1</version>
|
||||
</dependency>
|
||||
<!-- 硬件检测依赖 -->
|
||||
<dependency>
|
||||
<groupId>com.github.oshi</groupId>
|
||||
<artifactId>oshi-core-java11</artifactId>
|
||||
<version>5.7.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.junit.vintage</groupId>
|
||||
<artifactId>junit-vintage-engine</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.wechatpay-apiv3</groupId>
|
||||
<artifactId>wechatpay-apache-httpclient</artifactId>
|
||||
<version>0.2.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.huawei.sis</groupId>-->
|
||||
<!-- <artifactId>huaweicloud-java-sdk-sis</artifactId>-->
|
||||
<!-- <version>1.3.2</version>-->
|
||||
<!-- <scope>system</scope>-->
|
||||
<!-- <systemPath>${project.basedir}/libs/huaweicloud-java-sdk-sis-1.3.2.jar</systemPath>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>31.1-jre</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.huawei.sis</groupId>
|
||||
<artifactId>huaweicloud-java-sdk-sis</artifactId>
|
||||
<version>1.3.2</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/libs/huaweicloud-java-sdk-sis-1.3.2.jar</systemPath>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.minio</groupId>
|
||||
<artifactId>minio</artifactId>
|
||||
<version>8.4.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.huawei.apigateway</groupId>
|
||||
<artifactId>java-sdk-core</artifactId>
|
||||
<version>3.0.12</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/libs/java-sdk-core-3.0.12.jar</systemPath>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
<version>4.9.0</version>
|
||||
</dependency>
|
||||
<!-- <dependency>
|
||||
<groupId>org.springframework.retry</groupId>
|
||||
<artifactId>spring-retry</artifactId>
|
||||
</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.23.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.hubspot.jackson</groupId>
|
||||
<artifactId>jackson-datatype-protobuf</artifactId>
|
||||
<version>0.9.12</version>
|
||||
</dependency>
|
||||
<!-- <dependency>
|
||||
<groupId>com.chenlb.mmseg4j</groupId>
|
||||
<artifactId>mmseg4j-core</artifactId>
|
||||
<version>1.10.0</version>
|
||||
</dependency>-->
|
||||
<!-- <dependency>
|
||||
<groupId>org.ansj</groupId>
|
||||
<artifactId>ansj_seg</artifactId>
|
||||
<version>5.1.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.reflections</groupId>
|
||||
<artifactId>reflections</artifactId>
|
||||
<version>0.9.11</version>
|
||||
</dependency>-->
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.12.0</version>
|
||||
</dependency>
|
||||
<!-- <dependency>
|
||||
<groupId>info.debatty</groupId>
|
||||
<artifactId>java-string-similarity</artifactId>
|
||||
<version>2.0.0</version>
|
||||
</dependency>-->
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
<version>3.14.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-text</artifactId>
|
||||
<version>1.10.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>joda-time</groupId>
|
||||
<artifactId>joda-time</artifactId>
|
||||
<version>2.10.3</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<includeSystemScope>true</includeSystemScope>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<includeSystemScope>true</includeSystemScope>
|
||||
</configuration>
|
||||
</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>
|
||||
|
||||
<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>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>aliyun-central</id>
|
||||
<url>https://maven.aliyun.com/repository/central</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>aliyun-snapshots</id>
|
||||
<url>https://maven.aliyun.com/repository/snapshots</url>
|
||||
<releases>
|
||||
<enabled>false</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
</repositories>
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>aliyun-central</id>
|
||||
<url>https://maven.aliyun.com/repository/central</url>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
</project>
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
Subproject commit 5dd7fdb3d568c829356fa59b746b559d17da49b8
|
|
@ -0,0 +1,19 @@
|
|||
|
||||
CREATE TABLE `docu_document_draft` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT,
|
||||
`title` varchar(50) NOT NULL COMMENT '标题',
|
||||
`content` longtext NOT NULL COMMENT '内容',
|
||||
`create_user_id` bigint NOT NULL COMMENT '创建用户',
|
||||
`create_time` datetime NOT NULL COMMENT '创建时间',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE `docu_document` (
|
||||
`id` bigint NOT NULL AUTO_INCREMENT,
|
||||
`title` varchar(50) NOT NULL COMMENT '标题',
|
||||
`content` longtext NOT NULL COMMENT '内容',
|
||||
`publish_user_id` bigint NOT NULL COMMENT '发布用户',
|
||||
`publish_time` datetime NOT NULL COMMENT '发布时间',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
CREATE TABLE `file` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`file_name` varchar(255) NOT NULL,
|
||||
`file_path` varchar(255) NOT NULL,
|
||||
`file_type` varchar(255) NOT NULL,
|
||||
`create_time` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP,
|
||||
`creator` bigint(20) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
|
||||
|
||||
CREATE TABLE `file_binding` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`file_id` bigint(20) NOT NULL,
|
||||
`map_id` bigint(20) NOT NULL,
|
||||
`device_types` varchar(255) DEFAULT NULL,
|
||||
`device_ids` varchar(10000) DEFAULT NULL,
|
||||
`creator` bigint(20) NOT NULL,
|
||||
`create_time` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
|
|
@ -0,0 +1,5 @@
|
|||
ALTER TABLE `permission_distribute`
|
||||
ADD COLUMN `creator_id` bigint NULL AFTER `from_user_permission_id`;
|
||||
|
||||
alter table user_permission
|
||||
add create_time datetime default current_timestamp not null;
|
|
@ -0,0 +1,3 @@
|
|||
ALTER TABLE `draft_map_parking_time`
|
||||
CHANGE COLUMN `section_parking_time` `section_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '区段code' AFTER `station_code`,
|
||||
ADD COLUMN `parking_time` int NOT NULL COMMENT '停站时间' AFTER `section_code`;
|
|
@ -0,0 +1,3 @@
|
|||
ALTER TABLE `run_plan_load`
|
||||
ADD COLUMN `load_rule` varchar(32) NULL DEFAULT 'EVERY_DAY' AFTER `load_time`;
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
ALTER TABLE `sys_user` RENAME `sys_account`;
|
||||
|
||||
ALTER TABLE `sys_user_login` RENAME `sys_account_login`;
|
||||
|
||||
ALTER TABLE `sys_account`
|
||||
ADD COLUMN `type` varchar(2) NOT NULL DEFAULT 1 COMMENT '账号类型:1-个人账户;2-企业账户' AFTER `account`;
|
||||
|
||||
ALTER TABLE `sys_account`
|
||||
DROP COLUMN `offline`;
|
||||
|
||||
ALTER TABLE `sys_account`
|
||||
MODIFY COLUMN `account` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '账户' AFTER `id`;
|
||||
|
||||
ALTER TABLE `sys_account`
|
||||
MODIFY COLUMN `type` varchar(2) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '1' COMMENT '账号类型:1-个人账户;2-企业账户;3-企业账户下子账户' AFTER `account`;
|
||||
|
||||
ALTER TABLE `sys_account`
|
||||
ADD COLUMN `parent_account` varchar(32) NULL COMMENT '父企业账户account,当为企业子账户时不能为空' AFTER `account`;
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
ALTER TABLE `user_simulation_stats`
|
||||
ADD COLUMN `end_time` datetime NOT NULL DEFAULT '1970-01-01 01:01:01' ON UPDATE CURRENT_TIMESTAMP AFTER `fake`;
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
ALTER TABLE `map_data`
|
||||
ADD COLUMN `note` varchar(255) NULL COMMENT '备注' AFTER `version`;
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
SET FOREIGN_KEY_CHECKS=0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for model_2d_draft
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `model_2d_draft`;
|
||||
CREATE TABLE `model_2d_draft` (
|
||||
`id` bigint(20) NOT NULL,
|
||||
`code` varchar(32) NOT NULL COMMENT '编号',
|
||||
`name` varchar(32) NOT NULL COMMENT '模型名称',
|
||||
`json_data` mediumtext COMMENT '模型数据',
|
||||
`create_user_id` bigint(20) NOT NULL,
|
||||
`create_time` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP,
|
||||
`update_user_id` bigint(20) DEFAULT NULL,
|
||||
`update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for model_2d
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `model_2d`;
|
||||
CREATE TABLE `model_2d` (
|
||||
`id` bigint(20) NOT NULL,
|
||||
`code` varchar(32) NOT NULL COMMENT '编号(唯一)',
|
||||
`name` varchar(32) NOT NULL COMMENT '模型名称',
|
||||
`json_data` mediumtext NOT NULL COMMENT '模型数据',
|
||||
`version` int(11) NOT NULL COMMENT '版本',
|
||||
`state` varchar(2) NOT NULL COMMENT '状态',
|
||||
`create_user_id` bigint(20) NOT NULL,
|
||||
`create_time` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP,
|
||||
`update_user_id` bigint(20) DEFAULT NULL,
|
||||
`update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
@ -0,0 +1,21 @@
|
|||
ALTER TABLE `user_simulation_stats`
|
||||
DROP COLUMN `map_prd_id`,
|
||||
MODIFY COLUMN `role` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户角色' AFTER `prd_type`,
|
||||
MODIFY COLUMN `end_time` datetime NOT NULL DEFAULT now() ON UPDATE CURRENT_TIMESTAMP COMMENT '结束时间' AFTER `role`,
|
||||
MODIFY COLUMN `duration` int(11) NOT NULL COMMENT '有效时长' AFTER `end_time`,
|
||||
ADD COLUMN `start_time` datetime NOT NULL DEFAULT now() ON UPDATE CURRENT_TIMESTAMP COMMENT '开始时间' AFTER `role`;
|
||||
|
||||
SET FOREIGN_KEY_CHECKS=0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for sys_third_account_config
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `sys_third_account_config`;
|
||||
CREATE TABLE `sys_third_account_config` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`account` varchar(32) NOT NULL COMMENT '第三方账户账号',
|
||||
`interface_config` text COMMENT '接口信息配置',
|
||||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
|
|
@ -0,0 +1,14 @@
|
|||
SET FOREIGN_KEY_CHECKS=0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for circuitry_draft
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `circuitry_draft`;
|
||||
CREATE TABLE `circuitry_draft` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(32) NOT NULL COMMENT '名称',
|
||||
`draw_data` mediumtext COMMENT '绘图数据',
|
||||
`create_user_id` bigint(20) NOT NULL,
|
||||
`create_time` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
|
|
@ -0,0 +1,10 @@
|
|||
CREATE TABLE `draft_map_route_overrun` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||
`map_id` bigint(20) NOT NULL,
|
||||
`code` varchar(255) NOT NULL,
|
||||
`section_code` varchar(255) NOT NULL,
|
||||
`ci_switch` varchar(255) DEFAULT NULL,
|
||||
`switch_code` varchar(255) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
|
||||
|
|
@ -3,18 +3,15 @@ package club.joylink.rtss;
|
|||
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
|
||||
@EnableScheduling
|
||||
@EnableCaching
|
||||
@MapperScan(basePackages = {"club.joylink.rtss.dao","club.joylink.rtss.iscs.dao"})
|
||||
//@EnableRetry
|
||||
@MapperScan(basePackages= {"club.joylink.rtss.dao"})
|
||||
public class RtssApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(RtssApplication.class, args);
|
||||
}
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(RtssApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,41 +0,0 @@
|
|||
package club.joylink.rtss.aop;
|
||||
|
||||
import club.joylink.rtss.services.cgy.CgyStatsService;
|
||||
import club.joylink.rtss.simulation.cbtc.SimulationService;
|
||||
import club.joylink.rtss.vo.client.cgy.CgyThirdPartyLoginInfoVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.aspectj.lang.JoinPoint;
|
||||
import org.aspectj.lang.annotation.AfterReturning;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
@Aspect
|
||||
@Slf4j
|
||||
@Component
|
||||
public class CgyViewAspect {
|
||||
|
||||
private CgyStatsService cgyStatsService;
|
||||
private RestTemplate restTemplate;
|
||||
private SimulationService simulationService;
|
||||
|
||||
|
||||
@Autowired
|
||||
public CgyViewAspect(CgyStatsService cgyStatsService, RestTemplate restTemplate,
|
||||
SimulationService simulationService) {
|
||||
this.cgyStatsService = cgyStatsService;
|
||||
this.restTemplate = restTemplate;
|
||||
this.simulationService = simulationService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 成工院第三方登录接口被调用后,加一个浏览量,并同步给虚仿平台
|
||||
*/
|
||||
@AfterReturning(value = "execution(public * club.joylink.rtss.controller.LoginController.cgyThirdPartyLogin(..))")
|
||||
public void addViewCount(JoinPoint joinPoint) {
|
||||
Object arg = joinPoint.getArgs()[0];
|
||||
CgyThirdPartyLoginInfoVO loginInfoVO = (CgyThirdPartyLoginInfoVO) arg;
|
||||
cgyStatsService.updateView(loginInfoVO.getAppId());
|
||||
}
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
package club.joylink.rtss.bo.cgy;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* 成工院虚仿平台对接统计数据
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@RequiredArgsConstructor
|
||||
public class CgyStatsBO {
|
||||
|
||||
private final String appId;
|
||||
private final String appSecret;
|
||||
private final Long FunctionId;
|
||||
//统计数据是否发生变化
|
||||
private AtomicBoolean change;
|
||||
//浏览量
|
||||
private AtomicLong view;
|
||||
//实训人次
|
||||
private AtomicLong visitor;
|
||||
//实训人数
|
||||
private final Set<Long> userSet = new HashSet<>();
|
||||
//实训时长/s
|
||||
private AtomicLong duration;
|
||||
}
|
|
@ -1,101 +0,0 @@
|
|||
package club.joylink.rtss.bo.race;
|
||||
|
||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||
import club.joylink.rtss.vo.race.RaceApplication;
|
||||
import club.joylink.rtss.vo.race.RaceApplication.ResultNode;
|
||||
import club.joylink.rtss.vo.race.RaceApplication.ResultNode.Builder;
|
||||
import club.joylink.rtss.vo.race.RaceTask;
|
||||
import club.joylink.rtss.vo.race.RaceTask.RacePaperSingleModuleGroupTask;
|
||||
import club.joylink.rtss.vo.race.RaceTask.RaceTaskChildVO;
|
||||
import club.joylink.rtss.vo.race.RaceTask.RaceTaskChildVO.ChildNodeType;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RaceContent {
|
||||
|
||||
private long userId;
|
||||
private long paperId;
|
||||
private int moduleId;
|
||||
|
||||
/**
|
||||
* 训练使用到的任务树
|
||||
*/
|
||||
private RaceTask.RacePaperSingleModuleGroupTask taskTree;
|
||||
|
||||
/**
|
||||
* 训练结果
|
||||
*/
|
||||
private RaceApplication.RacePracticeResult.Builder result;
|
||||
|
||||
/**
|
||||
* 结果节点映射。仅为了通过ID找节点
|
||||
*/
|
||||
private Map<Long, Builder> resultNodeMap = new HashMap<>();
|
||||
|
||||
public RaceContent(long userId, long paperId, int moduleId,
|
||||
RacePaperSingleModuleGroupTask taskTree) {
|
||||
this.userId = userId;
|
||||
this.paperId = paperId;
|
||||
this.moduleId = moduleId;
|
||||
this.taskTree = taskTree;
|
||||
this.result = RaceApplication.RacePracticeResult.newBuilder();
|
||||
result.setCustomModuleId(taskTree.getCustomModuleId());
|
||||
Builder rootNode = ResultNode.newBuilder();
|
||||
buildResultNodeTree(taskTree.getChildList(), rootNode);
|
||||
result.addAllNode(rootNode.getChildList());
|
||||
// for (RaceTaskChildVO childVO : taskTree.getChildList()) {
|
||||
// Builder nodeBuilder = result.addNodeBuilder();
|
||||
// nodeBuilder.setName(childVO.getName());
|
||||
// nodeBuilder.setType(childVO.getNodeType());
|
||||
// nodeBuilder.setSceneId(childVO.getSceneId());
|
||||
// //构建任务映射
|
||||
// if (ChildNodeType.TASK == childVO.getNodeType()) {
|
||||
// resultNodeMap.put(childVO.getId(), nodeBuilder);
|
||||
// }
|
||||
// //递归
|
||||
// buildResultNodeTree(childVO, nodeBuilder);
|
||||
// }
|
||||
}
|
||||
|
||||
public Builder getResultNode(long taskId) {
|
||||
Builder builder = resultNodeMap.get(taskId);
|
||||
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotNull(builder,
|
||||
String.format("任务[%d]不存在", taskId));
|
||||
return builder;
|
||||
}
|
||||
|
||||
private void buildResultNodeTree(List<RaceTaskChildVO> children, Builder parentNode) {
|
||||
for (RaceTaskChildVO childVO : children) {
|
||||
//构建对应的结果Node
|
||||
Builder nodeBuilder = parentNode.addChildBuilder();
|
||||
nodeBuilder.setName(childVO.getName());
|
||||
nodeBuilder.setType(childVO.getNodeType());
|
||||
nodeBuilder.setSceneId(childVO.getSceneId());
|
||||
//构建任务映射
|
||||
if (ChildNodeType.TASK == childVO.getNodeType()) {
|
||||
resultNodeMap.put(childVO.getId(), nodeBuilder);
|
||||
}
|
||||
//递归
|
||||
buildResultNodeTree(childVO.getChildrenList(), nodeBuilder);
|
||||
}
|
||||
}
|
||||
|
||||
// private void buildResultNodeTree(RaceTaskChildVO children, Builder parentNode) {
|
||||
// for (RaceTaskChildVO childVO : children.getChildrenList()) {
|
||||
// //构建对应的结果Node
|
||||
// Builder nodeBuilder = parentNode.addChildBuilder();
|
||||
// nodeBuilder.setName(childVO.getName());
|
||||
// nodeBuilder.setType(childVO.getNodeType());
|
||||
// nodeBuilder.setSceneId(childVO.getSceneId());
|
||||
// //构建任务映射
|
||||
// if (ChildNodeType.TASK == childVO.getNodeType()) {
|
||||
// resultNodeMap.put(childVO.getId(), nodeBuilder);
|
||||
// }
|
||||
// //递归
|
||||
// buildResultNodeTree(childVO, nodeBuilder);
|
||||
// }
|
||||
// }
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
package club.joylink.rtss.configuration;
|
||||
|
||||
import club.joylink.rtss.entity.project.Project;
|
||||
import org.springframework.cache.interceptor.KeyGenerator;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Arrays;
|
||||
|
||||
@Configuration
|
||||
public class CacheConfig {
|
||||
|
||||
@Bean("projectKeyGenerator")
|
||||
public KeyGenerator projectKeyGenerator() {
|
||||
return new KeyGenerator() {
|
||||
@Override
|
||||
public Object generate(Object o, Method method, Object... objects) {
|
||||
String name = method.getName();
|
||||
String cacheKey = null;
|
||||
if ("queryLoginProjectByCode".equals(name)) {
|
||||
String code = String.valueOf(objects[0]);
|
||||
cacheKey = Project.isDefault(code) ? Project.DEFAULT_PROJECT_CODE : code;
|
||||
} else {
|
||||
cacheKey = Arrays.asList(objects).toString();
|
||||
}
|
||||
return String.format("%s[%s]", name, cacheKey);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
|
@ -6,7 +6,6 @@ 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 com.hubspot.jackson.datatype.protobuf.ProtobufModule;
|
||||
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
@ -18,40 +17,36 @@ 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";
|
||||
|
||||
/**
|
||||
* 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)));
|
||||
|
||||
@Bean
|
||||
public Jackson2ObjectMapperBuilderCustomizer jackson2ObjectMapperBuilderCustomizer() {
|
||||
return builder -> {
|
||||
builder.modulesToInstall(ProtobufModule.class);
|
||||
builder.failOnUnknownProperties(false);
|
||||
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(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)));
|
||||
};
|
||||
|
||||
}
|
||||
builder.serializerByType(LocalTime.class,
|
||||
new LocalTimeSerializer(DateTimeFormatter.ofPattern(TIME_FORMAT)));
|
||||
builder.deserializerByType(LocalTime.class,
|
||||
new LocalTimeDeserializer(DateTimeFormatter.ofPattern(TIME_FORMAT)));
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
package club.joylink.rtss.configuration;
|
||||
|
||||
import io.minio.MinioClient;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
@Configuration
|
||||
public class MinioClientConfig {
|
||||
@Value("${minio.endpoint}")
|
||||
private String endpoint;
|
||||
|
||||
@Value("${minio.accessKey}")
|
||||
private String accessKey;
|
||||
|
||||
@Value("${minio.secretKey}")
|
||||
private String secretKey;
|
||||
|
||||
@Value("${minio.bucket}")
|
||||
private String bucket;
|
||||
|
||||
@Value("${minio.replaceHttps}")
|
||||
private Boolean replaceHttps;
|
||||
|
||||
private MinioClient minioClient;
|
||||
|
||||
@PostConstruct
|
||||
private void init() {
|
||||
this.minioClient = MinioClient.builder().endpoint(endpoint).credentials(accessKey, secretKey).build();
|
||||
}
|
||||
}
|
|
@ -61,33 +61,4 @@ public class TaskExecutorConfiguration {
|
|||
return taskExecutor;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新实训监控
|
||||
*/
|
||||
@Bean("trainingV2Executor")
|
||||
public TaskExecutor trainExecutor(Environment env) {
|
||||
ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor();
|
||||
taskExecutor.setThreadNamePrefix("ns-training-v2-executor-");
|
||||
taskExecutor.setCorePoolSize(2);
|
||||
taskExecutor.setMaxPoolSize(2);
|
||||
taskExecutor.setQueueCapacity(100);
|
||||
taskExecutor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,72 +14,59 @@ import java.util.List;
|
|||
@Configuration
|
||||
public class WebConfig implements WebMvcConfigurer {
|
||||
|
||||
@Autowired
|
||||
private AuthenticateInterceptor authenticateInterceptor;
|
||||
@Autowired
|
||||
private AuthenticateInterceptor authenticateInterceptor;
|
||||
|
||||
@Autowired
|
||||
private LicenseInterceptor licenseInterceptor;
|
||||
@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/**");
|
||||
licenseWhiteList.add("/api/project/viewSetting/simple/all");
|
||||
licenseWhiteList.add("/api/project/viewSetting/project/{project}");
|
||||
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");
|
||||
//modbus测试
|
||||
whiteList.add("/api/test/modbus/writeCoil");
|
||||
@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/**");
|
||||
registry.addInterceptor(authenticateInterceptor).excludePathPatterns(whiteList);
|
||||
}
|
||||
|
||||
registry.addInterceptor(authenticateInterceptor).excludePathPatterns(whiteList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addFormatters(FormatterRegistry registry) {
|
||||
registry.addConverter(new LocalDateConverter());
|
||||
WebMvcConfigurer.super.addFormatters(registry);
|
||||
}
|
||||
@Override
|
||||
public void addFormatters(FormatterRegistry registry) {
|
||||
registry.addConverter(new LocalDateConverter());
|
||||
WebMvcConfigurer.super.addFormatters(registry);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -11,5 +11,4 @@ import org.springframework.stereotype.Component;
|
|||
@Setter
|
||||
public class ModbusTcpConfig {
|
||||
private int port;
|
||||
private int afcTransferPort;
|
||||
}
|
||||
|
|
|
@ -1,14 +1,10 @@
|
|||
package club.joylink.rtss.configuration.configProp;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@Component
|
||||
@ConfigurationProperties(prefix="common")
|
||||
@Getter
|
||||
|
|
|
@ -6,12 +6,19 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
|||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@ConfigurationProperties(prefix = "wechat")
|
||||
@ConfigurationProperties(prefix="wechat")
|
||||
@Getter
|
||||
@Setter
|
||||
public class WeChatConfig {
|
||||
|
||||
private String domainUri;
|
||||
|
||||
private String appId;
|
||||
|
||||
private String appSecret;
|
||||
|
||||
private String wxApiUrl;
|
||||
|
||||
private String wmBaseUrl;
|
||||
|
||||
private String spAppId;
|
||||
|
@ -26,22 +33,65 @@ public class WeChatConfig {
|
|||
|
||||
private String spApp3Secret;
|
||||
|
||||
/** 微信模块基础url */
|
||||
private String wxModuleUrl;
|
||||
|
||||
/**
|
||||
* 微信小程序配置
|
||||
*/
|
||||
private WeChatMiniProgramConfig mini;
|
||||
|
||||
public String getWxApiUrl(String redirect, String state) {
|
||||
return String.format(wxApiUrl, redirect, state);
|
||||
}
|
||||
|
||||
public String getWmLoginUrl(String state) {
|
||||
return String.format(wmBaseUrl, "login", state);
|
||||
}
|
||||
|
||||
public String getWmBindUrl(String state) {
|
||||
return String.format(wmBaseUrl, "bind", state);
|
||||
public String getWmBindUrl(Long userId) {
|
||||
return String.format(wmBaseUrl, "bind", userId);
|
||||
}
|
||||
|
||||
public String getPermissionDistributeUrl(String state) {
|
||||
return String.format(wmBaseUrl, "distribute", state);
|
||||
}
|
||||
|
||||
public String getWmJointRoomUrl(String state) {
|
||||
return String.format(wmBaseUrl, "joint", state);
|
||||
}
|
||||
|
||||
public String getWmSimulationUrl(String state) {
|
||||
return String.format(wmBaseUrl, "simulation", state);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取页面access_token的url
|
||||
* @return
|
||||
*/
|
||||
public String getPageAccessTokenUrl(String code) {
|
||||
return new StringBuilder(this.domainUri)
|
||||
.append("/sns/oauth2/access_token?appid=").append(this.appId)
|
||||
.append("&secret=").append(this.appSecret)
|
||||
.append("&code=").append(code)
|
||||
.append("&grant_type=authorization_code").toString();
|
||||
}
|
||||
|
||||
public String getJsAccessTokenUrl(String jsCode) {
|
||||
return new StringBuilder(this.domainUri)
|
||||
.append("/sns/oauth2/jscode2session?appid=").append(this.spAppId)
|
||||
.append("&secret=").append(this.spAppSecret)
|
||||
.append("&js_code=").append(jsCode)
|
||||
.append("&grant_type=authorization_code").toString();
|
||||
}
|
||||
|
||||
public String getUserInfoUrl(String access_token, String openid) {
|
||||
return new StringBuilder(this.domainUri)
|
||||
.append("/sns/userinfo?access_token=").append(access_token)
|
||||
.append("&openid=").append(openid)
|
||||
.append("&lang=zh_CN").toString();
|
||||
}
|
||||
|
||||
public String getCode2SessionUrl(String wmCode) {
|
||||
return new StringBuilder(this.domainUri)
|
||||
.append("/sns/jscode2session?appid=").append(spAppId)
|
||||
|
@ -66,7 +116,20 @@ public class WeChatConfig {
|
|||
.append("&grant_type=authorization_code").toString();
|
||||
}
|
||||
|
||||
public String getOrgBindCode(String state) {
|
||||
return String.format(wmBaseUrl, "company", state);
|
||||
public String getWxModuleBatchGetUserInfoUrl() {
|
||||
return this.wxModuleUrl + "/api/user/batchget";
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取微信服务模块打标签url
|
||||
* @return
|
||||
*/
|
||||
public String getWxApiTagUrl() {
|
||||
return this.wxModuleUrl+"/api/user/tagging";
|
||||
}
|
||||
|
||||
|
||||
public String getMsgSecCheckUrl() {
|
||||
return this.wxModuleUrl + "/api/wm/msgSecCheck";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
/**
|
||||
* 验证码有效期: 单位 分钟
|
||||
|
@ -819,12 +817,4 @@ public interface BusinessConsts {
|
|||
/** 关闭自动调度 */
|
||||
REGULATION_OFF,
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据库数据逻辑删除标识
|
||||
*/
|
||||
enum DBLogicDelete{
|
||||
NORMAL,
|
||||
DELETE,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@ package club.joylink.rtss.constants;
|
|||
|
||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||
import lombok.Getter;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* 客户端枚举
|
||||
|
@ -33,22 +32,17 @@ public enum Client {
|
|||
|
||||
/**
|
||||
* 根据客户端id查询客户端对象
|
||||
*
|
||||
* @param clientId
|
||||
* @return
|
||||
*/
|
||||
public static Client getByIdAndSecret(String clientId, String secret) {
|
||||
// 传入为空时,设置默认客户端
|
||||
if (StringUtils.isEmpty(clientId) && StringUtils.isEmpty(secret)) {
|
||||
return Client.Joylink;
|
||||
}
|
||||
Client[] values = Client.values();
|
||||
for (Client value : values) {
|
||||
if (value.getId().equals(clientId)
|
||||
&& value.getSecret().equals(secret)) {
|
||||
if(value.getId().equals(clientId)
|
||||
&& value.getSecret().equals(secret)) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
throw BusinessExceptionAssertEnum.INVALID_CLIENT.exception(String.format("未找到id为[%s]的客户端", clientId));
|
||||
throw BusinessExceptionAssertEnum.INVALID_CLIENT.exception(String.format("未找到id为[%s]的客户端",clientId));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
package club.joylink.rtss.constants;
|
||||
|
||||
/**
|
||||
* 方向标签枚举
|
||||
*/
|
||||
public enum DirectionLabelEnum {
|
||||
X,
|
||||
XF,
|
||||
XD,
|
||||
XN,
|
||||
XW,
|
||||
XWN,
|
||||
S,
|
||||
SF,
|
||||
SD,
|
||||
SDN,
|
||||
SH,
|
||||
SHN,
|
||||
NO;
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
package club.joylink.rtss.constants;
|
||||
|
||||
public enum IscsSystem {
|
||||
PA,
|
||||
PIS,
|
||||
}
|
|
@ -4,32 +4,24 @@ import lombok.Getter;
|
|||
|
||||
@Getter
|
||||
public enum MapPrdTypeEnum {
|
||||
LOCAL("01", "ATS现地工作站", "车站"),
|
||||
CENTER("02", "ATS行调工作站", "调度台"),
|
||||
JOINT("03", "综合演练云平台", "综合演练云平台"),
|
||||
DRIVER("04", "司机模拟驾驶系统", null),
|
||||
SCHEDULING("05", "派班工作站", null),
|
||||
ISCS("06", "ISCS工作站", null),
|
||||
BIG_SCREEN("07", "大屏工作站", null),
|
||||
RUN_PLAN_MAKE("08", "运行图编制工作站", null),
|
||||
DEPOT_IL("09", "车辆段联锁工作站", null),
|
||||
YJDDZH("10", "应急调度指挥系统", null),
|
||||
// CTC("10", "CTC工作站")
|
||||
LOCAL("01", "ATS现地工作站"),
|
||||
CENTER("02", "ATS行调工作站"),
|
||||
JOINT("03", "综合演练云平台"),
|
||||
DRIVER("04", "司机模拟驾驶系统"),
|
||||
SCHEDULING("05", "派班工作站"),
|
||||
ISCS("06", "ISCS工作站"),
|
||||
BIG_SCREEN("07", "大屏工作站"),
|
||||
RUN_PLAN_MAKE("08", "运行图编制工作站"),
|
||||
DEPOT_IL("09", "车辆段联锁工作站"),
|
||||
;
|
||||
|
||||
private String code;
|
||||
|
||||
private String msg;
|
||||
|
||||
/**
|
||||
* 大铁子系统名称
|
||||
*/
|
||||
private String railName;
|
||||
|
||||
MapPrdTypeEnum(String code, String msg, String railName) {
|
||||
MapPrdTypeEnum(String code, String msg) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
this.railName = railName;
|
||||
}
|
||||
|
||||
public static MapPrdTypeEnum getMapPrdTypeEnumByCode(String code) {
|
||||
|
|
|
@ -6,8 +6,6 @@ package club.joylink.rtss.constants;
|
|||
public enum Project {
|
||||
/** 自己项目 */
|
||||
DEFAULT,
|
||||
/** 无logo */
|
||||
NOLOGO,
|
||||
/** 西铁院项目 */
|
||||
XTY,
|
||||
/** 南铁院项目 */
|
||||
|
@ -38,34 +36,12 @@ public enum Project {
|
|||
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) {
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
package club.joylink.rtss.constants;
|
||||
|
||||
public interface ProjectCode {
|
||||
|
||||
String THAILAND_SANDBOX = "THAILAND_SANDBOX";
|
||||
String SR_SANDBOX = "SR_SANDBOX";
|
||||
String NGY_SAND_TABLE = "NGY_SAND_TABLE";
|
||||
String CDGXY = "CDGXY";
|
||||
String CGY = "CGY";
|
||||
|
||||
}
|
|
@ -1,8 +1,9 @@
|
|||
package club.joylink.rtss.constants;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 项目设备类型
|
||||
|
@ -10,139 +11,77 @@ import lombok.Getter;
|
|||
@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---------- */
|
||||
/* -----------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,
|
||||
/* -----------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,
|
||||
/* -----------client device end---------- */
|
||||
;
|
||||
|
||||
PIS_STAND,
|
||||
PIS_TRAIN,
|
||||
PIS,
|
||||
TMS,
|
||||
/* -----------client device end---------- */
|
||||
/* -----------Other start---------- */
|
||||
/**
|
||||
* 沙盘运行计划
|
||||
*/
|
||||
SAND_TABLE_RUN_PLAN;
|
||||
|
||||
public static List<ProjectDeviceType> PlcDeviceList() {
|
||||
return Arrays.asList(PLC_GATEWAY,
|
||||
PSC,
|
||||
PSD,
|
||||
PSL,
|
||||
IBP,
|
||||
SECTION,
|
||||
SWITCH,
|
||||
SIGNAL,
|
||||
DCU,
|
||||
UDP_LOW,
|
||||
UDP_CLIENT,
|
||||
TRAIN,
|
||||
SAND_TABLE_RUN_PLAN);
|
||||
}
|
||||
public static List<ProjectDeviceType> PlcDeviceList() {
|
||||
return Arrays.asList(PLC_GATEWAY,
|
||||
PSC,
|
||||
PSD,
|
||||
PSL,
|
||||
IBP,
|
||||
SECTION,
|
||||
SWITCH,
|
||||
SIGNAL,
|
||||
DCU,
|
||||
UDP_LOW,
|
||||
UDP_CLIENT,
|
||||
TRAIN);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,133 +0,0 @@
|
|||
package club.joylink.rtss.constants;
|
||||
|
||||
/**
|
||||
* 项目
|
||||
*/
|
||||
public enum ProjectEnum {
|
||||
/**
|
||||
* 自己项目
|
||||
*/
|
||||
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;
|
||||
|
||||
public static boolean isDefault(ProjectEnum project) {
|
||||
return DEFAULT.equals(project);
|
||||
}
|
||||
|
||||
public static boolean isLoginWithCreateSimulation(ProjectEnum project) {
|
||||
return ProjectEnum.DRTS.equals(project) || ProjectEnum.BJD.equals(project) || ProjectEnum.WJLS.equals(project);
|
||||
}
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
package club.joylink.rtss.constants;
|
||||
|
||||
public interface ServicePath {
|
||||
String MAIN = "https://joylink.club/jlcloud";
|
||||
}
|
|
@ -46,19 +46,6 @@ public enum SystemEnv {
|
|||
return false;
|
||||
}
|
||||
|
||||
public static boolean isTestEnv(String name) {
|
||||
SystemEnv[] envs = SystemEnv.values();
|
||||
for (SystemEnv env : envs) {
|
||||
if(Objects.equals(env.getName(), name)) {
|
||||
if(Test.equals(env)) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isDevEnv(String name) {
|
||||
SystemEnv[] envs = SystemEnv.values();
|
||||
for (SystemEnv env : envs) {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package club.joylink.rtss.controller;
|
||||
|
||||
import club.joylink.rtss.constants.Project;
|
||||
import club.joylink.rtss.services.ILearnService;
|
||||
import club.joylink.rtss.vo.AccountVO;
|
||||
import club.joylink.rtss.vo.client.PageQueryVO;
|
||||
|
@ -17,7 +18,7 @@ import org.springframework.web.bind.annotation.*;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 学习吧接口
|
||||
*学习吧接口
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(path = "/api/learn")
|
||||
|
@ -27,7 +28,7 @@ public class LearnController {
|
|||
private ILearnService iLearnService;
|
||||
|
||||
/**
|
||||
* 分页查询留言板列表
|
||||
*分页查询留言板列表
|
||||
*/
|
||||
@GetMapping(path = "/post")
|
||||
public PageVO<LearnPostVO> queryPagedPost(LearnPostPagedQueryVO queryVO) {
|
||||
|
@ -35,15 +36,15 @@ public class LearnController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 查询项目留言板
|
||||
*查询项目留言板
|
||||
*/
|
||||
@GetMapping("/{project}/post")
|
||||
public LearnPostVO queryPost(@PathVariable String project) {
|
||||
public LearnPostVO queryPost(@PathVariable Project project) {
|
||||
return iLearnService.queryPost(project);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新建帖子
|
||||
*新建帖子
|
||||
*/
|
||||
@PostMapping(path = "/post")
|
||||
public Long createPost(@RequestBody @Validated LearnPostCreateVO createVO, @RequestAttribute AccountVO user) {
|
||||
|
@ -51,7 +52,7 @@ public class LearnController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 编辑留言板基础信息
|
||||
*编辑留言板基础信息
|
||||
*/
|
||||
@PutMapping("/{postId}")
|
||||
public void updatePost(@PathVariable Long postId, @RequestBody @Validated LearnPostUpdateVO updateVO,
|
||||
|
@ -60,7 +61,7 @@ public class LearnController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 获取帖子信息
|
||||
*获取帖子信息
|
||||
*/
|
||||
@GetMapping(path = "/{postId}")
|
||||
public LearnPostVO getPostInfo(@PathVariable Long postId) {
|
||||
|
@ -68,7 +69,7 @@ public class LearnController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 赞贴
|
||||
*赞贴
|
||||
*/
|
||||
@PostMapping(path = "/post/{postId}/like")
|
||||
public void likePost(@PathVariable Long postId, @RequestAttribute AccountVO user) {
|
||||
|
@ -76,7 +77,7 @@ public class LearnController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 踩贴
|
||||
*踩贴
|
||||
*/
|
||||
@PostMapping(path = "/post/{postId}/unlike")
|
||||
public void unlikePost(@PathVariable Long postId, @RequestAttribute AccountVO user) {
|
||||
|
@ -84,7 +85,7 @@ public class LearnController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 置顶-管理员操作
|
||||
*置顶-管理员操作
|
||||
*/
|
||||
@PutMapping(path = "/{postId}/top")
|
||||
public void top(@PathVariable Long postId, @RequestAttribute AccountVO user) {
|
||||
|
@ -92,7 +93,7 @@ public class LearnController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 删除帖子-管理员操作
|
||||
*删除帖子-管理员操作
|
||||
*/
|
||||
@DeleteMapping(path = "/{postId}")
|
||||
public void deletePost(@PathVariable Long postId, @RequestAttribute AccountVO user) {
|
||||
|
@ -102,7 +103,7 @@ public class LearnController {
|
|||
//--------------------------------- 留言 ---------------------------------
|
||||
|
||||
/**
|
||||
* 留言
|
||||
*留言
|
||||
*/
|
||||
@PostMapping("/message/create")
|
||||
public long createMessage(@RequestBody @Validated LearnMessageCreateVO messageCreateVO, @RequestAttribute AccountVO user) {
|
||||
|
@ -110,7 +111,7 @@ public class LearnController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 成工院留言
|
||||
*成工院留言
|
||||
*/
|
||||
@PostMapping("/cgy/message/create")
|
||||
public long cgyCreateMessage(@RequestBody @Validated LearnMessageCreateVO messageCreateVO) {
|
||||
|
@ -118,7 +119,7 @@ public class LearnController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 分页查询留言
|
||||
*分页查询留言
|
||||
*/
|
||||
@GetMapping("/{postId}/message/pagedQuery/postId")
|
||||
public PageVO<LearnMessageVO> pagedQueryMessageByPostId(@PathVariable Long postId, LearnMessagePagedQueryVO queryVO) {
|
||||
|
@ -126,15 +127,15 @@ public class LearnController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 根据项目分页查询留言
|
||||
*根据项目分页查询留言
|
||||
*/
|
||||
@GetMapping("/{project}/message/pagedQuery/project")
|
||||
public PageVO<LearnMessageVO> pagedQueryMessageByProject(@PathVariable String project, LearnMessagePagedQueryVO queryVO) {
|
||||
public PageVO<LearnMessageVO> pagedQueryMessageByProject(@PathVariable Project project, LearnMessagePagedQueryVO queryVO) {
|
||||
return iLearnService.pagedQueryMessageByProject(project, queryVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除留言(管理员)
|
||||
*删除留言(管理员)
|
||||
*/
|
||||
@DeleteMapping("/{messageId}/deleteMessage/admin")
|
||||
public void adminDeleteMessage(@PathVariable Long messageId, @RequestAttribute AccountVO user) {
|
||||
|
@ -142,7 +143,7 @@ public class LearnController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 删除留言(用户删自己的)
|
||||
*删除留言(用户删自己的)
|
||||
*/
|
||||
@DeleteMapping("/{messageId}/deleteMessage/user")
|
||||
public void userDeleteMessage(@PathVariable Long messageId, @RequestAttribute AccountVO user) {
|
||||
|
@ -164,7 +165,7 @@ public class LearnController {
|
|||
//----------------------------------------- 评论 -----------------------------------------
|
||||
|
||||
/**
|
||||
* 分页查询留言评论列表
|
||||
*分页查询留言评论列表
|
||||
*/
|
||||
@GetMapping(path = "/{messageId}/comment")
|
||||
public PageVO<LearnCommentVO> queryPagedComment(@PathVariable Long messageId, PageQueryVO queryVO) {
|
||||
|
@ -172,7 +173,7 @@ public class LearnController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 查询留言回复列表
|
||||
*查询留言回复列表
|
||||
*/
|
||||
@GetMapping(path = "/{messageId}/list")
|
||||
public List<LearnCommentVO> queryCommentList(@PathVariable Long messageId) {
|
||||
|
@ -180,7 +181,7 @@ public class LearnController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 评论
|
||||
*评论
|
||||
*/
|
||||
@PostMapping(path = "/{messageId}/comment")
|
||||
public void comment(@PathVariable Long messageId,
|
||||
|
@ -190,7 +191,7 @@ public class LearnController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 成工院评论
|
||||
*成工院评论
|
||||
*/
|
||||
@PostMapping(path = "/cgy/{messageId}/comment")
|
||||
public void cygComment(@PathVariable Long messageId,
|
||||
|
@ -199,7 +200,7 @@ public class LearnController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 回复
|
||||
*回复
|
||||
*/
|
||||
@PostMapping(path = "/{messageId}/{commentId}/comment")
|
||||
public void comment(@PathVariable Long messageId, @PathVariable Long commentId,
|
||||
|
@ -209,7 +210,7 @@ public class LearnController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 赞回复
|
||||
*赞回复
|
||||
*/
|
||||
@PostMapping(path = "/comment/{commentId}/like")
|
||||
public void likeComment(@PathVariable Long commentId, @RequestAttribute AccountVO user) {
|
||||
|
@ -217,7 +218,7 @@ public class LearnController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 踩回复
|
||||
*踩回复
|
||||
*/
|
||||
@PostMapping(path = "/comment/{commentId}/unlike")
|
||||
public void unlikeComment(@PathVariable Long commentId, @RequestAttribute AccountVO user) {
|
||||
|
@ -225,7 +226,7 @@ public class LearnController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 取消置顶-管理员操作
|
||||
*取消置顶-管理员操作
|
||||
*/
|
||||
@PutMapping(path = "/{postId}/unTop")
|
||||
public void unTop(@PathVariable Long postId, @RequestAttribute AccountVO user) {
|
||||
|
@ -233,7 +234,7 @@ public class LearnController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 删除评论-管理员操作
|
||||
*删除评论-管理员操作
|
||||
*/
|
||||
@DeleteMapping(path = "/{commentId}/deleteComment/admin")
|
||||
public void adminDeleteComment(@PathVariable Long commentId, @RequestAttribute AccountVO user) {
|
||||
|
@ -241,7 +242,7 @@ public class LearnController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 删除评论-用户操作
|
||||
*删除评论-用户操作
|
||||
*/
|
||||
@DeleteMapping(path = "/{commentId}/deleteComment/user")
|
||||
public void userDeleteComment(@PathVariable Long commentId, @RequestAttribute AccountVO user) {
|
||||
|
@ -249,9 +250,8 @@ public class LearnController {
|
|||
}
|
||||
|
||||
//----------------------------------------- 改数据 -----------------------------------------
|
||||
|
||||
/**
|
||||
* 管理员修改留言数据
|
||||
*管理员修改留言数据
|
||||
*/
|
||||
@PutMapping(path = "/admin/update/message")
|
||||
public void adminUpdateMessage(LearnMessageUpdateVO messageUpdateVO) {
|
||||
|
@ -259,7 +259,7 @@ public class LearnController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 管理员修改评论数据
|
||||
*管理员修改评论数据
|
||||
*/
|
||||
@PutMapping(path = "/admin/update/comment")
|
||||
public void adminUpdateComment(LearnCommentUpdateVO commentUpdateVO) {
|
||||
|
@ -267,7 +267,7 @@ public class LearnController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 成工院留言时间打散
|
||||
*成工院留言时间打散
|
||||
*/
|
||||
@PutMapping(path = "/cgy/updateMessageTime")
|
||||
public void cgyUpdateMessageTime() {
|
||||
|
|
|
@ -1,154 +1,131 @@
|
|||
package club.joylink.rtss.controller;
|
||||
|
||||
import club.joylink.rtss.exception.BaseException;
|
||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||
import club.joylink.rtss.constants.Project;
|
||||
import club.joylink.rtss.services.auth.IAuthenticateService;
|
||||
import club.joylink.rtss.vo.AccountVO;
|
||||
import club.joylink.rtss.vo.LoginUserInfoVO;
|
||||
import club.joylink.rtss.vo.client.LoginStatusVO;
|
||||
import club.joylink.rtss.vo.client.LoginUserVO;
|
||||
import club.joylink.rtss.vo.client.cgy.CgyThirdPartyLoginInfoVO;
|
||||
import club.joylink.rtss.vo.client.validGroup.LoginInfoCheck;
|
||||
import club.joylink.rtss.vo.client.validGroup.ThirdLoginInfoCheck;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/login")
|
||||
public class LoginController {
|
||||
|
||||
@Autowired
|
||||
private IAuthenticateService iAuthenticateService;
|
||||
@Autowired
|
||||
private IAuthenticateService iAuthenticateService;
|
||||
|
||||
@PostMapping("/cgy/third")
|
||||
public String cgyThirdPartyLogin(@RequestBody @Validated CgyThirdPartyLoginInfoVO loginInfo) {
|
||||
return this.iAuthenticateService.cgyThirdPartyLogin(loginInfo);
|
||||
}
|
||||
|
||||
@PostMapping(path = "/third")
|
||||
public String thirdPartyLogin(
|
||||
@RequestBody @Validated(ThirdLoginInfoCheck.class) LoginUserVO loginInfo) {
|
||||
return this.iAuthenticateService.thirdPartyLogin(loginInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取微信小程序登陆二维码
|
||||
*/
|
||||
@GetMapping(path = "/wmurl")
|
||||
public LoginStatusVO getWmLoginUrl(@NotBlank String clientId, @NotBlank String secret,
|
||||
String project, @RequestParam(required = false) String deviceCode) {
|
||||
try {
|
||||
return this.iAuthenticateService.getWmLoginUrl(clientId, secret, project, deviceCode);
|
||||
} catch (BaseException e) {
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
throw BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.exception("获取登录二维码失败");
|
||||
@PostMapping(path = "/third")
|
||||
public String thirdPartyLogin(@RequestBody @Validated(ThirdLoginInfoCheck.class) LoginUserVO loginInfo) {
|
||||
return this.iAuthenticateService.thirdPartyLogin(loginInfo);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户微信小程序扫登陆二维码
|
||||
*/
|
||||
@GetMapping(path = "/scan/wmLoginUrl")
|
||||
public AccountVO scanWmLoginQrCode(String code, String state) {
|
||||
return this.iAuthenticateService.scanWmLoginQrCode(code, state);
|
||||
}
|
||||
/**
|
||||
*获取微信小程序登陆二维码
|
||||
*/
|
||||
@GetMapping(path = "/wmurl")
|
||||
public LoginStatusVO getWmLoginUrl(@NotBlank String clientId, @NotBlank String secret,
|
||||
Project project, @RequestParam(required = false) String deviceCode) {
|
||||
return this.iAuthenticateService.getWmLoginUrl(clientId, secret, project, deviceCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信小程序确认登陆接口
|
||||
*/
|
||||
@PostMapping(path = "/wm")
|
||||
public void wmConfirmLogin(String code, String state) {
|
||||
this.iAuthenticateService.wmConfirmClientLogin(code, state);
|
||||
}
|
||||
/**
|
||||
*用户微信小程序扫登陆二维码
|
||||
*/
|
||||
@GetMapping(path = "/scan/wmLoginUrl")
|
||||
public AccountVO scanWmLoginQrCode(String code, String state) {
|
||||
return this.iAuthenticateService.scanWmLoginQrCode(code, state);
|
||||
}
|
||||
|
||||
@PostMapping()
|
||||
public String loginWithPwd(@RequestBody @Validated(LoginInfoCheck.class) LoginUserVO loginUser) {
|
||||
return iAuthenticateService.loginWithPwd(loginUser);
|
||||
}
|
||||
/**
|
||||
*微信小程序确认登陆接口
|
||||
*/
|
||||
@PostMapping(path = "/wm")
|
||||
public void wmConfirmLogin(String code, String state) {
|
||||
this.iAuthenticateService.wmConfirmClientLogin(code, state);
|
||||
}
|
||||
|
||||
@GetMapping("/preLogout")
|
||||
public void preLogout(String token) {
|
||||
this.iAuthenticateService.preLogout(token);
|
||||
}
|
||||
@PostMapping()
|
||||
public String loginWithPwd(@RequestBody @Validated(LoginInfoCheck.class) LoginUserVO loginUser) {
|
||||
return iAuthenticateService.loginWithPwd(loginUser);
|
||||
}
|
||||
|
||||
@GetMapping(path = "/logout")
|
||||
public void logout(String token) {
|
||||
this.iAuthenticateService.logout(token);
|
||||
}
|
||||
@GetMapping("/preLogout")
|
||||
public void preLogout(String token) {
|
||||
this.iAuthenticateService.preLogout(token);
|
||||
}
|
||||
|
||||
@GetMapping(path = "/checkStatus")
|
||||
public LoginStatusVO checkStatus(@NotBlank String sessionId) {
|
||||
return iAuthenticateService.checkStatus(sessionId);
|
||||
}
|
||||
@GetMapping(path="/logout")
|
||||
public void logout(String token) {
|
||||
this.iAuthenticateService.logout(token);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户信息 - 通过token
|
||||
*
|
||||
* @param token
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(path = "/getUserInfo")
|
||||
public AccountVO getUserInfo(String token) {
|
||||
LoginUserInfoVO loginUserInfoVO = this.iAuthenticateService.getLoginUserInfoByToken(token);
|
||||
return loginUserInfoVO.getAccountVO();
|
||||
}
|
||||
@GetMapping(path="/checkStatus")
|
||||
public LoginStatusVO checkStatus(@NotBlank String sessionId) {
|
||||
return iAuthenticateService.checkStatus(sessionId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户登录信息(包含登录的项目/客户端等)
|
||||
*
|
||||
* @param token
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/loginUserInfo")
|
||||
public LoginUserInfoVO getLoginUserInfo(String token) {
|
||||
return this.iAuthenticateService.getLoginUserInfoByToken(token);
|
||||
}
|
||||
/**
|
||||
* 获取用户信息 - 通过token
|
||||
* @param token
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(path = "/getUserInfo")
|
||||
public AccountVO getUserInfo(String token) {
|
||||
LoginUserInfoVO loginUserInfoVO = this.iAuthenticateService.getLoginUserInfoByToken(token);
|
||||
return loginUserInfoVO.getAccountVO();
|
||||
}
|
||||
|
||||
/**
|
||||
* <玖琏科技>微信小程序code换取token
|
||||
*/
|
||||
@GetMapping(path = "/wm/token")
|
||||
public String getTokenByWmCode(String code) {
|
||||
return this.iAuthenticateService.getTokenByWmCode(code);
|
||||
}
|
||||
/**
|
||||
* 获取用户登录信息(包含登录的项目/客户端等)
|
||||
* @param token
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/loginUserInfo")
|
||||
public LoginUserInfoVO getLoginUserInfo(String token) {
|
||||
return this.iAuthenticateService.getLoginUserInfoByToken(token);
|
||||
}
|
||||
|
||||
/**
|
||||
* 到那儿了小程序code换token
|
||||
*
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(path = "/wm2/token")
|
||||
public String getTokenByWmCode2(String code) {
|
||||
return this.iAuthenticateService.getTokenByWmCode2(code);
|
||||
}
|
||||
/**
|
||||
*<玖琏科技>微信小程序code换取token
|
||||
*/
|
||||
@GetMapping(path = "/wm/token")
|
||||
public String getTokenByWmCode(String code) {
|
||||
return this.iAuthenticateService.getTokenByWmCode(code);
|
||||
}
|
||||
|
||||
/**
|
||||
* 郑州共赢小程序code换token
|
||||
*
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(path = "/wm/zzww/token")
|
||||
public String getTokenByWmCode3(String code) {
|
||||
return this.iAuthenticateService.getTokenByWmCode3(code);
|
||||
}
|
||||
/**
|
||||
* 到那儿了小程序code换token
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(path = "/wm2/token")
|
||||
public String getTokenByWmCode2(String code) {
|
||||
return this.iAuthenticateService.getTokenByWmCode2(code);
|
||||
}
|
||||
|
||||
/**
|
||||
* token是否过期
|
||||
*/
|
||||
@GetMapping(path = "/{token}/isExpired")
|
||||
public boolean isTokenExpired(@PathVariable String token) {
|
||||
return this.iAuthenticateService.isTokenExpired(token);
|
||||
}
|
||||
/**
|
||||
* 郑州共赢小程序code换token
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(path = "/wm/zzww/token")
|
||||
public String getTokenByWmCode3(String code) {
|
||||
return this.iAuthenticateService.getTokenByWmCode3(code);
|
||||
}
|
||||
|
||||
/**
|
||||
*token是否过期
|
||||
*/
|
||||
@GetMapping(path = "/{token}/isExpired")
|
||||
public boolean isTokenExpired(@PathVariable String token) {
|
||||
return this.iAuthenticateService.isTokenExpired(token);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -2,12 +2,9 @@ package club.joylink.rtss.controller;
|
|||
|
||||
import club.joylink.rtss.services.draftData.DraftMapDataHandleService;
|
||||
import club.joylink.rtss.services.publishData.PublishMapDataHandler;
|
||||
import java.util.LinkedHashMap;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
|
@ -19,40 +16,23 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
@RequestMapping("/api/mapData/handle")
|
||||
public class MapDataHandleController {
|
||||
|
||||
@Autowired
|
||||
private DraftMapDataHandleService draftMapDataHandleService;
|
||||
@Autowired
|
||||
private PublishMapDataHandler publishMapDataHandler;
|
||||
@Autowired
|
||||
private DraftMapDataHandleService draftMapDataHandleService;
|
||||
@Autowired
|
||||
private PublishMapDataHandler publishMapDataHandler;
|
||||
|
||||
@PutMapping("")
|
||||
public void dataHandle() {
|
||||
this.publishMapDataHandler.dataHandle();
|
||||
}
|
||||
@PutMapping("")
|
||||
public void dataHandle() {
|
||||
this.publishMapDataHandler.dataHandle();
|
||||
}
|
||||
|
||||
@PutMapping("/xian3")
|
||||
public void overlapSetHandle() {
|
||||
this.publishMapDataHandler.xian3Handle();
|
||||
}
|
||||
@PutMapping("/xian3")
|
||||
public void overlapSetHandle() {
|
||||
this.publishMapDataHandler.xian3Handle();
|
||||
}
|
||||
|
||||
@PutMapping("/signalSd")
|
||||
public void signalShowDirection() {
|
||||
this.publishMapDataHandler.signalShowDirection();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量修改线路数据和ISCS的车站名
|
||||
*/
|
||||
@PutMapping("/{mapId}/stationName/mapAndIscs")
|
||||
public void changeStationName(@PathVariable long mapId,
|
||||
@RequestBody LinkedHashMap<String, String> nameMap) {
|
||||
this.publishMapDataHandler.changeStationName(mapId, nameMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量修改线路区段长度
|
||||
*/
|
||||
@PutMapping("/{mapId}/{multiple}/sectionLen")
|
||||
public void updateSectionLen(@PathVariable long mapId, @PathVariable int multiple) {
|
||||
publishMapDataHandler.updateSectionLen(mapId, multiple);
|
||||
}
|
||||
@PutMapping("/signalSd")
|
||||
public void signalShowDirection() {
|
||||
this.publishMapDataHandler.signalShowDirection();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,60 +0,0 @@
|
|||
package club.joylink.rtss.controller;
|
||||
|
||||
import club.joylink.rtss.entity.minio.MinioFileInfo;
|
||||
import club.joylink.rtss.services.MinioService;
|
||||
import club.joylink.rtss.vo.AccountVO;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.minio.MinioFilePageVO;
|
||||
import io.minio.http.Method;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* minio 相关管理
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/minio")
|
||||
public class MinioController {
|
||||
@Autowired
|
||||
private MinioService minioService;
|
||||
|
||||
@GetMapping("/checkIsExist")
|
||||
public boolean checkFileIsExist(String directory, String fileName) {
|
||||
return minioService.checkFileIsExist(directory, fileName);
|
||||
}
|
||||
|
||||
@GetMapping("/preSignedUrl")
|
||||
public String getPreSignedObjectUrl(String directory, String fileName, Method method) {
|
||||
return minioService.preSignedObjectUrl(directory, fileName, method);
|
||||
}
|
||||
|
||||
@GetMapping("/downloadUrl")
|
||||
public String downloadUrl(String directory, String fileName) {
|
||||
return minioService.downloadObjectUrl(directory, fileName);
|
||||
}
|
||||
|
||||
@DeleteMapping("/removeObject")
|
||||
public void removeObject(String directory, String fileName) {
|
||||
minioService.removeMinioObject(directory, fileName);
|
||||
}
|
||||
|
||||
@PostMapping("/file/save")
|
||||
public void saveFile(@RequestAttribute AccountVO user, @RequestBody MinioFileInfo fileInfo) {
|
||||
minioService.saveFileInfo(user, fileInfo);
|
||||
}
|
||||
|
||||
@GetMapping("/file/list")
|
||||
public PageVO<MinioFileInfo> queryFileInfo(MinioFilePageVO pageVO) {
|
||||
return minioService.queryFileInfoList(pageVO);
|
||||
}
|
||||
|
||||
@PutMapping("/file/update")
|
||||
public void update(@RequestBody MinioFileInfo fileInfo) {
|
||||
minioService.update(fileInfo);
|
||||
}
|
||||
|
||||
@DeleteMapping("/file/del/{id}")
|
||||
public void delete(@PathVariable Long id) {
|
||||
minioService.delete(id);
|
||||
}
|
||||
}
|
|
@ -17,13 +17,11 @@ import org.springframework.web.bind.annotation.*;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 组织成员管理接口
|
||||
* 这些接口逐渐废弃,新接口加在这里{@link club.joylink.rtss.controller.org.OrgController}
|
||||
*组织成员管理接口
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/company")
|
||||
@Deprecated(since = "2022.12.08", forRemoval = true)
|
||||
public class CompanyController {
|
||||
public class OrgController {
|
||||
|
||||
@Autowired
|
||||
private IOrgUserService iOrgUserService;
|
||||
|
@ -41,87 +39,87 @@ public class CompanyController {
|
|||
private IOrgExamService iOrgExamService;
|
||||
|
||||
/**
|
||||
* 创建顶级组织
|
||||
*创建顶级组织
|
||||
*/
|
||||
@PostMapping
|
||||
public OrgVO create(@RequestBody @Validated TopOrgCreateVO topOrgCreateVO, @RequestAttribute(AuthenticateInterceptor.LOGIN_USER_KEY) AccountVO user) {
|
||||
return iOrgService.createTopOrg(topOrgCreateVO, user);
|
||||
public CompanyVO create(@RequestBody @Validated CompanyVO company, @RequestAttribute(AuthenticateInterceptor.LOGIN_USER_KEY) AccountVO user) {
|
||||
return iOrgService.createTopOrg(company, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取公司列表
|
||||
*获取公司列表
|
||||
*/
|
||||
@GetMapping
|
||||
public List<OrgVO> queryAll() {
|
||||
public List<CompanyVO> queryAll() {
|
||||
return iOrgService.queryAllTopOrg();
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页获取公司列表
|
||||
*分页获取公司列表
|
||||
*/
|
||||
@GetMapping("paging")
|
||||
public PageVO<OrgVO> pagingQueryAll(OrgQueryVO queryVO) {
|
||||
public PageVO<CompanyVO> pagingQueryAll(OrgQueryVO queryVO) {
|
||||
return iOrgService.pagedQueryAllTopOrg(queryVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询公司信息
|
||||
*查询公司信息
|
||||
*/
|
||||
@GetMapping("{id}")
|
||||
public OrgVO get(@PathVariable Long id) {
|
||||
public CompanyVO get(@PathVariable Long id) {
|
||||
return iOrgService.get(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新公司信息
|
||||
*更新公司信息
|
||||
*/
|
||||
@PutMapping("{id}")
|
||||
public OrgVO updateCompany(@PathVariable Long id, @RequestBody @Validated OrgVO company, @RequestAttribute AccountVO user) {
|
||||
public CompanyVO updateCompany(@PathVariable Long id, @RequestBody @Validated CompanyVO company, @RequestAttribute AccountVO user) {
|
||||
return iOrgService.updateOrg(id, company, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信小程用户绑定为单位管理员
|
||||
*微信小程用户绑定为单位管理员
|
||||
*/
|
||||
@PutMapping(path = "/bind/company")
|
||||
public OrgVO userScanCodeBindCompany(Long userId, Long companyId) {
|
||||
public CompanyVO userScanCodeBindCompany(Long userId, Long companyId) {
|
||||
return iOrgUserService.userScanCodeBindCompanyManager(userId, companyId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加部门信息
|
||||
*添加部门信息
|
||||
*/
|
||||
@PostMapping(path = "/dept")
|
||||
public OrgVO createDepart(@RequestBody @Validated OrgVO orgVO) {
|
||||
return iOrgUserService.createDepart(orgVO);
|
||||
public DepartmentVO createDepart(@RequestBody @Validated DepartmentVO departmentVO) {
|
||||
return iOrgUserService.createDepart(departmentVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取单位所有部门
|
||||
*获取单位所有部门
|
||||
*/
|
||||
@GetMapping(path = "{companyId}/dept")
|
||||
public List<OrgVO> queryCompanyDepart(@PathVariable Long companyId) {
|
||||
public List<DepartmentVO> queryCompanyDepart(@PathVariable Long companyId) {
|
||||
return iOrgUserService.getCompanyAllDepart(companyId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取部门及其子树
|
||||
*获取部门及其子树
|
||||
*/
|
||||
@GetMapping(path = "{companyId}/dept/{deptId}/tree")
|
||||
public OrgVO queryDepartTree(@PathVariable Long deptId, @PathVariable Long companyId) {
|
||||
public DepartmentVO queryDepartTree(@PathVariable Long deptId, @PathVariable Long companyId) {
|
||||
return iOrgUserService.getDepartTree(companyId, deptId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取部门及其子部门
|
||||
*获取部门及其子部门
|
||||
*/
|
||||
@GetMapping(path = "{companyId}/dept/{deptId}")
|
||||
public List<OrgVO> queryDepart(@PathVariable Long deptId, @PathVariable Long companyId) {
|
||||
public List<DepartmentVO> queryDepart(@PathVariable Long deptId, @PathVariable Long companyId) {
|
||||
return iOrgUserService.getDepartAndChild(companyId, deptId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除部门信息
|
||||
*删除部门信息
|
||||
*/
|
||||
@DeleteMapping("/dept/{deptId}")
|
||||
public void deleteDepart(@PathVariable Long deptId) {
|
||||
|
@ -129,23 +127,23 @@ public class CompanyController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 查询部门信息
|
||||
*查询部门信息
|
||||
*/
|
||||
@GetMapping("/dept/{deptId}")
|
||||
public OrgVO queryDepart(@PathVariable Long deptId) {
|
||||
return iOrgUserService.queryDepartById(deptId);
|
||||
public DepartmentVO getDepart(@PathVariable Long deptId) {
|
||||
return iOrgUserService.getDepartById(deptId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新部门信息
|
||||
*更新部门信息
|
||||
*/
|
||||
@PutMapping("/dept/{id}")
|
||||
public void updateDepartInfo(@PathVariable Long id, @RequestBody @Validated OrgVO orgVO) {
|
||||
iOrgUserService.updateDepartInfo(id, orgVO);
|
||||
public void updateDepartInfo(@PathVariable Long id, @RequestBody @Validated DepartmentVO departmentVO) {
|
||||
iOrgUserService.updateDepartInfo(id, departmentVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加单位成员关系信息
|
||||
*添加单位成员关系信息
|
||||
*/
|
||||
@PostMapping("refUserInfo")
|
||||
public void addCompanyUserInfo(@RequestAttribute AccountVO user, @RequestBody UserDepartRelVO userDepartRelVO) {
|
||||
|
@ -153,7 +151,7 @@ public class CompanyController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 更新单位成员关系信息
|
||||
*更新单位成员关系信息
|
||||
*/
|
||||
@PutMapping("refUserInfo")
|
||||
public void updateCompanyUserInfo(@RequestAttribute AccountVO user, @RequestBody UserDepartRelVO userDepartRelVO) {
|
||||
|
@ -161,7 +159,7 @@ public class CompanyController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 取消单位的部门成员关系
|
||||
*取消单位的部门成员关系
|
||||
*/
|
||||
@DeleteMapping("departUserInfo")
|
||||
public void deleteCompanyUserInfo(@RequestAttribute AccountVO user, @RequestBody @Validated UserDepartRelVO userDepartRelVO) {
|
||||
|
@ -169,7 +167,7 @@ public class CompanyController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 分页获取班级学生信息
|
||||
*分页获取班级学生信息
|
||||
*/
|
||||
@GetMapping("/dept/{clsId}/departUserInfo")
|
||||
public PageVO<OrgUserVO> getCompanyUserInfo(@RequestAttribute AccountVO user, @PathVariable Integer clsId, CompanyUserQueryVO companyUserQueryVO) {
|
||||
|
@ -177,7 +175,7 @@ public class CompanyController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 导入单位成员信息
|
||||
*导入单位成员信息
|
||||
*/
|
||||
@PostMapping("{clsId}/departUserInfo/import")
|
||||
public void importCompanyUserInfo(@RequestAttribute AccountVO user, @PathVariable Long clsId, @RequestBody List<ImportOrgUserVO> importOrgUsers) {
|
||||
|
@ -185,7 +183,7 @@ public class CompanyController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 获取单位用户的部门信息
|
||||
*获取单位用户的部门信息
|
||||
*/
|
||||
@GetMapping("{companyId}/userDeparts")
|
||||
public List<OrgUserVO> getUserCompanyDeparts(@RequestAttribute AccountVO user, @PathVariable Integer companyId) {
|
||||
|
@ -193,7 +191,7 @@ public class CompanyController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 查询自己给该组织(班级)排的课
|
||||
*查询自己给该组织(班级)排的课
|
||||
*/
|
||||
@GetMapping("/orgLesson/{orgId}/list")
|
||||
public List<LessonVO> queryOrgLessonICreated(@PathVariable Long orgId, @RequestAttribute AccountVO user) {
|
||||
|
@ -201,7 +199,7 @@ public class CompanyController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 修改班级-课程关系
|
||||
*修改班级-课程关系
|
||||
*/
|
||||
@PutMapping("/orgLesson/{clsId}/update")
|
||||
public void updateOrgLesson(@PathVariable Long clsId, @RequestBody List<Long> lessonIds, @RequestAttribute LoginUserInfoVO loginInfo) {
|
||||
|
@ -209,7 +207,7 @@ public class CompanyController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 给班级添加学生
|
||||
*给班级添加学生
|
||||
*/
|
||||
@PostMapping("/orgUser/{clsId}/addStudent")
|
||||
public void addStudent(@PathVariable Long clsId, @RequestBody ImportOrgUserVO importVO, @RequestAttribute AccountVO user) {
|
||||
|
@ -217,7 +215,7 @@ public class CompanyController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 创建班级
|
||||
*创建班级
|
||||
*/
|
||||
@PostMapping("/org/cls/create")
|
||||
public void createCls(@RequestBody NonTopOrgCreateVO createVO, @RequestAttribute LoginUserInfoVO loginInfo) {
|
||||
|
@ -225,23 +223,23 @@ public class CompanyController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 分页查询当前登录用户所属组织下的班级
|
||||
*分页查询当前登录项目所属组织下的班级
|
||||
*/
|
||||
@GetMapping("/paged/cls")
|
||||
public PageVO<OrgVO> pagedQuerySelfCls(OrgQueryVO queryVO, @RequestAttribute LoginUserInfoVO loginInfo) {
|
||||
public PageVO<DepartmentVO> pagedQuerySelfCls(OrgQueryVO queryVO, @RequestAttribute LoginUserInfoVO loginInfo) {
|
||||
return iOrgService.pagedQueryCls(queryVO, loginInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当前登录项目所属组织下的班级
|
||||
*查询当前登录项目所属组织下的班级
|
||||
*/
|
||||
@GetMapping("/list/cls")
|
||||
public List<OrgVO> queryCls(OrgQueryVO queryVO, @RequestAttribute LoginUserInfoVO loginInfo) {
|
||||
public List<DepartmentVO> queryCls(OrgQueryVO queryVO, @RequestAttribute LoginUserInfoVO loginInfo) {
|
||||
return iOrgService.queryCls(queryVO, loginInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建评价规则
|
||||
*创建评价规则
|
||||
*/
|
||||
@PostMapping("/orgScoringRule")
|
||||
public void createScoringRule(@RequestBody OrgScoringRuleVO orgScoringRuleVO, @RequestAttribute LoginUserInfoVO loginInfo) {
|
||||
|
@ -249,7 +247,7 @@ public class CompanyController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 更新评价规则
|
||||
*更新评价规则
|
||||
*/
|
||||
@PutMapping("/orgScoringRule")
|
||||
public void UpdateScoringRule(@RequestBody OrgScoringRuleVO orgScoringRuleVO, @RequestAttribute AccountVO user) {
|
||||
|
@ -257,7 +255,7 @@ public class CompanyController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 查询自己创建的评价规则基础信息
|
||||
*查询自己创建的评价规则基础信息
|
||||
*/
|
||||
@GetMapping("/orgScoringRule/basicInfo/self/paged")
|
||||
public PageVO<OrgScoringRuleVO> queryOrgScoringRuleBasicInfo(OrgScoringRuleQueryVO queryVO, @RequestAttribute AccountVO user) {
|
||||
|
@ -265,7 +263,7 @@ public class CompanyController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 查询自己创建的指定评价规则详细信息
|
||||
*查询自己创建的指定评价规则详细信息
|
||||
*/
|
||||
@GetMapping("/orgScoringRule/details/self/{orgId}/{schoolYear}/{term}")
|
||||
public OrgScoringRuleVO queryOrgScoringRuleDetails(@PathVariable Long orgId, @PathVariable String schoolYear,
|
||||
|
@ -274,24 +272,24 @@ public class CompanyController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 查询指定评价规则详细信息
|
||||
*查询指定评价规则详细信息
|
||||
*/
|
||||
@GetMapping("/orgScoringRule/details/self/{ruleId}")
|
||||
public OrgScoringRuleVO queryOrgScoringRuleDetails(@PathVariable Long ruleId) {
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除评分规则
|
||||
*删除评分规则
|
||||
*/
|
||||
@DeleteMapping("/orgScoringRule/details/self/{ruleId}")
|
||||
public void deleteScoringRule(@PathVariable Long ruleId, @RequestAttribute AccountVO user) {
|
||||
|
@ -299,15 +297,15 @@ public class CompanyController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 查询规则能够应用到的组织
|
||||
*查询规则能够应用到的组织
|
||||
*/
|
||||
@GetMapping("/orgScoringRule/{ruleId}/canApplyTo")
|
||||
public List<OrgVO> queryRuleCanApplyTo(@PathVariable Long ruleId, @RequestAttribute AccountVO user) {
|
||||
public List<DepartmentVO> queryRuleCanApplyTo(@PathVariable Long ruleId, @RequestAttribute AccountVO user) {
|
||||
return iOrgScoringRuleService.queryRuleCanApplyTo(ruleId, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将评价规则应用到
|
||||
*将评价规则应用到
|
||||
*/
|
||||
@PostMapping("/orgScoringRule/{ruleId}/apply")
|
||||
public void applyOrgScoringRule(@PathVariable Long ruleId, @RequestBody List<Long> orgIds) {
|
||||
|
@ -315,7 +313,7 @@ public class CompanyController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 给班级安排考试
|
||||
*给班级安排考试
|
||||
*/
|
||||
@PostMapping("/orgExam/{clsId}")
|
||||
public void createOrgExam(@PathVariable Long clsId, @RequestBody List<Long> examIds, @RequestAttribute AccountVO user) {
|
||||
|
@ -323,7 +321,7 @@ public class CompanyController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 查询班级安排的考试id
|
||||
*查询班级安排的考试id
|
||||
*/
|
||||
@GetMapping("/orgExam/{clsId}/list")
|
||||
public List<String> queryOrgExam(@PathVariable Long clsId, @RequestAttribute AccountVO user) {
|
||||
|
@ -331,7 +329,7 @@ public class CompanyController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 管理员查看组织树
|
||||
*管理员查看组织树
|
||||
*/
|
||||
@Role(RoleEnum.Admin)
|
||||
@GetMapping("/orgTree/{orgId}")
|
||||
|
@ -340,34 +338,11 @@ public class CompanyController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 获取学生实训使用时长
|
||||
*获取学生实训使用时长
|
||||
*/
|
||||
@GetMapping("/usage/students")
|
||||
public List<StudentsUsageStatisticsVO> statisticUsage(@Validated UsageQueryVO queryVO) {
|
||||
return iOrgUserService.statisticUsage(queryVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取绑定组织二维码
|
||||
*/
|
||||
@GetMapping("/{orgId}/qrCode")
|
||||
public String getBindQrCode(@PathVariable Long orgId, @RequestAttribute LoginUserInfoVO loginInfo) {
|
||||
return iOrgService.getBindQrCode(orgId, loginInfo.getProject());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询班级教师接口
|
||||
*/
|
||||
@GetMapping("/dept/{clsId}/teachers")
|
||||
public PageVO<OrgUserVO> clsTeacherList(@PathVariable Integer clsId, CompanyUserQueryVO companyUserQueryVO) {
|
||||
return iOrgUserService.clsTeacherList(clsId, companyUserQueryVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加教师接口
|
||||
*/
|
||||
@PostMapping("/dept/{clsId}/addTeacher")
|
||||
public void addTeacher(@PathVariable Long clsId, @RequestBody ImportOrgUserVO importVO, @RequestAttribute AccountVO user) {
|
||||
iOrgUserService.addTeacher(clsId, importVO, user);
|
||||
}
|
||||
}
|
|
@ -1,10 +1,9 @@
|
|||
package club.joylink.rtss.controller;
|
||||
|
||||
import club.joylink.rtss.constants.Project;
|
||||
import club.joylink.rtss.constants.RoleEnum;
|
||||
import club.joylink.rtss.controller.advice.AuthenticateInterceptor;
|
||||
import club.joylink.rtss.controller.advice.Role;
|
||||
import club.joylink.rtss.exception.BaseException;
|
||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||
import club.joylink.rtss.services.project.ServerService;
|
||||
import club.joylink.rtss.vo.AccountVO;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
|
@ -14,9 +13,6 @@ import lombok.extern.slf4j.Slf4j;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 项目域名管理接口
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/api/projectServer")
|
||||
|
@ -26,14 +22,8 @@ public class ProjectServerController {
|
|||
private ServerService serverService;
|
||||
|
||||
@GetMapping("/project/{project}")
|
||||
public ProjectServerVO getByProject(@PathVariable String project) {
|
||||
try {
|
||||
return this.serverService.getByProject(project);
|
||||
} catch (BaseException e) {
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
throw BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.exception(e);
|
||||
}
|
||||
public ProjectServerVO getByProject(@PathVariable Project project) {
|
||||
return this.serverService.getByProject(project);
|
||||
}
|
||||
|
||||
@Role(RoleEnum.SuperAdmin)
|
||||
|
@ -57,10 +47,4 @@ public class ProjectServerController {
|
|||
this.serverService.update(id, vo, accountVO);
|
||||
}
|
||||
|
||||
@Role(RoleEnum.SuperAdmin)
|
||||
@DeleteMapping("/{id}")
|
||||
public void delete(@PathVariable Long id) {
|
||||
this.serverService.delete(id);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
package club.joylink.rtss.controller;
|
||||
|
||||
import club.joylink.rtss.services.IVoiceCommandService;
|
||||
import club.joylink.rtss.simulation.cbtc.command.VoiceCommandBO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 语音指令接口
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/voiceCommand")
|
||||
public class VoiceCommandController {
|
||||
@Autowired
|
||||
private IVoiceCommandService iVoiceCommandService;
|
||||
|
||||
/**
|
||||
* 添加语音指令
|
||||
* @param command
|
||||
*/
|
||||
@PostMapping("")
|
||||
public void create(VoiceCommandBO command) {
|
||||
iVoiceCommandService.create(command);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有语音指令
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("")
|
||||
public List<VoiceCommandBO> getAll() {
|
||||
return iVoiceCommandService.getAll();
|
||||
}
|
||||
}
|
|
@ -5,7 +5,6 @@ import club.joylink.rtss.exception.PayException;
|
|||
import club.joylink.rtss.simulation.cbtc.exception.SimulationException;
|
||||
import club.joylink.rtss.vo.CommonJsonResponse;
|
||||
import club.joylink.rtss.vo.ResponseConsts;
|
||||
import com.google.protobuf.AbstractMessageLite;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.core.MethodParameter;
|
||||
import org.springframework.http.MediaType;
|
||||
|
@ -26,79 +25,67 @@ import java.util.List;
|
|||
@Slf4j
|
||||
public class CommonResponseBody implements ResponseBodyAdvice {
|
||||
|
||||
@Override
|
||||
public boolean supports(MethodParameter returnType, Class converterType) {
|
||||
return returnType.getMethod() != null && !returnType.getMethod().getReturnType().getSimpleName().equals("CommonJsonResponse");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object beforeBodyWrite(Object body, MethodParameter returnType, MediaType selectedContentType,
|
||||
Class selectedConverterType, ServerHttpRequest request, ServerHttpResponse response) {
|
||||
//byte[]
|
||||
if (body instanceof byte[]) {
|
||||
response.getHeaders().setContentType(MediaType.APPLICATION_OCTET_STREAM);
|
||||
return body;
|
||||
}
|
||||
//byte[]
|
||||
/*if(body instanceof AbstractMessageLite){
|
||||
response.getHeaders().setContentType(MediaType.APPLICATION_OCTET_STREAM);
|
||||
final AbstractMessageLite proto = (AbstractMessageLite) body;
|
||||
return proto.toByteArray();
|
||||
}*/
|
||||
if (body instanceof CommonJsonResponse) {
|
||||
return body;
|
||||
}
|
||||
if (request.getURI().getPath().startsWith("/swagger")) {
|
||||
return body;
|
||||
}
|
||||
if (request.getURI().getPath().equals("/api/userinfo/ifRegisted")) {
|
||||
return body;
|
||||
}
|
||||
if (request.getURI().getPath().equals("/api/userinfo/identity")) {
|
||||
return body;
|
||||
}
|
||||
CommonJsonResponse commonJsonResponse = CommonJsonResponse.newSuccessResponse(body);
|
||||
if (returnType.getMethod().getReturnType().equals(String.class) || body instanceof String) {
|
||||
return commonJsonResponse.toJSONString();
|
||||
}
|
||||
return commonJsonResponse;
|
||||
}
|
||||
|
||||
@ExceptionHandler({PayException.class})
|
||||
@ResponseStatus
|
||||
public CommonJsonResponse handleException(PayException e) {
|
||||
log.error("【支付异常】", e);
|
||||
return CommonJsonResponse.newErrorResponse();
|
||||
}
|
||||
|
||||
@ExceptionHandler({Exception.class})
|
||||
@ResponseBody
|
||||
public CommonJsonResponse handleException(Exception e) {
|
||||
if (e instanceof MethodArgumentNotValidException) {
|
||||
// 参数验证异常处理
|
||||
MethodArgumentNotValidException validException = (MethodArgumentNotValidException) e;
|
||||
List<ObjectError> errorList = validException.getBindingResult().getAllErrors();
|
||||
StringBuffer sb = new StringBuffer();
|
||||
errorList.forEach(error ->
|
||||
sb.append(error.getDefaultMessage()).append(";"));
|
||||
log.error("【参数校验异常】{}", e);
|
||||
return CommonJsonResponse.newErrorResponse(ResponseConsts.VALIDATE_ERROR.getCode(), sb.toString());
|
||||
}
|
||||
if (e instanceof BusinessException) {
|
||||
club.joylink.rtss.exception.BusinessException be = (club.joylink.rtss.exception.BusinessException) e;
|
||||
log.error("【业务异常】{}", e);
|
||||
return CommonJsonResponse.newErrorResponse(be.getCode(), be.getVoMessage());
|
||||
} else if (e instanceof MissingServletRequestParameterException) {
|
||||
log.error("【接口参数异常】", e);
|
||||
return CommonJsonResponse.newErrorResponse(ResponseConsts.VALIDATE_ERROR.getCode(), "接口参数异常");
|
||||
} else if (e instanceof SimulationException) {
|
||||
club.joylink.rtss.simulation.cbtc.exception.SimulationException simulationException = (club.joylink.rtss.simulation.cbtc.exception.SimulationException) e;
|
||||
log.error("【仿真系统异常】{}", e);
|
||||
return CommonJsonResponse.newErrorResponse(simulationException.getCode(), simulationException.getMessage());
|
||||
@Override
|
||||
public boolean supports(MethodParameter returnType, Class converterType) {
|
||||
return returnType.getMethod() != null && !returnType.getMethod().getReturnType().getSimpleName().equals("CommonJsonResponse");
|
||||
}
|
||||
|
||||
log.error("【系统异常】{}", e);
|
||||
return CommonJsonResponse.newErrorResponse();
|
||||
}
|
||||
@Override
|
||||
public Object beforeBodyWrite(Object body, MethodParameter returnType, MediaType selectedContentType,
|
||||
Class selectedConverterType, ServerHttpRequest request, ServerHttpResponse response) {
|
||||
if(body instanceof CommonJsonResponse) {
|
||||
return body;
|
||||
}
|
||||
if(request.getURI().getPath().startsWith("/swagger")) {
|
||||
return body;
|
||||
}
|
||||
if (request.getURI().getPath().equals("/api/userinfo/ifRegisted")) {
|
||||
return body;
|
||||
}
|
||||
if (request.getURI().getPath().equals("/api/userinfo/identity")) {
|
||||
return body;
|
||||
}
|
||||
CommonJsonResponse commonJsonResponse = CommonJsonResponse.newSuccessResponse(body);
|
||||
if(returnType.getMethod().getReturnType().equals(String.class) || body instanceof String) {
|
||||
return commonJsonResponse.toJSONString();
|
||||
}
|
||||
return commonJsonResponse;
|
||||
}
|
||||
|
||||
@ExceptionHandler({PayException.class})
|
||||
@ResponseStatus
|
||||
public CommonJsonResponse handleException(PayException e) {
|
||||
log.error("【支付异常】", e);
|
||||
return CommonJsonResponse.newErrorResponse();
|
||||
}
|
||||
|
||||
@ExceptionHandler({Exception.class})
|
||||
@ResponseBody
|
||||
public CommonJsonResponse handleException(Exception e) {
|
||||
if(e instanceof MethodArgumentNotValidException) {
|
||||
// 参数验证异常处理
|
||||
MethodArgumentNotValidException validException = (MethodArgumentNotValidException) e;
|
||||
List<ObjectError> errorList = validException.getBindingResult().getAllErrors();
|
||||
StringBuffer sb = new StringBuffer();
|
||||
errorList.forEach(error ->
|
||||
sb.append(error.getDefaultMessage()).append(";"));
|
||||
log.error("【参数校验异常】{}", e);
|
||||
return CommonJsonResponse.newErrorResponse(ResponseConsts.VALIDATE_ERROR.getCode(), sb.toString());
|
||||
} if(e instanceof BusinessException) {
|
||||
club.joylink.rtss.exception.BusinessException be = (club.joylink.rtss.exception.BusinessException) e;
|
||||
log.error("【业务异常】{}", e);
|
||||
return CommonJsonResponse.newErrorResponse(be.getCode(), be.getVoMessage());
|
||||
} else if(e instanceof MissingServletRequestParameterException) {
|
||||
log.error("【接口参数异常】", e);
|
||||
return CommonJsonResponse.newErrorResponse(ResponseConsts.VALIDATE_ERROR.getCode(), "接口参数异常");
|
||||
} else if (e instanceof SimulationException) {
|
||||
club.joylink.rtss.simulation.cbtc.exception.SimulationException simulationException = (club.joylink.rtss.simulation.cbtc.exception.SimulationException) e;
|
||||
log.error("【仿真系统异常】{}", e);
|
||||
return CommonJsonResponse.newErrorResponse(simulationException.getCode(), simulationException.getMessage());
|
||||
}
|
||||
|
||||
log.error("【系统异常】{}", e);
|
||||
return CommonJsonResponse.newErrorResponse();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -26,10 +26,10 @@ public class LicenseInterceptor implements HandlerInterceptor {
|
|||
@Override
|
||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
|
||||
if (SystemEnv.isLocalEnv(otherConfig.getEnv())) {
|
||||
// log.debug(String.format("本地部署许可证验证"));
|
||||
log.debug(String.format("本地部署许可证验证"));
|
||||
LicenseVO license = this.licenseService.getLicense();
|
||||
BusinessExceptionAssertEnum.LICENSE_EXPIRED.assertNotTrue(license.isExpire(), "本地license已过期");
|
||||
// log.debug("本地许可证有效");
|
||||
log.debug("本地许可证有效");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1,71 +0,0 @@
|
|||
package club.joylink.rtss.controller.alarm;
|
||||
|
||||
import club.joylink.rtss.entity.AlarmTips;
|
||||
import club.joylink.rtss.services.alarm.AlarmTipsService;
|
||||
import club.joylink.rtss.vo.AccountVO;
|
||||
import club.joylink.rtss.vo.alarm.AlarmQueryVO;
|
||||
import club.joylink.rtss.vo.alarm.AlarmTipsCreateVO;
|
||||
import club.joylink.rtss.vo.client.PageQueryVO;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 报警提示信息配置管理
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/alarm")
|
||||
public class AlarmTipsController {
|
||||
@Autowired
|
||||
private AlarmTipsService alarmTipsService;
|
||||
|
||||
/**
|
||||
* 创建提示信息
|
||||
*/
|
||||
@PostMapping("")
|
||||
public void create(@RequestBody AlarmTipsCreateVO alarmTipsCreateVO, @RequestAttribute AccountVO user) {
|
||||
alarmTipsService.create(alarmTipsCreateVO, user.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 单条查询
|
||||
*/
|
||||
@GetMapping("")
|
||||
public AlarmTips get(AlarmQueryVO queryVO) {
|
||||
return alarmTipsService.get(queryVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public List<AlarmTips> list() {
|
||||
return alarmTipsService.list();
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
public PageVO<AlarmTips> page(PageQueryVO queryVO) {
|
||||
return alarmTipsService.page(queryVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*/
|
||||
@PutMapping("/{id}")
|
||||
public void update(@PathVariable Long id, @RequestBody AlarmTipsCreateVO createVO, @RequestAttribute AccountVO user) {
|
||||
alarmTipsService.update(id, createVO, user.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@DeleteMapping("/{id}")
|
||||
public void delete(@PathVariable Long id) {
|
||||
alarmTipsService.delete(id);
|
||||
}
|
||||
}
|
|
@ -1,86 +0,0 @@
|
|||
package club.joylink.rtss.controller.audio;
|
||||
|
||||
import club.joylink.rtss.services.audio.AudioResourcesService;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.client.audio.AudioResourcesQueryVO;
|
||||
import club.joylink.rtss.vo.client.audio.AudioResourcesVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 音频资源管理
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/audioResources")
|
||||
public class AudioResourcesController {
|
||||
@Autowired
|
||||
private AudioResourcesService audioResourcesService;
|
||||
|
||||
/**
|
||||
* 创建
|
||||
*/
|
||||
@PostMapping()
|
||||
public void create(@RequestBody @Validated(value = AudioResourcesVO.Create.class) AudioResourcesVO vo) {
|
||||
audioResourcesService.create(vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成资源
|
||||
*/
|
||||
@PostMapping("/generate")
|
||||
public void generate(@RequestBody @Validated(value = AudioResourcesVO.Generate.class) AudioResourcesVO vo) {
|
||||
audioResourcesService.generate(vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public List<AudioResourcesVO> getList() {
|
||||
return audioResourcesService.getList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询一个
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public AudioResourcesVO getById(@PathVariable Long id) {
|
||||
return audioResourcesService.getById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量查询
|
||||
*/
|
||||
@GetMapping("/list/ids")
|
||||
public List<AudioResourcesVO> getList(@RequestBody List<Long> ids) {
|
||||
return audioResourcesService.getList(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@GetMapping("/paged")
|
||||
public PageVO<AudioResourcesVO> pagedQuery(AudioResourcesQueryVO queryVO) {
|
||||
return audioResourcesService.pagedQuery(queryVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@DeleteMapping("/{id}")
|
||||
public void delete(@PathVariable Long id) {
|
||||
audioResourcesService.delete(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*/
|
||||
@PutMapping("/{id}")
|
||||
public void update(@PathVariable Long id, @RequestBody AudioResourcesVO vo) {
|
||||
audioResourcesService.update(id, vo);
|
||||
}
|
||||
|
||||
}
|
|
@ -12,8 +12,8 @@ import javax.validation.constraints.PositiveOrZero;
|
|||
/**
|
||||
* 竞赛用户点赞
|
||||
*/
|
||||
//@RestController
|
||||
//@RequestMapping(path = "/api/v1/likes")
|
||||
@RestController
|
||||
@RequestMapping(path = "/api/v1/likes")
|
||||
public class CompetitionUserLikesController {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.*;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 出题规则
|
||||
*出题规则
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/questionsRule")
|
||||
|
@ -23,18 +23,18 @@ public class RaceQuestionsRuleController {
|
|||
private IRaceQuestionsRuleService iRaceQuestionsRuleService;
|
||||
|
||||
/**
|
||||
* 添加规则
|
||||
*添加规则
|
||||
*/
|
||||
@PostMapping
|
||||
public TheoryQuestionsRuleVO create(@RequestBody @Validated TheoryQuestionsRuleVO ruleVO,
|
||||
@RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY) LoginUserInfoVO loginUserInfoVO) {
|
||||
ruleVO.setProjectCode(loginUserInfoVO.getProject());
|
||||
ruleVO.setProjectCode(loginUserInfoVO.getProject().name());
|
||||
TheoryQuestionsRuleVO vo = this.iRaceQuestionsRuleService.create(ruleVO);
|
||||
return vo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取规则列表
|
||||
*获取规则列表
|
||||
*/
|
||||
@GetMapping
|
||||
public List<TheoryQuestionsRuleVO> queryAll() {
|
||||
|
@ -43,18 +43,17 @@ public class RaceQuestionsRuleController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 分页获取规则列表
|
||||
*分页获取规则列表
|
||||
*/
|
||||
@GetMapping("paging")
|
||||
public PageVO<TheoryQuestionsRuleVO> pagingQueryRules(TheoryQuestionRuleQueryVO queryVO
|
||||
, @RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY) LoginUserInfoVO loginInfo) {
|
||||
queryVO.setProjectCode(loginInfo.getProject());
|
||||
public PageVO<TheoryQuestionsRuleVO> pagingQueryRules(TheoryQuestionRuleQueryVO queryVO, @RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY) LoginUserInfoVO loginInfo) {
|
||||
queryVO.setProjectCode(loginInfo.getProject().name());
|
||||
PageVO<TheoryQuestionsRuleVO> list = this.iRaceQuestionsRuleService.pagingQueryRules(queryVO);
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除规则
|
||||
*删除规则
|
||||
*/
|
||||
@DeleteMapping("{id}")
|
||||
public void delete(@PathVariable Integer id) {
|
||||
|
@ -62,7 +61,7 @@ public class RaceQuestionsRuleController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 查询规则内容
|
||||
*查询规则内容
|
||||
*/
|
||||
@GetMapping("{id}")
|
||||
public TheoryQuestionsRuleVO get(@PathVariable Integer id) {
|
||||
|
@ -70,7 +69,7 @@ public class RaceQuestionsRuleController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 更改规则内容
|
||||
*更改规则内容
|
||||
*/
|
||||
@PutMapping("{id}")
|
||||
public TheoryQuestionsRuleVO get(@PathVariable Integer id, @RequestBody @Validated TheoryQuestionsRuleVO ruleVO) {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package club.joylink.rtss.controller.competition.question;
|
||||
|
||||
|
||||
import club.joylink.rtss.constants.Project;
|
||||
import club.joylink.rtss.services.completition.question.IQuestionBankService;
|
||||
import club.joylink.rtss.vo.AccountVO;
|
||||
import club.joylink.rtss.vo.LoginUserInfoVO;
|
||||
|
@ -17,7 +18,7 @@ import java.util.List;
|
|||
|
||||
|
||||
/**
|
||||
* 题库管理接口
|
||||
*题库管理接口
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(path = "/api/questionBank")
|
||||
|
@ -27,25 +28,25 @@ public class QuestionBankController {
|
|||
private IQuestionBankService iQuestionBankService;
|
||||
|
||||
/**
|
||||
* 分页查询题目
|
||||
*分页查询题目
|
||||
*/
|
||||
@GetMapping(path = "/questions/paging")
|
||||
public PageVO<QuestionVO> pagingQueryQuestions(@RequestAttribute LoginUserInfoVO loginInfo, QuestionQueryVO queryVO) {
|
||||
queryVO.setProjectCode(loginInfo.getProject());
|
||||
queryVO.setProjectCode(loginInfo.getProject().name());
|
||||
return iQuestionBankService.pagingQueryQuestions(queryVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询题目列表
|
||||
*查询题目列表
|
||||
*/
|
||||
@GetMapping(path = "/questions")
|
||||
public List<QuestionVO> queryQuestions(@RequestAttribute LoginUserInfoVO loginInfo, QuestionQueryVO queryVO) {
|
||||
queryVO.setProjectCode(loginInfo.getProject());
|
||||
public List<QuestionVO> queryQuestions(@RequestAttribute LoginUserInfoVO loginInfo,QuestionQueryVO queryVO) {
|
||||
queryVO.setProjectCode(loginInfo.getProject().name());
|
||||
return iQuestionBankService.queryQuestions(queryVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取题目信息
|
||||
*获取题目信息
|
||||
*/
|
||||
@GetMapping(path = "/questions/{questionId}")
|
||||
public QuestionVO getQuestion(@PathVariable Long questionId) {
|
||||
|
@ -53,36 +54,36 @@ public class QuestionBankController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 添加题目
|
||||
*添加题目
|
||||
*/
|
||||
@PostMapping(path = "/questions")
|
||||
public void addQuestion(@Validated @RequestBody QuestionVO questionVO, @RequestAttribute LoginUserInfoVO loginInfo,
|
||||
public void addQuestion(@Validated @RequestBody QuestionVO questionVO,@RequestAttribute LoginUserInfoVO loginInfo,
|
||||
@RequestAttribute AccountVO user) {
|
||||
questionVO.setProjectCode(loginInfo.getProject());
|
||||
questionVO.setProjectCode(loginInfo.getProject().name());
|
||||
iQuestionBankService.addQuestion(questionVO, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入项目或单位试题库
|
||||
*导入项目或单位试题库
|
||||
*/
|
||||
@PostMapping(path = "/questions/import")
|
||||
public void importProjectQuestion(@Validated @RequestBody List<QuestionVO> questions, @RequestAttribute LoginUserInfoVO loginInfo,
|
||||
@RequestAttribute AccountVO user, @RequestParam(required = false, name = "id") Long companyId) {
|
||||
|
||||
iQuestionBankService.importProjectQuestion(questions, loginInfo.getProject(), companyId, user);
|
||||
iQuestionBankService.importProjectQuestion(questions, loginInfo.getProject().name(), companyId,user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新题目
|
||||
*更新题目
|
||||
*/
|
||||
@PutMapping(path = "/questions/{questionId}")
|
||||
public void updateQuestion(@PathVariable Long questionId, @RequestAttribute LoginUserInfoVO loginInfo, @RequestBody QuestionVO questionVO) {
|
||||
questionVO.setProjectCode(loginInfo.getProject());
|
||||
public void updateQuestion(@PathVariable Long questionId, @RequestAttribute LoginUserInfoVO loginInfo,@RequestBody QuestionVO questionVO) {
|
||||
questionVO.setProjectCode(loginInfo.getProject().name());
|
||||
iQuestionBankService.updateQuestion(questionId, questionVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除题目
|
||||
*删除题目
|
||||
*/
|
||||
@DeleteMapping(path = "/questions/{questionId}")
|
||||
public void deleteQuestion(@PathVariable Long questionId) {
|
||||
|
@ -90,7 +91,7 @@ public class QuestionBankController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 根据题目查询选项
|
||||
*根据题目查询选项
|
||||
*/
|
||||
@GetMapping(path = "/questions/{questionId}/options")
|
||||
public List<QuestionOptionVO> getOptionsByQuestionId(@PathVariable Long questionId) {
|
||||
|
@ -98,20 +99,22 @@ public class QuestionBankController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 根据题型获取题目数量
|
||||
*根据题型获取题目数量
|
||||
*/
|
||||
@GetMapping(path = "/number")
|
||||
public Integer getNumberUnderKnowledgeAndType(@RequestAttribute LoginUserInfoVO loginInfo, String type, Long companyId) {
|
||||
|
||||
return iQuestionBankService.getNumberWithType(type, loginInfo.getProject(), companyId);
|
||||
return iQuestionBankService.getNumberWithType(type, loginInfo.getProject().name(), companyId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取题型数量
|
||||
*获取题型数量
|
||||
*/
|
||||
@GetMapping(path = "/type/number")
|
||||
public List<TheoryQuestionCountVO> getNumberUnderKnowledgeAndType(@RequestAttribute LoginUserInfoVO loginInfo, @RequestParam(required = false) Long companyId) {
|
||||
return iQuestionBankService.countNumByType(loginInfo.getProject(), companyId);
|
||||
|
||||
String projectCode = Project.isDefault(loginInfo.getProject()) ? null : loginInfo.getProject().name();
|
||||
return iQuestionBankService.countNumByType(projectCode, companyId);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -768,10 +768,4 @@ public class DraftMapController {
|
|||
public void deleteOperationDefinition(@PathVariable Long mapId, @PathVariable String code){
|
||||
iDraftMapService.deleteOperationDefinition(mapId, code);
|
||||
}
|
||||
|
||||
//临时接口
|
||||
@PostMapping("/handle/ctc/{id}")
|
||||
public void handle(@PathVariable Long id) {
|
||||
iDraftMapService.handle(id);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,70 +0,0 @@
|
|||
package club.joylink.rtss.controller.draft;
|
||||
|
||||
import club.joylink.rtss.services.draftData.DraftMapDisStationService;
|
||||
import club.joylink.rtss.vo.client.PageQueryVO;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.map.logic.MapDisStationNewVO;
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 草稿地图 调度台 接口
|
||||
* <p>
|
||||
* 接口中路径参数id 为 mapId
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/draftMap/{id}/disStation")
|
||||
@Slf4j
|
||||
public class DraftMapDisStationController {
|
||||
@Autowired
|
||||
private DraftMapDisStationService draftMapDisStationService;
|
||||
|
||||
/**
|
||||
* 创建调度台逻辑数据
|
||||
*/
|
||||
@PostMapping
|
||||
public void create(@RequestBody MapDisStationNewVO disStationNewVO){
|
||||
this.draftMapDisStationService.create(disStationNewVO);
|
||||
}
|
||||
/**
|
||||
* 更新调度台业务
|
||||
*/
|
||||
@PutMapping
|
||||
public void update(@RequestBody MapDisStationNewVO vo){
|
||||
this.draftMapDisStationService.update(vo);
|
||||
}
|
||||
/**
|
||||
* 删除调度台业务
|
||||
*/
|
||||
@DeleteMapping("/{code}")
|
||||
public void delete(@PathVariable("id") Long mapId,@PathVariable("code") String code){
|
||||
this.draftMapDisStationService.delete(mapId,code);
|
||||
}
|
||||
/**
|
||||
* 分页获取调度台
|
||||
*/
|
||||
@PostMapping("/page")
|
||||
public PageVO<MapDisStationNewVO> findByPage(@PathVariable("id") Long mapId, @RequestBody FindByPageReq req){
|
||||
return this.draftMapDisStationService.findByPage(mapId,req);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询所有调度台
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public List<MapDisStationNewVO> listQuery(@PathVariable long id) {
|
||||
return draftMapDisStationService.listQuery(id);
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class FindByPageReq extends PageQueryVO{
|
||||
/**
|
||||
* 是否降序,true-降序,false-升序,默认值为true;
|
||||
*/
|
||||
private Boolean desc = true;
|
||||
}
|
||||
}
|
|
@ -10,9 +10,6 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 草稿地图延续保护接口
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/draftMap/{id}/overlap")
|
||||
@Slf4j
|
||||
|
|
|
@ -9,9 +9,6 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 草稿地图超限区段接口
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/draftMap/{id}/overrun")
|
||||
public class DraftMapOverrunController {
|
||||
|
|
|
@ -8,9 +8,6 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 草稿地图停站时间接口
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/draftMap/{mapId}/parkTime")
|
||||
@Slf4j
|
||||
|
|
|
@ -10,9 +10,6 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 草稿地图进路接口
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/draftMap/{id}/route")
|
||||
@Slf4j
|
||||
|
@ -26,11 +23,6 @@ public class DraftMapRouteController {
|
|||
return this.draftMapRouteService.createRailwayRoute(id, routeNewVO);
|
||||
}
|
||||
|
||||
@PostMapping("/railway/generate")
|
||||
public List<MapRouteNewVO> generateRailwayRoute(@PathVariable Long id) {
|
||||
return this.draftMapRouteService.generateRailwayRoute(id);
|
||||
}
|
||||
|
||||
@GetMapping("/paging")
|
||||
public PageVO<MapRouteNewVO> pagingQuery(@PathVariable Long id, MapRouteQueryVO queryVO) {
|
||||
return this.draftMapRouteService.pagingQuery(id, queryVO);
|
||||
|
|
|
@ -8,9 +8,6 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 草稿地图运行等级接口
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/draftMap/{mapId}/runLevel")
|
||||
@Slf4j
|
||||
|
|
|
@ -11,9 +11,6 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 草稿地图信号机接近区段接口
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/draftMap/{id}/signalApproachSection")
|
||||
@Slf4j
|
||||
|
|
|
@ -1,67 +0,0 @@
|
|||
package club.joylink.rtss.controller.draft;
|
||||
|
||||
import club.joylink.rtss.entity.DraftMapStationDirection;
|
||||
import club.joylink.rtss.services.draftData.IDraftMapStationDirectionService;
|
||||
import club.joylink.rtss.vo.client.PageQueryVO;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 草稿地图车站方向接口
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/station/direction")
|
||||
@Slf4j
|
||||
public class DraftMapStationDirectionController {
|
||||
@Autowired
|
||||
private IDraftMapStationDirectionService draftMapStationDirectionLabelService;
|
||||
|
||||
/**
|
||||
* 查询地图下车站 方向的逻辑数据列表
|
||||
*
|
||||
* @param mapId 地图ID
|
||||
* @param code Code
|
||||
* @param labelEnum 方向类型
|
||||
* @return 数据列表
|
||||
*/
|
||||
@GetMapping(path = "/list/{mapId}")
|
||||
public PageVO<DraftMapStationDirection> stationLabelList(@PathVariable Long mapId, String code
|
||||
, String labelEnum, PageQueryVO queryVO) {
|
||||
return draftMapStationDirectionLabelService.stationLabelList(mapId, code, labelEnum, queryVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID查询地图下车站 方向的逻辑数据
|
||||
*
|
||||
* @param id 关系Id
|
||||
* @return 关系实体
|
||||
*/
|
||||
@GetMapping(path = "/{id}")
|
||||
public DraftMapStationDirection queryStationLabel(@PathVariable Long id) {
|
||||
return draftMapStationDirectionLabelService.queryStationLabel(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存关联关系信息
|
||||
*
|
||||
* @param mapId 地图信息
|
||||
* @param vo 关联关系
|
||||
* @return 处理结果
|
||||
*/
|
||||
@PostMapping(path = "/save/{mapId}")
|
||||
public String saveStationLabel(@PathVariable Long mapId, @RequestBody DraftMapStationDirection vo) {
|
||||
return draftMapStationDirectionLabelService.saveStationLabel(mapId, vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除车站 方向的逻辑数据
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@DeleteMapping(path = "/delete/{id}")
|
||||
public void deleteStationLabel(@PathVariable Long id) {
|
||||
draftMapStationDirectionLabelService.deleteStationLabel(id);
|
||||
}
|
||||
}
|
|
@ -1,84 +0,0 @@
|
|||
package club.joylink.rtss.controller.iscs;
|
||||
|
||||
import club.joylink.rtss.services.iscs.IscsDeviceService;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.client.iscs.device.IscsDeviceQueryVO;
|
||||
import club.joylink.rtss.vo.client.iscs.device.IscsDeviceVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* ISCS设备管理
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/iscsDevice")
|
||||
public class IscsDeviceController {
|
||||
@Autowired
|
||||
private IscsDeviceService iscsDeviceService;
|
||||
|
||||
/**
|
||||
* 创建
|
||||
*/
|
||||
@PostMapping()
|
||||
public void create(@RequestBody IscsDeviceVO vo) {
|
||||
iscsDeviceService.create(vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量创建
|
||||
*/
|
||||
@PostMapping("/create/batch")
|
||||
public void batchCreate(@RequestBody List<IscsDeviceVO> vos) {
|
||||
iscsDeviceService.batchCreate(vos);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有
|
||||
*/
|
||||
@GetMapping("/all")
|
||||
public List<IscsDeviceVO> getAll() {
|
||||
return iscsDeviceService.getAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取一条
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public IscsDeviceVO getById(@PathVariable Long id) {
|
||||
return iscsDeviceService.getById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据mapId获取list
|
||||
*/
|
||||
@GetMapping("/list/mapId/{mapId}")
|
||||
public List<IscsDeviceVO> getListByMapId(@PathVariable Long mapId) {
|
||||
return iscsDeviceService.getListByMapId(mapId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 条件查询
|
||||
*/
|
||||
@GetMapping("/list/criteria")
|
||||
public List<IscsDeviceVO> criteriaQuery(IscsDeviceQueryVO queryVO) {
|
||||
return iscsDeviceService.criteriaQuery(queryVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@GetMapping("/paged")
|
||||
public PageVO<IscsDeviceVO> pagedQuery(IscsDeviceQueryVO queryVO) {
|
||||
return iscsDeviceService.pagedQuery(queryVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@DeleteMapping("/{id}")
|
||||
public void delete(@PathVariable Long id) {
|
||||
iscsDeviceService.delete(id);
|
||||
}
|
||||
}
|
|
@ -1,89 +0,0 @@
|
|||
package club.joylink.rtss.controller.iscs;
|
||||
|
||||
import club.joylink.rtss.services.iscs.IscsSystemResourcesService;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.client.iscs.systemRes.IscsSystemResourcesQueryVO;
|
||||
import club.joylink.rtss.vo.client.iscs.systemRes.IscsSystemResourcesVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* ISCS系统资源管理
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/systemRes")
|
||||
public class IscsSystemResourcesController {
|
||||
@Autowired
|
||||
private IscsSystemResourcesService iscsSystemResourcesService;
|
||||
|
||||
/**
|
||||
* 创建
|
||||
*/
|
||||
@PostMapping()
|
||||
public void create(@RequestBody IscsSystemResourcesVO vo) {
|
||||
iscsSystemResourcesService.create(vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量创建
|
||||
*/
|
||||
@PostMapping("/create/batch")
|
||||
public void create(@RequestBody List<IscsSystemResourcesVO> vos) {
|
||||
iscsSystemResourcesService.batchCreate(vos);
|
||||
}
|
||||
|
||||
@PostMapping("/generate/{mapId}/{type}")
|
||||
public void generate(@PathVariable long mapId, @PathVariable int type) {
|
||||
iscsSystemResourcesService.generate(mapId, type);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有
|
||||
*/
|
||||
@GetMapping("/all")
|
||||
public List<IscsSystemResourcesVO> getAll() {
|
||||
return iscsSystemResourcesService.getAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取一条
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public IscsSystemResourcesVO getById(@PathVariable Long id) {
|
||||
return iscsSystemResourcesService.getById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 连同资源获取一条
|
||||
*/
|
||||
@GetMapping("/{id}/resources")
|
||||
public IscsSystemResourcesVO getByIdWithResources(@PathVariable Long id) {
|
||||
return iscsSystemResourcesService.getByIdWithResources(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 条件查询
|
||||
*/
|
||||
@GetMapping("/list/criteria")
|
||||
public List<IscsSystemResourcesVO> criteriaQuery(IscsSystemResourcesQueryVO queryVO) {
|
||||
return iscsSystemResourcesService.criteriaQuery(queryVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@GetMapping("/paged")
|
||||
public PageVO<IscsSystemResourcesVO> pagedQuery(IscsSystemResourcesQueryVO queryVO) {
|
||||
return iscsSystemResourcesService.pagedQuery(queryVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@DeleteMapping("/{id}")
|
||||
public void delete(@PathVariable Long id) {
|
||||
iscsSystemResourcesService.delete(id);
|
||||
}
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
package club.joylink.rtss.controller.org;
|
||||
|
||||
import club.joylink.rtss.services.org.IOrgService;
|
||||
import club.joylink.rtss.vo.client.org.OrgVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 组织相关数据管理
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/org")
|
||||
public class OrgController {
|
||||
@Autowired
|
||||
private IOrgService iOrgService;
|
||||
|
||||
/**
|
||||
* 列表查询该组织下的所有班级
|
||||
*/
|
||||
@GetMapping("/{topOrgId}/cls/list")
|
||||
public List<OrgVO> listQueryCls(@PathVariable long topOrgId) {
|
||||
return iOrgService.listQueryCls(topOrgId);
|
||||
}
|
||||
}
|
|
@ -1,98 +0,0 @@
|
|||
package club.joylink.rtss.controller.org;
|
||||
|
||||
import club.joylink.rtss.constants.Project;
|
||||
import club.joylink.rtss.dao.OrgDAO;
|
||||
import club.joylink.rtss.dao.OrgProjectDAO;
|
||||
import club.joylink.rtss.dao.project.ProjectDAO;
|
||||
import club.joylink.rtss.entity.Org;
|
||||
import club.joylink.rtss.entity.OrgExample;
|
||||
import club.joylink.rtss.entity.OrgProject;
|
||||
import club.joylink.rtss.services.org.IOrgProjectService;
|
||||
import club.joylink.rtss.vo.LoginUserInfoVO;
|
||||
import club.joylink.rtss.vo.client.org.OrgProjectVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static club.joylink.rtss.controller.advice.AuthenticateInterceptor.LOGIN_INFO_KEY;
|
||||
|
||||
/**
|
||||
* 组织-项目关系管理接口
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/api/orgProject")
|
||||
public class OrgProjectController {
|
||||
|
||||
@Autowired
|
||||
private IOrgProjectService orgProjectService;
|
||||
|
||||
/**
|
||||
* 用户登录时,要选择的组织列表(目前先查询顶级组织)
|
||||
*/
|
||||
@GetMapping("list")
|
||||
public List<OrgProjectVO> queryOrgList(@RequestAttribute LoginUserInfoVO loginInfo) {
|
||||
return orgProjectService.queryOrgProjectListByProjectAndUid(loginInfo.getProjectInfo(), loginInfo.getAccountVO().getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 选择登入组织(目前先查询顶级组织)
|
||||
*/
|
||||
@PutMapping("signIn/{orgId}")
|
||||
public void signInOrg(@PathVariable Long orgId, @RequestAttribute(name = LOGIN_INFO_KEY) LoginUserInfoVO loginInfo) {
|
||||
orgProjectService.signInOrg(orgId, loginInfo);
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private OrgProjectDAO orgProjectDAO;
|
||||
@Autowired
|
||||
private OrgDAO orgDAO;
|
||||
@Autowired
|
||||
ProjectDAO projectDAO;
|
||||
|
||||
/**
|
||||
* 旧数据处理(用完删除)
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@PostMapping("/oldData/handle")
|
||||
public void oldDataHandle() {
|
||||
orgProjectDAO.deleteByExample(null);
|
||||
|
||||
//查询项目和组织数据
|
||||
Map<String, club.joylink.rtss.entity.project.Project> projectMap = projectDAO.selectByExample(null).stream()
|
||||
.collect(Collectors.toMap(club.joylink.rtss.entity.project.Project::getCode, Function.identity()));
|
||||
OrgExample orgExample = new OrgExample();
|
||||
orgExample.clear();
|
||||
orgExample.createCriteria().andStatusEqualTo("1").andParentIdIsNull();
|
||||
Map<String, Org> orgMap = orgDAO.selectByExample(orgExample).stream()
|
||||
.collect(Collectors.toMap(Org::getProjectCode, Function.identity()));
|
||||
|
||||
OrgProject orgProject = new OrgProject();
|
||||
orgProject.setCreateTime(LocalDateTime.now());
|
||||
orgProject.setCreatorId(1L);
|
||||
for (Map.Entry<String, club.joylink.rtss.entity.project.Project> entry : projectMap.entrySet()) {
|
||||
String projectCode = entry.getKey();
|
||||
club.joylink.rtss.entity.project.Project project = entry.getValue();
|
||||
//建立项目-组织关系
|
||||
Org org = orgMap.get(projectCode);
|
||||
if (org == null) {
|
||||
org = orgMap.get(Project.DEFAULT.name());
|
||||
}
|
||||
orgProject.setId(null);
|
||||
orgProject.setProjectCode(projectCode);
|
||||
orgProject.setOrgId(org.getId());
|
||||
log.info(orgProject.getOrgId() + "-" + orgProject.getProjectCode());
|
||||
orgProjectDAO.insert(orgProject);
|
||||
//修改项目默认组织
|
||||
project.setDefaultOrg(org.getId());
|
||||
projectDAO.updateByPrimaryKey(project);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,54 +0,0 @@
|
|||
package club.joylink.rtss.controller.org;
|
||||
|
||||
import club.joylink.rtss.constants.RoleEnum;
|
||||
import club.joylink.rtss.controller.advice.Role;
|
||||
import club.joylink.rtss.services.org.OrgUserManageService;
|
||||
import club.joylink.rtss.vo.AccountVO;
|
||||
import club.joylink.rtss.vo.org.OrgUserParam;
|
||||
import club.joylink.rtss.vo.org.OrgUserQueryParam;
|
||||
import club.joylink.rtss.vo.org.OrgUserRoleVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 组织-用户-管理列表
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/manage")
|
||||
public class OrgUserManageController {
|
||||
|
||||
@Autowired
|
||||
private OrgUserManageService orgUserManageService;
|
||||
|
||||
/**
|
||||
* 修改角色关系时,查询用户列表
|
||||
*/
|
||||
@Role({RoleEnum.Admin, RoleEnum.SuperAdmin})
|
||||
@GetMapping(path = "/user/list")
|
||||
public List<AccountVO> queryUserList(OrgUserQueryParam param) {
|
||||
return orgUserManageService.queryUserList(param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定用户角色
|
||||
*/
|
||||
@Role({RoleEnum.Admin, RoleEnum.SuperAdmin})
|
||||
@PostMapping("/bind/org")
|
||||
public void bindOrgUserRole(@RequestBody OrgUserParam param) {
|
||||
orgUserManageService.bindOrgUserRole(param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据用户查询用户角色列表
|
||||
*
|
||||
* @param uid 用户ID
|
||||
* @return 角色列表
|
||||
*/
|
||||
@Role({RoleEnum.Admin, RoleEnum.SuperAdmin})
|
||||
@GetMapping("/{uid}/roles")
|
||||
public List<OrgUserRoleVO> queryUserRoleList(@PathVariable Long uid){
|
||||
return orgUserManageService.queryUserRoleList(uid);
|
||||
}
|
||||
}
|
|
@ -1,135 +0,0 @@
|
|||
package club.joylink.rtss.controller.paper;
|
||||
|
||||
|
||||
import club.joylink.rtss.constants.RoleEnum;
|
||||
import club.joylink.rtss.controller.advice.Role;
|
||||
import club.joylink.rtss.services.paper.PagerQuestionService;
|
||||
import club.joylink.rtss.vo.AccountVO;
|
||||
import club.joylink.rtss.vo.LoginUserInfoVO;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.client.pager.question.PagerLableQueryVO;
|
||||
import club.joylink.rtss.vo.client.pager.question.PaperQuestionVO;
|
||||
|
||||
import club.joylink.rtss.vo.client.pager.question.QuestionQueryVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 题库管理接口
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(path = "/api/question")
|
||||
public class PagerQuestionBankController {
|
||||
|
||||
@Autowired
|
||||
private PagerQuestionService questionBankService;
|
||||
/**
|
||||
* 管理查询题库
|
||||
*/
|
||||
@Role(value = RoleEnum.SuperAdmin)
|
||||
@GetMapping(path = "/paging")
|
||||
public PageVO<PaperQuestionVO> pagingQueryQuestions(QuestionQueryVO queryVO) {
|
||||
queryVO.setOrgId(queryVO.getOrgId());
|
||||
return questionBankService.pagingQueryQuestions(queryVO,true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询题目
|
||||
*/
|
||||
@GetMapping(path = "/org/paging")
|
||||
public PageVO<PaperQuestionVO> pagingQueryQuestions(@RequestAttribute LoginUserInfoVO loginInfo, QuestionQueryVO queryVO) {
|
||||
queryVO.setOrgId(loginInfo.getTopOrgId());
|
||||
return questionBankService.pagingQueryQuestions(queryVO,false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询题目列表
|
||||
*/
|
||||
@GetMapping(path = "/org")
|
||||
public List<PaperQuestionVO> queryQuestions(@RequestAttribute LoginUserInfoVO loginInfo, QuestionQueryVO queryVO) {
|
||||
queryVO.setOrgId(loginInfo.getTopOrgId());
|
||||
return questionBankService.queryQuestions(queryVO,false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取题目信息或预览
|
||||
*/
|
||||
@GetMapping(path = "/org/{questionId}")
|
||||
public PaperQuestionVO getQuestion(@PathVariable Long questionId,@RequestParam(name = "random",defaultValue = "false") boolean random) {
|
||||
return questionBankService.getQuestion(questionId, false,random);
|
||||
}
|
||||
|
||||
@PostMapping(path = "/org/test/answer/{questionId}")
|
||||
public boolean testAnswer(@PathVariable Long questionId,@RequestBody List<Integer> answers){
|
||||
return this.questionBankService.answer(questionId,answers);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加题目
|
||||
*/
|
||||
@PostMapping(path = "/org")
|
||||
public void addQuestion(@Validated @RequestBody PaperQuestionVO questionVO, @RequestAttribute LoginUserInfoVO loginInfo) {
|
||||
questionVO.setOrgId(loginInfo.getTopOrgId());
|
||||
questionBankService.saveOrUpdate(questionVO, loginInfo.getAccountVO());
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入项目或单位试题库
|
||||
*/
|
||||
@PostMapping(path = "/org/import")
|
||||
public void importProjectQuestion(@Validated @RequestBody List<PaperQuestionVO> questions, @RequestAttribute LoginUserInfoVO loginInfo) {
|
||||
questionBankService.importProjectQuestion(questions, loginInfo.getTopOrgId(), loginInfo.getAccountVO());
|
||||
}
|
||||
|
||||
@GetMapping(path="/org/clear")
|
||||
public void clearAllForOrg(@RequestAttribute LoginUserInfoVO loginInfo){
|
||||
this.questionBankService.clearAllForOrgId(loginInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据companyId 查询所有的标签
|
||||
*
|
||||
*/
|
||||
@GetMapping(path = "/org/label")
|
||||
public Collection<String> findAllLable(@RequestAttribute LoginUserInfoVO loginInfo,@RequestParam(name="type",required = false) String type) {
|
||||
return this.questionBankService.findAllLable(loginInfo.getTopOrgId() ,type);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据标签查询所有的题型
|
||||
*
|
||||
*/
|
||||
@PostMapping(path = "/org/label/question")
|
||||
public List<PaperQuestionVO> findByLable(@RequestAttribute LoginUserInfoVO loginInfo, @RequestBody PagerLableQueryVO queryVO) {
|
||||
|
||||
return this.questionBankService.queryQuestionsForRaceLable(loginInfo.getTopOrgId(),queryVO);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新题目
|
||||
*
|
||||
*/
|
||||
@PutMapping(path = "/org/{questionId}")
|
||||
public void updateQuestion(@PathVariable Long questionId, @RequestAttribute LoginUserInfoVO loginInfo, @RequestBody PaperQuestionVO questionVO, @RequestAttribute AccountVO user) {
|
||||
questionVO.setId(questionId);
|
||||
questionVO.setOrgId(loginInfo.getTopOrgId());
|
||||
questionBankService.saveOrUpdate(questionVO, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除题目
|
||||
*/
|
||||
@DeleteMapping(path = "/org")
|
||||
public void deleteQuestion(@RequestBody List<Long> questionId) {
|
||||
questionBankService.deleteQuestion(questionId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,161 +0,0 @@
|
|||
package club.joylink.rtss.controller.paper;
|
||||
|
||||
import club.joylink.rtss.constants.RoleEnum;
|
||||
import club.joylink.rtss.controller.advice.Role;
|
||||
import club.joylink.rtss.services.paper.PaperCompositionService;
|
||||
import club.joylink.rtss.vo.AccountVO;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.paper.CreatePaperCompositionRspVo;
|
||||
import club.joylink.rtss.vo.paper.FindPaperCompositionByAccountReqVo;
|
||||
import club.joylink.rtss.vo.paper.FindPaperCompositionPageReqVo;
|
||||
import club.joylink.rtss.vo.paper.PaperCompositionWithRuleVo;
|
||||
import club.joylink.rtss.vo.paper.PaperCompositionWithRuleVo.CreatorBasic;
|
||||
import java.util.List;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 试卷蓝图业务接口
|
||||
* <p>
|
||||
* 试卷蓝图状态解释:<br> 编辑中-可以修改、删除;封存-不可以修改删除,可以用来生成试卷,可以状态迁移编辑中和已使用;已使用-已经被用来生成过试卷,不可以修改删除,状态也不能改变。
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/api/v2/paper/composition")
|
||||
public class PaperCompositionController {
|
||||
|
||||
@Autowired
|
||||
private PaperCompositionService compositionService;
|
||||
|
||||
/**
|
||||
* 数据管理查询
|
||||
*
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@Role(value = RoleEnum.SuperAdmin)
|
||||
@PostMapping(path = "/manage/paging")
|
||||
public PageVO<PaperCompositionWithRuleVo> findPaperCompositionForPage(
|
||||
@RequestBody FindPaperCompositionPageReqVo req) {
|
||||
return this.compositionService.findPaperCompositionByPage(req);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建试卷蓝图包括规则定义 参数 tags 只支持单个
|
||||
*
|
||||
* @param orgId 组织id
|
||||
*/
|
||||
@PostMapping("/{orgId}")
|
||||
public CreatePaperCompositionRspVo createPaperCompositionWithRuleForOrg(
|
||||
@PathVariable("orgId") Long orgId, @RequestBody PaperCompositionWithRuleVo req,
|
||||
@RequestAttribute AccountVO user) {
|
||||
req.setOrgId(orgId);
|
||||
return this.compositionService.createPaperCompositionWithRule(req, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新试卷蓝图包括规则定义 参数 tags 只支持单个
|
||||
*/
|
||||
@PutMapping
|
||||
public void updatePaperCompositionWithRule(@RequestBody PaperCompositionWithRuleVo req,
|
||||
@RequestAttribute AccountVO user) {
|
||||
this.compositionService.updatePaperCompositionWithRule(req, user);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 将编辑好的试卷蓝图封存
|
||||
*/
|
||||
@PutMapping("/{pcId}/lock")
|
||||
public void lockPaperComposition(@PathVariable("pcId") Long pcId,
|
||||
@RequestAttribute AccountVO user) {
|
||||
compositionService.lockPaperComposition(pcId, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将封存的试卷蓝图设置失效
|
||||
*/
|
||||
@PutMapping("/{pcId}/invalid")
|
||||
public void invalidPaperComposition(@PathVariable("pcId") Long pcId,
|
||||
@RequestAttribute AccountVO user) {
|
||||
compositionService.unlockPaperComposition(pcId, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除试卷蓝图(只能删除处于编辑状态的)
|
||||
*
|
||||
* @param pcId 试卷蓝图id
|
||||
*/
|
||||
@DeleteMapping("/{pcId}")
|
||||
public void deletePaperComposition(@PathVariable("pcId") Long pcId,
|
||||
@RequestAttribute AccountVO user) {
|
||||
compositionService.deletePaperComposition(pcId, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据(组织id、线路id、试卷蓝图名称简介)分页查找试卷蓝图
|
||||
*/
|
||||
@PostMapping("/find/page")
|
||||
public PageVO<PaperCompositionWithRuleVo> findPaperCompositionByPage(
|
||||
@RequestBody FindPaperCompositionPageReqVo req) {
|
||||
return this.compositionService.findPaperCompositionByPage(req);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询试卷的创建者的信息
|
||||
*/
|
||||
@PostMapping("/list/creatorInfo")
|
||||
public List<CreatorBasic> queryCreatorList(@RequestBody FindPaperCompositionPageReqVo req) {
|
||||
return compositionService.queryCreatorList(req);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据mapId查询蓝图的基本信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/find/list")
|
||||
public List<PaperCompositionWithRuleVo> findPaperCompositionByList(
|
||||
@RequestBody FindPaperCompositionPageReqVo req) {
|
||||
return this.compositionService.findPaperCompositionList(req);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据试卷蓝图名称简介分页查找某个组织的试卷蓝图
|
||||
*/
|
||||
@PostMapping("/find/page/for/{orgId}")
|
||||
public PageVO<PaperCompositionWithRuleVo> findPaperCompositionForOrgByPage(
|
||||
@PathVariable("orgId") Long orgId, @RequestBody FindPaperCompositionPageReqVo req) {
|
||||
req.setOrgId(orgId);
|
||||
return this.compositionService.findPaperCompositionByPage(req);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据账户分页查找试卷蓝图
|
||||
*/
|
||||
@PostMapping("/find/page/by/account")
|
||||
public PageVO<PaperCompositionWithRuleVo> findAccountPaperCompositionByPage(
|
||||
@RequestBody FindPaperCompositionByAccountReqVo req) {
|
||||
return this.compositionService.findPaperCompositionByPageForAccount(req);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取试卷完整的蓝图,包括规则
|
||||
*
|
||||
* @param pcId 试卷蓝图id
|
||||
*/
|
||||
@GetMapping("/{pcId}")
|
||||
public PaperCompositionWithRuleVo findPaperComposition(@PathVariable("pcId") Long pcId,
|
||||
@RequestAttribute AccountVO user) {
|
||||
return this.compositionService.findPaperComposition(pcId, user);
|
||||
}
|
||||
}
|
|
@ -1,136 +0,0 @@
|
|||
package club.joylink.rtss.controller.paper;
|
||||
|
||||
import club.joylink.rtss.services.paper.*;
|
||||
import club.joylink.rtss.vo.AccountVO;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.paper.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户试卷
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/api/v2/paper")
|
||||
public class PaperUserController {
|
||||
|
||||
@Autowired
|
||||
private PaperUserService paperUserService;
|
||||
@Autowired
|
||||
private PaperUserCreateService paperUserCreateService;
|
||||
@Autowired
|
||||
private PaperUserLoadQuestionService paperUserLoadQuestionService;
|
||||
@Autowired
|
||||
private PaperUserSubmitAnswerService paperUserSubmitAnswerService;
|
||||
@Autowired
|
||||
private PaperUserFindPageService paperUserFindPageService;
|
||||
|
||||
/**
|
||||
* 根据试卷蓝图生成用户的试卷
|
||||
*
|
||||
* @param pcId 试卷蓝图id
|
||||
*/
|
||||
@PostMapping("/{pcId}")
|
||||
public CreatePaperRspVo createPaper(@PathVariable("pcId") Long pcId,
|
||||
@RequestAttribute AccountVO user) {
|
||||
return this.paperUserCreateService.createPaper(pcId, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户试卷完整信息
|
||||
*
|
||||
* @param puId 用户试卷id
|
||||
*/
|
||||
@GetMapping("/user/{puId}")
|
||||
public PaperUserWholeVo findPaperUser(@PathVariable("puId") Long puId,
|
||||
@RequestAttribute AccountVO user) {
|
||||
return this.paperUserService.findPaperUser(puId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 用户交卷
|
||||
*
|
||||
* @param puId 用户试卷id
|
||||
*/
|
||||
@PostMapping("/user/{puId}/submit")
|
||||
public PaperSubmitRspVo paperSubmit(@PathVariable("puId") Long puId,
|
||||
@RequestAttribute AccountVO user) {
|
||||
return this.paperUserService.paperSubmit(puId, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载用户试卷试题
|
||||
*
|
||||
* @param groupType 试卷试题大类型:1-理论题,2-实训题
|
||||
* @param qId 试题id
|
||||
* @param puId 试卷id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/user/question/{groupType}/{qId}/{puId}")
|
||||
public PaperQuestionLoadRspVo loadQuestion(@PathVariable("groupType") Integer groupType,
|
||||
@PathVariable("qId") Long qId, @PathVariable("puId") Long puId,
|
||||
@RequestAttribute AccountVO user) {
|
||||
PaperQType.GroupType pgType = PaperQType.GroupType.getItem(groupType);
|
||||
return this.paperUserLoadQuestionService.loadQuestion(pgType, qId, puId, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户提交答案
|
||||
* <p>
|
||||
* 对于理论题:用户完成一道题提交一道题的答案;<br> 对于实训题:用户完成实训操作后,由实训系统自己评判实训是否成功完成,前端提交实训是否成功完成的结果即可。
|
||||
*/
|
||||
@PostMapping("/user/question/answer")
|
||||
public PaperSubmitAnswerRspVo submitAnswer(@RequestBody PaperSubmitAnswerReqVo req,
|
||||
@RequestAttribute AccountVO user) {
|
||||
return this.paperUserSubmitAnswerService.submitAnswer(req, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询某个试卷蓝图的所有用户试卷基本信息
|
||||
*/
|
||||
/* @PostMapping("/user/page/composition")
|
||||
public PageVO<PaperUserInfoVo> findPaperUserByPage(@RequestBody FindPaperUserForCompositionReqVo req, @RequestAttribute AccountVO user) {
|
||||
return this.paperUserFindPageService.findPaperUserByPage(req);
|
||||
}*/
|
||||
|
||||
/**
|
||||
* 查看某个班级的某个试卷蓝图的所有学生试卷
|
||||
*/
|
||||
@GetMapping("/user/page")
|
||||
public PageVO<PageUserDetailVO> findPaperUserByPageForClass(
|
||||
@ModelAttribute PageUserDetailQuery req) {
|
||||
return this.paperUserFindPageService.findPaperUserByPageForClass(req);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看某个班级的某个试卷蓝图的所有学生试卷 (柱状图)
|
||||
*
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/user/curve")
|
||||
public CurveForClassVO curveForClass(@ModelAttribute PageUserDetailQuery req) {
|
||||
return this.paperUserFindPageService.curveForClass(req);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/question/label")
|
||||
public Collection<String> paperAllLabel(@RequestBody FindCountForQuestionReqVo req) {
|
||||
return this.paperUserService.findAllLabel(req);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看组织下某个类型题的数量 参数 tags 目前只支持单个
|
||||
*/
|
||||
@PostMapping("/question/count")
|
||||
public Long findCountForQuestion(@RequestBody FindCountForQuestionReqVo req) {
|
||||
// req.setOrgId(orgId);
|
||||
return this.paperUserService.findCountForQuestion(req);
|
||||
}
|
||||
}
|
|
@ -1,11 +1,10 @@
|
|||
package club.joylink.rtss.controller.permission;
|
||||
|
||||
import club.joylink.rtss.constants.Project;
|
||||
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.IPermissionDistributeService;
|
||||
import club.joylink.rtss.vo.AccountVO;
|
||||
import club.joylink.rtss.vo.LoginUserInfoVO;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.client.order.OrderCreateVO;
|
||||
import club.joylink.rtss.vo.client.permissionDistribute.DistributeVO;
|
||||
|
@ -19,7 +18,7 @@ import org.springframework.web.bind.annotation.*;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 权限分发管理接口
|
||||
*权限分发管理接口
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/distribute")
|
||||
|
@ -29,7 +28,7 @@ public class PermissionDistributeController {
|
|||
private IPermissionDistributeService permissionDistributeService;
|
||||
|
||||
/**
|
||||
* 分页查询权限分发数据
|
||||
*分页查询权限分发数据
|
||||
*/
|
||||
@GetMapping(path = "")
|
||||
public PageVO<DistributeVO> queryPagedDistribute(PermissionDistributeQueryVO queryVO) {
|
||||
|
@ -37,15 +36,15 @@ public class PermissionDistributeController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 生成打包分发二维码
|
||||
*生成打包分发二维码
|
||||
*/
|
||||
@GetMapping(path = "/package/qrCode")
|
||||
public String generateQrCode(Long id, @RequestAttribute(value = AuthenticateInterceptor.LOGIN_INFO_KEY) LoginUserInfoVO loginInfo) {
|
||||
return this.permissionDistributeService.generateQrCode(id, loginInfo.getProject());
|
||||
public String generateQrCode(Long id) {
|
||||
return this.permissionDistributeService.generateQrCode(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 权限分发立即失效
|
||||
*权限分发立即失效
|
||||
*/
|
||||
@GetMapping(path = "/{id}/invalid")
|
||||
public void immediateInvalid(@PathVariable Long id) {
|
||||
|
@ -53,15 +52,15 @@ public class PermissionDistributeController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 从订单分发权限,获取权限分发二维码
|
||||
*从订单分发权限,获取权限分发二维码
|
||||
*/
|
||||
@GetMapping(path = "/{orderCode}/distribute")
|
||||
public String givePermission(@PathVariable String orderCode, @RequestAttribute LoginUserInfoVO loginInfo) {
|
||||
return permissionDistributeService.distributeFromOrder(orderCode, loginInfo.getAccountVO(), loginInfo.getProject());
|
||||
public String givePermission(@PathVariable String orderCode, @RequestAttribute AccountVO user) {
|
||||
return permissionDistributeService.distributeFromOrder(orderCode, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 权限获取
|
||||
*权限获取
|
||||
*/
|
||||
@GetMapping(path = "/getPermission")
|
||||
public void getPermission(Long state, @RequestAttribute AccountVO user) {
|
||||
|
@ -70,7 +69,6 @@ public class PermissionDistributeController {
|
|||
|
||||
/**
|
||||
* 将权限分发包分发给指定账户
|
||||
*
|
||||
* @param id
|
||||
* @param accountId
|
||||
* @param user
|
||||
|
@ -82,15 +80,15 @@ public class PermissionDistributeController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 快速生成权限分发
|
||||
*快速生成权限分发
|
||||
*/
|
||||
@PostMapping(path = "/createQuickly")
|
||||
public String createQuickly(@RequestBody OrderCreateVO orderCreateVO, @RequestAttribute LoginUserInfoVO loginInfo) {
|
||||
return permissionDistributeService.createQuickly(orderCreateVO, loginInfo.getAccountVO(), loginInfo.getProject());
|
||||
public String createQuickly(@RequestBody OrderCreateVO orderCreateVO, @RequestAttribute AccountVO user) {
|
||||
return permissionDistributeService.createQuickly(orderCreateVO, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信小程序扫码获取权限
|
||||
*微信小程序扫码获取权限
|
||||
*/
|
||||
@GetMapping(path = "/permission")
|
||||
public List<UserPermissionVO> wmGetPermission(String code, Long id) {
|
||||
|
@ -98,15 +96,15 @@ public class PermissionDistributeController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 用户权限转增分发打包生成权限
|
||||
*用户权限转增分发打包生成权限
|
||||
*/
|
||||
@PostMapping(path = "/packageUserPermission")
|
||||
public String packageUserPermission(@RequestBody @Validated UserPermissionDistributeVO userPermissionAndAmountVO, @RequestAttribute LoginUserInfoVO loginInfo) {
|
||||
return permissionDistributeService.distributeFromUserPermission(userPermissionAndAmountVO, loginInfo);
|
||||
public String packageUserPermission(@RequestBody @Validated UserPermissionDistributeVO userPermissionAndAmountVO, @RequestAttribute AccountVO user) {
|
||||
return permissionDistributeService.distributeFromUserPermission(userPermissionAndAmountVO, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询个人权限分发列表
|
||||
*查询个人权限分发列表
|
||||
*/
|
||||
@GetMapping(path = "/personal")
|
||||
public List<DistributeVO> queryPersonalDistributeList(@RequestAttribute AccountVO user) {
|
||||
|
@ -114,7 +112,7 @@ public class PermissionDistributeController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 查询权限分发领取用户列表
|
||||
*查询权限分发领取用户列表
|
||||
*/
|
||||
@GetMapping(path = "/{id}/users")
|
||||
public List<UserPermissionVO> queryDistributeGetUsers(@PathVariable Long id, @RequestAttribute AccountVO user) {
|
||||
|
@ -122,7 +120,7 @@ public class PermissionDistributeController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 回收权限分发到用户权限中
|
||||
*回收权限分发到用户权限中
|
||||
*/
|
||||
@PutMapping(path = "/{id}/restore")
|
||||
public void restore(@PathVariable Long id) {
|
||||
|
@ -130,7 +128,7 @@ public class PermissionDistributeController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 查询权限分发包详情
|
||||
*查询权限分发包详情
|
||||
*/
|
||||
@GetMapping(path = "/package/{id}/detail")
|
||||
public PageVO<DistributeVO> queryPackageDetail(@PathVariable Long id,
|
||||
|
@ -143,8 +141,8 @@ public class PermissionDistributeController {
|
|||
*创建项目下所有地图权限的权限分发
|
||||
*/
|
||||
@PostMapping("/{project}/allMap/distribute")
|
||||
public String createAllMapDistribute(@PathVariable String project, Integer num, @RequestAttribute LoginUserInfoVO loginInfo) {
|
||||
return permissionDistributeService.createAllMapDistribute(project, num, loginInfo);
|
||||
public String createAllMapDistribute(@PathVariable Project project, Integer num, @RequestAttribute AccountVO user) {
|
||||
return permissionDistributeService.createAllMapDistribute(project, num, user);
|
||||
}
|
||||
|
||||
@Role(RoleEnum.SuperAdmin)
|
||||
|
|
|
@ -1,104 +0,0 @@
|
|||
package club.joylink.rtss.controller.permission2;
|
||||
|
||||
import club.joylink.rtss.services.permission.AcPermissionService;
|
||||
import club.joylink.rtss.vo.AccountVO;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.permission.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 权限管理接口V2
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/v2/permission")
|
||||
public class AcPermissionController {
|
||||
@Autowired
|
||||
private AcPermissionService permissionService;
|
||||
|
||||
/**
|
||||
* 创建权限
|
||||
*
|
||||
* @return 如果创建成功,则返回权限id
|
||||
*/
|
||||
@PostMapping("/create")
|
||||
public String createPermission(@RequestBody CreatePermissionReqVo req, @RequestAttribute AccountVO user) {
|
||||
return this.permissionService.createPermission(req, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 权限修改
|
||||
* @param req
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
@PutMapping("/update")
|
||||
public String updatePermission(@RequestBody CreatePermissionReqVo req, @RequestAttribute AccountVO user) {
|
||||
return this.permissionService.createPermission(req, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改权限基础信息(名称和描述)
|
||||
*/
|
||||
@PutMapping("/basic")
|
||||
public void updatePermissionBasic(@RequestBody UpdatePermissionBasicReqVo req) {
|
||||
this.permissionService.updatePermissionBasic(req);
|
||||
}
|
||||
|
||||
/**
|
||||
* 给权限添加功能
|
||||
*
|
||||
* @param permissionId 权限id
|
||||
* @param abilityId 权限功能id,即system_ability.id
|
||||
*/
|
||||
@PostMapping("/{permissionId}/accept/{abilityId}")
|
||||
public void addAbilityToPermission(@PathVariable("permissionId") Long permissionId, @PathVariable("abilityId") Long abilityId) {
|
||||
this.permissionService.addAbilityToPermission(permissionId, abilityId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取权限的所有功能
|
||||
*
|
||||
* @param permissionId 权限id
|
||||
*/
|
||||
@GetMapping("/{permissionId}/abilities")
|
||||
public List<PermissionAbilityRspVo> findPermissionAbilities(@PathVariable("permissionId") Long permissionId) {
|
||||
return this.permissionService.findPermissionAbilities(permissionId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有权限列表
|
||||
* @param name 模糊匹配权限名称
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/all")
|
||||
public List<PermissionBasicRspVo> findAllPermission(@RequestParam(value = "name",required = false) String name) {
|
||||
return this.permissionService.findAllPermission(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除权限的功能
|
||||
*/
|
||||
@DeleteMapping("/{permissionId}/abilities")
|
||||
public void deleteAbilities(@RequestBody PermissionAbilityDeletedReqVo req) {
|
||||
this.permissionService.deleteAbilities(req);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取一个权限的完整信息
|
||||
*/
|
||||
@GetMapping("/{permissionId}/whole")
|
||||
public WholePermissionRspVo findWholePermission(@PathVariable("permissionId") Long permissionId) {
|
||||
return this.permissionService.findWholePermission(permissionId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页获取权限
|
||||
*/
|
||||
@PostMapping("/find/page")
|
||||
public PageVO<PermissionBasicRspVo> findByPage(@RequestBody FindPermissionBasicByPageReqVo req) {
|
||||
return this.permissionService.findByPage(req);
|
||||
}
|
||||
}
|
|
@ -1,73 +0,0 @@
|
|||
package club.joylink.rtss.controller.permission2;
|
||||
|
||||
import club.joylink.rtss.controller.advice.AuthenticateInterceptor;
|
||||
import club.joylink.rtss.services.permission.IDistributeService;
|
||||
import club.joylink.rtss.vo.AccountVO;
|
||||
import club.joylink.rtss.vo.LoginUserInfoVO;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.permission.*;
|
||||
import club.joylink.rtss.vo.permission.distribute.DistributeDataVO;
|
||||
import club.joylink.rtss.vo.permission.distribute.DistributeQueryVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 权限分发业务接口V3
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/v3/permission/distribute")
|
||||
public class DistributeController {
|
||||
@Autowired
|
||||
private IDistributeService distributeService;
|
||||
|
||||
/**
|
||||
* 创建权限分发
|
||||
*/
|
||||
@PostMapping("/create")
|
||||
public void createDistribute(@RequestBody DistributeDataVO req, @RequestAttribute AccountVO user) {
|
||||
this.distributeService.create(req,user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页获取权限分发列表
|
||||
*/
|
||||
@PostMapping("/paging")
|
||||
public PageVO<DistributeDataVO> paging(@RequestBody DistributeQueryVO req) {
|
||||
return this.distributeService.paging(req);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看权限分发列表或分页对应的分发明细
|
||||
* @param disId 分发id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/list/distribute/{disId}")
|
||||
public List<DistributeDataVO.DistributePermissionVO> permissionList(@PathVariable(name="disId") Long disId){
|
||||
return this.distributeService.distributePermissionRefList(disId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成分发二维码
|
||||
*
|
||||
* @param pdId 权限分发id
|
||||
*/
|
||||
@GetMapping(path = "/{pdId}/qrCode")
|
||||
public String generateQrCode(@PathVariable("pdId") Long pdId, @RequestAttribute(value = AuthenticateInterceptor.LOGIN_INFO_KEY) LoginUserInfoVO loginInfo) {
|
||||
return this.distributeService.generateQrCode(pdId, loginInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 从权限分发,直接分发给指定主体
|
||||
*
|
||||
* @param pdId 权限分发id
|
||||
* @param subjectType 主体类型,其值为(user,org,project),user-一般用户,org-组织,project - 项目
|
||||
*
|
||||
*/
|
||||
@PostMapping("/{pdId}/to/{subjectType}/{subjectId}")
|
||||
public void permissionDistributeToSubject(@PathVariable("pdId") Long pdId, @PathVariable("subjectType") String subjectType, @PathVariable("subjectId") Long subjectId) {
|
||||
final PermissionSubjectTypeEnum subjectTypeEnum = PermissionSubjectTypeEnum.valueOf(subjectType);
|
||||
this.distributeService.subjectAcceptFromPermissionDistribute(pdId, subjectTypeEnum, subjectId);
|
||||
}
|
||||
}
|
|
@ -1,63 +0,0 @@
|
|||
package club.joylink.rtss.controller.permission2;
|
||||
|
||||
import club.joylink.rtss.constants.RoleEnum;
|
||||
import club.joylink.rtss.controller.advice.Role;
|
||||
import club.joylink.rtss.services.permission.PermissionSubjectService;
|
||||
import club.joylink.rtss.vo.LoginUserInfoVO;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.permission.subject.PermissionSubjectQueryVO;
|
||||
import club.joylink.rtss.vo.permission.subject.PermissionSubjectVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static club.joylink.rtss.controller.advice.AuthenticateInterceptor.LOGIN_INFO_KEY;
|
||||
|
||||
/**
|
||||
* 主体(用户或组织)的权限管理接口V2<br>
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/v2/permission/subject")
|
||||
public class PermissionSubjectController {
|
||||
@Autowired
|
||||
private PermissionSubjectService subjectService;
|
||||
/**
|
||||
* 分页获取权限分发列表
|
||||
*/
|
||||
@Role(value = RoleEnum.SuperAdmin)
|
||||
@GetMapping(path = "/page")
|
||||
public PageVO<PermissionSubjectVO> page(PermissionSubjectQueryVO req) {
|
||||
return this.subjectService.page(req);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户权限失效设置
|
||||
* @param id
|
||||
*/
|
||||
@GetMapping(path = "/inValid/{id}")
|
||||
public void statusForInValid(@PathVariable Long id){
|
||||
this.subjectService.subjectAndDistributeStatusForInValid(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看用户分发的下级所有用户权限
|
||||
* @param id
|
||||
*/
|
||||
@GetMapping(path = "/distribute/{id}")
|
||||
public List<PermissionSubjectVO> distributePermission(@PathVariable Long id){
|
||||
List<PermissionSubjectVO> list = this.subjectService.findDistributePermission(id);
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看当前mapId 下用户的所有权限及功能
|
||||
* @param mapId
|
||||
* @param loginUserInfoVO
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(path = "/permission/{mapId}")
|
||||
public List<PermissionSubjectVO> findPermissionWithMapIdAndUserInfo(@PathVariable(name="mapId") Long mapId, @RequestAttribute(name=LOGIN_INFO_KEY)LoginUserInfoVO loginUserInfoVO){
|
||||
return this.subjectService.findPermissionWithMapIdAndUserInfo(mapId,loginUserInfoVO);
|
||||
}
|
||||
}
|
|
@ -1,61 +0,0 @@
|
|||
package club.joylink.rtss.controller.permission2;
|
||||
|
||||
import club.joylink.rtss.services.permission.SystemAbilityService;
|
||||
import club.joylink.rtss.vo.LoginUserInfoVO;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.permission.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static club.joylink.rtss.controller.advice.AuthenticateInterceptor.LOGIN_INFO_KEY;
|
||||
|
||||
|
||||
/**
|
||||
* 面向权限的系统功能管理接口V2
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/api/v2/permission/system/ability")
|
||||
public class SystemAbilityController {
|
||||
@Autowired
|
||||
private SystemAbilityService abilityService;
|
||||
|
||||
/**
|
||||
* 根据权限功能的id查询完整信息
|
||||
*/
|
||||
@GetMapping("/{abilityId}")
|
||||
public SystemAbilityRspVo findById(@PathVariable("abilityId") Long abilityId){
|
||||
return this.abilityService.findVO(abilityId);
|
||||
}
|
||||
/**
|
||||
* 分页查询权限功能的基本信息
|
||||
*/
|
||||
@PostMapping("/page")
|
||||
public PageVO<SystemAbilityRspVo>findByPage(@RequestBody FindAbilityBasicByPageReqVo req){
|
||||
return this.abilityService.findByPage(req);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询权限功能的基本信息列表
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public List<SystemAbilityRspVo> list(FindAbilityBasicByPageReqVo filterVO){
|
||||
return this.abilityService.findList(filterVO);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 自动生成
|
||||
* @param userInfoVO
|
||||
*/
|
||||
@GetMapping("/autoCreate")
|
||||
public void autoCreate(@RequestAttribute(value = LOGIN_INFO_KEY) LoginUserInfoVO userInfoVO){
|
||||
this.abilityService.autoSynchMapSystemData(userInfoVO.getAccountVO().getId());
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -2,317 +2,252 @@ package club.joylink.rtss.controller.project;
|
|||
|
||||
import club.joylink.rtss.constants.ProjectDeviceType;
|
||||
import club.joylink.rtss.controller.advice.AuthenticateInterceptor;
|
||||
import club.joylink.rtss.entity.project.Project;
|
||||
import club.joylink.rtss.services.project.DeviceService;
|
||||
import club.joylink.rtss.vo.AccountVO;
|
||||
import club.joylink.rtss.vo.LoginUserInfoVO;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.client.project.IbpConfigVO;
|
||||
import club.joylink.rtss.vo.client.project.LswConfigVO;
|
||||
import club.joylink.rtss.vo.client.project.LwConfigVO;
|
||||
import club.joylink.rtss.vo.client.project.PlcGatewayConfigVO;
|
||||
import club.joylink.rtss.vo.client.project.ProjectDevicePageQueryVO;
|
||||
import club.joylink.rtss.vo.client.project.ProjectDeviceVO;
|
||||
import club.joylink.rtss.vo.client.project.PscConfigVO;
|
||||
import club.joylink.rtss.vo.client.project.PsdConfigVO;
|
||||
import club.joylink.rtss.vo.client.project.PslConfigVO;
|
||||
import club.joylink.rtss.vo.client.project.RelationLoginConfigVO;
|
||||
import club.joylink.rtss.vo.client.project.SignalConfigVO;
|
||||
import club.joylink.rtss.vo.client.project.SwitchConfigVO;
|
||||
import club.joylink.rtss.vo.client.project.VrIbpConfigVO;
|
||||
import club.joylink.rtss.vo.client.project.VrpsdConfigVO;
|
||||
import java.util.List;
|
||||
import club.joylink.rtss.vo.client.project.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 项目设备管理接口(新)
|
||||
*项目设备管理接口(新)
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(path = "/api/device")
|
||||
public class DeviceController {
|
||||
|
||||
@Autowired
|
||||
private DeviceService deviceService;
|
||||
@Autowired
|
||||
private DeviceService deviceService;
|
||||
|
||||
/**
|
||||
* 分页查询项目设备
|
||||
*/
|
||||
@GetMapping("/paging")
|
||||
public PageVO<ProjectDeviceVO> pagingQuery(ProjectDevicePageQueryVO queryVO) {
|
||||
return this.deviceService.pagingQuery(queryVO);
|
||||
}
|
||||
/**
|
||||
*分页查询项目设备
|
||||
*/
|
||||
@GetMapping("/paging")
|
||||
public PageVO<ProjectDeviceVO> pagingQuery(ProjectDevicePageQueryVO queryVO,
|
||||
@RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY)
|
||||
LoginUserInfoVO userLoginInfo) {
|
||||
return this.deviceService.pagingQuery(queryVO, userLoginInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 项目设备编号是否已经存在
|
||||
*/
|
||||
@GetMapping("/exist/{code}")
|
||||
public boolean isDeviceCodeExist(@PathVariable String code, String projectCode) {
|
||||
String project = Project.isDefault(projectCode) ? Project.DEFAULT_PROJECT_CODE : projectCode;
|
||||
return this.deviceService.isDeviceCodeExist(project, code);
|
||||
}
|
||||
/**
|
||||
*项目设备编号是否已经存在
|
||||
*/
|
||||
@GetMapping("/exist/{code}")
|
||||
public boolean isDeviceCodeExist(@PathVariable String code,
|
||||
@RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY)
|
||||
LoginUserInfoVO userLoginInfo) {
|
||||
return this.deviceService.isDeviceCodeExist(userLoginInfo.getProject(), code);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新建项目设备
|
||||
*/
|
||||
@PostMapping("")
|
||||
public String create(@RequestBody @Validated ProjectDeviceVO deviceVO,
|
||||
@RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY)
|
||||
LoginUserInfoVO userLoginInfo) {
|
||||
return this.deviceService.create(deviceVO, userLoginInfo);
|
||||
}
|
||||
/**
|
||||
*新建项目设备
|
||||
*/
|
||||
@PostMapping("")
|
||||
public String create(@RequestBody @Validated ProjectDeviceVO deviceVO,
|
||||
@RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY)
|
||||
LoginUserInfoVO userLoginInfo) {
|
||||
return this.deviceService.create(deviceVO, userLoginInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备详情(包含配置信息)
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public ProjectDeviceVO getDeviceDetailInfoById(@PathVariable Long id) {
|
||||
return this.deviceService.getDeviceDetailInfoById(id);
|
||||
}
|
||||
/**
|
||||
*获取设备详情(包含配置信息)
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public ProjectDeviceVO getDeviceDetailInfoById(@PathVariable Long id) {
|
||||
return this.deviceService.getDeviceDetailInfoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加/修改道岔设备网关映射配置
|
||||
*/
|
||||
@PutMapping("/{id}/config/plcgateway")
|
||||
public void updatePlcGatewayConfig(@PathVariable Long id,
|
||||
@RequestBody @Validated PlcGatewayConfigVO configVO) {
|
||||
this.deviceService.updatePlcGatewayConfig(id, configVO);
|
||||
}
|
||||
/**
|
||||
*添加/修改道岔设备网关映射配置
|
||||
*/
|
||||
@PutMapping("/{id}/config/plcgateway")
|
||||
public void updatePlcGatewayConfig(@PathVariable Long id, @RequestBody @Validated PlcGatewayConfigVO configVO) {
|
||||
this.deviceService.updatePlcGatewayConfig(id, configVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加/修改道岔设备网关映射配置
|
||||
*/
|
||||
@PutMapping("/{id}/config/switch")
|
||||
public void updateSwitchConfig(@PathVariable Long id,
|
||||
@RequestBody @Validated SwitchConfigVO configVO) {
|
||||
this.deviceService.updateSwitchConfig(id, configVO);
|
||||
}
|
||||
/**
|
||||
*添加/修改道岔设备网关映射配置
|
||||
*/
|
||||
@PutMapping("/{id}/config/switch")
|
||||
public void updateSwitchConfig(@PathVariable Long id, @RequestBody @Validated SwitchConfigVO configVO) {
|
||||
this.deviceService.updateSwitchConfig(id, configVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加/修改信号机设备网关映射配置
|
||||
*/
|
||||
@PutMapping("/{id}/config/signal")
|
||||
public void updateSignalConfig(@PathVariable Long id,
|
||||
@RequestBody @Validated SignalConfigVO configVO) {
|
||||
this.deviceService.updateSignalConfig(id, configVO);
|
||||
}
|
||||
/**
|
||||
*添加/修改信号机设备网关映射配置
|
||||
*/
|
||||
@PutMapping("/{id}/config/signal")
|
||||
public void updateSignalConfig(@PathVariable Long id, @RequestBody @Validated SignalConfigVO configVO) {
|
||||
this.deviceService.updateSignalConfig(id, configVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加/修改屏蔽门设备网关映射配置
|
||||
*/
|
||||
@PutMapping("/{id}/config/psc")
|
||||
public void updatePscConfig(@PathVariable Long id, @RequestBody @Validated PscConfigVO configVO) {
|
||||
this.deviceService.updatePscConfig(id, configVO);
|
||||
}
|
||||
/**
|
||||
*添加/修改屏蔽门设备网关映射配置
|
||||
*/
|
||||
@PutMapping("/{id}/config/psc")
|
||||
public void updatePscConfig(@PathVariable Long id, @RequestBody @Validated PscConfigVO configVO) {
|
||||
this.deviceService.updatePscConfig(id, configVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加/修改屏蔽门设备网关映射配置
|
||||
*/
|
||||
@PutMapping("/{id}/config/psd")
|
||||
public void updatePsdConfig(@PathVariable Long id, @RequestBody @Validated PsdConfigVO configVO) {
|
||||
this.deviceService.updatePsdConfig(id, configVO);
|
||||
}
|
||||
/**
|
||||
*添加/修改屏蔽门设备网关映射配置
|
||||
*/
|
||||
@PutMapping("/{id}/config/psd")
|
||||
public void updatePsdConfig(@PathVariable Long id, @RequestBody @Validated PsdConfigVO configVO) {
|
||||
this.deviceService.updatePsdConfig(id, configVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加/修改屏蔽门设备网关映射配置
|
||||
*/
|
||||
@PutMapping("/{id}/config/psl")
|
||||
public void updatePslConfig(@PathVariable Long id, @RequestBody @Validated PslConfigVO configVO) {
|
||||
this.deviceService.updatePslConfig(id, configVO);
|
||||
}
|
||||
/**
|
||||
*添加/修改屏蔽门设备网关映射配置
|
||||
*/
|
||||
@PutMapping("/{id}/config/psl")
|
||||
public void updatePslConfig(@PathVariable Long id, @RequestBody @Validated PslConfigVO configVO) {
|
||||
this.deviceService.updatePslConfig(id, configVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加/修改屏蔽门设备网关映射配置
|
||||
*/
|
||||
@PutMapping("/{id}/config/ibp")
|
||||
public void updateIbpConfig(@PathVariable Long id, @RequestBody @Validated IbpConfigVO configVO) {
|
||||
this.deviceService.updateIbpConfig(id, configVO);
|
||||
}
|
||||
/**
|
||||
*添加/修改屏蔽门设备网关映射配置
|
||||
*/
|
||||
@PutMapping("/{id}/config/ibp")
|
||||
public void updateIbpConfig(@PathVariable Long id, @RequestBody @Validated IbpConfigVO configVO) {
|
||||
this.deviceService.updateIbpConfig(id, configVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加/修改虚拟IBP盘配置
|
||||
*/
|
||||
@PutMapping("/{id}/config/vribp")
|
||||
public void updateVrIbpConfig(@PathVariable Long id,
|
||||
@RequestBody @Validated VrIbpConfigVO configVO) {
|
||||
this.deviceService.updateVrIbpConfig(id, configVO);
|
||||
}
|
||||
/**
|
||||
*添加/修改虚拟IBP盘配置
|
||||
*/
|
||||
@PutMapping("/{id}/config/vribp")
|
||||
public void updateVrIbpConfig(@PathVariable Long id, @RequestBody @Validated VrIbpConfigVO configVO) {
|
||||
this.deviceService.updateVrIbpConfig(id, configVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加/修改现地工作站配置
|
||||
*/
|
||||
@PutMapping("/{id}/config/lw")
|
||||
public void updateLwConfig(@PathVariable Long id, @RequestBody @Validated LwConfigVO configVO) {
|
||||
this.deviceService.updateLwConfig(id, configVO);
|
||||
}
|
||||
/**
|
||||
*添加/修改现地工作站配置
|
||||
*/
|
||||
@PutMapping("/{id}/config/lw")
|
||||
public void updateLwConfig(@PathVariable Long id, @RequestBody @Validated LwConfigVO configVO) {
|
||||
this.deviceService.updateLwConfig(id, configVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加/修改大屏工作站配置
|
||||
*/
|
||||
@PutMapping("/{id}/config/lsw")
|
||||
public void updateLswConfig(@PathVariable Long id, @RequestBody @Validated LswConfigVO configVO) {
|
||||
this.deviceService.updateLswConfig(id, configVO);
|
||||
}
|
||||
/**
|
||||
*添加/修改大屏工作站配置
|
||||
*/
|
||||
@PutMapping("/{id}/config/lsw")
|
||||
public void updateLswConfig(@PathVariable Long id, @RequestBody @Validated LswConfigVO configVO) {
|
||||
this.deviceService.updateLswConfig(id, configVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加/修改CCTV工作站配置
|
||||
*/
|
||||
@PutMapping("/{id}/config/cctv")
|
||||
public void updateCctvConfig(@PathVariable Long id,
|
||||
@RequestBody @Validated RelationLoginConfigVO configVO) {
|
||||
this.deviceService.updateCctvConfig(id, configVO);
|
||||
}
|
||||
/**
|
||||
*添加/修改CCTV工作站配置
|
||||
*/
|
||||
@PutMapping("/{id}/config/cctv")
|
||||
public void updateCctvConfig(@PathVariable Long id, @RequestBody @Validated RelationLoginConfigVO configVO) {
|
||||
this.deviceService.updateCctvConfig(id, configVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加/修改电子沙盘工作站配置
|
||||
*/
|
||||
@PutMapping("/{id}/config/sandbox")
|
||||
public void updateSandboxConfig(@PathVariable Long id,
|
||||
@RequestBody @Validated RelationLoginConfigVO configVO) {
|
||||
this.deviceService.updateSandboxConfig(id, configVO);
|
||||
}
|
||||
/**
|
||||
*添加/修改电子沙盘工作站配置
|
||||
*/
|
||||
@PutMapping("/{id}/config/sandbox")
|
||||
public void updateSandboxConfig(@PathVariable Long id, @RequestBody @Validated RelationLoginConfigVO configVO) {
|
||||
this.deviceService.updateSandboxConfig(id, configVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加/修改虚拟屏蔽门工作站配置
|
||||
*/
|
||||
@PutMapping("/{id}/config/vrpsd")
|
||||
public void updateVrpsdConfig(@PathVariable Long id,
|
||||
@RequestBody @Validated VrpsdConfigVO configVO) {
|
||||
this.deviceService.updateVrpsdConfig(id, configVO);
|
||||
}
|
||||
/**
|
||||
*添加/修改虚拟屏蔽门工作站配置
|
||||
*/
|
||||
@PutMapping("/{id}/config/vrpsd")
|
||||
public void updateVrpsdConfig(@PathVariable Long id, @RequestBody @Validated VrpsdConfigVO configVO) {
|
||||
this.deviceService.updateVrpsdConfig(id, configVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加/修改现地综合监控工作站配置
|
||||
*/
|
||||
@PutMapping("/{id}/config/iscslw")
|
||||
public void updateIscsLwConfig(@PathVariable Long id,
|
||||
@RequestBody @Validated RelationLoginConfigVO configVO) {
|
||||
this.deviceService.updateIscsLwConfig(id, configVO);
|
||||
}
|
||||
/**
|
||||
*添加/修改现地综合监控工作站配置
|
||||
*/
|
||||
@PutMapping("/{id}/config/iscslw")
|
||||
public void updateIscsLwConfig(@PathVariable Long id, @RequestBody @Validated RelationLoginConfigVO configVO) {
|
||||
this.deviceService.updateIscsLwConfig(id, configVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加/修改中心综合监控工作站配置
|
||||
*/
|
||||
@PutMapping("/{id}/config/iscscw")
|
||||
public void updateIscsCwConfig(@PathVariable Long id,
|
||||
@RequestBody @Validated RelationLoginConfigVO configVO) {
|
||||
this.deviceService.updateIscsCwConfig(id, configVO);
|
||||
}
|
||||
/**
|
||||
*添加/修改中心综合监控工作站配置
|
||||
*/
|
||||
@PutMapping("/{id}/config/iscscw")
|
||||
public void updateIscsCwConfig(@PathVariable Long id, @RequestBody @Validated RelationLoginConfigVO configVO) {
|
||||
this.deviceService.updateIscsCwConfig(id, configVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加/修改联锁工作站配置
|
||||
*/
|
||||
@PutMapping("/{id}/config/ilw")
|
||||
public void updateIlwConfig(@PathVariable Long id,
|
||||
@RequestBody @Validated RelationLoginConfigVO configVO) {
|
||||
this.deviceService.updateIlwConfig(id, configVO);
|
||||
}
|
||||
/**
|
||||
*添加/修改联锁工作站配置
|
||||
*/
|
||||
@PutMapping("/{id}/config/ilw")
|
||||
public void updateIlwConfig(@PathVariable Long id, @RequestBody @Validated RelationLoginConfigVO configVO) {
|
||||
this.deviceService.updateIlwConfig(id, configVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改配置,以json的形式
|
||||
*/
|
||||
@PutMapping("/config/updateConfig")
|
||||
public void updateConfig(@RequestBody ProjectDeviceVO projectDeviceVO) {
|
||||
this.deviceService.updateConfig(projectDeviceVO);
|
||||
}
|
||||
/**
|
||||
* 修改配置,以json的形式
|
||||
*/
|
||||
@PutMapping("/config/updateConfig")
|
||||
public void updateConfig(@RequestBody ProjectDeviceVO projectDeviceVO) {
|
||||
this.deviceService.updateConfig(projectDeviceVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备
|
||||
*/
|
||||
@DeleteMapping("/{id}")
|
||||
public void delete(@PathVariable Long id) {
|
||||
this.deviceService.delete(id);
|
||||
}
|
||||
/**
|
||||
*删除设备
|
||||
*/
|
||||
@DeleteMapping("/{id}")
|
||||
public void delete(@PathVariable Long id) {
|
||||
this.deviceService.delete(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询某个类型的所有设备
|
||||
*/
|
||||
@GetMapping("/{project}/{type}/all")
|
||||
public List<ProjectDeviceVO> queryByType(@PathVariable String project,
|
||||
@PathVariable ProjectDeviceType type) {
|
||||
return this.deviceService.queryByType(type, project);
|
||||
}
|
||||
/**
|
||||
*查询某个类型的所有设备
|
||||
*/
|
||||
@GetMapping("/{type}/all")
|
||||
public List<ProjectDeviceVO> queryByType(@PathVariable ProjectDeviceType type,
|
||||
@RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY)
|
||||
LoginUserInfoVO userLoginInfo) {
|
||||
return this.deviceService.queryByType(type, userLoginInfo.getProject());
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
// @ApiOperation(value = "查询项目下的所有设备")
|
||||
// @GetMapping("/project")
|
||||
// public List<ProjectDeviceVO> queryByProjectCode(String projectCode, String group) {
|
||||
// return this.iProjectDeviceService.queryByProjectCode(projectCode, group);
|
||||
// }
|
||||
@PostMapping("/xty/addOrUpdate")
|
||||
public void addOrUpdateXtyDeviceConfig(
|
||||
@RequestAttribute(name = AuthenticateInterceptor.LOGIN_USER_KEY)
|
||||
AccountVO accountVO) {
|
||||
this.deviceService.addOrUpdateXtyDeviceConfig(accountVO);
|
||||
}
|
||||
@PostMapping("/xty/addOrUpdate")
|
||||
public void addOrUpdateXtyDeviceConfig(@RequestAttribute(name = AuthenticateInterceptor.LOGIN_USER_KEY)
|
||||
AccountVO accountVO) {
|
||||
this.deviceService.addOrUpdateXtyDeviceConfig(accountVO);
|
||||
}
|
||||
|
||||
@PostMapping("/gzb/addOrUpdate")
|
||||
public void addOrUpdateGzbDeviceConfig(
|
||||
@RequestAttribute(name = AuthenticateInterceptor.LOGIN_USER_KEY)
|
||||
AccountVO accountVO) {
|
||||
this.deviceService.addOrUpdateGzbDeviceConfig(accountVO);
|
||||
}
|
||||
@PostMapping("/gzb/addOrUpdate")
|
||||
public void addOrUpdateGzbDeviceConfig(@RequestAttribute(name = AuthenticateInterceptor.LOGIN_USER_KEY)
|
||||
AccountVO accountVO) {
|
||||
this.deviceService.addOrUpdateGzbDeviceConfig(accountVO);
|
||||
}
|
||||
|
||||
@PostMapping("/sdy/addOrUpdate")
|
||||
public void addOrUpdateSdyDeviceConfig(
|
||||
@RequestAttribute(name = AuthenticateInterceptor.LOGIN_USER_KEY)
|
||||
AccountVO accountVO) {
|
||||
this.deviceService.addOrUpdateSdyDeviceConfig(accountVO);
|
||||
}
|
||||
@PostMapping("/sdy/addOrUpdate")
|
||||
public void addOrUpdateSdyDeviceConfig(@RequestAttribute(name = AuthenticateInterceptor.LOGIN_USER_KEY)
|
||||
AccountVO accountVO) {
|
||||
this.deviceService.addOrUpdateSdyDeviceConfig(accountVO);
|
||||
}
|
||||
|
||||
@PostMapping("/zjd/addOrUpdate")
|
||||
public void addOrUpdateZjdDeviceConfig(
|
||||
@RequestAttribute(name = AuthenticateInterceptor.LOGIN_USER_KEY)
|
||||
AccountVO accountVO) {
|
||||
this.deviceService.addOrUpdateRichorDeviceConfig(accountVO);
|
||||
}
|
||||
@PostMapping("/zjd/addOrUpdate")
|
||||
public void addOrUpdateZjdDeviceConfig(@RequestAttribute(name = AuthenticateInterceptor.LOGIN_USER_KEY)
|
||||
AccountVO accountVO) {
|
||||
this.deviceService.addOrUpdateRichorDeviceConfig(accountVO);
|
||||
}
|
||||
|
||||
@PostMapping("/sr/addOrUpdate/{mapId}")
|
||||
public void addOrUpdateSrDeviceConfig(
|
||||
@RequestAttribute(name = AuthenticateInterceptor.LOGIN_USER_KEY)
|
||||
AccountVO accountVO, @PathVariable Long mapId) {
|
||||
this.deviceService.addOrUpdateSrDeviceConfig(accountVO, mapId);
|
||||
}
|
||||
|
||||
@PostMapping("/hhcj/addOrUpdate")
|
||||
public void addOrUpdateHhcjDeviceConfig(
|
||||
@RequestAttribute(name = AuthenticateInterceptor.LOGIN_USER_KEY)
|
||||
AccountVO accountVO) {
|
||||
this.deviceService.addOrUpdateHhcjDeviceConfig(accountVO);
|
||||
}
|
||||
|
||||
@PostMapping("/say/addOrUpdate")
|
||||
public void addOrUpdateSayDeviceConfig(
|
||||
@RequestAttribute(name = AuthenticateInterceptor.LOGIN_USER_KEY)
|
||||
AccountVO accountVO) {
|
||||
this.deviceService.addOrUpdateSayDeviceConfig(accountVO);
|
||||
}
|
||||
|
||||
@PostMapping("/thailand/addOrUpdate/{mapId}")
|
||||
public void addOrUpdateThailandDeviceConfig(
|
||||
@RequestAttribute(name = AuthenticateInterceptor.LOGIN_USER_KEY)
|
||||
AccountVO accountVO, @PathVariable Long mapId) {
|
||||
this.deviceService.addOrUpdateThailandDeviceConfig(accountVO, mapId);
|
||||
}
|
||||
|
||||
@PostMapping("/ngy/addOrUpdate/{mapId}")
|
||||
public void addOrUpdateNgyDeviceConfig(
|
||||
@RequestAttribute(name = AuthenticateInterceptor.LOGIN_USER_KEY)
|
||||
AccountVO accountVO, @PathVariable Long mapId) {
|
||||
this.deviceService.addOrUpdateNgyDeviceConfig(accountVO, mapId);
|
||||
}
|
||||
|
||||
@PostMapping("/cdgxy/addOrUpdate")
|
||||
public void addOrUpdateCdgxyDeviceConfig(@RequestAttribute AccountVO user) {
|
||||
this.deviceService.addOrUpdateCdgxyDeviceConfig(user);
|
||||
}
|
||||
@PostMapping("/sr/addOrUpdate/{mapId}")
|
||||
public void addOrUpdateSrDeviceConfig(@RequestAttribute(name = AuthenticateInterceptor.LOGIN_USER_KEY)
|
||||
AccountVO accountVO, @PathVariable Long mapId) {
|
||||
this.deviceService.addOrUpdateSrDeviceConfig(accountVO, mapId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,132 +0,0 @@
|
|||
package club.joylink.rtss.controller.project;
|
||||
|
||||
import club.joylink.rtss.controller.advice.AuthenticateInterceptor;
|
||||
import club.joylink.rtss.entity.project.Project;
|
||||
import club.joylink.rtss.entity.project.ProjectView;
|
||||
import club.joylink.rtss.services.project.ProjectService;
|
||||
import club.joylink.rtss.vo.AccountVO;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.client.org.OrgVO;
|
||||
import club.joylink.rtss.vo.client.org.TopOrgCreateVO;
|
||||
import club.joylink.rtss.vo.project.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 项目设备管理接口(新)
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(path = "/api/project")
|
||||
public class ProjectInfoController {
|
||||
|
||||
@Autowired
|
||||
private ProjectService projectService;
|
||||
|
||||
@GetMapping("/page")
|
||||
public PageVO<ProjectInfoVO> pagingQuery(ProjectQueryVO queryVO) {
|
||||
return projectService.pagingQuery(queryVO);
|
||||
}
|
||||
|
||||
@GetMapping("/all")
|
||||
public List<ProjectInfoVO> getAllProject() {
|
||||
return projectService.getAllProject();
|
||||
}
|
||||
|
||||
@GetMapping("/{id}")
|
||||
public Project getProjectById(@PathVariable Long id) {
|
||||
return projectService.queryProjectById(id);
|
||||
}
|
||||
|
||||
@GetMapping("/code/{code}")
|
||||
public Project getProjectByCode(@PathVariable String code){
|
||||
return projectService.queryProjectByCode(code);
|
||||
}
|
||||
|
||||
@DeleteMapping("/del/{id}")
|
||||
public void delProjectById(@PathVariable Long id) {
|
||||
projectService.deleteProject(id);
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
public void updateProject(@RequestBody Project project) {
|
||||
projectService.updateProject(project);
|
||||
}
|
||||
|
||||
@PostMapping("/save")
|
||||
public void saveProject(@RequestBody Project project) {
|
||||
projectService.save(project);
|
||||
}
|
||||
|
||||
@GetMapping("/check/code")
|
||||
public boolean checkProjectCode(String code) {
|
||||
return projectService.checkProjectCode(code);
|
||||
}
|
||||
|
||||
@PutMapping("/setDefaultOrg")
|
||||
public void setProjectDefaultOrg(@RequestBody Project project) {
|
||||
projectService.setProjectDefaultOrg(project.getId(), project.getDefaultOrg());
|
||||
}
|
||||
|
||||
@GetMapping("/{id}/orgList")
|
||||
public List<OrgVO> orgList(@PathVariable Long id) {
|
||||
return projectService.projectOrgList(id);
|
||||
}
|
||||
|
||||
@PostMapping("/{id}/createDefaultOrg")
|
||||
public ProjectInfoVO quickCreateDefaultOrg(@PathVariable Long id, @RequestBody TopOrgCreateVO orgVO
|
||||
, @RequestAttribute(AuthenticateInterceptor.LOGIN_USER_KEY) AccountVO user) {
|
||||
return projectService.quickCreateDefaultOrg(id, orgVO, user);
|
||||
}
|
||||
|
||||
@GetMapping("/viewSetting/page")
|
||||
public PageVO<ProjectView> projectViewPagingQuery(ProjectViewQueryVO queryVO) {
|
||||
return projectService.projectViewPagingQuery(queryVO);
|
||||
}
|
||||
|
||||
@GetMapping("/viewSetting/all")
|
||||
public List<ProjectView> getAllProjectView() {
|
||||
return projectService.getAllProjectView();
|
||||
}
|
||||
|
||||
@GetMapping("/viewSetting/{id}")
|
||||
public ProjectView getProjectViewById(@PathVariable Long id) {
|
||||
return projectService.queryProjectViewById(id);
|
||||
}
|
||||
|
||||
@DeleteMapping("/viewSetting/del/{id}")
|
||||
public void delProjectViewById(@PathVariable Long id) {
|
||||
projectService.deleteProjectView(id);
|
||||
}
|
||||
|
||||
@PutMapping("/viewSetting/update")
|
||||
public void updateProjectView(@RequestBody ProjectView projectView) {
|
||||
projectService.updateProjectView(projectView);
|
||||
}
|
||||
|
||||
@PostMapping("/viewSetting/save")
|
||||
public void saveProjectView(@RequestBody ProjectView projectView) {
|
||||
projectService.saveProjectView(projectView);
|
||||
}
|
||||
|
||||
@GetMapping("/check/markKey")
|
||||
public boolean checkProjectViewMarkKey(String markKey, Long id) {
|
||||
return projectService.checkProjectViewMarkKey(markKey, id);
|
||||
}
|
||||
|
||||
@GetMapping("/simple")
|
||||
public List<ProjectVO> queryProjectSimpleInfo() {
|
||||
return projectService.getSimpleProjectList();
|
||||
}
|
||||
|
||||
@GetMapping("/viewSetting/project/{project}")
|
||||
public ProjectViewVO queryProjectViewSetting(@PathVariable String project) {
|
||||
return projectService.getProjectViewSetting(project);
|
||||
}
|
||||
|
||||
@GetMapping("/viewSetting/simple/all")
|
||||
public List<ProjectViewVO> queryViewAll() {
|
||||
return projectService.queryViewAll();
|
||||
}
|
||||
}
|
|
@ -107,7 +107,7 @@ public class ExamController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 分页查询当前登录项目下的试卷
|
||||
*分页查询当前登录项目下的试卷
|
||||
*/
|
||||
@GetMapping("/paged/loginProject")
|
||||
public PageVO<ExamDefinitionVO> pagedQueryByLoginProject(ExamDefinitionQueryVO queryVO, @RequestAttribute LoginUserInfoVO loginInfo) {
|
||||
|
@ -115,7 +115,7 @@ public class ExamController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 不分页查询当前登录项目下的试卷
|
||||
*不分页查询当前登录项目下的试卷
|
||||
*/
|
||||
@GetMapping("/list/loginProject")
|
||||
public List<ExamDefinitionVO> listQueryExamByLoginProject(ExamDefinitionQueryVO queryVO, @RequestAttribute LoginUserInfoVO loginInfo) {
|
||||
|
@ -135,30 +135,6 @@ public class ExamController {
|
|||
*/
|
||||
@GetMapping("/list/{mapId}")
|
||||
public List<ExamDefinitionVO> listQuery(@PathVariable Long mapId, String prdType) {
|
||||
return iExamService.queryBasicInfo(mapId, prdType, BusinessConsts.STATUS_USE, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新考试规则
|
||||
*/
|
||||
@PutMapping("/update/rules")
|
||||
public void updateRules(@RequestBody ExamDefinitionVO examDefinitionVO) {
|
||||
iExamService.updateRules(examDefinitionVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查并更新【规则数据异常】状态
|
||||
*/
|
||||
@PutMapping("/checkAndUpdateAbnormal/{mapId}")
|
||||
public void check4SetAbnormalAndRegenerateSystemRules(@PathVariable long mapId) {
|
||||
iExamService.checkAndUpdateAbnormal(mapId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 重新生成考试规则
|
||||
*/
|
||||
@PutMapping("/regenerateRules/{mapId}")
|
||||
public void regenerateRules(@PathVariable long mapId) {
|
||||
iExamService.regenerateRules(mapId);
|
||||
return iExamService.queryBasicInfo(mapId, prdType, BusinessConsts.STATUS_USE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,9 +5,9 @@ import club.joylink.rtss.vo.client.PageVO;
|
|||
import club.joylink.rtss.vo.draft.Lesson3DQueryVO;
|
||||
import club.joylink.rtss.vo.draft.Lesson3DVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/lesson3d")
|
||||
|
@ -21,33 +21,4 @@ public class Lesson3dController {
|
|||
return this.lesson3DService.pagingQuery(queryVO);
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
public List<Lesson3DVO> queryListBy(Lesson3DQueryVO queryVO) {
|
||||
return this.lesson3DService.queryBy(queryVO);
|
||||
}
|
||||
|
||||
@GetMapping(path = "/{id}")
|
||||
public Lesson3DVO getById(@PathVariable Long id) {
|
||||
Lesson3DVO param = this.lesson3DService.getById(id);
|
||||
return param;
|
||||
}
|
||||
|
||||
/**
|
||||
* 上线
|
||||
* @param id
|
||||
*/
|
||||
@PutMapping("/{id}/online")
|
||||
public void online(@PathVariable Long id) {
|
||||
this.lesson3DService.online(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 下线
|
||||
* @param id
|
||||
*/
|
||||
@PutMapping("/{id}/offline")
|
||||
public void offline(@PathVariable Long id) {
|
||||
this.lesson3DService.offline(id);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ import org.springframework.web.bind.annotation.*;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 课程数据管理接口
|
||||
*课程数据管理接口
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/lesson")
|
||||
|
@ -37,7 +37,7 @@ public class LessonController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 获取课程实训树
|
||||
*获取课程实训树
|
||||
*/
|
||||
@GetMapping(path = "/{id}/tree")
|
||||
public LessonTreeVO getLessonTrainingTree(@PathVariable Long id, @RequestAttribute AccountVO user) {
|
||||
|
@ -45,15 +45,15 @@ public class LessonController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 获取课程详情
|
||||
*获取课程详情
|
||||
*/
|
||||
@GetMapping(path = "/{id}")
|
||||
@GetMapping(path="/{id}")
|
||||
public LessonVO getLessonDetail(@PathVariable Long id, @RequestAttribute AccountVO user) {
|
||||
return this.iLessonService.getLessonDetail(id, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据条件获取课程列表
|
||||
*根据条件获取课程列表
|
||||
*/
|
||||
@GetMapping(path = "")
|
||||
public List<LessonVO> queryLessons(LessonQueryVO lessonQueryVO) {
|
||||
|
@ -61,7 +61,7 @@ public class LessonController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 根据部门获取关联课程列表
|
||||
*根据部门获取关联课程列表
|
||||
*/
|
||||
@GetMapping(path = "/depart/{departId}")
|
||||
public List<LessonVO> queryLessons(@PathVariable Long departId) {
|
||||
|
@ -69,7 +69,7 @@ public class LessonController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 获取课程列表
|
||||
*获取课程列表
|
||||
*/
|
||||
@GetMapping(path = "/listOfMap")
|
||||
public List<LessonVO> queryLessonsOfMap(Long mapId) {
|
||||
|
@ -77,54 +77,54 @@ public class LessonController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 分页获取已发布的课程
|
||||
*分页获取已发布的课程
|
||||
*/
|
||||
@GetMapping(path = "/publishedLesson")
|
||||
public PageVO<LessonVO> selectPagedPublishedLesson(LessonQueryVO queryVO) {
|
||||
return iLessonService.selectPagedPublishedLesson(queryVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除已发布的课程
|
||||
*/
|
||||
@Role(RoleEnum.SuperAdmin)
|
||||
/**
|
||||
*删除已发布的课程
|
||||
*/
|
||||
@DeleteMapping(path = "/publishedLesson/{lessonId}")
|
||||
public void deletePublishedLesson(@PathVariable Long lessonId, @RequestAttribute AccountVO user) {
|
||||
iLessonService.deletePublishedLesson(lessonId, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户删除教学实训删除自己发布的课程
|
||||
*/
|
||||
@Role(RoleEnum.LessonCreater)
|
||||
/**
|
||||
*用户删除教学实训删除自己发布的课程
|
||||
*/
|
||||
@DeleteMapping(path = "/usedLesson/{lessonId}")
|
||||
public void deleteUsedLesson(@PathVariable Long lessonId, @RequestAttribute AccountVO user) {
|
||||
iLessonService.deleteUsedLesson(lessonId, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发布课程上线
|
||||
*发布课程上线
|
||||
*/
|
||||
@PutMapping(path = "/{id}/onLine")
|
||||
@Role({RoleEnum.Admin, RoleEnum.SuperAdmin})
|
||||
@Role({RoleEnum.Admin,RoleEnum.SuperAdmin})
|
||||
public void onLine(@PathVariable Long id, @RequestAttribute AccountVO user) {
|
||||
this.iLessonService.onLine(id, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发布课程下线
|
||||
*发布课程下线
|
||||
*/
|
||||
@PutMapping(path = "/{id}/offLine")
|
||||
@Role({RoleEnum.Admin, RoleEnum.SuperAdmin})
|
||||
@Role({RoleEnum.Admin,RoleEnum.SuperAdmin})
|
||||
public void offLine(@PathVariable Long id, @RequestAttribute AccountVO user) {
|
||||
this.iLessonService.offLine(id, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新课程名称和简介
|
||||
*更新课程名称和简介
|
||||
*/
|
||||
@PutMapping(path = "/{id}/nameAndRemarks")
|
||||
@Role({RoleEnum.Admin, RoleEnum.SuperAdmin})
|
||||
@Role({RoleEnum.Admin,RoleEnum.SuperAdmin})
|
||||
public void updateNameAndRemarks(@PathVariable Long id,
|
||||
@RequestBody @Validated(LessonUpdateNameAndRemarksCheck.class) LessonVO lessonVO,
|
||||
@RequestAttribute AccountVO user) {
|
||||
|
@ -132,7 +132,7 @@ public class LessonController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 生成默认课程和考试功能
|
||||
*生成默认课程和考试功能
|
||||
*/
|
||||
@PostMapping(path = "/generating")
|
||||
public void generateLessonAndExam(@RequestAttribute AccountVO user, @RequestBody List<Long> mapIds) {
|
||||
|
@ -140,7 +140,7 @@ public class LessonController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 分页查询用户当前登录的项目下的课程
|
||||
*分页查询用户当前登录的项目下的课程
|
||||
*/
|
||||
@GetMapping(path = "/paged/byLoginProject")
|
||||
public PageVO<LessonVO> pagedQueryByLoginProject(LessonQueryVO queryVO,
|
||||
|
@ -149,7 +149,7 @@ public class LessonController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 查询用户当前登录的项目下的课程
|
||||
*查询用户当前登录的项目下的课程
|
||||
*/
|
||||
@GetMapping(path = "/list/byLoginProject")
|
||||
public List<LessonVO> queryByLoginProject(LessonQueryVO queryVO,
|
||||
|
@ -158,7 +158,7 @@ public class LessonController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 查询自己给指定班级创建的课程
|
||||
*查询自己给指定班级创建的课程
|
||||
*/
|
||||
@GetMapping(path = "/list/org/self")
|
||||
public List<LessonVO> queryOrgLessonOfSelf(Long clsId, @RequestAttribute LoginUserInfoVO loginInfo) {
|
||||
|
|
|
@ -6,7 +6,6 @@ import club.joylink.rtss.controller.advice.Role;
|
|||
import club.joylink.rtss.services.IMapService;
|
||||
import club.joylink.rtss.services.IReleaseService;
|
||||
import club.joylink.rtss.services.local.LocalDataService;
|
||||
import club.joylink.rtss.simulation.cbtc.Simulation;
|
||||
import club.joylink.rtss.vo.AccountVO;
|
||||
import club.joylink.rtss.vo.LoginUserInfoVO;
|
||||
import club.joylink.rtss.vo.client.*;
|
||||
|
@ -15,7 +14,10 @@ import club.joylink.rtss.vo.client.map.MapCopyOption;
|
|||
import club.joylink.rtss.vo.client.map.MapInfoUpdateVO;
|
||||
import club.joylink.rtss.vo.client.validGroup.MapInfoSortCheck;
|
||||
import club.joylink.rtss.vo.map.*;
|
||||
import club.joylink.rtss.vo.map.graph.*;
|
||||
import club.joylink.rtss.vo.map.graph.MapPSDVO;
|
||||
import club.joylink.rtss.vo.map.graph.MapSectionNewVO;
|
||||
import club.joylink.rtss.vo.map.graph.MapStationNewVO;
|
||||
import club.joylink.rtss.vo.map.graph.MapStationStandNewVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
@ -23,7 +25,6 @@ import org.springframework.web.bind.annotation.*;
|
|||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*发布地图管理接口
|
||||
|
@ -397,45 +398,4 @@ public class MapController {
|
|||
public List<MapSectionNewVO> querySectionsUnderMap(@PathVariable Long id) {
|
||||
return iMapService.querySectionsUnderMap(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询地图下所有列车
|
||||
*/
|
||||
@GetMapping("/{id}/trains")
|
||||
public List<MapTrainVO> queryTrains(@PathVariable long id) {
|
||||
return iMapService.queryTrains(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询地图成员Map
|
||||
*/
|
||||
@GetMapping("/{id}/memberMap")
|
||||
public Map<Simulation.Type, List<MapMemberVO>> queryMemberMap(@PathVariable long id) {
|
||||
return iMapService.queryMemberMap(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取地图下所有车站
|
||||
*/
|
||||
@GetMapping("/{id}/stations")
|
||||
public List<MapStationNewVO> getMapStations(@PathVariable long id) {
|
||||
return iMapService.getMapStations(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询与登录用户有关的在线地图列表
|
||||
*/
|
||||
@GetMapping("/list/online/ofUser")
|
||||
public List<MapVO> listMapsOfUser(@RequestAttribute LoginUserInfoVO loginInfo) {
|
||||
return iMapService.listMapsOfUser(loginInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取地图配置的客户端信息
|
||||
* @return 客户端信息
|
||||
*/
|
||||
@GetMapping("/{id}/mapClientMap")
|
||||
public Map<Simulation.Type, List<MapClientVO>> queryMapClientMap(@PathVariable long id) {
|
||||
return iMapService.queryMapClientMap(id);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,205 +0,0 @@
|
|||
package club.joylink.rtss.controller.publish;
|
||||
|
||||
import club.joylink.rtss.constants.RoleEnum;
|
||||
import club.joylink.rtss.controller.advice.Role;
|
||||
import club.joylink.rtss.services.mapFunction.RtsMapFunctionService;
|
||||
import club.joylink.rtss.services.mapFunctionTemplate.MapFunctionTemplateService;
|
||||
import club.joylink.rtss.vo.AccountVO;
|
||||
import club.joylink.rtss.vo.LoginUserInfoVO;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.client.mapFunction.MapFunctionBatchModifyVO;
|
||||
import club.joylink.rtss.vo.client.mapFunction.MapFunctionCreateVO;
|
||||
import club.joylink.rtss.vo.client.mapFunction.MapFunctionGenerateParamVO;
|
||||
import club.joylink.rtss.vo.client.mapFunction.MapFunctionGenerateVO;
|
||||
import club.joylink.rtss.vo.client.mapFunction.MapFunctionQueryVO;
|
||||
import club.joylink.rtss.vo.client.mapFunction.MapFunctionUpdateVO;
|
||||
import club.joylink.rtss.vo.client.mapFunction.MapFunctionVO;
|
||||
import club.joylink.rtss.vo.client.mapFunctionTemplate.MapFunctionTemplateCreateVO;
|
||||
import club.joylink.rtss.vo.client.mapFunctionTemplate.MapFunctionTemplateQueryVO;
|
||||
import club.joylink.rtss.vo.client.mapFunctionTemplate.MapFunctionTemplateVO;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 地图功能及模板管理接口
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/mapFunction")
|
||||
public class MapFunctionController {
|
||||
|
||||
@Autowired
|
||||
private RtsMapFunctionService rtsMapFunctionService;
|
||||
|
||||
@Autowired
|
||||
private MapFunctionTemplateService mapFunctionTemplateService;
|
||||
|
||||
/**
|
||||
* 创建地图功能
|
||||
*/
|
||||
@Role(RoleEnum.Admin)
|
||||
@PostMapping("")
|
||||
public void create(@RequestBody MapFunctionCreateVO createVO,
|
||||
@RequestAttribute LoginUserInfoVO loginInfo) {
|
||||
rtsMapFunctionService.create(createVO, loginInfo.getAccountVO().getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成地图功能
|
||||
*/
|
||||
@Role(RoleEnum.Admin)
|
||||
@PostMapping("/{mapId}/generate")
|
||||
public List<String> generate(@PathVariable long mapId,
|
||||
@RequestBody @Validated MapFunctionGenerateParamVO paramVO,
|
||||
@RequestAttribute LoginUserInfoVO loginInfo) {
|
||||
return rtsMapFunctionService.generate(mapId, paramVO, loginInfo.getAccountVO().getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询地图功能(新)
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public List<MapFunctionVO> listQuery(MapFunctionQueryVO queryVO) {
|
||||
return rtsMapFunctionService.listQuery(queryVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询地图功能
|
||||
*/
|
||||
@GetMapping("/paged")
|
||||
public PageVO<MapFunctionVO> pagedQuery(MapFunctionQueryVO queryVO) {
|
||||
return rtsMapFunctionService.pagedQuery(queryVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除地图功能
|
||||
*/
|
||||
@Role(RoleEnum.Admin)
|
||||
@DeleteMapping("/{id}")
|
||||
public void delete(@PathVariable long id) {
|
||||
rtsMapFunctionService.delete(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除地图功能
|
||||
*/
|
||||
@Role(RoleEnum.Admin)
|
||||
@DeleteMapping("/batch/{mapId}")
|
||||
public void batchDelete(@PathVariable long mapId) {
|
||||
rtsMapFunctionService.batchDelete(mapId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新地图功能
|
||||
*/
|
||||
@Role(RoleEnum.Admin)
|
||||
@PutMapping("/{id}")
|
||||
public void update(@PathVariable long id, @RequestBody MapFunctionUpdateVO updateVO,
|
||||
@RequestAttribute LoginUserInfoVO loginInfo) {
|
||||
rtsMapFunctionService.update(id, updateVO, loginInfo.getAccountVO().getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID获取地图功能信息
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public MapFunctionVO queryOne(@PathVariable Long id) {
|
||||
return rtsMapFunctionService.get(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新分组
|
||||
*
|
||||
* @param groupMap k- group v-mapFunctionIds
|
||||
*/
|
||||
@PutMapping("/group")
|
||||
public void updateGroup(@RequestBody Map<String, List<Long>> groupMap,
|
||||
@RequestAttribute AccountVO user) {
|
||||
rtsMapFunctionService.updateGroup(groupMap, user.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 跨线路批量修改线路功能
|
||||
*/
|
||||
@PutMapping("/crossMap/batch")
|
||||
public void batchModifyDesc(@RequestBody MapFunctionBatchModifyVO vo) {
|
||||
rtsMapFunctionService.batchModify(vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建线路功能模板
|
||||
*/
|
||||
@PostMapping("/template")
|
||||
public void create(@RequestBody MapFunctionTemplateCreateVO createVO,
|
||||
@RequestAttribute AccountVO user) {
|
||||
mapFunctionTemplateService.create(createVO, user.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询线路功能模板
|
||||
*/
|
||||
@GetMapping("/template/list")
|
||||
public List<MapFunctionTemplateVO> listQuery(MapFunctionTemplateQueryVO queryVO) {
|
||||
return mapFunctionTemplateService.listQuery(queryVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询线路功能模板
|
||||
*/
|
||||
@GetMapping("/template/paged")
|
||||
public PageVO<MapFunctionTemplateVO> pagedQuery(MapFunctionTemplateQueryVO queryVO) {
|
||||
return mapFunctionTemplateService.pagedQuery(queryVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新线路功能模板
|
||||
*/
|
||||
@PutMapping("/template/{id}")
|
||||
public MapFunctionTemplateVO update(@PathVariable long id,
|
||||
@RequestBody MapFunctionTemplateCreateVO createVO,
|
||||
@RequestAttribute AccountVO user) {
|
||||
return mapFunctionTemplateService.update(id, createVO, user.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除线路功能模板
|
||||
*/
|
||||
@DeleteMapping("/template/{id}")
|
||||
public void deleteTemplate(@PathVariable long id) {
|
||||
mapFunctionTemplateService.delete(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据模板生成地图功能
|
||||
*
|
||||
* @return 生成过程中的特殊情况日志
|
||||
*/
|
||||
@PostMapping("/generate/from/template")
|
||||
public List<String> generateFromTemplate(@RequestBody MapFunctionGenerateVO vo,
|
||||
@RequestAttribute AccountVO user) {
|
||||
return rtsMapFunctionService.generateFromTemplate(vo, user.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据地图原有的线路功能信息生成新的线路功能信息(模板与当前数据名称匹配)
|
||||
*
|
||||
* @param mapIds 地图ID列表
|
||||
* @param user 登录用户信息
|
||||
* @return 没有生成信息记录,方便用户自定义操作
|
||||
*/
|
||||
@PostMapping("/generate/mapIds")
|
||||
public List<String> generateFunByOldData(@RequestBody List<Long> mapIds,
|
||||
@RequestAttribute AccountVO user) {
|
||||
return rtsMapFunctionService.generateFunByOldData(mapIds, user);
|
||||
}
|
||||
}
|
|
@ -1,91 +0,0 @@
|
|||
package club.joylink.rtss.controller.racetr;
|
||||
|
||||
import club.joylink.rtss.services.race.RaceApplicationService;
|
||||
import club.joylink.rtss.vo.AccountVO;
|
||||
import club.joylink.rtss.vo.LoginUserInfoVO;
|
||||
import club.joylink.rtss.vo.paper.PaperTrainAnswerDetail;
|
||||
import club.joylink.rtss.vo.race.RaceApplication;
|
||||
import club.joylink.rtss.vo.race.RaceTask;
|
||||
import club.joylink.rtss.vo.race.RaceTaskFinishParamDTO;
|
||||
import java.util.List;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 赛题训练接口
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/race")
|
||||
@AllArgsConstructor
|
||||
public class RaceApplicationController {
|
||||
|
||||
private RaceApplicationService raceApplicationService;
|
||||
|
||||
/**
|
||||
* 开始训练
|
||||
* <p>
|
||||
* 目前用用户id作为训练上下文的ID,即用户同时进行一个训练
|
||||
*
|
||||
* @param paperId 赛题ID
|
||||
* @return 训练的信息
|
||||
*/
|
||||
@PostMapping("/{paperId}/{moduleId}")
|
||||
public RaceTask.RacePaperSingleModuleGroupTask start(@PathVariable long paperId,
|
||||
@PathVariable int moduleId, @RequestAttribute AccountVO user) {
|
||||
return raceApplicationService.start(paperId, moduleId, user.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载场景
|
||||
*
|
||||
* @param simulationId 场景依托的仿真
|
||||
* @param sceneId 场景的ID
|
||||
*/
|
||||
@PutMapping("/{simulationId}/load/{sceneId}")
|
||||
public void loadScene(@PathVariable String simulationId, @PathVariable long sceneId,
|
||||
@RequestAttribute LoginUserInfoVO loginInfo) {
|
||||
raceApplicationService.loadScene(simulationId, sceneId, loginInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 完成任务
|
||||
*
|
||||
* @param taskId 任务ID
|
||||
* @param paramDTO 完成任务所需的参数。主要就是需要前端做判定的操作/步骤
|
||||
* @return
|
||||
*/
|
||||
@PutMapping("/{taskId}/finish")
|
||||
public List<PaperTrainAnswerDetail> finishTask(@PathVariable long taskId,
|
||||
@RequestBody RaceTaskFinishParamDTO paramDTO, @RequestAttribute AccountVO user) {
|
||||
return raceApplicationService.finishTask(taskId, paramDTO, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 完成训练
|
||||
*
|
||||
* @return 评分结果
|
||||
*/
|
||||
@PutMapping("/finish")
|
||||
public RaceApplication.RacePracticeResult finish(@RequestAttribute AccountVO user) {
|
||||
return raceApplicationService.finish(user.getId());
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 获取用户正在进行的竞赛信息
|
||||
// * <p>
|
||||
// * 目前想到的使用场景就是页面刷新后
|
||||
// *
|
||||
// * @return 竞赛信息
|
||||
// */
|
||||
// @GetMapping("")
|
||||
// public Object getRaceInfo() {
|
||||
// return null;
|
||||
// }
|
||||
|
||||
}
|
|
@ -1,145 +0,0 @@
|
|||
package club.joylink.rtss.controller.racetr;
|
||||
|
||||
|
||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||
import club.joylink.rtss.services.paper.PagerQuestionService;
|
||||
import club.joylink.rtss.services.race.RacePaperService;
|
||||
import club.joylink.rtss.vo.AccountVO;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.race.RacePaper.RacePaperCreateVO;
|
||||
import club.joylink.rtss.vo.race.RacePaper.RacePaperDetailVO;
|
||||
import club.joylink.rtss.vo.race.RacePaper.RacePaperMenuVO;
|
||||
import club.joylink.rtss.vo.race.RacePaper.RacePaperModuleVO;
|
||||
import club.joylink.rtss.vo.race.RacePaper.RacePaperVO;
|
||||
import club.joylink.rtss.vo.race.RacePaperQueryVO;
|
||||
import club.joylink.rtss.vo.race.RaceTask.RacePaperSingleModuleGroupTask;
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 竞赛-试题管理
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/exercise/race/paper")
|
||||
public class RacePaperController {
|
||||
|
||||
@Autowired
|
||||
private RacePaperService racePaperService;
|
||||
|
||||
@Autowired
|
||||
private PagerQuestionService questionService;
|
||||
|
||||
@GetMapping("/questions")
|
||||
public List<Long> queryQuestionFromPBank() {
|
||||
return this.questionService.queryAllDefaultOrgPaperIds();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建试卷
|
||||
*/
|
||||
@PostMapping()
|
||||
public void save(@RequestBody RacePaperCreateVO createVO, @RequestAttribute AccountVO user) {
|
||||
racePaperService.create(createVO, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新试卷内容
|
||||
*
|
||||
* @param id
|
||||
* @param updateVO
|
||||
* @param user
|
||||
*/
|
||||
@PostMapping("/{id}")
|
||||
public void update(@PathVariable("id") Long id, @RequestBody RacePaperCreateVO updateVO,
|
||||
@RequestAttribute AccountVO user) {
|
||||
this.racePaperService.update(id, updateVO, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
public PageVO<RacePaperVO> pageQuery(RacePaperQueryVO queryVO) {
|
||||
return racePaperService.pageQuery(queryVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取赛季试卷菜单
|
||||
*
|
||||
* @param queryVO
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/menu")
|
||||
public RacePaperMenuVO pageMenu(RacePaperQueryVO queryVO) {
|
||||
return this.racePaperService.pageMenuQuery(queryVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 试卷配置
|
||||
*
|
||||
* @param id
|
||||
* @param moduleVO
|
||||
* @param user
|
||||
*/
|
||||
@PostMapping("/{id}/config")
|
||||
public void configSeting(@PathVariable("id") Long id, @RequestBody RacePaperModuleVO moduleVO,
|
||||
@RequestAttribute AccountVO user) {
|
||||
this.racePaperService.configSeting(id, moduleVO, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取明细
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public RacePaperDetailVO detail(@PathVariable("id") Long id) {
|
||||
return this.racePaperService.detail(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 拷贝功能
|
||||
*
|
||||
* @param id
|
||||
* @param user
|
||||
*/
|
||||
@PutMapping("/{id}/copy")
|
||||
public void copy(@PathVariable("id") Long id, @RequestAttribute AccountVO user) {
|
||||
this.racePaperService.copy(id, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@DeleteMapping("/{id}")
|
||||
public void delete(@PathVariable("id") Long id) {
|
||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotNull(id);
|
||||
racePaperService.delete(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取试卷对应模块的模块任务树
|
||||
*
|
||||
* @param id
|
||||
* @param moduleId
|
||||
* @return
|
||||
*/
|
||||
|
||||
@GetMapping("/{paperId}/module/{moduleId}/task")
|
||||
public RacePaperSingleModuleGroupTask paperModuleTask(@PathVariable("paperId") Long id,
|
||||
@PathVariable("moduleId") Integer moduleId) {
|
||||
return this.racePaperService.singlePaperModuleTask(id, moduleId);
|
||||
|
||||
}
|
||||
}
|
|
@ -1,85 +0,0 @@
|
|||
package club.joylink.rtss.controller.racetr;
|
||||
|
||||
import club.joylink.rtss.services.race.RaceSceneService;
|
||||
import club.joylink.rtss.vo.AccountVO;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.race.RaceSceneOuterClass.RaceSceneListVO;
|
||||
import club.joylink.rtss.vo.race.RaceSceneOuterClass.RaceScenePublishVO;
|
||||
import club.joylink.rtss.vo.race.RaceSceneOuterClass.RaceSceneVO;
|
||||
import club.joylink.rtss.vo.race.RaceSceneOuterClass.SceneCustomCreateVO;
|
||||
import club.joylink.rtss.vo.race.RaceSceneQueryVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 竞赛-场景管理-发布的管理
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/exercise/race/scene")
|
||||
public class RaceSceneController {
|
||||
|
||||
@Autowired
|
||||
private RaceSceneService sceneService;
|
||||
|
||||
@PostMapping("/custom/edit")
|
||||
public void customSave(@RequestBody SceneCustomCreateVO vo, @RequestAttribute AccountVO user) {
|
||||
this.sceneService.customSave(vo, user);
|
||||
}
|
||||
|
||||
@PostMapping("/custom/{id}/edit")
|
||||
public void customUpdate(@PathVariable("id") Long id, @RequestBody SceneCustomCreateVO vo, @RequestAttribute AccountVO user) {
|
||||
this.sceneService.customUpdate(id, vo, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 草稿实训发布到场景
|
||||
*
|
||||
* @param vo
|
||||
* @param user
|
||||
*/
|
||||
@PostMapping("/publish/training")
|
||||
public void publishHere(@RequestBody RaceScenePublishVO vo, @RequestAttribute AccountVO user) {
|
||||
this.sceneService.publishHere(vo, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取明细
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public RaceSceneVO detail(@PathVariable("id") Long id) {
|
||||
return this.sceneService.detail(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页
|
||||
*
|
||||
* @param query
|
||||
* @return
|
||||
*/
|
||||
|
||||
@GetMapping("/page")
|
||||
public PageVO<RaceSceneListVO> page(RaceSceneQueryVO query) {
|
||||
return this.sceneService.page(query);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param id
|
||||
*/
|
||||
@DeleteMapping("/{id}")
|
||||
public void delete(@PathVariable("id") Long id) {
|
||||
this.sceneService.delete(id);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,88 +0,0 @@
|
|||
package club.joylink.rtss.controller.racetr;
|
||||
|
||||
import club.joylink.rtss.services.race.RaceScoreRuleService;
|
||||
import club.joylink.rtss.vo.AccountVO;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.race.RaceScoringRule.RaceScoringRuleListVO;
|
||||
import club.joylink.rtss.vo.race.RaceScoringRule.RaceScoringRuleVO;
|
||||
import club.joylink.rtss.vo.race.RaceScoringRule.Rule;
|
||||
import club.joylink.rtss.vo.race.TaskRuleQueryVO;
|
||||
import java.util.Map;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 竞赛-评分
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/exercise/race/score")
|
||||
public class RaceScoreRuleController {
|
||||
|
||||
@Autowired
|
||||
private RaceScoreRuleService scoreRuleService;
|
||||
|
||||
/**
|
||||
* 1.创建基础信息
|
||||
*
|
||||
* @param nameMap
|
||||
* @param user
|
||||
*/
|
||||
@PostMapping
|
||||
public void saveBasic(@RequestBody Map<String, String> nameMap, @RequestAttribute AccountVO user) {
|
||||
this.scoreRuleService.saveBasic(nameMap.get("name"), user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 评分配置
|
||||
*
|
||||
* @param ruleId
|
||||
* @param rule
|
||||
* @param user
|
||||
*/
|
||||
@PostMapping("/edit/rule/{ruleId}")
|
||||
public void editRule(@PathVariable("ruleId") Long ruleId, @RequestBody Rule rule, @RequestAttribute AccountVO user) {
|
||||
this.scoreRuleService.editRule(ruleId, rule, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 明细
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public RaceScoringRuleVO detail(@PathVariable("id") Long id) {
|
||||
return this.scoreRuleService.detail(id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分页
|
||||
*
|
||||
* @param query
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
public PageVO<RaceScoringRuleListVO> page(TaskRuleQueryVO query) {
|
||||
return this.scoreRuleService.page(query);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param id
|
||||
*/
|
||||
|
||||
@DeleteMapping("{id}")
|
||||
public void delete(@PathVariable("id") Long id) {
|
||||
this.scoreRuleService.delete(id);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,102 +0,0 @@
|
|||
package club.joylink.rtss.controller.racetr;
|
||||
|
||||
|
||||
import club.joylink.rtss.services.race.RaceSeasonService;
|
||||
import club.joylink.rtss.vo.AccountVO;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.race.RaceSeasonOuterClass.RaceSeasonCreateVO;
|
||||
import club.joylink.rtss.vo.race.RaceSeasonOuterClass.RaceSeasonVO;
|
||||
import club.joylink.rtss.vo.race.RaceSeasonQueryVO;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 竞赛-赛季管理
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/exercise/race/season")
|
||||
public class RaceSeasonController {
|
||||
|
||||
@Autowired
|
||||
private RaceSeasonService raceSeasonService;
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param dto
|
||||
* @param user
|
||||
*/
|
||||
@PostMapping
|
||||
public void save(@RequestBody RaceSeasonCreateVO dto, @RequestAttribute AccountVO user) {
|
||||
this.raceSeasonService.save(dto, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
* @param id
|
||||
* @param dto
|
||||
* @param user
|
||||
*/
|
||||
@PostMapping("/{id}")
|
||||
public void update(@PathVariable("id") Long id, @RequestBody RaceSeasonCreateVO dto, @RequestAttribute AccountVO user) {
|
||||
this.raceSeasonService.update(id, dto, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑html内容
|
||||
*
|
||||
* @param id
|
||||
* @param user
|
||||
*/
|
||||
@PostMapping("/{id}/html")
|
||||
public void updateHtmlContent(@PathVariable("id") Long id, @RequestBody Map<String, String> contentMap, @RequestAttribute AccountVO user) {
|
||||
String content = contentMap.get("htmlContent");
|
||||
this.raceSeasonService.updateHtmlContent(id, content, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查找对应的html content
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/{id}/html")
|
||||
public Map<String, String> queryHtmlContent(@PathVariable("id") Long id) {
|
||||
String html = this.raceSeasonService.queryHtmlContent(id);
|
||||
return Map.of("html", StringUtils.hasText(html) ? html : "");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 查找
|
||||
*
|
||||
* @param query
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/page")
|
||||
public PageVO<RaceSeasonVO> page(RaceSeasonQueryVO query) {
|
||||
return raceSeasonService.page(query);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param id
|
||||
*/
|
||||
//绑定过的数据不能删除,没有绑定的可以删除(物理删除)
|
||||
@DeleteMapping("/{id}")
|
||||
public void delete(@PathVariable("id") Long id) {
|
||||
this.raceSeasonService.delete(id);
|
||||
}
|
||||
}
|
|
@ -1,94 +0,0 @@
|
|||
package club.joylink.rtss.controller.racetr;
|
||||
|
||||
import club.joylink.rtss.services.race.RaceTaskService;
|
||||
import club.joylink.rtss.vo.AccountVO;
|
||||
import club.joylink.rtss.vo.race.RaceTask.RaceTaskBind;
|
||||
import club.joylink.rtss.vo.race.RaceTask.RaceTaskCreateVO;
|
||||
import club.joylink.rtss.vo.race.RaceTask.RaceTaskDetailVO;
|
||||
import club.joylink.rtss.vo.race.RaceTaskTreeVO;
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/exercise/race/task")
|
||||
public class RaceTaskController {
|
||||
|
||||
@Autowired
|
||||
private RaceTaskService taskService;
|
||||
|
||||
/**
|
||||
* 创建任务并绑定对应的发布场景
|
||||
*
|
||||
* @param vo
|
||||
* @param user
|
||||
*/
|
||||
@PostMapping
|
||||
public void save(@RequestBody RaceTaskCreateVO vo, @RequestAttribute AccountVO user) {
|
||||
this.taskService.save(vo, user);
|
||||
}
|
||||
|
||||
@PostMapping("/{id}")
|
||||
public void update(@PathVariable("id") Long id, @RequestBody RaceTaskCreateVO vo,
|
||||
@RequestAttribute AccountVO user) {
|
||||
this.taskService.update(id, vo, user);
|
||||
}
|
||||
|
||||
@PostMapping("/{taskId}/bind")
|
||||
public void bind(@PathVariable("taskId") Long taskId, @RequestBody List<RaceTaskBind> bind,
|
||||
@RequestAttribute AccountVO user) {
|
||||
this.taskService.bind(taskId, bind, user);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 返回任务数据以"树"的结构
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/tree")
|
||||
public List<RaceTaskTreeVO> tree() {
|
||||
return this.taskService.tree();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param id
|
||||
*/
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
public void delete(@PathVariable("id") Long id) {
|
||||
this.taskService.delete(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取一个节点下的所有数据
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/{id}/children")
|
||||
public List<RaceTaskTreeVO> childList(@PathVariable("id") Long id) {
|
||||
return this.taskService.findChildren(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取一个节点的明细
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public RaceTaskDetailVO detail(@PathVariable("id") Long id) {
|
||||
return this.taskService.detail(id);
|
||||
}
|
||||
|
||||
}
|
|
@ -12,7 +12,7 @@ import javax.validation.constraints.NotBlank;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 三维驾驶操作接口
|
||||
* 驾驶操作接口
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/simulation/driving")
|
||||
|
@ -25,7 +25,7 @@ public class DrivingOperationController {
|
|||
private DrivingService drivingService;
|
||||
|
||||
/**
|
||||
* 获取在正线运行的列车列表
|
||||
* 获取在运行的列车列表
|
||||
* @param group
|
||||
* @return
|
||||
*/
|
||||
|
|
|
@ -28,8 +28,8 @@ public class JointSimulationController {
|
|||
*生成综合仿真分享二维码
|
||||
*/
|
||||
@GetMapping("/{group}/qrCode")
|
||||
public String generateQrCode(@PathVariable String group, @RequestAttribute(value = AuthenticateInterceptor.LOGIN_INFO_KEY)LoginUserInfoVO loginInfo) {
|
||||
return this.groupSimulationService.generateQrCode(group, loginInfo);
|
||||
public String generateQrCode(@PathVariable String group) {
|
||||
return this.groupSimulationService.generateQrCode(group);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -26,9 +26,6 @@ public class SchedulingSimulationController {
|
|||
@Autowired
|
||||
private SchedulingService schedulingService;
|
||||
|
||||
/**
|
||||
* 获取当前派班计划
|
||||
*/
|
||||
@GetMapping(path = "/{group}/current")
|
||||
public SchedulingPlanNewVO getCurrentSchedulingPlan(@PathVariable String group) {
|
||||
return this.schedulingService.queryCurrentSchedulingPlan(group);
|
||||
|
|
|
@ -2,10 +2,8 @@ package club.joylink.rtss.controller.simulation;
|
|||
|
||||
import club.joylink.rtss.controller.advice.AuthenticateInterceptor;
|
||||
import club.joylink.rtss.simulation.cbtc.conversation.CommunicationObject;
|
||||
import club.joylink.rtss.simulation.cbtc.conversation.ConversationGroupHandlerService;
|
||||
import club.joylink.rtss.simulation.cbtc.conversation.ConversationManagerService;
|
||||
import club.joylink.rtss.simulation.cbtc.conversation.ConversationText;
|
||||
import club.joylink.rtss.simulation.cbtc.data.vo.ConversationGroupVO;
|
||||
import club.joylink.rtss.simulation.cbtc.data.vo.ConversationVO;
|
||||
import club.joylink.rtss.vo.AccountVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -24,9 +22,6 @@ public class SimulationConversationController {
|
|||
@Autowired
|
||||
private ConversationManagerService conversationManagerService;
|
||||
|
||||
@Autowired
|
||||
private ConversationGroupHandlerService conversationGroupHandlerService;
|
||||
|
||||
/**
|
||||
*根据会话id获取仿真会话
|
||||
*/
|
||||
|
@ -105,14 +100,4 @@ public class SimulationConversationController {
|
|||
this.conversationManagerService.textChat(group, id, text, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取本仿真的用户群组信息
|
||||
*
|
||||
* @param group 仿真ID
|
||||
* @return 用户群组
|
||||
*/
|
||||
@GetMapping("/group/list")
|
||||
public List<ConversationGroupVO> groupList(@PathVariable String group, @RequestAttribute AccountVO user) {
|
||||
return conversationGroupHandlerService.getAllConversationsGroup(group, user);
|
||||
}
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue