forked from Gitlink/soft_bot
Compare commits
3 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
aa9fe38514 | |
|
|
ebb6df163e | |
|
|
650a716810 |
|
|
@ -1,2 +1,4 @@
|
|||
/target
|
||||
/.idea/
|
||||
.idea
|
||||
/docker/logs
|
||||
/docker/.env
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AzureSettings">
|
||||
<option name="appInsights" value="rO0ABXVyAEtbTGNvbS5taWNyb3NvZnQuYXBwbGljYXRpb25pbnNpZ2h0cy5wcmVmZXJlbmNlLkFwcGxpY2F0aW9uSW5zaWdodHNSZXNvdXJjZTvCzxEP0C2HbAIAAHhwAAAAAA==" />
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<annotationProcessing>
|
||||
<profile default="true" name="Default" enabled="true" />
|
||||
<profile name="Maven default annotation processors profile" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<module name="SoftBot" />
|
||||
</profile>
|
||||
</annotationProcessing>
|
||||
</component>
|
||||
<component name="JavacSettings">
|
||||
<option name="ADDITIONAL_OPTIONS_OVERRIDE">
|
||||
<module name="SoftBot" options="-parameters" />
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
|
||||
<data-source source="LOCAL" name="@localhost" uuid="ae9ddb7d-d7b5-4954-adf9-f873ecb1ac9f">
|
||||
<driver-ref>mysql.8</driver-ref>
|
||||
<synchronize>true</synchronize>
|
||||
<jdbc-driver>com.mysql.cj.jdbc.Driver</jdbc-driver>
|
||||
<jdbc-url>jdbc:mysql://localhost:3306</jdbc-url>
|
||||
<working-dir>$ProjectFileDir$</working-dir>
|
||||
</data-source>
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding">
|
||||
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="JavaDoc" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="TOP_LEVEL_CLASS_OPTIONS">
|
||||
<value>
|
||||
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
|
||||
<option name="REQUIRED_TAGS" value="" />
|
||||
</value>
|
||||
</option>
|
||||
<option name="INNER_CLASS_OPTIONS">
|
||||
<value>
|
||||
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
|
||||
<option name="REQUIRED_TAGS" value="" />
|
||||
</value>
|
||||
</option>
|
||||
<option name="METHOD_OPTIONS">
|
||||
<value>
|
||||
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
|
||||
<option name="REQUIRED_TAGS" value="@return@param@throws or @exception" />
|
||||
</value>
|
||||
</option>
|
||||
<option name="FIELD_OPTIONS">
|
||||
<value>
|
||||
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
|
||||
<option name="REQUIRED_TAGS" value="" />
|
||||
</value>
|
||||
</option>
|
||||
<option name="IGNORE_DEPRECATED" value="false" />
|
||||
<option name="IGNORE_JAVADOC_PERIOD" value="true" />
|
||||
<option name="IGNORE_DUPLICATED_THROWS" value="false" />
|
||||
<option name="IGNORE_POINT_TO_ITSELF" value="false" />
|
||||
<option name="myAdditionalJavadocTags" value="date" />
|
||||
</inspection_tool>
|
||||
</profile>
|
||||
</component>
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RemoteRepositoriesConfiguration">
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Central Repository" />
|
||||
<option name="url" value="https://repo.maven.apache.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Maven Central repository" />
|
||||
<option name="url" value="https://repo1.maven.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="jboss.community" />
|
||||
<option name="name" value="JBoss Community repository" />
|
||||
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
||||
</remote-repository>
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="MavenProjectsManager">
|
||||
<option name="originalFiles">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/pom.xml" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
<option name="id" value="jpab" />
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RunConfigurationProducerService">
|
||||
<option name="ignoredProducers">
|
||||
<set>
|
||||
<option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="SqlDialectMappings">
|
||||
<file url="file://$PROJECT_DIR$/src/main/resources/sql/soft_bot.sql" dialect="MySQL" />
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,124 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Palette2">
|
||||
<group name="Swing">
|
||||
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
|
||||
</item>
|
||||
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
|
||||
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
|
||||
<initial-values>
|
||||
<property name="text" value="Button" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="RadioButton" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="CheckBox" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="Label" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||
<preferred-size width="200" height="200" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||
<preferred-size width="200" height="200" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
|
||||
<preferred-size width="-1" height="20" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
|
||||
</item>
|
||||
</group>
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
10
README.md
10
README.md
|
|
@ -14,6 +14,16 @@ Spring Boot 2.4.4、Mysql 5.7+、Mybatis-plus、~~ElasticSearch 7.15.2~~
|
|||
|
||||
2.3 将系统通过maven指令 mvn package 将系统打包成jar包,使用java -jar jar包名字启动服务 启动后端口为8080
|
||||
|
||||
2.4 docker运行
|
||||
```
|
||||
# 复制配置文件
|
||||
cp ./docker/.env.example ./docker/.env
|
||||
# 填写配置文件
|
||||
vim ./docker/.env
|
||||
# 启动
|
||||
../docker/start_docker_compose.sh
|
||||
```
|
||||
|
||||
3.业务模块:
|
||||
|
||||
(1)用户模块
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
# nacos
|
||||
NACOS_CONTAINER_NAME=
|
||||
NACOS_IP=
|
||||
NACOS_PORT=
|
||||
NACOS_USERNAME=
|
||||
NACOS_PASSWORD=
|
||||
|
||||
# mysql
|
||||
MYSQL_CONTAINER_NAME=
|
||||
MYSQL_IP=
|
||||
MYSQL_PORT=
|
||||
MYSQL_DATABASE=
|
||||
MYSQL_USERNAME=
|
||||
MYSQL_PASSWORD=
|
||||
|
||||
# local port
|
||||
SOFTBOT_LOCAL_PORT=
|
||||
|
||||
# microservice network name
|
||||
MICROSERVICES_NETWORK_NAME=
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
FROM openjdk:8-jdk
|
||||
ADD target/softbot.jar /data/softbot.jar
|
||||
WORKDIR /data
|
||||
ENTRYPOINT ["sh","-c","java -jar $JAVA_OPTS softbot.jar --spring.config.location=/data/config/softbot_application.yml"]
|
||||
ENTRYPOINT ["sh","-c","java -jar $JAVA_OPTS softbot.jar $NACOS_OPTS $MYSQL_OPTS --spring.profiles.active=prod"]
|
||||
|
|
@ -7,13 +7,23 @@ services:
|
|||
context: ../
|
||||
dockerfile: docker/Dockerfile
|
||||
volumes:
|
||||
- ./config/softbot_application.yml:/data/config/softbot_application.yml
|
||||
- ./logs:/data/logs
|
||||
external_links:
|
||||
- ${NACOS_CONTAINER_NAME}
|
||||
- ${MYSQL_CONTAINER_NAME}
|
||||
ports:
|
||||
- "8069:8081"
|
||||
- "${SOFTBOT_LOCAL_PORT}:8081"
|
||||
environment:
|
||||
- TZ=Asia/Shanghai
|
||||
- NACOS_OPTS=--nacos_ip=${NACOS_IP} --nacos_port=${NACOS_PORT} --nacos_username=${NACOS_USERNAME} --nacos_password=${NACOS_PASSWORD}
|
||||
- MYSQL_OPTS=--mysql_ip=${MYSQL_IP} --mysql_port=${MYSQL_PORT} --mysql_username=${MYSQL_USERNAME} --mysql_password=${MYSQL_PASSWORD} --mysql_database=${MYSQL_DATABASE}
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
memory: 800M
|
||||
restart: always
|
||||
restart: always
|
||||
|
||||
networks:
|
||||
microservices_network:
|
||||
external:
|
||||
name: ${MICROSERVICES_NETWORK_NAME}
|
||||
|
|
@ -1 +1,5 @@
|
|||
mvn -f ../pom.xml clean package -DskipTests && cp ../src/main/resources/application.yml ./config/softbot_application.yml && docker-compose -f docker-compose.yml up -d --build --force-recreate
|
||||
#!/bin/bash
|
||||
# 编译项目
|
||||
mvn -f ../pom.xml clean package -DskipTests
|
||||
# 启动docker-compose
|
||||
docker-compose -f docker-compose.yml up -d --build --force-recreate
|
||||
159
pom.xml
159
pom.xml
|
|
@ -8,115 +8,70 @@
|
|||
<artifactId>SoftBot</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
|
||||
<!-- SpringCloud 微服务 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-dependencies</artifactId>
|
||||
<version>${spring-cloud.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba 微服务 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
|
||||
<version>${spring-cloud-alibaba.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringBoot 依赖配置 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-dependencies</artifactId>
|
||||
<version>${spring-boot.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.4.4</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
|
||||
<description>Demo project for Spring Boot</description>
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<spring-boot.version>2.7.7</spring-boot.version>
|
||||
<spring-cloud.version>2021.0.5</spring-cloud.version>
|
||||
<spring-cloud-alibaba.version>2021.0.4.0</spring-cloud-alibaba.version>
|
||||
<swagger.fox.version>3.0.0</swagger.fox.version>
|
||||
<swagger.core.version>1.6.2</swagger.core.version>
|
||||
<druid.version>1.2.16</druid.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
<version>2021.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- bootstrap 启动器 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-bootstrap</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.validation</groupId>
|
||||
<artifactId>validation-api</artifactId>
|
||||
<version>2.0.1.Final</version>
|
||||
</dependency>
|
||||
<!-- mybatis-plus begin -->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
<version>3.5.5</version>
|
||||
</dependency>
|
||||
<groupId>javax.validation</groupId>
|
||||
<artifactId>validation-api</artifactId>
|
||||
<version>2.0.1.Final</version>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||
<!-- <artifactId>spring-boot-starter-data-elasticsearch</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- es插件 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus</artifactId>
|
||||
<version>3.5.5</version>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
<version>3.4.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.pagehelper</groupId>
|
||||
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
||||
<version>1.2.5</version>
|
||||
</dependency>
|
||||
<!-- mybatis-plus end -->
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.8.24</version>
|
||||
<version>5.5.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Swagger -->
|
||||
<!-- https://mvnrepository.com/artifact/io.springfox/springfox-swagger-ui -->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger2</artifactId>
|
||||
<version>${swagger.fox.version}</version>
|
||||
</dependency>
|
||||
<!-- Swagger 依赖配置 -->
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-models</artifactId>
|
||||
<version>${swagger.core.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-annotations</artifactId>
|
||||
<version>${swagger.core.version}</version>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
<version>2.9.2</version>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||
<!-- <artifactId>spring-boot-starter-data-jdbc</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||
<!-- <artifactId>spring-boot-starter-jdbc</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-thymeleaf</artifactId>
|
||||
|
|
@ -138,6 +93,7 @@
|
|||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
|
|
@ -162,12 +118,23 @@
|
|||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-data-redis -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||
<version>2.4.0</version>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>junit</groupId>-->
|
||||
<!-- <artifactId>junit</artifactId>-->
|
||||
<!-- <version>4.13.2</version>-->
|
||||
<!-- <scope>test</scope>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger2</artifactId>
|
||||
<version>${swagger.fox.version}</version>
|
||||
<version>2.9.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
|
@ -188,33 +155,21 @@
|
|||
<artifactId>aspectjweaver</artifactId>
|
||||
<version>1.9.4</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>30.0-jre</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- 处理访问Gitlink相关接口 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
<version>4.5.14</version>
|
||||
</dependency>
|
||||
<!-- Druid -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid-spring-boot-starter</artifactId>
|
||||
<version>${druid.version}</version>
|
||||
<version>20.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>softbot</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>${spring-boot.version}</version>
|
||||
|
||||
<!-- 没有该配置 热部署的devtools不生效-->
|
||||
<configuration>
|
||||
<fork>true</fork>
|
||||
|
|
@ -227,11 +182,11 @@
|
|||
</configuration>
|
||||
</plugin>
|
||||
<!--加上这个是为了防止出现maven打包错误-->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>3.1.0</version><!--亲测:3.1.0和2.4.3都可以。-->
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>3.1.0</version><!--亲测:3.1.0和2.4.3都可以。-->
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
package com.gitlink.softbot;
|
||||
|
||||
|
||||
import com.gitlink.softbot.annotation.EnableCustomSwagger2;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
import org.springframework.retry.annotation.EnableRetry;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
|
||||
|
|
@ -12,7 +11,7 @@ import org.springframework.scheduling.annotation.EnableAsync;
|
|||
@MapperScan("com.gitlink.softbot.dao")
|
||||
@EnableAsync
|
||||
@EnableRetry
|
||||
@EnableCustomSwagger2
|
||||
@EnableDiscoveryClient
|
||||
public class SoftBotApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
|
|
|||
|
|
@ -1,17 +0,0 @@
|
|||
package com.gitlink.softbot.annotation;
|
||||
|
||||
import com.gitlink.softbot.config.SwaggerConfig;
|
||||
import org.springframework.context.annotation.Import;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Target({ ElementType.TYPE })
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Inherited
|
||||
@Import({ SwaggerConfig.class })
|
||||
public @interface EnableCustomSwagger2
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1,9 +1,8 @@
|
|||
package com.gitlink.softbot.config;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.DbType;
|
||||
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
||||
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
|
||||
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.optimize.JsqlParserCountOptimize;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
|
|
@ -11,15 +10,15 @@ import org.springframework.context.annotation.Configuration;
|
|||
public class MybatisPlusConfig {
|
||||
|
||||
@Bean
|
||||
public MybatisPlusInterceptor paginationInterceptor() {
|
||||
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
|
||||
PaginationInnerInterceptor paginationInterceptor = new PaginationInnerInterceptor(DbType.MYSQL);
|
||||
// 配置分页参数
|
||||
// paginationInterceptor.setMaxLimit(500L);
|
||||
// 设置分页参数的封装方式,默认为false,即不封装分页参数
|
||||
// paginationInterceptor.setOverflow(false);
|
||||
interceptor.addInnerInterceptor(paginationInterceptor);
|
||||
return interceptor;
|
||||
public PaginationInterceptor paginationInterceptor() {
|
||||
PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
|
||||
// 设置请求的页面大于最大页后操作, true调回到首页,false 继续请求 默认false
|
||||
// paginationInterceptor.setOverflow(false);
|
||||
// 设置最大单页限制数量,默认 500 条,-1 不受限制
|
||||
// paginationInterceptor.setLimit(500);
|
||||
// 开启 count 的 join 优化,只针对部分 left join
|
||||
paginationInterceptor.setCountSqlParser(new JsqlParserCountOptimize(true));
|
||||
return paginationInterceptor;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,50 +0,0 @@
|
|||
package com.gitlink.softbot.config;
|
||||
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.config.BeanPostProcessor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.ReflectionUtils;
|
||||
import org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping;
|
||||
import springfox.documentation.spring.web.plugins.WebFluxRequestHandlerProvider;
|
||||
import springfox.documentation.spring.web.plugins.WebMvcRequestHandlerProvider;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Component
|
||||
public class SwaggerBeanPostProcessor implements BeanPostProcessor
|
||||
{
|
||||
@Override
|
||||
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException
|
||||
{
|
||||
if (bean instanceof WebMvcRequestHandlerProvider || bean instanceof WebFluxRequestHandlerProvider)
|
||||
{
|
||||
customizeSpringfoxHandlerMappings(getHandlerMappings(bean));
|
||||
}
|
||||
return bean;
|
||||
}
|
||||
|
||||
private <T extends RequestMappingInfoHandlerMapping> void customizeSpringfoxHandlerMappings(List<T> mappings)
|
||||
{
|
||||
List<T> copy = mappings.stream().filter(mapping -> mapping.getPatternParser() == null)
|
||||
.collect(Collectors.toList());
|
||||
mappings.clear();
|
||||
mappings.addAll(copy);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private List<RequestMappingInfoHandlerMapping> getHandlerMappings(Object bean)
|
||||
{
|
||||
try
|
||||
{
|
||||
Field field = ReflectionUtils.findField(bean.getClass(), "handlerMappings");
|
||||
field.setAccessible(true);
|
||||
return (List<RequestMappingInfoHandlerMapping>) field.get(bean);
|
||||
}
|
||||
catch (IllegalArgumentException | IllegalAccessException e)
|
||||
{
|
||||
throw new IllegalStateException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -8,27 +8,25 @@ import springfox.documentation.builders.PathSelectors;
|
|||
import springfox.documentation.builders.RequestHandlerSelectors;
|
||||
import springfox.documentation.service.ApiInfo;
|
||||
import springfox.documentation.spi.DocumentationType;
|
||||
import springfox.documentation.spring.web.plugins.ApiSelectorBuilder;
|
||||
import springfox.documentation.spring.web.plugins.Docket;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
|
||||
@Configuration
|
||||
@EnableSwagger2
|
||||
public class SwaggerConfig {
|
||||
@Bean
|
||||
public Docket createRestApi()
|
||||
{
|
||||
ApiSelectorBuilder builder = new Docket(DocumentationType.SWAGGER_2)
|
||||
.apiInfo(apiInfo()).select()
|
||||
public Docket createRestApi() {
|
||||
return new Docket(DocumentationType.SWAGGER_2)
|
||||
.apiInfo(apiInfo())
|
||||
//是否开启 (true 开启 false隐藏。生产环境建议隐藏)
|
||||
//.enable(false)
|
||||
.select()
|
||||
//扫描的路径包,设置basePackage会将包下的所有被@Api标记类的所有方法作为api
|
||||
.apis(RequestHandlerSelectors.basePackage("com.gitlink.softbot.controller"))
|
||||
.paths(PathSelectors.any());
|
||||
|
||||
return builder.build();
|
||||
//指定路径处理PathSelectors.any()代表所有的路径
|
||||
.paths(PathSelectors.any())
|
||||
.build();
|
||||
}
|
||||
|
||||
private ApiInfo apiInfo() {
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import com.gitlink.softbot.utils.AuthOperate;
|
|||
import com.gitlink.softbot.utils.GitLinkApi;
|
||||
import com.gitlink.softbot.vo.*;
|
||||
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.gitlink.softbot.vo.BotInputVO;
|
||||
import javax.annotation.Resource;
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ import com.gitlink.softbot.vo.*;
|
|||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
|
@ -56,7 +55,6 @@ public class MarketService implements IMarketService {
|
|||
GitLinkApi api;
|
||||
|
||||
@Autowired
|
||||
@Lazy
|
||||
UserService userService;
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -23,6 +23,9 @@ import java.util.List;
|
|||
@Slf4j
|
||||
public class AsyncDeleteWebhookService {
|
||||
|
||||
@Resource
|
||||
private UserService userService;
|
||||
|
||||
@Autowired
|
||||
private GitLinkApi api;
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ import com.gitlink.softbot.utils.response.AddWebhookResponse;
|
|||
import com.gitlink.softbot.vo.Webhook;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.retry.annotation.Backoff;
|
||||
import org.springframework.retry.annotation.Recover;
|
||||
import org.springframework.retry.annotation.Retryable;
|
||||
|
|
@ -27,7 +26,6 @@ import java.util.List;
|
|||
public class AsyncUpdateWebhookService {
|
||||
|
||||
@Resource
|
||||
@Lazy
|
||||
private UserService userService;
|
||||
|
||||
@Autowired
|
||||
|
|
|
|||
|
|
@ -1,8 +1,25 @@
|
|||
server:
|
||||
port: 8080
|
||||
port: 8081
|
||||
es-url:
|
||||
127.0.0.1:9200
|
||||
spring:
|
||||
|
||||
config:
|
||||
activate:
|
||||
on-profile: dev
|
||||
|
||||
application:
|
||||
# 应用名称
|
||||
name: softbot
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
username: nacos
|
||||
password: nacos
|
||||
|
||||
|
||||
datasource:
|
||||
username: root
|
||||
password: 123456 #tonglin0711
|
||||
|
|
@ -45,6 +62,7 @@ spring:
|
|||
timeout: 10000
|
||||
password: 123456
|
||||
|
||||
|
||||
mybatis-plus:
|
||||
configuration:
|
||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
server:
|
||||
port: 8081
|
||||
es-url:
|
||||
127.0.0.1:9200
|
||||
|
||||
spring:
|
||||
|
||||
config:
|
||||
activate:
|
||||
on-profile: prod
|
||||
|
||||
application:
|
||||
# 应用名称
|
||||
name: softbot
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: ${nacos_ip}:${nacos_port}
|
||||
username: ${nacos_username}
|
||||
password: ${nacos_password}
|
||||
|
||||
datasource:
|
||||
username: ${mysql_username}
|
||||
password: ${mysql_password}
|
||||
url: jdbc:mysql://${mysql_ip}:${mysql_port}/${mysql_database}?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
dbcp2:
|
||||
test-on-borrow: false
|
||||
test-while-idle: true
|
||||
time-between-eviction-runs-millis: 3600000
|
||||
|
||||
elasticsearch:
|
||||
rest:
|
||||
uris: http://127.0.0.1:9200
|
||||
|
||||
jackson:
|
||||
time-zone: GMT+8
|
||||
date-format: yyyy-MM-dd HH:mm:ss
|
||||
mvc:
|
||||
view:
|
||||
prefix: /WEB-INF/jsp/
|
||||
suffix: .jsp
|
||||
thymeleaf:
|
||||
prefix: classpath:/templates/
|
||||
suffix: .html
|
||||
encoding: UTF-8
|
||||
redis:
|
||||
database: 0
|
||||
host: 101.35.140.79
|
||||
port: 6379
|
||||
# password:
|
||||
# 连接超时时间
|
||||
timeout: 10000
|
||||
password: 123456
|
||||
|
||||
mybatis-plus:
|
||||
configuration:
|
||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
mapper-locations: classpath:mapper/*.xml
|
||||
|
||||
|
||||
mybatis:
|
||||
mapper-locations: classpath:mapper/*.xml
|
||||
type-aliases-package: com.gitlink.softbot.entity
|
||||
configuration:
|
||||
map-underscore-to-camel-case: true
|
||||
|
||||
#showSql
|
||||
logging:
|
||||
level:
|
||||
com:
|
||||
example:
|
||||
mapper : debug
|
||||
elasticsearch:
|
||||
url: localhost:9200
|
||||
|
||||
gitlink:
|
||||
url: https://testforgeplus.trustie.net
|
||||
token: eyJraWQiOiJUaEVSLVl3Ukg4TWYwOHM0UnJLUDYzXzZLWmVET2NZckZXcmdzN2VUVWdrIiwiYWxnIjoiSFM1MTIifQ.eyJpc3MiOiJHaXRMaW5rIiwiaWF0IjoxNjc1NzYyMDkwLCJqdGkiOiI0MzA1ZDUwZC01ZGRkLTQ0MzUtODMyNS1iZDczYmVhMWMxYjciLCJ1c2VyIjp7ImlkIjpudWxsLCJsb2dpbiI6bnVsbCwibWFpbCI6bnVsbH19.hpHCJeU4Jyz-DM2NBUdB-tQW_E0-tu9H3LoGhsJ7kPHkSsdXJCII0jxhyPb9gwDsgd8SnlRZF8tZDDjnZSoztQ
|
||||
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
server:
|
||||
port: 8081
|
||||
|
||||
spring:
|
||||
application:
|
||||
# 应用名称
|
||||
name: softbot
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
server:
|
||||
port: 8081
|
||||
|
||||
spring:
|
||||
application:
|
||||
# 应用名称
|
||||
name: microservices-soft-bot
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
username: nacos
|
||||
password: nacos
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
username: nacos
|
||||
password: nacos
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
spring:
|
||||
autoconfigure:
|
||||
exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
|
||||
datasource:
|
||||
username: root
|
||||
password: 123456
|
||||
url: jdbc:mysql://127.0.0.1:3306/testforgeplus?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
dbcp2:
|
||||
test-on-borrow: false
|
||||
test-while-idle: true
|
||||
time-between-eviction-runs-millis: 3600000
|
||||
elasticsearch:
|
||||
uris: http://127.0.0.1:9222
|
||||
devtools:
|
||||
restart:
|
||||
enabled: true
|
||||
additional-paths: src/main/java
|
||||
|
||||
poll-interval: 3000
|
||||
quiet-period: 1000
|
||||
jackson:
|
||||
time-zone: GMT+8
|
||||
date-format: yyyy-MM-dd HH:mm:ss
|
||||
mvc:
|
||||
view:
|
||||
prefix: /WEB-INF/jsp/
|
||||
suffix: .jsp
|
||||
thymeleaf:
|
||||
prefix: classpath:/templates/
|
||||
suffix: .html
|
||||
encoding: UTF-8
|
||||
redis:
|
||||
database: 0
|
||||
host: 127.0.0.1
|
||||
port: 6379
|
||||
# password:
|
||||
timeout: 10000
|
||||
|
||||
mybatis-plus:
|
||||
configuration:
|
||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
mapper-locations: classpath:mapper/*.xml
|
||||
|
||||
|
||||
mybatis:
|
||||
mapper-locations: classpath:mapper/*.xml
|
||||
type-aliases-package: com.gitlink.softbot.entity
|
||||
configuration:
|
||||
map-underscore-to-camel-case: true
|
||||
|
||||
#showSql
|
||||
logging:
|
||||
level:
|
||||
com:
|
||||
example:
|
||||
mapper : debug
|
||||
|
||||
gitlink:
|
||||
url: https://testforgeplus.trustie.net
|
||||
token: oenOds0ooINojK5_T3Qv3j2mIhWmQGMFZQLO3_evowc
|
||||
|
|
@ -39,7 +39,7 @@ CREATE TABLE `bot` (
|
|||
`private_key` text,
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE KEY `name` (`bot_name`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=802 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of bot
|
||||
|
|
@ -195,3 +195,156 @@ CREATE TABLE `transfer_bot` (
|
|||
-- ----------------------------
|
||||
-- Records of transfer_bot
|
||||
-- ----------------------------
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `bot`;
|
||||
CREATE TABLE `bot` (
|
||||
`id` int NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`bot_name` varchar(255) NOT NULL COMMENT 'bot名称',
|
||||
`bot_des` longtext COMMENT 'bot描述',
|
||||
`webhook` varchar(255) NOT NULL COMMENT 'bot回调url',
|
||||
`is_public` tinyint DEFAULT NULL COMMENT '0:私有1:公开',
|
||||
`logo` varchar(255) DEFAULT NULL COMMENT 'logo',
|
||||
`state` tinyint DEFAULT NULL COMMENT '0:挂起1:工作',
|
||||
`client_id` varchar(255) DEFAULT NULL COMMENT '客户端id(后台生成)',
|
||||
`client_secret` varchar(255) DEFAULT NULL COMMENT '客户端密钥(后台生成)',
|
||||
`web_url` varchar(255) DEFAULT NULL COMMENT '主页网址',
|
||||
`category` varchar(255) DEFAULT NULL COMMENT '类型',
|
||||
`install_num` int DEFAULT '0' COMMENT '下载数量',
|
||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`uid` int DEFAULT NULL,
|
||||
`owner_id` int DEFAULT NULL,
|
||||
`private_key` text,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `name` (`bot_name`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
|
||||
|
||||
-- Records of bot
|
||||
INSERT INTO `bot` VALUES
|
||||
('783', 'botnameegdret', 'miaoshusd', 'http://localhost:10000', '1', 'asdasdasfdg', '0', 'qwer', 'ert', 'botnameegdret', '疑修管理', '6', '2023-03-07 17:42:13', '2023-03-07 17:42:13', NULL, '84993', NULL),
|
||||
('791', 'botnameegdretui', 'miaoshusd', 'www.hauhahasd.com', '1', 'asdasdasfdg', '0', 'qwer', 'ert', 'botnameegdretui', '疑修管理', '1', '2023-03-07 17:23:28', '2023-03-06 23:05:28', NULL, '84993', NULL),
|
||||
('792', 'botnameegdretop', 'miaoshusd', 'www.hauhahasd.com', '0', 'asdasdasfdg', '0', 'qwer', 'ert', 'botnameegdretop', NULL, '0', '2023-03-06 23:05:29', '2023-03-06 23:05:29', NULL, '84993', NULL);
|
||||
|
||||
-- Table structure for bot_category
|
||||
DROP TABLE IF EXISTS `bot_category`;
|
||||
CREATE TABLE `bot_category` (
|
||||
`id` int NOT NULL,
|
||||
`category` varchar(255) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- Records of bot_category
|
||||
INSERT INTO `bot_category` VALUES
|
||||
('1', '疑修管理'),
|
||||
('2', '合并请求管理'),
|
||||
('3', '代码审阅'),
|
||||
('4', '代码质量'),
|
||||
('5', '依赖管理'),
|
||||
('6', '构建'),
|
||||
('7', '测试'),
|
||||
('8', '部署'),
|
||||
('9', '文档管理'),
|
||||
('10', '其他');
|
||||
|
||||
-- Table structure for bot_limit_event
|
||||
DROP TABLE IF EXISTS `bot_limit_event`;
|
||||
CREATE TABLE `bot_limit_event` (
|
||||
`id` int NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`bot_id` int NOT NULL COMMENT 'bot的唯一标识',
|
||||
`read_write_code` tinyint NOT NULL COMMENT '0:只读1:读写2:无权限',
|
||||
`read_write_pr` tinyint NOT NULL COMMENT '0:只读1:读写2:无权限',
|
||||
`auth_category` tinyint NOT NULL COMMENT '0:代码仓库权限1:合并请求权限2:无权限',
|
||||
`event` tinyint NOT NULL COMMENT '0:git推送到存储库1:创建分支或标签2:删除分支或标签3:合并请求被打开或重新打开4:合并请求被分配5:无权限',
|
||||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8;
|
||||
|
||||
-- Records of bot_limit_event
|
||||
INSERT INTO `bot_limit_event` VALUES
|
||||
('18', '783', '0', '1', '0', '1', '2022-10-05 19:21:53', '2022-10-05 19:21:53'),
|
||||
('19', '791', '0', '1', '0', '1', '2022-10-07 20:19:22', '2022-10-07 20:19:22'),
|
||||
('20', '792', '1', '2', '0', '2', '2022-12-29 18:34:26', '2022-12-29 18:34:26'),
|
||||
('21', '793', '1', '2', '0', '1', '2022-12-29 18:42:26', '2022-12-29 18:42:26'),
|
||||
('23', '794', '1', '2', '0', '1', '2022-12-29 18:45:54', '2022-12-29 18:45:54'),
|
||||
('27', '799', '1', '2', '0', '1', '2022-12-29 19:30:05', '2022-12-29 19:30:05'),
|
||||
('28', '799', '2', '1', '1', '2', '2022-12-29 19:30:05', '2022-12-29 19:30:05');
|
||||
|
||||
-- Table structure for install_bot
|
||||
DROP TABLE IF EXISTS `install_bot`;
|
||||
CREATE TABLE `install_bot` (
|
||||
`id` int NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`bot_id` int NOT NULL COMMENT 'bot唯一标识',
|
||||
`installer_id` int NOT NULL COMMENT '安装者唯一标识',
|
||||
`store_id` int NOT NULL COMMENT '仓库唯一标识',
|
||||
`state` tinyint NOT NULL COMMENT '0:挂起1:工作2:卸载',
|
||||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`installer_login` varchar(255) NOT NULL,
|
||||
`store_repo` varchar(255) NOT NULL,
|
||||
`webhook_id` int DEFAULT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8;
|
||||
|
||||
-- Table structure for market_bot
|
||||
DROP TABLE IF EXISTS `market_bot`;
|
||||
CREATE TABLE `market_bot` (
|
||||
`id` int NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`bot_id` int NOT NULL COMMENT 'bot唯一 标识',
|
||||
`market_name` varchar(255) DEFAULT NULL COMMENT '上市名称',
|
||||
`market_desc` varchar(255) DEFAULT NULL COMMENT '上市简介',
|
||||
`market_intro` longtext COMMENT '详细介绍',
|
||||
`first_func` varchar(255) NOT NULL COMMENT '主要功能',
|
||||
`second_func` varchar(255) DEFAULT NULL COMMENT '次要功能',
|
||||
`webhook` varchar(255) DEFAULT NULL COMMENT '回调url',
|
||||
`is_receive_ag1` tinyint DEFAULT '0' COMMENT '0:接收协议1:不接受收开发者协议',
|
||||
`is_receive_ag2` tinyint DEFAULT '0' COMMENT '0:接收协议1:不接受平台协议',
|
||||
`market_time` datetime DEFAULT NULL COMMENT '上市时间',
|
||||
`logo` varchar(255) DEFAULT NULL COMMENT '头像',
|
||||
`install_num` int DEFAULT '0' COMMENT '安装次数',
|
||||
`category` varchar(255) DEFAULT NULL COMMENT '类型',
|
||||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `唯一` (`bot_id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=55 DEFAULT CHARSET=utf8;
|
||||
|
||||
-- Records of market_bot
|
||||
INSERT INTO `market_bot` VALUES ('49', '783', 'qwe', 'asd', null, '代码审阅', '疑修管理', 'sad', '1', '1', '2023-03-06 21:07:01', 'sd', '6', 'asd', '2023-03-06 21:07:01', '2023-03-07 17:40:57');
|
||||
INSERT INTO `market_bot` VALUES ('54', '791', 'asder', 'asd', 'asdasd', '其他', '', 'www.asd.com', '0', '0', '2023-03-06 21:06:58', 'asd', '1', 'xcv', '2023-03-06 21:06:58', '2023-03-07 17:23:28');
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `register_bot`;
|
||||
CREATE TABLE `register_bot` (
|
||||
`id` int NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`bot_id` int NOT NULL COMMENT 'bot唯一标识',
|
||||
`developer_id` int NOT NULL COMMENT 'bot开发者唯一标识',
|
||||
`create_time` datetime NOT NULL COMMENT '创建时间',
|
||||
`update_time` datetime NOT NULL COMMENT '更新时间',
|
||||
`developer_login` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `bot_id` (`bot_id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
|
||||
|
||||
-- Records of register_bot
|
||||
INSERT INTO `register_bot` (id, bot_id, developer_id, create_time, update_time, developer_login) VALUES
|
||||
(3, 783, 84993, '2023-03-07 09:46:37', '2023-03-07 09:46:37', 'durian'),
|
||||
(4, 791, 84993, '2023-03-07 09:46:37', '2023-03-07 09:46:37', 'durian'),
|
||||
(5, 792, 84993, '2023-03-07 09:46:35', '2023-03-07 09:46:35', 'durian');
|
||||
|
||||
-- Table structure for `transfer_bot`
|
||||
DROP TABLE IF EXISTS `transfer_bot`;
|
||||
CREATE TABLE `transfer_bot` (
|
||||
`id` int NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`bot_id` int NOT NULL COMMENT 'bot唯一标识',
|
||||
`transfer_from_id` int NOT NULL COMMENT '转让者唯一标识',
|
||||
`transfer_to_id` int NOT NULL COMMENT '接收者唯一标识',
|
||||
`is_success` tinyint NOT NULL COMMENT '0:转让失败,1:转让成功 2:待接收',
|
||||
`transfer_time` datetime NOT NULL COMMENT '转让时间',
|
||||
`create_time` datetime NOT NULL COMMENT '创建时间',
|
||||
`update_time` datetime NOT NULL COMMENT '更新时间',
|
||||
`from_login` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
|
||||
`to_login` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ import org.springframework.boot.test.context.SpringBootTest;
|
|||
import org.springframework.test.context.ActiveProfiles;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
@ActiveProfiles("dev")
|
||||
@SpringBootTest
|
||||
public class GitLinkApiTest {
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ import org.springframework.web.client.RestTemplate;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@ActiveProfiles("dev")
|
||||
@ActiveProfiles("test")
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
|
||||
class RestTemplateUtilTests {
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue