Files
servicebase/pkg/common/http/response/Activity.go
2025-11-19 14:24:13 +08:00

52 lines
868 B
Go

package response
import "gitea.ddegame.cn/open/servicebase/pkg/common/http/dto"
type CommonResponse struct {
Code string
Result any
Msg string
}
// 用户信息
type UserInfoResponse struct {
Code string
Result dto.UserDTO
Msg string
}
// 获取用户邀请汇总数据返回
type UserInviteSummaryResponse struct {
Code string
Result dto.UserInviteSummaryDTO
Msg string
}
func Success(data any) (res CommonResponse) {
res.Code = "6000"
res.Result = data
return
}
func Page(data any, count int64) (res CommonResponse) {
res.Code = "6000"
res.Result = map[string]any{
"list": data,
"count": count,
}
return
}
func Failed(msg string) (res CommonResponse) {
res.Code = "8020"
res.Msg = msg
return
}
func Gen(code, msg string, result any) (res CommonResponse) {
res.Code = code
res.Msg = msg
res.Result = result
return
}