feat: the power log page is ready

This commit is contained in:
RockYang
2024-03-20 14:14:30 +08:00
parent 8487d2c9eb
commit 8dda639b23
19 changed files with 443 additions and 212 deletions

View File

@@ -22,6 +22,7 @@ func NewChatRoleHandler(app *core.AppServer, db *gorm.DB) *ChatRoleHandler {
// List 获取用户聊天应用列表
func (h *ChatRoleHandler) List(c *gin.Context) {
all := h.GetBool(c, "all")
userId := h.GetLoginUserId(c)
var roles []model.ChatRole
res := h.DB.Where("enable", true).Order("sort_num ASC").Find(&roles)
@@ -31,7 +32,7 @@ func (h *ChatRoleHandler) List(c *gin.Context) {
}
// 获取所有角色
if userId == 0 {
if userId == 0 || all {
// 转成 vo
var roleVos = make([]vo.ChatRole, 0)
for _, r := range roles {