Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change sql #160

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions agile.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
MYSQL_HOST=mysql
MYSQL_PORT=3306
MYSQL_DATABASE=case_manager
MYSQL_USER=agile
MYSQL_PASSWORD=agile
MYSQL_ROOT_PASSWORD=agile
TZ=Asia/Shanghai
AUTH_FLAG=true
19 changes: 11 additions & 8 deletions case-server/sql/case-server.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ CREATE TABLE `case_backup` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id',
`case_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '用例集id',
`title` varchar(64) NOT NULL DEFAULT '' COMMENT '用例名称',
`creator` varchar(20) NOT NULL DEFAULT '' COMMENT '用例保存人',
`creator` varchar(1023) NOT NULL DEFAULT '' COMMENT '用例保存人',
`gmt_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '用例保存时间',
`case_content` longtext CHARACTER SET utf8mb4,
`record_content` longtext COMMENT '任务执行内容',
Expand All @@ -22,9 +22,9 @@ CREATE TABLE `exec_record` (
`pass_count` int(10) NOT NULL DEFAULT '0' COMMENT '执行个数',
`total_count` int(10) NOT NULL DEFAULT '0' COMMENT '需执行总个数',
`success_count` int(10) NOT NULL DEFAULT '0' COMMENT '成功个数',
`creator` varchar(20) NOT NULL DEFAULT '' COMMENT '用例创建人',
`modifier` varchar(20) NOT NULL DEFAULT '' COMMENT '用例修改人',
`executors` varchar(200) NOT NULL DEFAULT '' COMMENT '执行人',
`creator` varchar(1023) NOT NULL DEFAULT '' COMMENT '用例创建人',
`modifier` varchar(1023) NOT NULL DEFAULT '' COMMENT '用例修改人',
`executors` varchar(1023) NOT NULL DEFAULT '' COMMENT '执行人',
`description` varchar(1000) NOT NULL DEFAULT '' COMMENT '描述',
`choose_content` varchar(200) NOT NULL DEFAULT '' COMMENT '圈选用例内容',
`gmt_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '记录创建时间',
Expand All @@ -33,7 +33,7 @@ CREATE TABLE `exec_record` (
`expect_end_time` timestamp NOT NULL DEFAULT '1971-01-01 00:00:00' COMMENT '预计结束时间',
`actual_start_time` timestamp NOT NULL DEFAULT '1971-01-01 00:00:00' COMMENT '实际开始时间',
`actual_end_time` timestamp NOT NULL DEFAULT '1971-01-01 00:00:00' COMMENT '实际结束时间',
`owner` varchar(200) NOT NULL DEFAULT '' COMMENT '负责人',
`owner` varchar(1023) NOT NULL DEFAULT '' COMMENT '负责人',
PRIMARY KEY (`id`),
KEY `idx_caseId_isdelete` (`case_id`,`is_delete`)
) ENGINE=InnoDB AUTO_INCREMENT=898 DEFAULT CHARSET=utf8 COMMENT='用例执行记录';
Expand All @@ -44,7 +44,7 @@ CREATE TABLE `test_case` (
`title` varchar(64) NOT NULL DEFAULT 'testcase' COMMENT '用例名称',
`description` varchar(512) NOT NULL DEFAULT '' COMMENT '用例描述',
`is_delete` int(11) NOT NULL DEFAULT '0' COMMENT '用例状态 0-正常 1-删除',
`creator` varchar(20) NOT NULL DEFAULT '' COMMENT '用例创建人',
`creator` varchar(1023) NOT NULL DEFAULT '' COMMENT '用例创建人',
`modifier` varchar(1000) NOT NULL DEFAULT '' COMMENT '用例修改人',
`case_content` longtext CHARACTER SET utf8mb4,
`gmt_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '记录创建时间',
Expand Down Expand Up @@ -86,14 +86,15 @@ alter table exec_record
# 增加用户信息表
CREATE TABLE `user` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id',
`username` varchar(255) NOT NULL DEFAULT '' COMMENT '用户名',
`username` varchar(1023) NOT NULL DEFAULT '' COMMENT '用户名',
`password` varchar(1023) NOT NULL DEFAULT '' COMMENT '密码',
`salt` varchar(1023) NOT NULL DEFAULT '' COMMENT '盐',
`is_delete` int(1) NOT NULL DEFAULT '0' COMMENT '是否删除',
`channel` int(1) NOT NULL DEFAULT '0' COMMENT '渠道',
`product_line_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '业务线',
`gmt_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '注册时间',
`gmt_updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`authority_name` varchar(63) NOT NULL DEFAULT ''COMMENT '权限名称,ROLE_开头,全大写',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=677 DEFAULT CHARSET=utf8 COMMENT='用户信息';

Expand All @@ -110,7 +111,9 @@ CREATE TABLE `authority` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='权限信息';

INSERT INTO `authority` (id,authority_name,authority_desc,authority_content) VALUES (1, 'ROLE_USER', '普通用户', '/api/dir/list,/api/record/list,/api/record/getRecordInfo,/api/user/**,/api/case/list*');
INSERT INTO `authority` (id,authority_name,authority_desc,authority_content) VALUES (1, 'ROLE_USER', '普通用户', '/api/dir/list,/api/record/list,/api/record/getRecordInfo,/api/user/**,/api/case/list*,api/dir/cardTree,api/case/getCaseInfo');
INSERT INTO `authority` (id,authority_name,authority_desc,authority_content) VALUES (2, 'ROLE_ADMIN', '管理员', '/api/dir/list,/api/backup/**,/api/record/**,/api/file/**,/api/user/**,/api/case/**');
INSERT INTO `authority` (id,authority_name,authority_desc,authority_content) VALUES (3, 'ROLE_SA', '超级管理员','/api/**');
INSERT INTO `authority` (id,authority_name,authority_desc,authority_content) VALUES (4, 'ROLE_QA', '普通测试人员','/api/**');
INSERT INTO `authority` (id,authority_name,authority_desc,authority_content) VALUES (5, 'ROLE_RD', '普通开发人员','/api/dir/list,/api/record/list,/api/record/getRecordInfo,/api/user/**,/api/case/list*,/api/dir/cardTree,/api/case/**');

Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ public class SystemConstant {
public final static String COMMA = ",";

public final static Integer IS_DELETE = 1;

public final static Integer NOT_DELETE = 0;

public static final String POINT = ".";

public static final String HTTP_USER_AGENT = "User-Agent";

public static final String DEFAULT_AUTHORITY_NAME = "ROLE_USER";
public static final String DEFAULT_AUTHORITY_NAME = "ROLE_RD";

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.xiaoju.framework.handler;

import com.alibaba.fastjson.JSON;
import com.corundumstudio.socketio.BroadcastOperations;
import com.corundumstudio.socketio.SocketIOClient;
import com.corundumstudio.socketio.SocketIOServer;
Expand All @@ -16,6 +17,7 @@ public LockIngressTask(SocketIOClient client, SocketIOServer socketIOServer, Roo

@Override
public void run() {
LOGGER.info("websocket client:{}",JSON.toJSONString(client));
room.lock();
LOGGER.info(data.getMessage());
ClientEntity clientEntity = getRoomFromClient(client);
Expand Down
2 changes: 1 addition & 1 deletion case-server/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ spring.thymeleaf.suffix=.html
spring.devtools.add-properties=false

# 权限开关,默认关闭
authority.flag=false
authority.flag=true
34 changes: 34 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
version: '3'
services:
case-server:
image: yestodayhadrain/case-server:v1.0.6
container_name: agileTC-caseserver
env_file:
- ./agile.env
command: bash -c "cd /app/ && java -jar case-server-1.0-SNAPSHOT.jar"
# docker 端口映射,如果宿主机 8080 端口被占用需要更改
ports:
- "8080:8094"
depends_on:
- mysql
restart: always
networks:
- agile-net
mysql:
image: mysql:latest
container_name: agileTC-mysql
# 挂载到宿主机目录 /data/mysql/data
volumes:
- /data/mysql/data:/var/lib/mysql
env_file:
- ./agile.env
# docker 端口映射,如果宿主机 6666 端口被占用需要更改
ports:
- "6666:3306"
restart: always
networks:
- agile-net
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
networks:
agile-net:
driver: bridge