mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-05 08:43:45 +08:00
feat: add index page for mobile
This commit is contained in:
@@ -187,12 +187,20 @@ func (h *ChatHandler) Detail(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
// 填充角色名称
|
||||
var role model.ChatRole
|
||||
res = h.DB.Where("id", chatItem.RoleId).First(&role)
|
||||
if res.Error != nil {
|
||||
resp.ERROR(c, "Role not found")
|
||||
return
|
||||
}
|
||||
|
||||
var chatItemVo vo.ChatItem
|
||||
err := utils.CopyObject(chatItem, &chatItemVo)
|
||||
if err != nil {
|
||||
resp.ERROR(c, err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
chatItemVo.RoleName = role.Name
|
||||
resp.SUCCESS(c, chatItemVo)
|
||||
}
|
||||
|
||||
@@ -2,11 +2,12 @@ package vo
|
||||
|
||||
type ChatItem struct {
|
||||
BaseVo
|
||||
UserId uint `json:"user_id"`
|
||||
Icon string `json:"icon"`
|
||||
RoleId uint `json:"role_id"`
|
||||
ChatId string `json:"chat_id"`
|
||||
ModelId uint `json:"model_id"`
|
||||
Model string `json:"model"`
|
||||
Title string `json:"title"`
|
||||
UserId uint `json:"user_id"`
|
||||
Icon string `json:"icon"`
|
||||
RoleId uint `json:"role_id"`
|
||||
RoleName string `json:"role_name"`
|
||||
ChatId string `json:"chat_id"`
|
||||
ModelId uint `json:"model_id"`
|
||||
Model string `json:"model"`
|
||||
Title string `json:"title"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user