feat(1.0):新增消息总数字段
This commit is contained in:
parent
34c8394e8f
commit
23ce0e6982
@ -1958,6 +1958,10 @@ const docTemplate = `{
|
|||||||
"description": "小程序编号",
|
"description": "小程序编号",
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
|
"message_total": {
|
||||||
|
"description": "消息总数",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
"name": {
|
"name": {
|
||||||
"description": "小程序名称",
|
"description": "小程序名称",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
@ -2415,6 +2419,10 @@ const docTemplate = `{
|
|||||||
"description": "消息内容",
|
"description": "消息内容",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"id": {
|
||||||
|
"description": "消息ID",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
"msg_type": {
|
"msg_type": {
|
||||||
"description": "消息类型(1:文本 2:图片)",
|
"description": "消息类型(1:文本 2:图片)",
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
|
|||||||
@ -1950,6 +1950,10 @@
|
|||||||
"description": "小程序编号",
|
"description": "小程序编号",
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
|
"message_total": {
|
||||||
|
"description": "消息总数",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
"name": {
|
"name": {
|
||||||
"description": "小程序名称",
|
"description": "小程序名称",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
@ -2407,6 +2411,10 @@
|
|||||||
"description": "消息内容",
|
"description": "消息内容",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"id": {
|
||||||
|
"description": "消息ID",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
"msg_type": {
|
"msg_type": {
|
||||||
"description": "消息类型(1:文本 2:图片)",
|
"description": "消息类型(1:文本 2:图片)",
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
|
|||||||
@ -320,6 +320,9 @@ definitions:
|
|||||||
id:
|
id:
|
||||||
description: 小程序编号
|
description: 小程序编号
|
||||||
type: integer
|
type: integer
|
||||||
|
message_total:
|
||||||
|
description: 消息总数
|
||||||
|
type: integer
|
||||||
name:
|
name:
|
||||||
description: 小程序名称
|
description: 小程序名称
|
||||||
type: string
|
type: string
|
||||||
@ -643,6 +646,9 @@ definitions:
|
|||||||
content:
|
content:
|
||||||
description: 消息内容
|
description: 消息内容
|
||||||
type: string
|
type: string
|
||||||
|
id:
|
||||||
|
description: 消息ID
|
||||||
|
type: integer
|
||||||
msg_type:
|
msg_type:
|
||||||
description: 消息类型(1:文本 2:图片)
|
description: 消息类型(1:文本 2:图片)
|
||||||
type: integer
|
type: integer
|
||||||
|
|||||||
@ -21,15 +21,16 @@ type listRequest struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type listData struct {
|
type listData struct {
|
||||||
ID int32 `json:"id"` // 小程序编号
|
ID int32 `json:"id"` // 小程序编号
|
||||||
AppID string `json:"app_id"` // 小程序ID
|
AppID string `json:"app_id"` // 小程序ID
|
||||||
AppSecret string `json:"app_secret"` // 小程序密钥
|
AppSecret string `json:"app_secret"` // 小程序密钥
|
||||||
Name string `json:"name"` // 小程序名称
|
Name string `json:"name"` // 小程序名称
|
||||||
Description string `json:"description"` // 小程序描述
|
Description string `json:"description"` // 小程序描述
|
||||||
Avatar string `json:"avatar"` // 小程序头像
|
Avatar string `json:"avatar"` // 小程序头像
|
||||||
TemplateID string `json:"template_id"` // 模版ID
|
TemplateID string `json:"template_id"` // 模版ID
|
||||||
CreatedAt string `json:"created_at"` // 创建时间
|
CreatedAt string `json:"created_at"` // 创建时间
|
||||||
UpdatedAt string `json:"updated_at"` // 更新时间
|
UpdatedAt string `json:"updated_at"` // 更新时间
|
||||||
|
MessageTotal int64 `json:"message_total"` // 消息总数
|
||||||
}
|
}
|
||||||
|
|
||||||
type listResponse struct {
|
type listResponse struct {
|
||||||
@ -135,16 +136,18 @@ func (h *handler) PageList() core.HandlerFunc {
|
|||||||
res.List = make([]listData, len(resultData))
|
res.List = make([]listData, len(resultData))
|
||||||
|
|
||||||
for k, v := range resultData {
|
for k, v := range resultData {
|
||||||
|
messageTotalCount, _ := h.readDB.AppMessageLog.WithContext(ctx.RequestContext()).Where(h.readDB.AppMessageLog.AppID.Eq(v.AppID)).Count()
|
||||||
res.List[k] = listData{
|
res.List[k] = listData{
|
||||||
ID: v.ID,
|
ID: v.ID,
|
||||||
AppID: v.AppID,
|
AppID: v.AppID,
|
||||||
AppSecret: v.AppSecret,
|
AppSecret: v.AppSecret,
|
||||||
Name: v.Name,
|
Name: v.Name,
|
||||||
Description: v.Description,
|
Description: v.Description,
|
||||||
Avatar: v.Avatar,
|
Avatar: v.Avatar,
|
||||||
TemplateID: v.TemplateID,
|
TemplateID: v.TemplateID,
|
||||||
CreatedAt: timeutil.FriendlyTime(v.CreatedAt),
|
CreatedAt: timeutil.FriendlyTime(v.CreatedAt),
|
||||||
UpdatedAt: timeutil.FriendlyTime(v.UpdatedAt),
|
UpdatedAt: timeutil.FriendlyTime(v.UpdatedAt),
|
||||||
|
MessageTotal: messageTotalCount,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user