初始化项目

This commit is contained in:
waner
2026-02-28 14:41:43 +08:00
parent 8d57e8b3fd
commit 7c16d5d576
178 changed files with 10310 additions and 1 deletions
+22
View File
@@ -0,0 +1,22 @@
spring:
datasource:
url: jdbc:mysql://127.0.0.1:4000/tms?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
username: root
password: root
driver-class-name: com.mysql.cj.jdbc.Driver
mybatis-plus:
mapper-locations: classpath*:/mapper/**/*.xml
global-config:
db-config:
logic-delete-field: deleted
logic-delete-value: 1
logic-not-delete-value: 0
configuration:
map-underscore-to-camel-case: true
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
logging:
level:
com.cisd.tms: info
com.baomidou.mybatisplus: info
+21
View File
@@ -0,0 +1,21 @@
spring:
datasource:
url: jdbc:mysql://tidb-host:4000/tms?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
username: ${TMS_DB_USER:root}
password: ${TMS_DB_PASSWORD:change-me}
driver-class-name: com.mysql.cj.jdbc.Driver
mybatis-plus:
mapper-locations: classpath*:/mapper/**/*.xml
global-config:
db-config:
logic-delete-field: deleted
logic-delete-value: 1
logic-not-delete-value: 0
configuration:
map-underscore-to-camel-case: true
logging:
level:
com.cisd.tms: info
root: info
+40
View File
@@ -0,0 +1,40 @@
spring:
application:
name: tms-framework
profiles:
active: dev
server:
port: 8080
management:
endpoints:
web:
exposure:
include: health,info,metrics
endpoint:
health:
show-details: always
springdoc:
api-docs:
enabled: true
path: /v3/api-docs
swagger-ui:
enabled: true
path: /swagger-ui.html
tags-sorter: alpha
operations-sorter: alpha
tms:
security:
internal-token: ${TMS_INTERNAL_TOKEN:change-me-internal-token}
openapi:
timestamp-skew-seconds: 300
clients:
demo-app: ${TMS_OPENAPI_DEMO_SECRET:change-me-openapi-secret}
crypto-card:
enabled: ${TMS_CRYPTO_CARD_ENABLED:false}
mode: ${TMS_CRYPTO_CARD_MODE:MOCK}
vendor-lib-path: ${TMS_CRYPTO_VENDOR_LIB_PATH:}
vendor-lib-name: ${TMS_CRYPTO_VENDOR_LIB_NAME:swsdsdf}
@@ -0,0 +1,29 @@
CREATE TABLE IF NOT EXISTS tms_init_task (
id BIGINT PRIMARY KEY,
task_id VARCHAR(64) NOT NULL,
version VARCHAR(32) NOT NULL,
status VARCHAR(32) NOT NULL,
create_time DATETIME(3) NOT NULL,
update_time DATETIME(3) NOT NULL,
UNIQUE KEY uk_tms_init_task_task_id (task_id)
);
CREATE TABLE IF NOT EXISTS tms_auth_user (
id BIGINT PRIMARY KEY,
username VARCHAR(64) NOT NULL,
display_name VARCHAR(128) NOT NULL,
role VARCHAR(64) NOT NULL,
create_time DATETIME(3) NOT NULL,
update_time DATETIME(3) NOT NULL,
UNIQUE KEY uk_tms_auth_user_username (username)
);
CREATE TABLE IF NOT EXISTS tms_device_node (
id BIGINT PRIMARY KEY,
node_id VARCHAR(64) NOT NULL,
host VARCHAR(128) NOT NULL,
status VARCHAR(32) NOT NULL,
create_time DATETIME(3) NOT NULL,
update_time DATETIME(3) NOT NULL,
UNIQUE KEY uk_tms_device_node_node_id (node_id)
);
+15
View File
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<property name="PATTERN" value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level [%X{traceId}] %logger{36} - %msg%n"/>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${PATTERN}</pattern>
<charset>UTF-8</charset>
</encoder>
</appender>
<root level="INFO">
<appender-ref ref="CONSOLE"/>
</root>
</configuration>
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cisd.tms.modules.auth.mapper.AuthUserMapper">
<resultMap id="AuthUserResultMap" type="com.cisd.tms.modules.auth.entity.AuthUserEntity">
<id property="id" column="id"/>
<result property="username" column="username"/>
<result property="displayName" column="display_name"/>
<result property="role" column="role"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<select id="selectByUsername" parameterType="string" resultMap="AuthUserResultMap">
SELECT id, username, display_name, role, create_time, update_time
FROM tms_auth_user
WHERE username = #{username}
LIMIT 1
</select>
</mapper>
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cisd.tms.modules.device.mapper.DeviceNodeMapper">
<resultMap id="DeviceNodeResultMap" type="com.cisd.tms.modules.device.entity.DeviceNodeEntity">
<id property="id" column="id"/>
<result property="nodeId" column="node_id"/>
<result property="host" column="host"/>
<result property="status" column="status"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<select id="selectByNodeId" parameterType="string" resultMap="DeviceNodeResultMap">
SELECT id, node_id, host, status, create_time, update_time
FROM tms_device_node
WHERE node_id = #{nodeId}
LIMIT 1
</select>
</mapper>
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cisd.tms.modules.init.mapper.InitTaskMapper">
<resultMap id="InitTaskResultMap" type="com.cisd.tms.modules.init.entity.InitTaskEntity">
<id property="id" column="id"/>
<result property="taskId" column="task_id"/>
<result property="version" column="version"/>
<result property="status" column="status"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<select id="selectByTaskId" parameterType="string" resultMap="InitTaskResultMap">
SELECT id, task_id, version, status, create_time, update_time
FROM tms_init_task
WHERE task_id = #{taskId}
LIMIT 1
</select>
</mapper>