Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 37

1.1.

AuthService

1.1.1. login

条件:

用户当前处在未登录状态。

错误处理:

用户输入用户名密码不匹配,向外抛出用户名密码错误异常。

1.1.2. logout

条件:

用户当前处在登录状态。

1.2. BrokerService

1.2.1. listBrokerName

条件:

用户当前处在登录状态。
1.2.2. getBrokerNameListByGroup

条件:

用户当前处在登录状态。

1.3. CommunicateService

1.3.1. sendCommand

条件:

用户当前处在登录状态。

1.3.2. subConfig

条件:

用户当前处在登录状态。

1.4. ClusterService

1.4.1. list

条件:
用户当前处在登录状态。

1.5. ConsumeService

1.5.1. consume

条件:

用户当前处在登录状态。

1.5.2. getConsumerConnection

条件:

用户当前处在登录状态。

1.6. DashBoardService

1.6.1. statisticsOverview

条件:

用户当前处在登录状态。
1.6.2. topicOverview

条件:

用户当前处在登录状态。

1.6.3. topicQuery

条件:

用户当前处在登录状态。

1.6.4. queryMsgDistribution

条件:

用户当前处在登录状态。

1.6.5. queryTopicDistribution

条件:

用户当前处在登录状态。
1.6.6. viewMsgDistribution

条件:

用户当前处在登录状态。

1.6.7. viewTopicDistribution

条件:

用户当前处在登录状态。

1.7. GroupService

1.7.1. page

条件:

用户当前处在登录状态。

1.7.2. consumerList

条件:

用户当前处在登录状态。
1.7.3. createOrUpdateGroup

条件:

用户当前处在登录状态。

1.7.4. deleteGroup

条件:

用户当前处在登录状态。

1.7.5. getClientConnection

条件:

用户当前处在登录状态。

1.7.6. getConsumerGroupConfig

条件:

用户当前处在登录状态。
1.7.7. checkGroupUnique

条件:

用户当前处在登录状态。

1.7.8. list

条件:

用户当前处在登录状态。

1.8. MessageLogServic

1.8.1. pages

条件:

用户当前处在登录状态。

SQL:
select service_id, service_name, message_id,
type, topic, lineId, tag,
"key", create_time, message_detail from MESSAGE_LOG
where
topic = ? and
message_id = ? and
service_id = ? and
create_at between ? and ? and
is_delete = 0 limit ?, ?;

1.8.2. lineIdList

条件:

用户当前处在登录状态。

SQL:

select message_id from MESSAGE_LOG


where
topic = ? and
message_id like ? and
is_delete = 0 limit 100;

1.8.3. batchSavee

条件:

用户当前处在登录状态。

SQL:
insert into MESSAGE_LOG (service_id, service_name,
message_id,
type, topic, lineId, tag,
"key", create_time, message_detail, is_delete)
values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 0);

1.9. MessageService

1.9.1. viewMessage

条件:

用户当前处在登录状态。

1.9.2. messageTrackDetail

条件:

用户当前处在登录状态。

1.9.3. queryMessageByTopic

条件:

用户当前处在登录状态。
1.9.4. queryMessageByTopicAndKey

条件:

用户当前处在登录状态。

1.9.5. consumeMessageDirectly

条件:

用户当前处在登录状态。

1.9.6. queryLatestMessage

条件:

用户当前处在登录状态。

1.9.7. getMessageCount

条件:

用户当前处在登录状态。

1.10. PermissionService
1.10.1. getPermissionVO

条件:

用户当前处在登录状态。

SQL:

select id, code, label, parent_id from PERMISSION


where is_delete = 0;

1.10.2. getPermissionCodeByIds

条件:

用户当前处在登录状态。

SQL:

select code from PERMISSION


where id in (?, ?, ?) and is_delete = 0;

1.11. ProducerService

1.11.1. send

条件:

用户当前处在登录状态。
1.12. RolePermissionService

1.12.1. addOrUpdate

条件:

用户当前处在登录状态。

SQL:

输入记录 ID 为 null

insert into ROLE_PERMISSION (role_id, permission_id,


is_delete) values (?, ?, 0);

输入记录 ID 非 null

update ROLE_PERMISSION set role_id = ?, permission_id = ?


where id = ?;

1.12.2. removeByRoleId

条件:

用户当前处在登录状态。

SQL:

update ROLE_PERMISSION set is_delete = 1


where role_id = ?;
1.12.3. getPermissionIdsByRoleIds

条件:

用户当前处在登录状态。

SQL:

select p.permission_id from ROLE_PERMISSION rp inner join


PERMISSION p on rp.permission_id = p.id
where rp.role_id in (?, ?, ?) and
rp.is_delete = 0 and
p.is_delete = 0;

1.13. RoleService

1.13.1. addOrUpdate

条件:

用户当前处在登录状态。

SQL:

输入记录 ID 为 null

insert into ROLE (name, “describe”, is_delete)


values (?, ?, 0);

输入记录 ID 非 null
update ROLE set name = ?, describe = ? where id = ?;

1.13.2. getPermissionCodesByRoleIds

条件:

用户当前处在登录状态。

SQL:

select p.code from ROLE_PERMISSION rp inner join


PERMISSION p on rp.permission_id = p.id
where rp.role_id in (?, ?, ?) and
rp.is_delete = 0 and
p.is_delete = 0;

1.13.3. getPermissionCodesByUserId

条件:

用户当前处在登录状态。

SQL:
select p.code from ROLE_PERMISSION rp inner join
PERMISSION p on rp.permission_id = p.id
inner join DA_USER_ROLE_REL ur on ur.role_id = rp.role_id
inner join DA_USER u on u.role_id = rp.role_id
where ur.user_id in (?, ?, ?) and
rp.is_delete = 0 and
p.is_delete = 0 and
ur.is_delete = 0;

1.13.4. page

条件:

用户当前处在登录状态。

SQL:

select name, “describe” from ROLE


where name like ? and
“describe” like ? and
creator_id = ? and
is_delete = 0 limit ?, ?;

1.13.5. roleList

条件:

用户当前处在登录状态。

SQL:
select name, “describe” from ROLE
where name like ? and
is_delete = 0 limit 100;

1.13.6. del

条件:

用户当前处在登录状态。

SQL:

update ROLE set is_delete = 1


where id = ?;

1.13.7. detail

条件:

用户当前处在登录状态。

SQL:

select name, “describe” from ROLE where id = ? and is_delete =


0;
select id from ROLE_PERMISSION where role_id = ? and
is_delete = 0;
1.14. ServiceInfoService

1.14.1. saveOrUpdate

条件:

用户当前处在登录状态。

1.14.2. page

条件:

用户当前处在登录状态。

1.14.3. delete

条件:

用户当前处在登录状态。

1.14.4. changeStatus

条件:

用户当前处在登录状态。
1.14.5. listAll

条件:

用户当前处在登录状态。

1.14.6. listAllRoot

条件:

用户当前处在登录状态。

1.14.7. getServiceCount

条件:

用户当前处在登录状态。

1.14.8. getServiceInfoList

条件:

用户当前处在登录状态。
1.14.9. getServiceInfo

条件:

用户当前处在登录状态。

1.15. ServiceTopicSubService

1.15.1. add

条件:

用户当前处在登录状态。

1.15.2. del

条件:

用户当前处在登录状态。

1.15.3. pages

条件:

用户当前处在登录状态。
1.15.4. listByServiceId

条件:

用户当前处在登录状态。

1.15.5. topListExcludeRegister

条件:

用户当前处在登录状态。

1.15.6. update

条件:

用户当前处在登录状态。

1.16. TopicService

1.16.1. page

条件:

用户当前处在登录状态。
1.16.2. getTopicConfig

条件:

用户当前处在登录状态。

1.16.3. getQueueStatus

条件:

用户当前处在登录状态。

1.16.4. resetOffset

条件:

用户当前处在登录状态。

1.16.5. consumerList

条件:

用户当前处在登录状态。
1.16.6. deleteTopic

条件:

用户当前处在登录状态。

1.16.7. createOrUpdateTopic

条件:

用户当前处在登录状态。

1.16.8. getTopicCount

条件:

用户当前处在登录状态。

1.16.9. listAllName

条件:

用户当前处在登录状态。
1.16.10. listGroupNameByTopic

条件:

用户当前处在登录状态。

1.17. UserRoleRelService

1.17.1. getRoleIdsByUserId

条件:

用户当前处在登录状态。

SQL:

select role_id from DA_USER_ROLE_REL where user_id = ? and


is_delete = 0;

1.18. UserService

1.18.1. page

条件:

用户当前处在登录状态。
1.18.2. register

条件:

用户当前处在登录状态。

1.18.3. getUserByName

条件:

用户当前处在登录状态。

1.18.4. delete

条件:

用户当前处在登录状态。

1.18.5. update

条件:

用户当前处在登录状态。
1.18.6. resetPassword

条件:

用户当前处在登录状态。

1.18.7. listAll

条件:

用户当前处在登录状态。

1.18.8. listAllName

条件:

用户当前处在登录状态。

1.18.9. getCurrentUser

条件:

用户当前处在登录状态。
2. 数据库设计

2.1. 数据库模型图

图1 用户角色权限模型图
图2 服务管理模型图

2.2. 数据库表清单

表1 数据库表清单

序号 中文名称 英文名称

2.3.1 权限表 PERMISSION

2.3.2 角色表 ROLE

2.3.3 角色权限关系表 ROLE_PERMISSION

2.3.4 用户表 DA_USER


2.3.5 用户角色关系表 DA_USER_ROLE_REL

2.3.6 服务信息表 DA_SERVICE_INFO

2.3.7 服务消费者组关系表 SERVICE_GROUP_SUB

2.3.8 消息授权表 SERVICE_TOPIC_SUB

2.3.9 链路分析表 MESSAGE_LOG

2.3. 数据库表结构

2.3.1. 权限表-PERMISSION

表2 权限表

表名称 PERMISSION

描述 用户权限表

字段 名称 类型 备注

id INT 主键

code VARCHAR 权限码

label VARCHAR 权限名称

parent_id INT 父权限 Id

is_delete INT 逻辑删除字段


2.3.2. 角色表-ROLE

表3 角色表

表名称 ROLE

描述 用户角色表

名称 类型 备注

id BIGINIT 主键

name VARCHAR 角色名称

describe VARCHAR 角色描述

字段 is_delete INT 逻辑删除字段

create_at DATETIME 创建时间

update_at DATETIME 更新时间

create_by BIGINT 创建人

update_by BIGINT 更新人


2.3.3. 角色权限关系表-ROLE_PERMISSION

表4 角色权限关系表

表名称 ROLE_PERMISSION

描述 角色权限关系表

名称 类型 备注

id BIGINIT 主键

role_id BIGINT 角色 id

permission_id BIGINT 权限点 id

字段 is_delete INT 逻辑删除字段

create_at DATETIME 创建时间

update_at DATETIME 更新时间

create_by BIGINT 创建人

update_by BIGINT 更新人

2.3.4. 用户表-DA_USER

表5 用户表

表名称 DA_USER
描述 用户表

名称 类型 备注

id BIGINIT 主键

username VARCHAR 账号

real_name VARCHAR 用户名

password VARCHAR 密码

字段 status TINYINT 状态 0 停用 1 启用

is_delete INT 逻辑删除字段

create_at DATETIME 创建时间

update_at DATETIME 更新时间

create_by BIGINT 创建人

update_by BIGINT 更新人

2.3.5. 用户角色关系表-DA_USER_ROLE_REL

表6 用户角色关系表

表名称 DA_USER_ROLE_REL
描述 用户角色关系表

名称 类型 备注

id BIGINIT 主键

user_id BIGINT 用户 id

role_id BIGINT 角色 id

字段 is_delete INT 逻辑删除字段

create_at DATETIME 创建时间

update_at DATETIME 更新时间

create_by BIGINT 创建人

update_by BIGINT 更新人

2.3.6. 服务信息表-DA_SERVICE_INFO

表7 服务信息表

表名称 DA_SERVICE_INFO

描述 服务信息表

字段 名称 类型 备注

id BIGINIT 主键
service_id VARCHAR 自定义服务 id

service_name VARCHAR 服务名称

service_desc VARCHAR 服务描述

status TINYINT 状态 0 断开 1 启用

is_root TINYINT 是否根节点 0 否 1 是

parent_id BIGINT 父 id

available TINYINT 是否启用 0 否 1 是

is_delete INT 逻辑删除字段

create_at DATETIME 创建时间

update_at DATETIME 更新时间

create_by BIGINT 创建人

update_by BIGINT 更新人

2.3.7. 服务消费者组关系表-SERVICE_GROUP_SUB

表8 服务消费者组关系表

表名称 SERVICE_GROUP_SUB

描述 服务消费者组关系表
名称 类型 备注

id BIGINIT 主键

字段 service_id VARCHAR 自定义服务 id

group_name VARCHAR 组名称

is_delete INT 逻辑删除字段

2.3.8. 消息授权表-SERVICE_TOPIC_SUB

表9 消息授权表

表名称 SERVICE_TOPIC_SUB

描述 消息授权表

字段 名称 类型 备注

id BIGINIT 主键

service_id VARCHAR 自定义服务 id

topic VARCHAR 消息主题名称

tag VARCHAR 订阅标签信息

group VARCHAR 消费者组

type VARCHAR 订阅类型


is_delete INT 逻辑删除字段

2.3.9. 链路分析表-MESSAGE_LOG

表10 链路分析表

表名称 MESSAGE_LOG

描述 链路分析表

名称 类型 备注

id BIGINIT 主键

service_id VARCHAR 自定义服务 id

topic VARCHAR 消息主题名称

tag VARCHAR 订阅标签信息

字段 key VARCHAR 订阅类型

message_id VARCHAR 消息 id

create_at TIMESTAMP 创建时间

message_detail TEXT 消息内容详情

line_id VARCHAR 行号

type VARCHAR read/write

You might also like