refactor: chat role manage for admin is ready

This commit is contained in:
RockYang
2023-06-20 11:46:13 +08:00
parent d244ad9983
commit f593526bd4
10 changed files with 175 additions and 64 deletions

View File

@@ -25,7 +25,7 @@ func NewChatRoleHandler(app *core.AppServer, db *gorm.DB) *ChatRoleHandler {
// List get user list
func (h *ChatRoleHandler) List(c *gin.Context) {
var roles []model.ChatRole
res := h.db.Find(&roles)
res := h.db.Where("enable", true).Order("sort ASC").Find(&roles)
if res.Error != nil {
resp.ERROR(c, "No roles found,"+res.Error.Error())
return