Initial commit
This commit is contained in:
55
target/classes/application.yml
Normal file
55
target/classes/application.yml
Normal file
@@ -0,0 +1,55 @@
|
||||
spring:
|
||||
application:
|
||||
name: ota-server
|
||||
datasource:
|
||||
url: jdbc:mysql://127.0.0.1:3306/ota_server?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: 123456
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
|
||||
server:
|
||||
port: 8080
|
||||
|
||||
ota:
|
||||
auth-token: f47ac10b-58cc-4372-a567-0e02b2c3d479
|
||||
heartbeat-timeout-seconds: 120
|
||||
cors:
|
||||
allowed-origins:
|
||||
- http://localhost:5173
|
||||
- http://127.0.0.1:5173
|
||||
allowed-methods:
|
||||
- GET
|
||||
- POST
|
||||
- PUT
|
||||
- DELETE
|
||||
- OPTIONS
|
||||
allowed-headers:
|
||||
- "*"
|
||||
allow-credentials: true
|
||||
|
||||
sa-token:
|
||||
token-name: X-OTA-TOKEN
|
||||
token-prefix: ""
|
||||
timeout: 1800
|
||||
active-timeout: -1
|
||||
is-concurrent: true
|
||||
is-share: true
|
||||
is-log: true
|
||||
token-style: uuid
|
||||
is-read-header: true
|
||||
is-read-cookie: false
|
||||
is-read-body: false
|
||||
is-read-param: false
|
||||
|
||||
mybatis-plus:
|
||||
configuration:
|
||||
map-underscore-to-camel-case: true
|
||||
global-config:
|
||||
db-config:
|
||||
id-type: auto
|
||||
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: health,info
|
||||
BIN
target/classes/com/noblelift/ota/OtaServerApplication.class
Normal file
BIN
target/classes/com/noblelift/ota/OtaServerApplication.class
Normal file
Binary file not shown.
Binary file not shown.
BIN
target/classes/com/noblelift/ota/common/annotation/Log.class
Normal file
BIN
target/classes/com/noblelift/ota/common/annotation/Log.class
Normal file
Binary file not shown.
BIN
target/classes/com/noblelift/ota/common/aspect/LogAspect.class
Normal file
BIN
target/classes/com/noblelift/ota/common/aspect/LogAspect.class
Normal file
Binary file not shown.
Binary file not shown.
BIN
target/classes/com/noblelift/ota/common/dto/ApiMessage.class
Normal file
BIN
target/classes/com/noblelift/ota/common/dto/ApiMessage.class
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
target/classes/com/noblelift/ota/common/model/VehicleInfo.class
Normal file
BIN
target/classes/com/noblelift/ota/common/model/VehicleInfo.class
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
target/classes/com/noblelift/ota/config/OtaConfiguration.class
Normal file
BIN
target/classes/com/noblelift/ota/config/OtaConfiguration.class
Normal file
Binary file not shown.
BIN
target/classes/com/noblelift/ota/config/OtaProperties$Cors.class
Normal file
BIN
target/classes/com/noblelift/ota/config/OtaProperties$Cors.class
Normal file
Binary file not shown.
BIN
target/classes/com/noblelift/ota/config/OtaProperties.class
Normal file
BIN
target/classes/com/noblelift/ota/config/OtaProperties.class
Normal file
Binary file not shown.
BIN
target/classes/com/noblelift/ota/config/SaTokenConfigure.class
Normal file
BIN
target/classes/com/noblelift/ota/config/SaTokenConfigure.class
Normal file
Binary file not shown.
Binary file not shown.
BIN
target/classes/com/noblelift/ota/domain/AgentStatus.class
Normal file
BIN
target/classes/com/noblelift/ota/domain/AgentStatus.class
Normal file
Binary file not shown.
BIN
target/classes/com/noblelift/ota/domain/TaskStatus.class
Normal file
BIN
target/classes/com/noblelift/ota/domain/TaskStatus.class
Normal file
Binary file not shown.
BIN
target/classes/com/noblelift/ota/domain/UpgradeMode.class
Normal file
BIN
target/classes/com/noblelift/ota/domain/UpgradeMode.class
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
90
target/classes/schema.sql
Normal file
90
target/classes/schema.sql
Normal file
@@ -0,0 +1,90 @@
|
||||
CREATE DATABASE IF NOT EXISTS ota_server DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
USE ota_server;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS ota_release (
|
||||
id BIGINT PRIMARY KEY AUTO_INCREMENT,
|
||||
release_version VARCHAR(128) NOT NULL UNIQUE,
|
||||
release_notes TEXT NOT NULL,
|
||||
upgrade_mode VARCHAR(32) NOT NULL,
|
||||
published_at DATETIME(6) NOT NULL,
|
||||
parking_required TINYINT(1) NOT NULL DEFAULT 0,
|
||||
components_json JSON NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS ota_vehicle (
|
||||
id BIGINT PRIMARY KEY AUTO_INCREMENT,
|
||||
vehicle_id VARCHAR(64) NOT NULL UNIQUE,
|
||||
vin VARCHAR(64) NOT NULL,
|
||||
current_release VARCHAR(128) NOT NULL,
|
||||
current_backend_version VARCHAR(128) NULL,
|
||||
current_frontend_version VARCHAR(128) NULL,
|
||||
current_ros_version VARCHAR(128) NULL,
|
||||
last_seen_at DATETIME(6) NULL,
|
||||
agent_status VARCHAR(32) NULL,
|
||||
target_release VARCHAR(128) NULL,
|
||||
last_result VARCHAR(512) NULL,
|
||||
images_json JSON NULL,
|
||||
backup_file VARCHAR(512) NULL
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS ota_vehicle_assignment (
|
||||
id BIGINT PRIMARY KEY AUTO_INCREMENT,
|
||||
vehicle_id VARCHAR(64) NOT NULL UNIQUE,
|
||||
release_version VARCHAR(128) NOT NULL,
|
||||
task_status VARCHAR(32) NOT NULL,
|
||||
prompted_at DATETIME(6) NULL,
|
||||
confirmed_at DATETIME(6) NULL,
|
||||
started_at DATETIME(6) NULL,
|
||||
finished_at DATETIME(6) NULL,
|
||||
postpone_count INT NOT NULL DEFAULT 0,
|
||||
last_message VARCHAR(512) NULL,
|
||||
CONSTRAINT fk_assignment_release_version FOREIGN KEY (release_version) REFERENCES ota_release(release_version)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS sys_user (
|
||||
id BIGINT PRIMARY KEY AUTO_INCREMENT,
|
||||
username VARCHAR(64) NOT NULL UNIQUE,
|
||||
password VARCHAR(128) NOT NULL,
|
||||
nickname VARCHAR(64) NOT NULL,
|
||||
status TINYINT NOT NULL DEFAULT 1,
|
||||
created_at DATETIME(6) NOT NULL,
|
||||
updated_at DATETIME(6) NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS sys_role (
|
||||
id BIGINT PRIMARY KEY AUTO_INCREMENT,
|
||||
role_code VARCHAR(64) NOT NULL UNIQUE,
|
||||
role_name VARCHAR(64) NOT NULL,
|
||||
status TINYINT NOT NULL DEFAULT 1,
|
||||
created_at DATETIME(6) NOT NULL,
|
||||
updated_at DATETIME(6) NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS sys_user_role (
|
||||
id BIGINT PRIMARY KEY AUTO_INCREMENT,
|
||||
user_id BIGINT NOT NULL,
|
||||
role_id BIGINT NOT NULL,
|
||||
created_at DATETIME(6) NOT NULL,
|
||||
UNIQUE KEY uk_user_role (user_id, role_id),
|
||||
CONSTRAINT fk_user_role_user FOREIGN KEY (user_id) REFERENCES sys_user(id),
|
||||
CONSTRAINT fk_user_role_role FOREIGN KEY (role_id) REFERENCES sys_role(id)
|
||||
);
|
||||
|
||||
INSERT INTO sys_role (id, role_code, role_name, status, created_at, updated_at)
|
||||
VALUES
|
||||
(1, 'SUPER_ADMIN', '系统管理员', 1, NOW(6), NOW(6)),
|
||||
(2, 'ADMIN', '运维管理员', 1, NOW(6), NOW(6)),
|
||||
(3, 'AGENT', '车端代理', 1, NOW(6), NOW(6))
|
||||
ON DUPLICATE KEY UPDATE role_name = VALUES(role_name), status = VALUES(status), updated_at = NOW(6);
|
||||
|
||||
INSERT INTO sys_user (id, username, password, nickname, status, created_at, updated_at)
|
||||
VALUES
|
||||
(1, 'admin', 'e10adc3949ba59abbe56e057f20f883e', '超级管理员', 1, NOW(6), NOW(6)),
|
||||
(2, 'agent', 'e10adc3949ba59abbe56e057f20f883e', '车端代理', 1, NOW(6), NOW(6))
|
||||
ON DUPLICATE KEY UPDATE password = VALUES(password), nickname = VALUES(nickname), status = VALUES(status), updated_at = NOW(6);
|
||||
|
||||
INSERT INTO sys_user_role (user_id, role_id, created_at)
|
||||
VALUES
|
||||
(1, 1, NOW(6)),
|
||||
(2, 3, NOW(6))
|
||||
ON DUPLICATE KEY UPDATE created_at = VALUES(created_at);
|
||||
Reference in New Issue
Block a user