refactor: refactor chat model, replace mode value with mode id. refactored system config module, add seperate configration for every chat model

This commit is contained in:
RockYang
2023-09-04 16:32:20 +08:00
parent 0cc9cf8b45
commit 7ecd7eeba1
28 changed files with 714 additions and 276 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.Where("enable", true).Order("sort ASC").Find(&roles)
res := h.db.Where("enable", true).Order("sort_num ASC").Find(&roles)
if res.Error != nil {
resp.ERROR(c, "No roles found,"+res.Error.Error())
return