feat:(REQ-2298) 增加单测配置

This commit is contained in:
lilong 2024-05-23 16:35:50 +08:00
parent 30e8e914ae
commit 9a76dc3171
4 changed files with 59 additions and 2 deletions

View File

@ -1,5 +1,6 @@
package cn.axzo.tyr.base;
import cn.axzo.tyr.server.TyrApplication;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
@ -29,7 +30,7 @@ import java.nio.charset.StandardCharsets;
import java.util.List;
@ExtendWith(SpringExtension.class)
@SpringBootTest(classes = {TestConfig.class})
@SpringBootTest(classes = {TestConfig.class, TyrApplication.class})
@AutoConfigureMockMvc
@Transactional
@ActiveProfiles("unittest")

View File

@ -0,0 +1,23 @@
package cn.axzo.tyr.server.service;
import cn.axzo.tyr.base.BaseTest;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.HashMap;
import java.util.Map;
import static org.junit.jupiter.api.Assertions.*;
class RoleServiceTest extends BaseTest {
@Autowired
private RoleService roleService;
@Test
void list() {
}
}

View File

@ -31,4 +31,7 @@ xxl:
flush:
role1052:
saasPreTempalteIdOfProject: 5
saasPreTempalteIdOfOu: 43
saasPreTempalteIdOfOu: 43
axzo:
role:
superAdmin: '{1:"entSuperAdmin",2:"projSuperAdmin",6:"omsSuperAdmin"}'

View File

@ -54,3 +54,33 @@ CREATE TABLE `saas_feature` (
PRIMARY KEY (`id`),
KEY `IDX_CODE` (`feature_code`)
) ENGINE=InnoDB AUTO_INCREMENT=4618 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='saas-菜单页面表';
CREATE TABLE `saas_role` (
`id` bigint NOT NULL AUTO_INCREMENT,
`NAME` varchar(50) NOT NULL DEFAULT '' COMMENT '角色名称',
`description` varchar(200) NOT NULL DEFAULT '' COMMENT '角色描述',
`role_type` varchar(50) NOT NULL DEFAULT '' COMMENT '角色类型common 普通角色 super_admin超级管理员(禁止删除) admin子管理员(禁止删除) init初始化内置角色 ',
`role_code` varchar(64) NOT NULL DEFAULT '' COMMENT '角色编码',
`workspace_id` bigint NOT NULL DEFAULT '0' COMMENT '工作台Id',
`owner_ou_id` bigint NOT NULL DEFAULT '0' COMMENT '角色所属单位Id 可能是总包,也可能是分包',
`product_unit_type` tinyint NOT NULL DEFAULT '0' COMMENT '产品单位类型',
`workspace_type` tinyint DEFAULT '0' COMMENT '1:企业工作台 2;项目工作台',
`is_delete` bigint NOT NULL DEFAULT '0' COMMENT '是否删除0否other是',
`create_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`create_by` bigint NOT NULL DEFAULT '0' COMMENT '创建者',
`update_by` bigint NOT NULL DEFAULT '0' COMMENT '更新者',
`fit_ou_type_bit` int DEFAULT '1' COMMENT '适用单位类型-1:总包 2:建设单位 4:监理单位 8:劳务分包 16:专业分包,65535:全部',
`fit_ou_node_type_bit` int DEFAULT '65535' COMMENT '适用节点类型 1:部门 2:班组 4:小组,65535:全部',
`position_template_id` bigint DEFAULT '0' COMMENT '职位模板ID 若此字段不为0则为专属角色该角色专属于某个职位',
`project_team_manage_role_resource_id` bigint DEFAULT NULL COMMENT '主要用于代班长角色迁移字段: project_team_manage_role 表的ID',
`from_pre_role_id` bigint DEFAULT '0' COMMENT '来源的模版角色id',
`job_code` varchar(128) DEFAULT '' COMMENT '岗位字典中的编码',
`is_display` tinyint NOT NULL DEFAULT '1' COMMENT '是否显示',
`enabled` tinyint NOT NULL DEFAULT '1' COMMENT '是否启用',
`sort` int NOT NULL DEFAULT '0' COMMENT '排序',
PRIMARY KEY (`id`),
KEY `workspace_ou_idx` (`workspace_id`,`owner_ou_id`,`is_delete`),
KEY `ou_workspace_idx` (`owner_ou_id`,`workspace_id`,`is_delete`)
) ENGINE=InnoDB AUTO_INCREMENT=102623 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='saas-角色'