Files
qitongxue-api/api/user/v1/message.go
2026-09-30 17:01:18 +08:00

48 lines
1.8 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package v1
import "github.com/gogf/gf/v2/frame/g"
// ============================================================================
// C 端站内信契约(迭代-2026-09-30)
//
// 写入点(后端业务事件统一落 user_messages,见 logic/message.go PushMessage):
// 会员开通/次数包到账(发货成功)、报价申请回执、报价处理结果、反馈官方回复。
// C 端只读:列表 / 未读数 / 标记已读(单条或全部)。
// ============================================================================
// MessageItem 站内信条目
type MessageItem struct {
Id int64 `json:"id"`
Type string `json:"type"` // order_delivered/quote_submitted/quote_handled/feedback_replied/system
Title string `json:"title"`
Content string `json:"content"`
Link string `json:"link"` // 小程序内跳转路由,空=不跳转
IsRead int `json:"is_read"`
CreatedAt string `json:"created_at"`
}
// MessageListReq 我的消息(最近 N 条 + 未读数;不自动置已读,已读走 /message/read)
type MessageListReq struct {
g.Meta `path:"/message/list" method:"get" tags:"message" summary:"我的站内信"`
Limit int `json:"limit"`
}
type MessageListRes struct {
List []MessageItem `json:"list"`
Unread int `json:"unread"`
}
// MessageUnreadReq 未读消息数(首页 / 我的页徽标)
type MessageUnreadReq struct {
g.Meta `path:"/message/unread" method:"get" tags:"message" summary:"未读站内信数"`
}
type MessageUnreadRes struct {
Count int `json:"count"`
}
// MessageReadReq 标记已读:Id>0 单条;Id=0 全部
type MessageReadReq struct {
g.Meta `path:"/message/read" method:"post" tags:"message" summary:"站内信标记已读"`
Id int64 `json:"id"`
}
type MessageReadRes struct{}