message.go 2.0 KB
package protocol

var errmessge ErrorMap = map[int]string{
	0:    "成功",
	1:    "系统异常",
	2:    "参数错误",
	101:  "clientId或clientSecret无效",
	113:  "签名验证失败",
	1009: "验证码已超时,登录失败",
	1011: "短信验证码次数超过限制,请稍后重试",
	1012: "验证码错误",
	2001: "请输入正确的手机号码",
	2002: "后台未配置账号信息,请联系管理员配置",
	2009: "上传的文件流为空",
	//2020: "帐号不存在,请联系管理员",
	2021: "登录失败,手机号或密码错误",
	2025: "短信验证码验证失败",
	2026: "两次输入的密码不一致",
	4139: "authCode无效或过期",
	4140: "refreshToken过期,需要重新登录授权",
	4141: "accessToken过期或无效,需要进行重新获取令牌",
	4142: "Uuid已存在,请求失败",
}

/*MessageCenter */
type MessageCenterRequest struct {
	MsgType int `json:"msgType" valid:"Required"`
}
type MessageCenterResponse struct {
	Totals []*MessageTotal `json:"totals"`
}

type MessageTotal struct {
	MsgType  int `json:"msgType" orm:"column(msg_type)"`
	MsgTotal int `json:"msgTotal" orm:"column(total)"`
}

/*MsgCenterRead */
type MsgCenterReadRequest struct {
	MsgId   int64 `json:"msgId" valid:"Required"`
	MsgType int   `json:"msgType" valid:"Required"`
}
type MsgCenterReadResponse struct {
}

/*MsgCenterAllRead */
type MsgCenterAllReadRequest struct {
	MsgType int `json:"msgType" valid:"Required"`
}
type MsgCenterAllReadResponse struct {
}

/*互动消息*/
type MsgInteractiveRequest struct {
	LastId     int64 `json:"lastId"`
	PageSize   int   `json:"pageSize" valid:"Required"`
	MsgType    int   `json:"msgType" valid:"Required"`
	SourceType int   `json:"sourceType" valid:"Required"`
}
type MsgInteractiveResponse struct {
	Lists []*UserMsg `json:"lists"`
	Total int        `json:"total"`
}

type UserMsg struct {
	Id         int64  `json:"msgId"`
	SourceType int    `json:"msgType"`
	Content    string `json:"content"`
	CreateAt   int64  `json:"msgTime"`
	IsRead     int    `json:"isRead"`
	//机会 //评论
}