From 475e48451637899921f02c7680c5d03122b5827e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=82=85=E5=93=A5?= <184172133@qq.com> Date: Sat, 4 Nov 2023 21:06:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E5=82=85=E5=93=A5=EF=BC=8Cfeat?= =?UTF-8?q?=EF=BC=9A=E5=9F=BA=E7=A1=80=E7=8E=AF=E5=A2=83=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/dev-ops/app/docker-compose-1.0.yml | 21 ++++ docs/dev-ops/app/start.sh | 20 ++++ docs/dev-ops/app/stop.sh | 1 + docs/dev-ops/mysql/docker-compose.yml | 29 +++++ .../dev-ops/mysql/sql/xfg-frame-archetype.sql | 108 ++++++++++++++++++ 5 files changed, 179 insertions(+) create mode 100644 docs/dev-ops/app/docker-compose-1.0.yml create mode 100644 docs/dev-ops/app/start.sh create mode 100644 docs/dev-ops/app/stop.sh create mode 100644 docs/dev-ops/mysql/docker-compose.yml create mode 100644 docs/dev-ops/mysql/sql/xfg-frame-archetype.sql diff --git a/docs/dev-ops/app/docker-compose-1.0.yml b/docs/dev-ops/app/docker-compose-1.0.yml new file mode 100644 index 0000000..d835c84 --- /dev/null +++ b/docs/dev-ops/app/docker-compose-1.0.yml @@ -0,0 +1,21 @@ +# /usr/local/bin/docker-compose -f /docs/dev-ops/environment/environment-docker-compose-2.4.yml up -d +version: '3.8' +# docker-compose -f docker-compose-1.0.yml up -d +# 你需要修改system为你自身系统的仓库名 +services: + x-api-app: + image: system/xfg-frame-archetype-lite:1.0-SNAPSHOT + container_name: xfg-frame-archetype-lite + restart: on-failure + ports: + - "8091:8091" + environment: + - TZ=PRC + - SERVER_PORT=8091 + volumes: + - ./log:/data/log + logging: + driver: "json-file" + options: + max-size: "10m" + max-file: "3" \ No newline at end of file diff --git a/docs/dev-ops/app/start.sh b/docs/dev-ops/app/start.sh new file mode 100644 index 0000000..42cb615 --- /dev/null +++ b/docs/dev-ops/app/start.sh @@ -0,0 +1,20 @@ +CONTAINER_NAME=xfg-frame-archetype-lite +IMAGE_NAME=system/xfg-frame-archetype-lite:1.0-SNAPSHOT +PORT=8091 + +echo "容器部署开始 ${CONTAINER_NAME}" + +# 停止容器 +docker stop ${CONTAINER_NAME} + +# 删除容器 +docker rm ${CONTAINER_NAME} + +# 启动容器 +docker run --name ${CONTAINER_NAME} \ +-p ${PORT}:${PORT} \ +-d ${IMAGE_NAME} + +echo "容器部署成功 ${CONTAINER_NAME}" + +docker logs -f ${CONTAINER_NAME} \ No newline at end of file diff --git a/docs/dev-ops/app/stop.sh b/docs/dev-ops/app/stop.sh new file mode 100644 index 0000000..7d61546 --- /dev/null +++ b/docs/dev-ops/app/stop.sh @@ -0,0 +1 @@ +docker stop xfg-frame-archetype-lite \ No newline at end of file diff --git a/docs/dev-ops/mysql/docker-compose.yml b/docs/dev-ops/mysql/docker-compose.yml new file mode 100644 index 0000000..f7930e8 --- /dev/null +++ b/docs/dev-ops/mysql/docker-compose.yml @@ -0,0 +1,29 @@ +# 命令执行 docker-compose up -d +version: '3.9' +services: + mysql: + image: mysql:8.0.32 + container_name: mysql + command: --default-authentication-plugin=mysql_native_password + restart: always + environment: + TZ: Asia/Shanghai + # MYSQL_ALLOW_EMPTY_PASSWORD: 'yes' # 可配置无密码,注意配置 SPRING_DATASOURCE_PASSWORD= + MYSQL_ROOT_PASSWORD: 123456 + MYSQL_USER: xfg + MYSQL_PASSWORD: 123456 + depends_on: + - mysql-job-dbdata + ports: + - "3306:3306" + volumes: + - ./sql:/docker-entrypoint-initdb.d + volumes_from: + - mysql-job-dbdata + + # 自动加载数据 + mysql-job-dbdata: + image: alpine:3.18.2 + container_name: mysql-job-dbdata + volumes: + - /var/lib/mysql \ No newline at end of file diff --git a/docs/dev-ops/mysql/sql/xfg-frame-archetype.sql b/docs/dev-ops/mysql/sql/xfg-frame-archetype.sql new file mode 100644 index 0000000..8b598d3 --- /dev/null +++ b/docs/dev-ops/mysql/sql/xfg-frame-archetype.sql @@ -0,0 +1,108 @@ +/* + Navicat Premium Data Transfer + + Source Server : 127.0.0.1 + Source Server Type : MySQL + Source Server Version : 50639 + Source Host : localhost:3306 + Source Schema : road-map + + Target Server Type : MySQL + Target Server Version : 50639 + File Encoding : 65001 + + Date: 15/07/2023 09:26:39 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +CREATE database if NOT EXISTS `xfg_frame_archetype` default character set utf8mb4 collate utf8mb4_0900_ai_ci; +use `xfg_frame_archetype`; + +-- ---------------------------- +-- Table structure for employee +-- ---------------------------- +DROP TABLE IF EXISTS `employee`; +CREATE TABLE `employee` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `employee_number` varchar(16) NOT NULL DEFAULT '' COMMENT '雇员ID', + `employee_name` varchar(32) NOT NULL DEFAULT '' COMMENT '雇员姓名', + `employee_level` varchar(8) NOT NULL DEFAULT '' COMMENT '雇员级别', + `employee_title` varchar(16) NOT NULL DEFAULT '' COMMENT '雇员岗位Title', + `create_time` datetime NOT NULL COMMENT '创建时间', + `update_time` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`id`), + UNIQUE KEY `idx_employee_number` (`employee_number`) +) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8; + +-- ---------------------------- +-- Records of employee +-- ---------------------------- +BEGIN; +INSERT INTO `employee` VALUES (1, '10000001', 'sXvfDpsWnJdLsCVk64tJgw==', 'T-3', '中级工程师', '2023-07-14 15:26:26', '2023-07-14 15:26:26'); +INSERT INTO `employee` VALUES (2, '10000010', 'sXvfDpsWnJdLsCVk64tJgw==', 'T2', '见习工程师', '2023-07-14 15:34:40', '2023-07-14 15:34:40'); +INSERT INTO `employee` VALUES (3, '10000011', 'sXvfDpsWnJdLsCVk64tJgw==', 'T2', '见习工程师', '2023-07-14 15:34:40', '2023-07-14 15:34:40'); +INSERT INTO `employee` VALUES (4, '10000012', 'sXvfDpsWnJdLsCVk64tJgw==', 'T2', '见习工程师', '2023-07-14 15:34:40', '2023-07-14 15:34:40'); +INSERT INTO `employee` VALUES (5, '10000013', 'sXvfDpsWnJdLsCVk64tJgw==', 'T2', '见习工程师', '2023-07-14 15:34:40', '2023-07-14 15:34:40'); +INSERT INTO `employee` VALUES (6, '10000014', 'sXvfDpsWnJdLsCVk64tJgw==', 'T2', '见习工程师', '2023-07-14 15:34:40', '2023-07-14 15:34:40'); +INSERT INTO `employee` VALUES (9, '10000002', 'sXvfDpsWnJdLsCVk64tJgw==', 'T2', '见习工程师', '2023-07-15 07:42:52', '2023-07-15 07:42:52'); +INSERT INTO `employee` VALUES (22, '10000015', 'hMCgLG6WV3CsNBQ1UD6PEQ==', 'T2', '见习工程师', '2023-07-15 08:02:31', '2023-07-15 08:02:31'); +INSERT INTO `employee` VALUES (23, '10000016', 'hMCgLG6WV3CsNBQ1UD6PEQ==', 'T2', '见习工程师', '2023-07-15 08:02:31', '2023-07-15 08:02:31'); +INSERT INTO `employee` VALUES (24, '10000017', 'hMCgLG6WV3CsNBQ1UD6PEQ==', 'T2', '见习工程师', '2023-07-15 08:02:31', '2023-07-15 08:02:31'); +INSERT INTO `employee` VALUES (39, '10000022', 'GyG+V0r6mBCNsdusuKl03g==', 'T1', '实习工程师', '2023-07-15 09:17:49', '2023-07-15 09:17:49'); +COMMIT; + +-- ---------------------------- +-- Table structure for employee_salary +-- ---------------------------- +DROP TABLE IF EXISTS `employee_salary`; +CREATE TABLE `employee_salary` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `employee_number` varchar(16) NOT NULL DEFAULT '' COMMENT '雇员编号', + `salary_total_amount` decimal(8,2) NOT NULL COMMENT '薪资总额', + `salary_merit_amount` decimal(8,2) NOT NULL COMMENT '绩效工资', + `salary_base_amount` decimal(8,2) NOT NULL COMMENT '基础工资', + `create_time` datetime NOT NULL COMMENT '创建时间', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`id`), + KEY `idx_employee_number` (`employee_number`) +) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8; + +-- ---------------------------- +-- Records of employee_salary +-- ---------------------------- +BEGIN; +INSERT INTO `employee_salary` VALUES (1, '10000001', 5100.00, 1020.00, 4080.00, '2023-07-14 16:09:06', '2023-07-14 16:09:06'); +INSERT INTO `employee_salary` VALUES (2, '10000010', 5000.00, 1000.00, 4000.00, '2023-07-14 16:17:10', '2023-07-14 16:17:10'); +INSERT INTO `employee_salary` VALUES (3, '10000011', 5000.00, 1000.00, 4000.00, '2023-07-14 16:17:10', '2023-07-14 16:17:10'); +INSERT INTO `employee_salary` VALUES (4, '10000012', 5000.00, 1000.00, 4000.00, '2023-07-14 16:17:10', '2023-07-14 16:17:10'); +INSERT INTO `employee_salary` VALUES (5, '10000013', 5000.00, 1000.00, 4000.00, '2023-07-14 16:17:10', '2023-07-14 16:17:10'); +INSERT INTO `employee_salary` VALUES (6, '10000014', 5000.00, 1000.00, 4000.00, '2023-07-14 16:17:10', '2023-07-14 16:17:10'); +INSERT INTO `employee_salary` VALUES (8, '10000022', 100.00, 10.00, 90.00, '2023-07-15 09:17:49', '2023-07-15 09:17:49'); +COMMIT; + +-- ---------------------------- +-- Table structure for employee_salary_adjust +-- ---------------------------- +DROP TABLE IF EXISTS `employee_salary_adjust`; +CREATE TABLE `employee_salary_adjust` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `employee_number` varchar(16) NOT NULL DEFAULT '' COMMENT '雇员编号', + `adjust_order_id` varchar(32) NOT NULL DEFAULT '' COMMENT '调薪单号', + `adjust_total_amount` decimal(8,2) NOT NULL COMMENT '总额调薪', + `adjust_base_amount` decimal(8,2) NOT NULL COMMENT '基础调薪', + `adjust_merit_amount` decimal(8,2) NOT NULL COMMENT '绩效调薪', + `create_time` datetime NOT NULL COMMENT '创建时间', + `update_time` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`id`), + UNIQUE KEY `idx_order_id` (`adjust_order_id`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; + +-- ---------------------------- +-- Records of employee_salary_adjust +-- ---------------------------- +BEGIN; +INSERT INTO `employee_salary_adjust` VALUES (1, '10000001', '109089990198888811', 1000.00, 800.00, 200.00, '2023-07-14 16:55:53', '2023-07-14 16:55:53'); +INSERT INTO `employee_salary_adjust` VALUES (2, '10000001', '100908977676001', 100.00, 20.00, 80.00, '2023-07-14 21:57:39', '2023-07-14 21:57:39'); +COMMIT; \ No newline at end of file -- GitLab