first commit
This commit is contained in:
149
pkg/res/abstract.go
Normal file
149
pkg/res/abstract.go
Normal file
@ -0,0 +1,149 @@
|
||||
package res
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"servicebase/pkg/cerrors"
|
||||
"servicebase/pkg/log"
|
||||
"servicebase/pkg/req"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
const (
|
||||
CodeSuccess = 200
|
||||
CodeFailed = 500
|
||||
AuthERR = 400
|
||||
)
|
||||
|
||||
type Fn func(c *gin.Context) Response
|
||||
|
||||
func WrapApi(f Fn) gin.HandlerFunc {
|
||||
return func(c *gin.Context) {
|
||||
if f == nil {
|
||||
c.JSON(http.StatusInternalServerError, Failed("biz fn is nil"))
|
||||
c.Abort()
|
||||
return
|
||||
}
|
||||
rsp := f(c)
|
||||
if rsp.Cause != nil {
|
||||
log.ErrorFWithCtx(c.Request.Context(), "api err :[%+v]", rsp.Cause)
|
||||
}
|
||||
c.JSON(http.StatusOK, rsp)
|
||||
}
|
||||
}
|
||||
|
||||
type Response struct {
|
||||
Code int `json:"code"`
|
||||
Msg string `json:"msg,omitempty"`
|
||||
Data interface{} `json:"data,omitempty"`
|
||||
Cause error `json:"-"`
|
||||
}
|
||||
|
||||
type PageData struct {
|
||||
Total int64 `json:"total"`
|
||||
CountPage int64 `json:"count_page"`
|
||||
HasNext bool `json:"has_next"`
|
||||
List interface{} `json:"list"`
|
||||
}
|
||||
|
||||
func (t Response) Success() bool {
|
||||
return t.Code == CodeSuccess
|
||||
}
|
||||
|
||||
func Success(data interface{}) Response {
|
||||
return Response{
|
||||
Code: CodeSuccess,
|
||||
Msg: "",
|
||||
Data: data,
|
||||
}
|
||||
}
|
||||
|
||||
func Empty() Response {
|
||||
return Response{
|
||||
Code: CodeSuccess,
|
||||
Msg: "",
|
||||
}
|
||||
}
|
||||
|
||||
func Page(pageable req.Page, count int64, data interface{}) Response {
|
||||
cnt := (count + pageable.Size - 1) / pageable.Size
|
||||
return Success(PageData{
|
||||
Total: count,
|
||||
CountPage: cnt,
|
||||
HasNext: pageable.Size < cnt,
|
||||
List: data,
|
||||
})
|
||||
}
|
||||
|
||||
func Failed(msg string) Response {
|
||||
return Response{
|
||||
Code: CodeFailed,
|
||||
Msg: msg,
|
||||
}
|
||||
}
|
||||
|
||||
func Error(e error) Response {
|
||||
return Response{
|
||||
Code: CodeFailed,
|
||||
Msg: e.Error(),
|
||||
}
|
||||
}
|
||||
|
||||
func ErrorMsg(msg string, e error) Response {
|
||||
return Response{
|
||||
Code: CodeFailed,
|
||||
Msg: fmt.Sprintf("%s,%v", msg, e),
|
||||
}
|
||||
}
|
||||
|
||||
func ErrorCode(code int) Response {
|
||||
return Response{
|
||||
Code: code,
|
||||
Msg: cerrors.Msg(code),
|
||||
}
|
||||
}
|
||||
|
||||
func FailedWithCause(msg string, err error) Response {
|
||||
return Response{
|
||||
Code: CodeFailed,
|
||||
Msg: msg,
|
||||
Cause: err,
|
||||
}
|
||||
}
|
||||
|
||||
func Cause(err error) Response {
|
||||
return Response{
|
||||
Code: CodeFailed,
|
||||
Msg: err.Error(),
|
||||
Cause: err,
|
||||
}
|
||||
}
|
||||
|
||||
func AuthFailed(msg string) Response {
|
||||
return Response{
|
||||
Code: AuthERR,
|
||||
Msg: msg,
|
||||
}
|
||||
}
|
||||
|
||||
func FailedF(msg string, args ...interface{}) Response {
|
||||
return Response{
|
||||
Code: CodeFailed,
|
||||
Msg: fmt.Sprintf(msg, args...),
|
||||
}
|
||||
}
|
||||
|
||||
type IDBody struct {
|
||||
ID string `json:"id" form:"id" uri:"id"`
|
||||
}
|
||||
|
||||
type ImageDTO struct {
|
||||
ImageID string `json:"image_id"`
|
||||
ImageUrl string `json:"image_url"`
|
||||
}
|
||||
|
||||
type AccessTokenDTO struct {
|
||||
AccessToken string
|
||||
ExpireTime string
|
||||
}
|
||||
35
pkg/res/act_news.go
Normal file
35
pkg/res/act_news.go
Normal file
@ -0,0 +1,35 @@
|
||||
package res
|
||||
|
||||
import "servicebase/pkg/datasource/fields"
|
||||
|
||||
type ActNewsAll struct {
|
||||
ListType []ActNewsType `gorm:"-" json:"list_type"`
|
||||
ListBanner []ActNews `gorm:"-" json:"list_banner"`
|
||||
ListNews []ActNews `gorm:"-" json:"list_news"`
|
||||
}
|
||||
|
||||
type ActNewsType struct {
|
||||
ID string `gorm:"column:id;type:char(32);not null;uniqueIndex:id,priority:1;comment:业务ID" json:"type_id"` // 业务ID
|
||||
Name string `gorm:"column:name;type:varchar(255);not null;comment:类型名称" json:"name"` // 类型名称
|
||||
Sort int32 `gorm:"column:sort;type:int;not null;default:999;comment:排序" json:"sort"` // 排序
|
||||
State int32 `gorm:"column:state;type:int;not null;default:1;comment:状态1=启用 2=禁用" json:"state"` // 状态1=启用 2=禁用
|
||||
CreateAt fields.Time `gorm:"column:create_at;type:datetime;not null;default:CURRENT_TIMESTAMP;comment:创建时间" json:"create_at"` // 创建时间
|
||||
UpdateAt fields.Time `gorm:"column:update_at;type:datetime;not null;default:CURRENT_TIMESTAMP;comment:更新时间" json:"update_at"` // 更新时间
|
||||
}
|
||||
|
||||
type ActNews struct {
|
||||
ID string `gorm:"column:id;type:char(32);not null;uniqueIndex:id,priority:1;comment:业务ID" json:"news_id"` // 业务ID
|
||||
TypeID string `gorm:"column:type_id;type:char(32);not null;comment:类型" json:"type_id"` // 类型
|
||||
Title string `gorm:"column:title;type:varchar(255);not null;comment:标题" json:"title"` // 标题
|
||||
HeadImg string `gorm:"column:head_img;type:varchar(255);not null;comment:头图" json:"head_img"` // 头图
|
||||
Content string `gorm:"column:content;type:longtext;not null;comment:内容:富文本" json:"content"` // 内容:富文本
|
||||
Sort int32 `gorm:"column:sort;type:int;not null;default:999;comment:排序" json:"sort"` // 排序
|
||||
Position int32 `gorm:"column:position;type:int;not null;default:1;comment:位置1=列表 2=banner" json:"position"` // 位置1=列表 2=banner
|
||||
State int32 `gorm:"column:state;type:int;not null;default:1;comment:状态1=启用 2=禁用" json:"state"` // 状态1=启用 2=禁用
|
||||
ViewCount int32 `gorm:"column:view_count;type:int;not null;default:1;comment:状态1=启用 2=禁用" json:"view_count"` // 浏览量
|
||||
NewsDate fields.Date `gorm:"column:news_date;type:datetime;not null;comment:新闻时间" json:"news_date"` // 新闻时间
|
||||
CreateBy string `gorm:"column:create_by;type:varchar(255);not null;comment:创建人" json:"create_by"` // 创建人
|
||||
UpdateBy string `gorm:"column:update_by;type:varchar(255);not null;comment:更新人" json:"update_by"` // 更新人
|
||||
|
||||
DetailScheme string `gorm:"detail_scheme"`
|
||||
}
|
||||
24
pkg/res/admin.go
Normal file
24
pkg/res/admin.go
Normal file
@ -0,0 +1,24 @@
|
||||
package res
|
||||
|
||||
import (
|
||||
"github.com/shopspring/decimal"
|
||||
)
|
||||
|
||||
type DashboardBasic struct {
|
||||
TotalSale DashboardBasicItem `json:"total_sale"`
|
||||
OrderStateList []DashboardBasicItem `json:"order_state_list"`
|
||||
StoreSaleList []DashboardBasicItem `json:"store_sale_list"`
|
||||
CateSaleList []DashboardBasicItem `json:"cate_sale_list"`
|
||||
CommoditySaleList []DashboardBasicItem `json:"commodity_sale_list"`
|
||||
LatestOrderList []OrderRes `json:"latest_order_list"`
|
||||
}
|
||||
|
||||
type DashboardBasicItem struct {
|
||||
Title string `json:"title"`
|
||||
Desc string `json:"desc"`
|
||||
Icon string `json:"icon"`
|
||||
Cnt int64 `json:"cnt"`
|
||||
Amount decimal.Decimal `json:"amount"`
|
||||
CntText string `json:"cnt_text"`
|
||||
AmountText string `json:"amount_text"`
|
||||
}
|
||||
21
pkg/res/admin_act.go
Normal file
21
pkg/res/admin_act.go
Normal file
@ -0,0 +1,21 @@
|
||||
package res
|
||||
|
||||
import "servicebase/pkg/datasource/fields"
|
||||
|
||||
type News struct {
|
||||
ID string `gorm:"column:id;type:char(32);not null;uniqueIndex:id,priority:1;comment:业务ID" json:"id"` // 业务ID
|
||||
TypeID string `gorm:"column:type_id;type:char(32);not null;comment:类型" json:"type_id"` // 类型
|
||||
TypeName string `gorm:"column:type_name;type:char(32);not null;comment:类型" json:"type_name"` // 类型
|
||||
Title string `gorm:"column:title;type:varchar(255);not null;comment:标题" json:"title"` // 标题
|
||||
HeadImg string `gorm:"column:head_img;type:varchar(255);not null;comment:头图" json:"head_img"` // 头图
|
||||
Content string `gorm:"column:content;type:longtext;not null;comment:内容:富文本" json:"content"` // 内容:富文本
|
||||
Sort int32 `gorm:"column:sort;type:int;not null;default:999;comment:排序" json:"sort"` // 排序
|
||||
Position int32 `gorm:"column:position;type:int;not null;default:1;comment:位置1=列表 2=banner" json:"position"` // 位置1=列表 2=banner
|
||||
State int32 `gorm:"column:state;type:int;not null;default:1;comment:状态1=启用 2=禁用" json:"state"` // 状态1=启用 2=禁用
|
||||
StateName string `gorm:"column:state_name;type:int;not null;default:1;comment:状态1=启用 2=禁用" json:"state_name"` // 状态1=启用 2=禁用
|
||||
NewsDate fields.Time `gorm:"column:news_date;type:datetime;not null;comment:新闻时间" json:"news_date"` // 新闻时间
|
||||
CreateAt fields.Time `gorm:"column:create_at;type:datetime;not null;default:CURRENT_TIMESTAMP;comment:创建时间" json:"create_at"` // 创建时间
|
||||
CreateBy string `gorm:"column:create_by;type:varchar(255);not null;comment:创建人" json:"create_by"` // 创建人
|
||||
UpdateAt fields.Time `gorm:"column:update_at;type:datetime;not null;default:CURRENT_TIMESTAMP;comment:更新时间" json:"update_at"` // 更新时间
|
||||
UpdateBy string `gorm:"column:update_by;type:varchar(255);not null;comment:更新人" json:"update_by"` // 更新人
|
||||
}
|
||||
37
pkg/res/admin_trade.go
Normal file
37
pkg/res/admin_trade.go
Normal file
@ -0,0 +1,37 @@
|
||||
package res
|
||||
|
||||
import "servicebase/pkg/datasource/fields"
|
||||
|
||||
type UserGameRole struct {
|
||||
ID string `gorm:"column:id;type:char(32);not null;uniqueIndex:id,priority:1;comment:业务ID" json:"id"` // 业务ID
|
||||
UserID string `gorm:"column:user_id;type:char(32);not null;comment:用户ID" json:"user_id"` // 用户ID
|
||||
UserNo string `gorm:"column:user_no;type:char(32);not null;comment:用户ID" json:"user_no"` // 用户ID
|
||||
UserName string `gorm:"column:user_name;type:char(32);not null;comment:用户ID" json:"user_name"` // 用户ID
|
||||
GameID string `gorm:"column:game_id;type:char(32);not null;comment:游戏" json:"game_id"` // 游戏
|
||||
TargetID string `gorm:"column:target_id;type:char(32);not null;comment:游戏" json:"target_id"` // 三方ID
|
||||
GameName string `gorm:"column:game_name;type:char(32);not null;comment:游戏" json:"game_name"` // 游戏
|
||||
GameRoleName string `gorm:"column:game_role_name;type:varchar(255);not null;comment:角色名称" json:"game_role_name"` // 角色名称
|
||||
GameRoleID string `gorm:"column:game_role_id;type:varchar(255);not null;comment:角色ID" json:"game_role_id"` // 角色ID
|
||||
Desc string `gorm:"column:desc;type:varchar(255);not null;comment:描述" json:"desc"` // 描述
|
||||
Icon string `gorm:"column:icon;type:varchar(255);not null;comment:图标" json:"icon"` // 图标
|
||||
Logo string `gorm:"column:logo;type:varchar(255);not null;comment:logo" json:"logo"` // logo
|
||||
Price int32 `gorm:"column:price;type:int;not null;comment:价格,单位为分" json:"price"` // 价格,单位为分
|
||||
DataState int32 `gorm:"column:data_state;type:int;not null;default:2;comment:数据状态:1=完成 2=待处理" json:"data_state"` // 数据状态:1=完成 2=待处理
|
||||
State int32 `gorm:"column:state;type:int;not null;default:1;comment:状态1=启用 2=禁用" json:"state"` // 状态1=启用 2=禁用
|
||||
Title string `gorm:"column:title;type:text;not null;comment:标题" json:"title"` // 标题
|
||||
ProductNo string `gorm:"column:product_no;type:varchar(255);not null;comment:商品编号" json:"product_no"` // 商品编号
|
||||
ThirdID string `gorm:"column:third_id;type:varchar(255);not null;comment:第三方ID" json:"third_id"` // 第三方ID
|
||||
ProductType string `gorm:"column:product_type;type:varchar(255);not null;comment:商品类型" json:"product_type"` // 商品类型
|
||||
ServerZone string `gorm:"column:server_zone;type:varchar(255);not null;comment:游戏区服" json:"server_zone"` // 游戏区服
|
||||
CanReAuth string `gorm:"column:can_re_auth;type:varchar(255);not null;comment:canReAuth==1?可二次实名":不可实名" json:"can_re_auth"` // canReAuth=="1"?"可二次实名":"不可实名"
|
||||
HaveChenMi string `gorm:"column:have_chen_mi;type:varchar(255);not null;comment:{{item.haveChenMi==1?有:无}}防沉迷" json:"have_chen_mi"` // {{item.haveChenMi=="1"?"有":"无"}}防沉迷
|
||||
UserPrice string `gorm:"column:user_price;type:varchar(255);not null;comment:第三方ID" json:"user_price"` // 第三方ID
|
||||
BrightLights string `gorm:"column:bright_lights;type:varchar(2048);not null;comment:第三方ID" json:"bright_lights"` // 第三方ID
|
||||
Vip string `gorm:"column:vip;type:varchar(255);not null;comment:贵族等级" json:"vip"` // 贵族等级
|
||||
PriceInput *string `gorm:"column:price_input;type:varchar(30);comment:通过输入的价格统计" json:"price_input"` // 通过输入的价格统计
|
||||
SkinList string `gorm:"column:skin_list;type:text;not null;comment:皮肤列表" json:"skin_list"` // 皮肤列表
|
||||
CreateAt fields.Time `gorm:"column:create_at;type:datetime;not null;default:CURRENT_TIMESTAMP;comment:创建时间" json:"create_at"` // 创建时间
|
||||
CreateBy string `gorm:"column:create_by;type:varchar(255);not null;comment:创建人" json:"create_by"` // 创建人
|
||||
UpdateAt fields.Time `gorm:"column:update_at;type:datetime;not null;default:CURRENT_TIMESTAMP;comment:更新时间" json:"update_at"` // 更新时间
|
||||
UpdateBy string `gorm:"column:update_by;type:varchar(255);not null;comment:更新人" json:"update_by"` // 更新人
|
||||
}
|
||||
66
pkg/res/app_user.go
Normal file
66
pkg/res/app_user.go
Normal file
@ -0,0 +1,66 @@
|
||||
package res
|
||||
|
||||
import "servicebase/pkg/datasource/fields"
|
||||
|
||||
type UserRes struct {
|
||||
IDBody
|
||||
UserType string `gorm:"column:user_type;type:char(1);not null;comment:P=person C= crop" json:"user_type"`
|
||||
Truename string `gorm:"column:truename;type:varchar(60);not null" json:"truename"`
|
||||
Nickname string `gorm:"column:nickname;type:varchar(60);not null" json:"nickname"`
|
||||
Password string `gorm:"column:password;type:varchar(60);not null" json:"password"`
|
||||
Phone string `gorm:"column:phone;type:varchar(20);not null" json:"phone"`
|
||||
Email string `gorm:"column:email;type:varchar(100);not null;uniqueIndex:EMAIL_idx,priority:1" json:"email"`
|
||||
Birthday string `gorm:"column:birthday;type:varchar(20);not null" json:"birthday"`
|
||||
Gender string `gorm:"column:gender;type:char(1);not null" json:"gender"`
|
||||
Position string `gorm:"column:position;type:varchar(100);not null" json:"position"`
|
||||
PostCode string `gorm:"column:post_code;type:varchar(20);not null" json:"post_code"`
|
||||
Prefecture string `gorm:"column:prefecture;type:varchar(100);not null" json:"prefecture"`
|
||||
Address string `gorm:"column:address;type:varchar(255);not null" json:"address"`
|
||||
Building string `gorm:"column:building;type:varchar(100);not null" json:"building"`
|
||||
Status string `gorm:"column:status;type:char(1);not null;default:1" json:"status"`
|
||||
CreateAt fields.Time `gorm:"column:create_at;type:datetime;not null" json:"create_at"`
|
||||
UpdateAt fields.Time `gorm:"column:update_at;type:datetime;not null" json:"update_at"`
|
||||
InvoiceType string `gorm:"column:invoice_type;type:char(1);not null;comment:发票类型 1=可开 2=不可开" json:"invoice_type"`
|
||||
InvoiceNo string `gorm:"column:invoice_no;type:varchar(50);not null;comment:发票编号" json:"invoice_no"`
|
||||
AccountBank string `gorm:"column:account_bank;type:varchar(255);not null;comment:开户银行" json:"account_bank"`
|
||||
AccountBranch string `gorm:"column:account_branch;type:varchar(255);not null;comment:开户支行" json:"account_branch"`
|
||||
AccountType string `gorm:"column:account_type;type:char(1);not null;comment:账户类型 1= 普通預金 2=当座預金" json:"account_type"`
|
||||
AccountNo string `gorm:"column:account_no;type:varchar(100);not null;comment:银行账号" json:"account_no"`
|
||||
AccountName string `gorm:"column:account_name;type:varchar(100);not null;comment:开户人姓名" json:"account_name"`
|
||||
PersonalDocType string `gorm:"column:personal_doc_type;type:char(1);not null;comment:1=居民票的复印件2=驾驶证3=护照4=保险证5=在留卡" json:"personal_doc_type"`
|
||||
PersonalImage string `gorm:"column:personal_image;type:varchar(255);not null;comment:身份证照片" json:"personal_image"`
|
||||
PersonalEndDate string `gorm:"column:personal_end_date;type:varchar(255);not null;comment:身份证有效期" json:"personal_end_date"`
|
||||
PersonalImage2 string `gorm:"column:personal_image_2;type:varchar(255);not null;comment:身份证照片2" json:"personal_image_2"`
|
||||
}
|
||||
|
||||
type AppUserRes struct {
|
||||
ID string `gorm:"column:id;type:char(32);not null;uniqueIndex:id,priority:1;comment:ID" json:"id"`
|
||||
No string `gorm:"column:no;type:varchar(64);not null;index:uk,priority:1;comment:用户号、用户名" json:"no"`
|
||||
Nickname string `gorm:"column:nickname;type:varchar(64);not null;comment:昵称" json:"nickname"`
|
||||
Sign string `gorm:"column:sign;type:varchar(255);not null;comment:签名" json:"sign"`
|
||||
Avatar string `gorm:"column:avatar;type:varchar(255);not null;comment:头像" json:"avatar"`
|
||||
Password string `gorm:"column:password;type:varchar(64);not null;comment:密码" json:"password"`
|
||||
PassSalt string `gorm:"column:pass_salt;type:varchar(32);not null;comment:密码盐" json:"pass_salt"`
|
||||
WxOpenID string `gorm:"column:wx_open_id;type:varchar(64);not null;comment:OPEN ID" json:"wx_open_id"`
|
||||
WxUnionID string `gorm:"column:wx_union_id;type:varchar(64);not null;comment:UNION ID" json:"wx_union_id"`
|
||||
CreateAt fields.Time `gorm:"column:create_at;type:datetime;not null;default:CURRENT_TIMESTAMP;comment:创建时间" json:"create_at"`
|
||||
UpdateAt fields.Time `gorm:"column:update_at;type:datetime;not null;default:CURRENT_TIMESTAMP;comment:更新时间" json:"update_at"`
|
||||
}
|
||||
|
||||
type AppUserAuthRes struct { // 店铺商品-卡片
|
||||
Token string `json:"token"`
|
||||
}
|
||||
|
||||
type AppUserRelationApplyRes struct {
|
||||
ID string `gorm:"column:id;type:char(32);not null;uniqueIndex:id,priority:1;comment:ID" json:"id"`
|
||||
Type string `gorm:"column:type;type:varchar(64);not null;comment:类型:CLAN=家 FRIEND=朋友" json:"type"`
|
||||
TypeID string `gorm:"column:type_id;type:char(32);not null;comment:团体ID" json:"type_id"`
|
||||
OpUserID string `gorm:"column:op_user_id;type:char(32);not null;comment:操作用户" json:"op_user_id"`
|
||||
ToUserID string `gorm:"column:to_user_id;type:char(32);not null;comment:目标用户" json:"to_user_id"`
|
||||
Message string `gorm:"column:message;type:varchar(255);not null;comment:申请内容" json:"message"`
|
||||
ReplyMsg string `gorm:"column:reply_msg;type:varchar(255);not null;comment:回复内容" json:"reply_msg"`
|
||||
Channel string `gorm:"column:channel;type:varchar(64);not null;comment:方式 APPLY=用户申请 INVITE=管理员邀请" json:"channel"`
|
||||
State string `gorm:"column:state;type:varchar(32);not null;comment:OK" json:"state"`
|
||||
CreateAt fields.Time `gorm:"column:create_at;type:datetime;not null;default:CURRENT_TIMESTAMP;comment:创建时间" json:"create_at"`
|
||||
UpdateAt fields.Time `gorm:"column:update_at;type:datetime;not null;default:CURRENT_TIMESTAMP;comment:更新时间" json:"update_at"`
|
||||
}
|
||||
43
pkg/res/app_user_clan.go
Normal file
43
pkg/res/app_user_clan.go
Normal file
@ -0,0 +1,43 @@
|
||||
package res
|
||||
|
||||
import "servicebase/pkg/datasource/fields"
|
||||
|
||||
type UserClanRes struct {
|
||||
ID string `gorm:"column:id;type:char(32);not null;uniqueIndex:id,priority:1;comment:ID" json:"id"`
|
||||
No string `gorm:"column:no;type:varchar(64);not null;index:uk,priority:1;comment:编号" json:"no"`
|
||||
Nickname string `gorm:"column:nickname;type:varchar(64);not null;comment:昵称" json:"nickname"`
|
||||
Sign string `gorm:"column:sign;type:varchar(255);not null;comment:签名" json:"sign"`
|
||||
Avatar string `gorm:"column:avatar;type:varchar(255);not null;comment:头像" json:"avatar"`
|
||||
CreatorUID string `gorm:"column:creator_uid;type:char(32);not null;comment:创建人" json:"creator_uid"`
|
||||
ManagerUID string `gorm:"column:manager_uid;type:char(32);not null;comment:管理人" json:"manager_uid"`
|
||||
CntMember int32 `gorm:"column:cnt_member;type:int;not null;comment:成员数" json:"cnt_member"`
|
||||
CntMoment int32 `gorm:"column:cnt_moment;type:int;not null;comment:动态数量" json:"cnt_moment"`
|
||||
CreateAt fields.Time `gorm:"column:create_at;type:datetime;not null;default:CURRENT_TIMESTAMP;comment:创建时间" json:"create_at"`
|
||||
UpdateAt fields.Time `gorm:"column:update_at;type:datetime;not null;default:CURRENT_TIMESTAMP;comment:更新时间" json:"update_at"`
|
||||
|
||||
UserNo string `gorm:"column:no;type:varchar(64);not null;index:uk,priority:1;comment:用户号、用户名" json:"user_no"`
|
||||
UserNickname string `gorm:"column:nickname;type:varchar(64);not null;comment:昵称" json:"user_nickname"`
|
||||
UserAvatar string `gorm:"column:avatar;type:varchar(255);not null;comment:头像" json:"user_avatar"`
|
||||
}
|
||||
|
||||
type UserClanMemberRes struct {
|
||||
ID string `gorm:"column:id;type:char(32);not null;uniqueIndex:id,priority:1;comment:ID" json:"id"`
|
||||
No string `gorm:"column:no;type:varchar(64);not null;index:uk,priority:1;comment:编号" json:"no"`
|
||||
Nickname string `gorm:"column:nickname;type:varchar(64);not null;comment:昵称" json:"nickname"`
|
||||
Sign string `gorm:"column:sign;type:varchar(255);not null;comment:签名" json:"sign"`
|
||||
Avatar string `gorm:"column:avatar;type:varchar(255);not null;comment:头像" json:"avatar"`
|
||||
CreateAt fields.Time `gorm:"column:create_at;type:datetime;not null;default:CURRENT_TIMESTAMP;comment:创建时间" json:"create_at"`
|
||||
}
|
||||
|
||||
type UserClanMemberApplyRes struct {
|
||||
ID string `gorm:"column:id;type:char(32);not null;uniqueIndex:id,priority:1;comment:ID" json:"id"`
|
||||
ClanID string `gorm:"column:clan_id;type:char(32);not null;comment:团体ID" json:"clan_id"`
|
||||
ApplyUserID string `gorm:"column:apply_user_id;type:char(32);not null;comment:操作用户" json:"apply_user_id"`
|
||||
TargetUserID string `gorm:"column:target_user_id;type:char(32);not null;comment:目标用户" json:"target_user_id"`
|
||||
Message string `gorm:"column:message;type:varchar(255);not null;comment:申请内容" json:"message"`
|
||||
ReplyMsg string `gorm:"column:reply_msg;type:varchar(255);not null;comment:回复内容" json:"reply_msg"`
|
||||
Channel string `gorm:"column:channel;type:varchar(64);not null;comment:方式 APPLY=用户申请 INVITE=管理员邀请" json:"channel"`
|
||||
State string `gorm:"column:state;type:varchar(32);not null;comment:OK" json:"state"`
|
||||
CreateAt fields.Time `gorm:"column:create_at;type:datetime;not null;default:CURRENT_TIMESTAMP;comment:创建时间" json:"create_at"`
|
||||
UpdateAt fields.Time `gorm:"column:update_at;type:datetime;not null;default:CURRENT_TIMESTAMP;comment:更新时间" json:"update_at"`
|
||||
}
|
||||
121
pkg/res/app_user_content.go
Normal file
121
pkg/res/app_user_content.go
Normal file
@ -0,0 +1,121 @@
|
||||
package res
|
||||
|
||||
import (
|
||||
"servicebase/pkg/datasource/fields"
|
||||
|
||||
"github.com/shopspring/decimal"
|
||||
)
|
||||
|
||||
type CategoryRes struct {
|
||||
IDBody
|
||||
CatName string `gorm:"column:cat_name;type:varchar(60);not null" json:"cat_name"`
|
||||
IconImg string `gorm:"column:icon_img;type:varchar(255);not null" json:"icon_img"`
|
||||
ParentID string `gorm:"column:parent_id;type:int;not null" json:"parent_id"`
|
||||
Level int32 `gorm:"column:level;type:int;not null" json:"level"`
|
||||
Status int32 `gorm:"column:status;type:int;not null" json:"status"`
|
||||
IsHot string `gorm:"column:is_hot;type:char(1);not null;default:0" json:"is_hot"`
|
||||
CreateAt fields.Time `gorm:"column:create_at;type:datetime;not null" json:"create_at"`
|
||||
UpdateAt fields.Time `gorm:"column:update_at;type:datetime;not null" json:"update_at"`
|
||||
}
|
||||
|
||||
type ShopRes struct {
|
||||
IDBody
|
||||
ShopName string `gorm:"column:shop_name;type:varchar(255);not null" json:"shop_name"`
|
||||
BgColor string `gorm:"column:bg_color;type:varchar(20);not null" json:"bg_color"`
|
||||
Lng string `gorm:"column:lng;type:varchar(50);not null" json:"lng"`
|
||||
Lat string `gorm:"column:lat;type:varchar(50);not null" json:"lat"`
|
||||
Address string `gorm:"column:address;type:varchar(255);not null" json:"address"`
|
||||
PostCode string `gorm:"column:post_code;type:varchar(20);not null" json:"post_code"`
|
||||
Phone string `gorm:"column:phone;type:varchar(20);not null" json:"phone"`
|
||||
OpenTime string `gorm:"column:open_time;type:varchar(255);not null" json:"open_time"`
|
||||
Traffic string `gorm:"column:traffic;type:varchar(255);not null" json:"traffic"`
|
||||
Status string `gorm:"column:status;type:char(1);not null" json:"status"`
|
||||
CreateAt fields.Time `gorm:"column:create_at;type:datetime;not null" json:"create_at"`
|
||||
UpdateAt fields.Time `gorm:"column:update_at;type:datetime;not null" json:"update_at"`
|
||||
}
|
||||
|
||||
type SpuRes struct {
|
||||
IDBody
|
||||
SpuCode string `gorm:"column:spu_code;type:varchar(60);not null;comment:商品编码" json:"spu_code"`
|
||||
TopCatID string `gorm:"column:top_cat_id;type:int;not null;comment:一级分类ID" json:"top_cat_id"`
|
||||
TopCatName string `gorm:"column:top_cat_name;type:varchar(60);not null;comment:一级分类ID" json:"top_cat_name"`
|
||||
SecondCatID string `gorm:"column:second_cat_id;type:int;not null;comment:二级分类ID" json:"second_cat_id"`
|
||||
SecondCatName string `gorm:"column:second_cat_name;type:varchar(60);not null;comment:二级分类ID" json:"second_cat_name"`
|
||||
ThirdCatID string `gorm:"column:third_cat_id;type:int;not null;comment:三级分类ID" json:"third_cat_id"`
|
||||
ThirdCatName string `gorm:"column:third_cat_name;type:varchar(60);not null;comment:三级分类ID" json:"third_cat_name"`
|
||||
Title string `gorm:"column:title;type:varchar(255);not null;comment:商品名称" json:"title"`
|
||||
HeadImg string `gorm:"column:head_img;type:varchar(255);not null;comment:商品图片" json:"head_img"`
|
||||
Tag string `gorm:"column:tag;type:varchar(100);not null;comment:标签" json:"tag"`
|
||||
NewPrice string `gorm:"column:new_price;type:varchar(30);not null;comment:新品价格" json:"new_price"`
|
||||
NewPriceProps string `gorm:"column:new_price_props;type:json;not null;comment:新品价格属性" json:"new_price_props"`
|
||||
AllowOld string `gorm:"column:allow_old;type:char(1);not null;comment:允许卖二手" json:"allow_old"`
|
||||
OldPrice string `gorm:"column:old_price;type:varchar(30);not null;comment:二手价" json:"old_price"`
|
||||
OldPriceProps string `gorm:"column:old_price_props;type:json;not null;comment:二手价属性\n" json:"old_price_props"`
|
||||
Status string `gorm:"column:status;type:char(1);not null;comment:1=上架 2=下架" json:"status"`
|
||||
CreateAt fields.Time `gorm:"column:create_at;type:datetime;not null" json:"create_at"`
|
||||
UpdateAt fields.Time `gorm:"column:update_at;type:datetime;not null" json:"update_at"`
|
||||
SortNo string `gorm:"column:sort_no;type:int;not null" json:"sort_no"`
|
||||
}
|
||||
|
||||
type SkuRes struct {
|
||||
IDBody
|
||||
SpuID string `gorm:"column:spu_id;type:int(11);not null;comment:SPUID" json:"spu_id"`
|
||||
SkuCode string `gorm:"column:sku_code;type:varchar(30);not null" json:"sku_code"`
|
||||
SkuName string `gorm:"column:sku_name;type:varchar(255);not null" json:"sku_name"`
|
||||
Attrs string `gorm:"column:attrs;type:json;not null" json:"attrs"`
|
||||
AttrsName string `gorm:"column:attrs_name;type:varchar(255);not null;comment:属性字符串" json:"attrs_name"`
|
||||
MarketPrice decimal.Decimal `gorm:"column:market_price;type:decimal(9,2);not null;comment:市场价" json:"market_price"`
|
||||
SalePrice decimal.Decimal `gorm:"column:sale_price;type:decimal(9,2);not null;comment:销售价" json:"sale_price"`
|
||||
SaleCount int32 `gorm:"column:sale_count;type:int(11);not null;comment:销量" json:"sale_count"`
|
||||
SaleStatus string `gorm:"column:sale_status;type:char(1);not null;comment:1=上架 2=下架" json:"sale_status"`
|
||||
StockNum int32 `gorm:"column:stock_num;type:int(11);not null;comment:库存" json:"stock_num"`
|
||||
}
|
||||
|
||||
type CommodityRes struct {
|
||||
IDBody
|
||||
SpuCode string `gorm:"column:spu_code;type:varchar(60);not null;comment:商品编码" json:"spu_code"`
|
||||
TopCatID string `gorm:"column:top_cat_id;type:int;not null;comment:一级分类ID" json:"top_cat_id"`
|
||||
SecondCatID string `gorm:"column:second_cat_id;type:int;not null;comment:二级分类ID" json:"second_cat_id"`
|
||||
ThirdCatID string `gorm:"column:third_cat_id;type:int;not null;comment:三级分类ID" json:"third_cat_id"`
|
||||
Title string `gorm:"column:title;type:varchar(255);not null;comment:商品名称" json:"title"`
|
||||
HeadImg string `gorm:"column:head_img;type:varchar(255);not null;comment:商品图片" json:"head_img"`
|
||||
Tag string `gorm:"column:tag;type:varchar(100);not null;comment:标签" json:"tag"`
|
||||
NewPrice string `gorm:"column:new_price;type:varchar(30);not null;comment:新品价格" json:"new_price"`
|
||||
NewPriceProps string `gorm:"column:new_price_props;type:json;not null;comment:新品价格属性" json:"new_price_props"`
|
||||
AllowOld string `gorm:"column:allow_old;type:char(1);not null;comment:允许卖二手" json:"allow_old"`
|
||||
OldPrice string `gorm:"column:old_price;type:varchar(30);not null;comment:二手价" json:"old_price"`
|
||||
OldPriceProps string `gorm:"column:old_price_props;type:json;not null;comment:二手价属性\n" json:"old_price_props"`
|
||||
Status string `gorm:"column:status;type:char(1);not null;comment:1=上架 2=下架" json:"status"`
|
||||
}
|
||||
|
||||
type BannerRes struct {
|
||||
IDBody
|
||||
ImgURL string `gorm:"column:img_url;type:varchar(255);not null;comment:图片地址" json:"img_url"`
|
||||
Title string `gorm:"column:title;type:varchar(255);not null;comment:标题" json:"title"`
|
||||
LinkURL string `gorm:"column:link_url;type:varchar(255);not null;comment:链接" json:"link_url"`
|
||||
Status string `gorm:"column:status;type:char(1);not null;comment:状态 1=正常 0=作废" json:"status"`
|
||||
ViewPos string `gorm:"column:view_pos;type:varchar(60);not null;comment:HOME_TOP 首页顶部 SPU_TOP 商品页顶部" json:"view_pos"`
|
||||
CreateAt fields.Time `gorm:"column:create_at;type:datetime;not null" json:"create_at"`
|
||||
UpdateAt fields.Time `gorm:"column:update_at;type:datetime;not null" json:"update_at"`
|
||||
}
|
||||
|
||||
type FAQRes struct {
|
||||
IDBody
|
||||
Question string `gorm:"column:question;type:varchar(255);not null;comment:问题" json:"question"`
|
||||
Answer string `gorm:"column:answer;type:longtext;not null;comment:答案" json:"answer"`
|
||||
Status string `gorm:"column:status;type:char(1);not null" json:"status"`
|
||||
OrderNo int32 `gorm:"column:order_no;type:int;not null;default:1000;comment:序号" json:"order_no"`
|
||||
CreateAt fields.Time `gorm:"column:create_at;type:datetime;not null" json:"create_at"`
|
||||
UpdateAt fields.Time `gorm:"column:update_at;type:datetime;not null" json:"update_at"`
|
||||
}
|
||||
|
||||
type ArticleRes struct {
|
||||
IDBody
|
||||
Title string `gorm:"column:title;type:varchar(255);comment:文章标题" json:"title"`
|
||||
Content string `gorm:"column:content;type:text;comment:文章内容" json:"content"`
|
||||
ImgURL string `gorm:"column:img_url;type:varchar(255);comment:文章图片" json:"img_url"`
|
||||
ArticleType string `gorm:"column:article_type;type:char(1);comment:文章类型 1=首页特色介绍 2=网站条款" json:"article_type"`
|
||||
Status string `gorm:"column:status;type:char(1);comment:文章状态 0=作废 1=正常" json:"status"`
|
||||
CreateAt fields.Time `gorm:"column:create_at;type:datetime;not null" json:"create_at"`
|
||||
UpdateAt fields.Time `gorm:"column:update_at;type:datetime;not null" json:"update_at"`
|
||||
}
|
||||
32
pkg/res/app_user_friend.go
Normal file
32
pkg/res/app_user_friend.go
Normal file
@ -0,0 +1,32 @@
|
||||
package res
|
||||
|
||||
import "servicebase/pkg/datasource/fields"
|
||||
|
||||
type UserFriendRes struct {
|
||||
ID string `gorm:"column:id;type:char(32);not null;uniqueIndex:id,priority:1;comment:ID" json:"id"`
|
||||
No string `gorm:"column:no;type:varchar(64);not null;index:uk,priority:1;comment:编号" json:"no"`
|
||||
Nickname string `gorm:"column:nickname;type:varchar(64);not null;comment:昵称" json:"nickname"`
|
||||
Sign string `gorm:"column:sign;type:varchar(255);not null;comment:签名" json:"sign"`
|
||||
Avatar string `gorm:"column:avatar;type:varchar(255);not null;comment:头像" json:"avatar"`
|
||||
CreateAt fields.Time `gorm:"column:create_at;type:datetime;not null;default:CURRENT_TIMESTAMP;comment:创建时间" json:"create_at"`
|
||||
|
||||
ClanID string
|
||||
ClanName string
|
||||
ClanAvatar string
|
||||
}
|
||||
|
||||
type UserFriendTopRes struct {
|
||||
ID string `gorm:"column:id;type:char(32);not null;uniqueIndex:id,priority:1;comment:ID" json:"id"`
|
||||
}
|
||||
|
||||
type UserFriendApplyRes struct {
|
||||
ID string `gorm:"column:id;type:char(32);not null;uniqueIndex:id,priority:1;comment:ID" json:"id"`
|
||||
FromUserID string `gorm:"column:from_user_id;type:char(32);not null;index:uk,priority:1;comment:团体ID" json:"from_user_id"`
|
||||
ToUserID string `gorm:"column:to_user_id;type:char(32);not null;index:uk,priority:2;comment:用户ID" json:"to_user_id"`
|
||||
Message string `gorm:"column:message;type:varchar(255);not null;comment:申请内容" json:"message"`
|
||||
ReplyMsg string `gorm:"column:reply_msg;type:varchar(255);not null" json:"reply_msg"`
|
||||
Channel string `gorm:"column:channel;type:varchar(64);not null;comment:方式 NORMAL=普通" json:"channel"`
|
||||
State string `gorm:"column:state;type:varchar(32);not null;comment:OK" json:"state"`
|
||||
CreateAt fields.Time `gorm:"column:create_at;type:datetime;not null;default:CURRENT_TIMESTAMP;comment:创建时间" json:"create_at"`
|
||||
UpdateAt fields.Time `gorm:"column:update_at;type:datetime;not null;default:CURRENT_TIMESTAMP;comment:更新时间" json:"update_at"`
|
||||
}
|
||||
28
pkg/res/app_user_moment.go
Normal file
28
pkg/res/app_user_moment.go
Normal file
@ -0,0 +1,28 @@
|
||||
package res
|
||||
|
||||
import "servicebase/pkg/datasource/fields"
|
||||
|
||||
type UserMomentRes struct {
|
||||
ID string `gorm:"column:id;type:char(32);not null;uniqueIndex:id,priority:1;comment:ID" json:"id"`
|
||||
ClanID string `gorm:"column:clan_id;type:char(32);not null;comment:家" json:"clan_id"`
|
||||
Title string `gorm:"column:title;type:varchar(64);not null;comment:标题" json:"title"`
|
||||
TextContent string `gorm:"column:text_content;type:varchar(2048);not null;comment:内容" json:"text_content"`
|
||||
CreateBy string `gorm:"column:create_by;type:char(32);not null;comment:创建人" json:"create_by"`
|
||||
CreateAt fields.Time `gorm:"column:create_at;type:datetime;not null;default:CURRENT_TIMESTAMP;comment:创建时间" json:"create_at"`
|
||||
UpdateAt fields.Time `gorm:"column:update_at;type:datetime;not null;default:CURRENT_TIMESTAMP;comment:更新时间" json:"update_at"`
|
||||
|
||||
UserNo string `gorm:"column:no;type:varchar(64);not null;index:uk,priority:1;comment:用户号、用户名" json:"user_no"`
|
||||
UserNickname string `gorm:"column:nickname;type:varchar(64);not null;comment:昵称" json:"user_nickname"`
|
||||
UserAvatar string `gorm:"column:avatar;type:varchar(255);not null;comment:头像" json:"user_avatar"`
|
||||
|
||||
Items []UserMomentItemRes `gorm:"-" json:"items"`
|
||||
}
|
||||
|
||||
type UserMomentItemRes struct {
|
||||
ID string `gorm:"column:id;type:char(32);not null;uniqueIndex:id,priority:1;comment:ID" json:"id"`
|
||||
ClanID string `gorm:"column:clan_id;type:char(32);not null;comment:家" json:"clan_id"`
|
||||
MomentID string `gorm:"column:moment_id;type:char(32);not null;comment:动态" json:"moment_id"`
|
||||
Type string `gorm:"column:type;type:varchar(64);not null;comment:类型:PIC=图片" json:"type"`
|
||||
Content string `gorm:"column:content;type:varchar(255);not null;comment:内容、如图片id" json:"content"`
|
||||
CreateBy string `gorm:"column:create_by;type:char(32);not null;comment:创建人" json:"create_by"`
|
||||
}
|
||||
67
pkg/res/app_user_order.go
Normal file
67
pkg/res/app_user_order.go
Normal file
@ -0,0 +1,67 @@
|
||||
package res
|
||||
|
||||
import (
|
||||
"servicebase/pkg/datasource/fields"
|
||||
|
||||
"github.com/shopspring/decimal"
|
||||
)
|
||||
|
||||
type OrderRes struct {
|
||||
IDBody
|
||||
UserID string `gorm:"column:user_id;type:int;not null;comment:用户id" json:"user_id"`
|
||||
Truename string `json:"truename"`
|
||||
Nickname string `json:"nickname"`
|
||||
OrderNo string `gorm:"column:order_no;type:varchar(255);not null;comment:订单号" json:"order_no"`
|
||||
OrderStatus string `gorm:"column:order_status;type:char(2);not null;comment:订单状态 1=已下单 2=已收货 3=已付款 4=已完成 0=已取消" json:"order_status"`
|
||||
OrderType int32 `gorm:"column:order_type;type:int;not null;comment:订单类型 1=到店 2=邮寄" json:"order_type"`
|
||||
OrderAmount decimal.Decimal `gorm:"column:order_amount;type:decimal(10,2);not null;comment:订单金额" json:"order_amount"`
|
||||
OrderExtraAmount decimal.Decimal `gorm:"column:order_extra_amount;type:decimal(10,2);not null;comment:订单额外费用(挂号信要2000其他0)" json:"order_extra_amount"`
|
||||
OrderPayAmount decimal.Decimal `gorm:"column:order_pay_amount;type:decimal(10,2);not null;comment:订单支付金额" json:"order_pay_amount"`
|
||||
OrderPayType int32 `gorm:"column:order_pay_type;type:int;not null;comment:订单支付类型1=现金 2=银行汇款 3=挂号信" json:"order_pay_type"`
|
||||
OrderPayTime string `gorm:"column:order_pay_time;type:datetime;not null;comment:订单支付时间" json:"order_pay_time"`
|
||||
OrderPayNo string `gorm:"column:order_pay_no;type:varchar(255);not null;comment:订单支付流水号" json:"order_pay_no"`
|
||||
OrderPayStatus string `gorm:"column:order_pay_status;type:char(1);not null;comment:订单支付状态 0=未支付 1=已支付" json:"order_pay_status"`
|
||||
OrderPayRemark string `gorm:"column:order_pay_remark;type:varchar(255);not null;comment:订单支付备注" json:"order_pay_remark"`
|
||||
OrderRemark string `gorm:"column:order_remark;type:varchar(255);not null;comment:订单备注" json:"order_remark"`
|
||||
ToShopID string `gorm:"column:to_shop_id;type:int;not null;comment:到店门店id" json:"to_shop_id"`
|
||||
ToShopName string `json:"to_shop_name"`
|
||||
ToShopDate string `gorm:"column:to_shop_date;type:char(10);not null;comment:到店日期" json:"to_shop_date"`
|
||||
ToShopTime string `gorm:"column:to_shop_time;type:char(20);not null;comment:到店时间" json:"to_shop_time"`
|
||||
ExpressArriveDate string `gorm:"column:express_arrive_date;type:varchar(20);not null;comment:快递日期" json:"express_arrive_date"`
|
||||
ExpressArriveTime string `gorm:"column:express_arrive_time;type:varchar(255);not null;comment:快递时间" json:"express_arrive_time"`
|
||||
InvoiceType string `gorm:"column:invoice_type;type:char(1);not null;comment:发票类型1=需要发票 2=不需要" json:"invoice_type"`
|
||||
InvoiceNo string `gorm:"column:invoice_no;type:varchar(255);comment:发票号码" json:"invoice_no"`
|
||||
CreateAt fields.Time `gorm:"column:create_at;type:datetime;not null;comment:Create Time" json:"create_at"`
|
||||
UpdateAt fields.Time `gorm:"column:update_at;type:datetime;not null;comment:Create Time" json:"update_at"`
|
||||
PersonalDocType string `gorm:"column:personal_doc_type;type:varchar(255);not null;comment:身份类型" json:"personal_doc_type"`
|
||||
PersonalDoc string `gorm:"column:personal_doc;type:varchar(255);not null;comment:身份照片" json:"personal_doc"`
|
||||
PersonalEndDate string `gorm:"column:personal_end_date;type:varchar(255);not null;comment:身份有效期" json:"personal_end_date"`
|
||||
Details []OrderDetaliRes `json:"details" gorm:"-"`
|
||||
BankName string `gorm:"column:bank_name;type:varchar(255);not null;comment:银行名" json:"bank_name"`
|
||||
BranchBankName string `gorm:"column:branch_bank_name;type:varchar(255);not null;comment:支行名" json:"branch_bank_name"`
|
||||
CardType string `gorm:"column:card_type;type:varchar(255);not null;comment:卡类型" json:"card_type"`
|
||||
CardNo string `gorm:"column:card_no;type:varchar(255);not null;comment:卡号" json:"card_no"`
|
||||
CardUserName string `gorm:"column:card_user_name;type:varchar(255);not null;comment:卡户名" json:"card_user_name"`
|
||||
Birthday string `gorm:"column:birthday;type:varchar(255);not null;comment:生日" json:"birthday"`
|
||||
Position string `json:"position"`
|
||||
Phone string `json:"phone"`
|
||||
Gender string `json:"gender"`
|
||||
Prefecture string `json:"prefecture"`
|
||||
Address string `json:"address"`
|
||||
Building string `json:"building"`
|
||||
}
|
||||
|
||||
type OrderDetaliRes struct {
|
||||
IDBody
|
||||
OrderID string `gorm:"column:order_id;type:int;not null;comment:订单ID" json:"order_id"`
|
||||
ProductID string `gorm:"column:product_id;type:int;not null;comment:商品ID" json:"product_id"`
|
||||
ProductName string `gorm:"column:product_name;type:varchar(255);not null;comment:商品名称" json:"product_name"`
|
||||
ProductPrice decimal.Decimal `gorm:"column:product_price;type:decimal(10,2);not null;comment:商品价格" json:"product_price"`
|
||||
ProductNum int32 `gorm:"column:product_num;type:int;not null;comment:商品数量" json:"product_num"`
|
||||
ProductTotal decimal.Decimal `gorm:"column:product_total;type:decimal(10,2);not null;comment:商品总价" json:"product_total"`
|
||||
ProductPros string `gorm:"column:product_pros;type:varchar(255);not null;comment:属性" json:"product_pros"`
|
||||
CreateAt *fields.Time `gorm:"column:create_at;type:datetime;not null;comment:Create Time" json:"create_at"`
|
||||
UpdateAt *fields.Time `gorm:"column:update_at;type:datetime;not null;comment:Create Time" json:"update_at"`
|
||||
PriceType string `gorm:"column:price_type;type:char(50);not null;comment:价格类型" json:"price_type"`
|
||||
ProductCode string `json:"product_code"`
|
||||
}
|
||||
29
pkg/res/app_user_shop.go
Normal file
29
pkg/res/app_user_shop.go
Normal file
@ -0,0 +1,29 @@
|
||||
package res
|
||||
|
||||
import "servicebase/pkg/datasource/fields"
|
||||
|
||||
type CategoryTreeRes struct {
|
||||
IDBody
|
||||
CatName string `gorm:"column:cat_name;type:varchar(60);not null" json:"cat_name"`
|
||||
IconImg string `gorm:"column:icon_img;type:varchar(255);not null" json:"icon_img"`
|
||||
ParentID string `gorm:"column:parent_id;type:int;not null" json:"parent_id"`
|
||||
Level int32 `gorm:"column:level;type:int;not null" json:"level"`
|
||||
Status int32 `gorm:"column:status;type:int;not null" json:"status"`
|
||||
IsHot string `gorm:"column:is_hot;type:char(1);not null;default:0" json:"is_hot"`
|
||||
CreateAt fields.Time `gorm:"column:create_at;type:datetime;not null" json:"create_at"`
|
||||
UpdateAt fields.Time `gorm:"column:update_at;type:datetime;not null" json:"update_at"`
|
||||
Children []*CategoryTreeRes `json:"children" gorm:"-"`
|
||||
}
|
||||
|
||||
type ShopItemRes struct {
|
||||
ID string `json:"shopId"`
|
||||
ShopName string `json:"shopName"`
|
||||
BgColor string `json:"bgColor"`
|
||||
Lng string `json:"lng"`
|
||||
Lat string `json:"lat"`
|
||||
Address string `json:"address"`
|
||||
PostCode string `json:"postCode"`
|
||||
Phone string `json:"phone"`
|
||||
OpenTime string `json:"openTime"`
|
||||
Traffic string `json:"traffic"`
|
||||
}
|
||||
163
pkg/res/common_auth.go
Normal file
163
pkg/res/common_auth.go
Normal file
@ -0,0 +1,163 @@
|
||||
package res
|
||||
|
||||
import (
|
||||
"servicebase/pkg/datasource/fields"
|
||||
)
|
||||
|
||||
type AdminUserAuthRes struct {
|
||||
Token string `json:"token"`
|
||||
}
|
||||
|
||||
type TenantRes struct {
|
||||
ID string `gorm:"column:id;type:char(32);not null;uniqueIndex:id,priority:1;comment:业务ID" json:"id"`
|
||||
Name string `gorm:"column:name;type:varchar(255);not null;index:idx_name,priority:1;comment:租户名" json:"name"`
|
||||
Contact string `gorm:"column:contact;type:varchar(255);not null;comment:联系方式" json:"contact"`
|
||||
Desc string `gorm:"column:desc;type:varchar(255);not null;comment:备注" json:"desc"`
|
||||
CreateAt fields.Time `gorm:"column:create_at;type:datetime;not null;default:CURRENT_TIMESTAMP;comment:创建时间" json:"create_at"`
|
||||
CreateBy string `gorm:"column:create_by;type:varchar(255);not null;comment:创建人" json:"create_by"`
|
||||
UpdateAt fields.Time `gorm:"column:update_at;type:datetime;not null;index:idx_delete_at,priority:2;default:CURRENT_TIMESTAMP;comment:更新时间" json:"update_at"`
|
||||
UpdateBy string `gorm:"column:update_by;type:varchar(255);not null;comment:更新人" json:"update_by"`
|
||||
}
|
||||
|
||||
type AdminUserRes struct {
|
||||
IDBody
|
||||
Username string `json:"username"`
|
||||
Nickname string `json:"nickname"`
|
||||
Desc string `json:"desc"`
|
||||
State int32 `json:"state"` // 创建人
|
||||
CreateAt fields.Time `json:"create_at"` // 创建时间
|
||||
CreateBy string `json:"create_by"` // 创建人
|
||||
UpdateAt fields.Time `json:"update_at"` // 更新时间
|
||||
UpdateBy string `json:"update_by"`
|
||||
}
|
||||
|
||||
type AdminRoleRes struct {
|
||||
IDBody
|
||||
TenantID string `json:"tenant_id"` // 租户ID
|
||||
Name string `json:"name"`
|
||||
Code string `json:"code"`
|
||||
UserType string `json:"user_type"` // 类型:HEAD=总行、BRANCH=分行
|
||||
Desc string `json:"desc"` // 描述
|
||||
CreateAt fields.Time `json:"create_at"` // 创建时间
|
||||
CreateBy string `json:"create_by"` // 创建人
|
||||
UpdateAt fields.Time `json:"update_at"` // 更新时间
|
||||
UpdateBy string `json:"update_by"`
|
||||
}
|
||||
|
||||
type AdminPrivilegeRes struct {
|
||||
IDBody
|
||||
TenantID string `json:"tenant_id"` // 租户ID
|
||||
ParentID string `json:"parent_id"` // 父ID
|
||||
Name string `json:"name"` // 权限名称
|
||||
Level string `json:"level"` // 权限级别
|
||||
SourceType string `gorm:"column:source_type;type:varchar(64);not null" json:"source_type"` // 类型:resource、api等
|
||||
TargetType string `gorm:"column:target_type;type:varchar(64);not null" json:"target_type"` // 类型:GROUP MENU BTN 等
|
||||
Target string `gorm:"column:target;type:varchar(64);not null" json:"target"` // 权限值 menu:菜单路径; api=url-pre
|
||||
Desc string `gorm:"column:desc;type:varchar(64);not null" json:"desc"`
|
||||
CreateAt fields.Time `json:"create_at"` // 创建时间
|
||||
}
|
||||
|
||||
type AdminPrivilegeTypedTreeRes struct {
|
||||
Type string `json:"type"`
|
||||
TypeName string `json:"type_name"`
|
||||
Tree *[]*AdminPrivilegeTreeRes `json:"tree"`
|
||||
}
|
||||
|
||||
type AdminPrivilegeTreeRes struct {
|
||||
IDBody
|
||||
TenantID string `json:"tenant_id"` // 租户ID
|
||||
ParentID string `json:"parent_id"` // 父ID
|
||||
Name string `json:"name"` // 权限名称
|
||||
Level string `json:"level"` // 权限级别
|
||||
SourceType string `gorm:"column:source_type;type:varchar(64);not null" json:"source_type"` // 类型:resource、api等
|
||||
TargetType string `gorm:"column:target_type;type:varchar(64);not null" json:"target_type"` // 类型:GROUP MENU BTN 等
|
||||
Target string `gorm:"column:target;type:varchar(64);not null" json:"target"` // 权限值 menu:菜单路径; api=url-pre
|
||||
Desc string `gorm:"column:desc;type:varchar(64);not null" json:"desc"`
|
||||
Children []*AdminPrivilegeTreeRes `json:"children" gorm:"-"`
|
||||
}
|
||||
|
||||
type AdminRolePrivilegeTypedALLRes struct {
|
||||
Type string `json:"type"`
|
||||
TypeName string `json:"type_name"`
|
||||
Tree *[]*AdminRolePrivilegeALLRes `json:"tree"`
|
||||
}
|
||||
|
||||
type AdminRolePrivilegeALLRes struct {
|
||||
ID string `json:"id"` // 角色-权限关联关系的ID
|
||||
Authorized bool `json:"authorized"` // 角色是否已授权该权限
|
||||
ScopeID string `json:"scope_id"`
|
||||
ScopeName string `json:"scope_name"`
|
||||
ScopeCode string `json:"scope_code"`
|
||||
PrivilegeParentID string `json:"privilege_parent_id"`
|
||||
PrivilegeID string `json:"privilege_id"`
|
||||
PrivilegeName string `json:"privilege_name"`
|
||||
PrivilegeCode string `json:"privilege_code"`
|
||||
PrivilegeTarget string `json:"privilege_target"`
|
||||
PrivilegeSourceType string `json:"privilege_source_type"`
|
||||
PrivilegeSourceTypeName string `json:"privilege_source_type_name"`
|
||||
Children []*AdminRolePrivilegeALLRes `json:"children" gorm:"-"`
|
||||
}
|
||||
|
||||
var typeName = map[string]string{
|
||||
"INTERFACE": "接口权限",
|
||||
"RESOURCE": "资源权限",
|
||||
"DATA": "数据权限",
|
||||
}
|
||||
|
||||
func (d *AdminRolePrivilegeTypedALLRes) Complete() {
|
||||
d.TypeName = typeName[d.Type]
|
||||
}
|
||||
|
||||
func (d *AdminRolePrivilegeALLRes) Complete() {
|
||||
d.PrivilegeSourceTypeName = typeName[d.PrivilegeSourceType]
|
||||
}
|
||||
|
||||
type SystemSettingRes struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"` // 配置名称
|
||||
Key string `json:"key"` // 配置key
|
||||
Value string `json:"value"` // 配置内容
|
||||
Ext string `json:"ext"` // 扩展信息
|
||||
Desc string `json:"desc"` // 描述说明
|
||||
Changeable int32 `json:"changeable"` // 是否可以修改 1=可修改 2=不可修改
|
||||
Deletable int32 `json:"deletable"` // 是否可以删除 1=可删除 2=不可删除
|
||||
}
|
||||
|
||||
type AdminSystemContentRes struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"` // 配置名称
|
||||
Key string `json:"key"` // 配置key
|
||||
Value string `json:"value"` // 配置内容
|
||||
Ext string `json:"ext"` // 扩展信息
|
||||
Desc string `json:"desc"` // 描述说明
|
||||
Changeable int32 `json:"changeable"` // 是否可以修改 1=可修改 2=不可修改
|
||||
Deletable int32 `json:"deletable"` // 是否可以删除 1=可删除 2=不可删除
|
||||
}
|
||||
|
||||
type AdminUserRoleAllRes struct {
|
||||
ID string `json:"id"` // 用户-角色关联关系的ID
|
||||
Authorized bool `json:"authorized"` // 是否已授权
|
||||
RoleID string `json:"role_id"`
|
||||
RoleName string `json:"role_name"`
|
||||
RoleCode string `json:"role_code"`
|
||||
}
|
||||
|
||||
type UserCheckRes struct {
|
||||
Allowed bool `json:"allowed"`
|
||||
ErrMsg string `json:"err_msg"`
|
||||
}
|
||||
|
||||
func (d UserCheckRes) HasError() bool {
|
||||
return len(d.ErrMsg) > 0
|
||||
}
|
||||
|
||||
type AdminUserResourceItemRes struct {
|
||||
ID string `json:"-"`
|
||||
ParentID string `json:"-"`
|
||||
Code string `json:"code"`
|
||||
Name string `json:"name"`
|
||||
Level int32 `json:"level"`
|
||||
Target string `json:"target"`
|
||||
Desc string `json:"desc"`
|
||||
Children []*AdminUserResourceItemRes `json:"children,omitempty" gorm:"-"`
|
||||
}
|
||||
15
pkg/res/common_basic.go
Normal file
15
pkg/res/common_basic.go
Normal file
@ -0,0 +1,15 @@
|
||||
package res
|
||||
|
||||
type AttachmentDTO struct {
|
||||
ID string `json:"id"`
|
||||
Filename string `json:"filename"`
|
||||
Url string `json:"url"`
|
||||
ThumbUrl string `json:"thumb_url"`
|
||||
}
|
||||
|
||||
type AttachmentRes struct {
|
||||
ID string `json:"id"`
|
||||
Filename string `json:"filename"`
|
||||
Url string `json:"url"`
|
||||
ThumbUrl string `json:"thumb_url"`
|
||||
}
|
||||
405
pkg/res/match.go
Normal file
405
pkg/res/match.go
Normal file
@ -0,0 +1,405 @@
|
||||
package res
|
||||
|
||||
type BasicInfo struct {
|
||||
AbbrEn string `json:"abbr_en"`
|
||||
AbbrZh string `json:"abbr_zh"`
|
||||
Bonus string `json:"bonus"`
|
||||
CityName string `json:"city_name"`
|
||||
Color string `json:"color"`
|
||||
Cover string `json:"cover"`
|
||||
DispName string `json:"disp_name"`
|
||||
EndTime string `json:"end_time"`
|
||||
Grade string `json:"grade"`
|
||||
GradeLabel string `json:"grade_label"`
|
||||
ID string `json:"id"`
|
||||
Logo string `json:"logo"`
|
||||
Mode string `json:"mode"`
|
||||
SpecialColor string `json:"special_color"`
|
||||
SpecialGradeLabel string `json:"special_grade_label"`
|
||||
StartTime string `json:"start_time"`
|
||||
Status string `json:"status"`
|
||||
}
|
||||
|
||||
type Team struct {
|
||||
Abbr string `json:"abbr"`
|
||||
ID string `json:"id"`
|
||||
Logo string `json:"logo"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
type WinTeam struct {
|
||||
Abbr string `json:"abbr"`
|
||||
ID string `json:"id"`
|
||||
Logo string `json:"logo"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
type MatchItem struct {
|
||||
BasicInfo BasicInfo `json:"basic_info"`
|
||||
IsFollow int64 `json:"is_follow"`
|
||||
PageToken string `json:"page_token"`
|
||||
RecentMatch interface{} `json:"recent_match"`
|
||||
Teams []Team `json:"teams"`
|
||||
WinTeam WinTeam `json:"win_team"`
|
||||
}
|
||||
type Data struct {
|
||||
APIGo bool `json:"api_go"`
|
||||
Items []MatchItem `json:"items"`
|
||||
Stats []string `json:"stats"`
|
||||
}
|
||||
|
||||
type MatchResponse struct {
|
||||
Data Data `json:"data"`
|
||||
Errcode int64 `json:"errcode"`
|
||||
Message interface{} `json:"message"`
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
|
||||
// 详情返回的
|
||||
type MatchDetailData struct {
|
||||
Basic DetailBasic `json:"basic"`
|
||||
CurTeamRank []CurTeamRank `json:"cur_team_rank"`
|
||||
PointType string `json:"point_type"`
|
||||
RelativeTTS []string `json:"relative_tts"`
|
||||
TeamRank []TeamRank `json:"team_rank"`
|
||||
Teams []TeamElement `json:"teams"`
|
||||
}
|
||||
|
||||
type DetailBasic struct {
|
||||
AbbrEn string `json:"abbr_en"`
|
||||
AbbrZh string `json:"abbr_zh"`
|
||||
Bonus string `json:"bonus"`
|
||||
Character string `json:"character"`
|
||||
CityName string `json:"city_name"`
|
||||
EndTime string `json:"end_time"`
|
||||
Grade string `json:"grade"`
|
||||
ID string `json:"id"`
|
||||
Logo string `json:"logo"`
|
||||
NameEn string `json:"name_en"`
|
||||
NameZh string `json:"name_zh"`
|
||||
StartTime string `json:"start_time"`
|
||||
Status string `json:"status"`
|
||||
TtID string `json:"tt_id"`
|
||||
TtNameShow string `json:"tt_name_show"`
|
||||
}
|
||||
|
||||
type CurTeamRank struct {
|
||||
Bonus string `json:"bonus"`
|
||||
CupInfo string `json:"cup_info"`
|
||||
MetalInfo string `json:"metal_info"`
|
||||
Point string `json:"point"`
|
||||
PointType string `json:"point_type"`
|
||||
Promotion string `json:"promotion"`
|
||||
Rank string `json:"rank"`
|
||||
RankDesc string `json:"rank_desc"`
|
||||
Team CurTeamRankTeam `json:"team"`
|
||||
TtName []string `json:"tt_name"`
|
||||
}
|
||||
|
||||
type CurTeamRankTeam struct {
|
||||
Abbr string `json:"abbr"`
|
||||
GlobalBonus string `json:"global_bonus"`
|
||||
GlobalRank string `json:"global_rank"`
|
||||
ID string `json:"id"`
|
||||
Logo string `json:"logo"`
|
||||
Name string `json:"name"`
|
||||
RegionName string `json:"region_name"`
|
||||
}
|
||||
|
||||
type TeamRank struct {
|
||||
Bonus string `json:"bonus"`
|
||||
CupInfo string `json:"cup_info"`
|
||||
MetalInfo string `json:"metal_info"`
|
||||
Point string `json:"point"`
|
||||
PointType string `json:"point_type"`
|
||||
Promotion string `json:"promotion"`
|
||||
Rank string `json:"rank"`
|
||||
RankDesc string `json:"rank_desc"`
|
||||
Team TeamRankTeam `json:"team"`
|
||||
TtName []string `json:"tt_name"`
|
||||
}
|
||||
|
||||
type TeamRankTeam struct {
|
||||
Abbr string `json:"abbr"`
|
||||
GlobalBonus string `json:"global_bonus"`
|
||||
GlobalRank string `json:"global_rank"`
|
||||
ID string `json:"id"`
|
||||
Logo string `json:"logo"`
|
||||
Name string `json:"name"`
|
||||
RegionName string `json:"region_name"`
|
||||
}
|
||||
|
||||
type TeamElement struct {
|
||||
Abbr string `json:"abbr"`
|
||||
CustomText1 string `json:"custom_text1"`
|
||||
CustomText2 string `json:"custom_text2"`
|
||||
GlobalBonus string `json:"global_bonus"`
|
||||
GlobalRank string `json:"global_rank"`
|
||||
ID string `json:"id"`
|
||||
Logo string `json:"logo"`
|
||||
Name string `json:"name"`
|
||||
PromotionFromTt PromotionFromTt `json:"promotion_from_tt"`
|
||||
PromotionRank string `json:"promotion_rank"`
|
||||
RegionName string `json:"region_name"`
|
||||
TtSource string `json:"tt_source"`
|
||||
}
|
||||
|
||||
type PromotionFromTt struct {
|
||||
AbbrEn string `json:"abbr_en"`
|
||||
AbbrZh string `json:"abbr_zh"`
|
||||
Cover string `json:"cover"`
|
||||
ID string `json:"id"`
|
||||
LocalID string `json:"local_id"`
|
||||
Logo string `json:"logo"`
|
||||
NameEn string `json:"name_en"`
|
||||
NameZh string `json:"name_zh"`
|
||||
RelatedType string `json:"related_type"`
|
||||
}
|
||||
|
||||
type MatchDetailResponse struct {
|
||||
Data MatchDetailData `json:"data"`
|
||||
Errcode int64 `json:"errcode"`
|
||||
Message interface{} `json:"message"`
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
|
||||
// 赛程的
|
||||
type MatchBattleResponse struct {
|
||||
Data BattleData `json:"data"`
|
||||
Errcode int64 `json:"errcode"`
|
||||
Message interface{} `json:"message"`
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
|
||||
type BattleData struct {
|
||||
Matches []Match `json:"matches"`
|
||||
StateVer string `json:"state_ver"`
|
||||
StateVerV1 interface{} `json:"state_ver_v1"`
|
||||
TodayMcTotal string `json:"today_mc_total"`
|
||||
}
|
||||
|
||||
type Match struct {
|
||||
LikeData LikeData `json:"like_data"`
|
||||
McInfo McInfo `json:"mc_info"`
|
||||
State State `json:"state"`
|
||||
TtInfo TtInfo `json:"tt_info"`
|
||||
}
|
||||
|
||||
type LikeData struct {
|
||||
IsDislikes bool `json:"is_dislikes"`
|
||||
IsLikes bool `json:"is_likes"`
|
||||
Team1Likes int64 `json:"team1_likes"`
|
||||
Team2Likes int64 `json:"team2_likes"`
|
||||
}
|
||||
|
||||
type McInfo struct {
|
||||
Display string `json:"display"`
|
||||
Format string `json:"format"`
|
||||
GameType string `json:"game_type"`
|
||||
Grade string `json:"grade"`
|
||||
GroupID int64 `json:"group_id"`
|
||||
ID string `json:"id"`
|
||||
PlanTs string `json:"plan_ts"`
|
||||
RoundName string `json:"round_name"`
|
||||
SortNum int64 `json:"sort_num"`
|
||||
Star string `json:"star"`
|
||||
T1Info T1Info `json:"t1_info"`
|
||||
T2Info T2Info `json:"t2_info"`
|
||||
Tags string `json:"tags"`
|
||||
TtStage string `json:"tt_stage"`
|
||||
TtStageDesc string `json:"tt_stage_desc"`
|
||||
UserData UserData `json:"user_data"`
|
||||
}
|
||||
|
||||
type T1Info struct {
|
||||
Bonus string `json:"bonus"`
|
||||
Country string `json:"country"`
|
||||
DispName string `json:"disp_name"`
|
||||
ID string `json:"id"`
|
||||
Logo string `json:"logo"`
|
||||
Rank string `json:"rank"`
|
||||
VRank interface{} `json:"v_rank"`
|
||||
}
|
||||
|
||||
type T2Info struct {
|
||||
Bonus string `json:"bonus"`
|
||||
Country string `json:"country"`
|
||||
DispName string `json:"disp_name"`
|
||||
ID string `json:"id"`
|
||||
Logo string `json:"logo"`
|
||||
Rank string `json:"rank"`
|
||||
VRank interface{} `json:"v_rank"`
|
||||
}
|
||||
|
||||
type UserData struct {
|
||||
SubStatus int64 `json:"sub_status"`
|
||||
}
|
||||
|
||||
type State struct {
|
||||
BoutStates []BoutState `json:"bout_states"`
|
||||
DarkHorse string `json:"dark_horse"`
|
||||
DropAct int64 `json:"drop_act"`
|
||||
HasExpertPlan int64 `json:"has_expert_plan"`
|
||||
HasForecast int64 `json:"has_forecast"`
|
||||
HighlightStatus int64 `json:"highlight_status"`
|
||||
LiveStatus *Status `json:"live_status"`
|
||||
RoundNum string `json:"round_num"`
|
||||
Status string `json:"status"`
|
||||
T1Odds string `json:"t1_odds"`
|
||||
T1OddsPercent string `json:"t1_odds_percent"`
|
||||
T1QuickScore string `json:"t1_quick_score"`
|
||||
T1Score string `json:"t1_score"`
|
||||
T2Odds string `json:"t2_odds"`
|
||||
T2OddsPercent string `json:"t2_odds_percent"`
|
||||
T2QuickScore string `json:"t2_quick_score"`
|
||||
T2Score string `json:"t2_score"`
|
||||
VideoStatus *Status `json:"video_status"`
|
||||
}
|
||||
|
||||
type BoutState struct {
|
||||
BaseTs string `json:"base_ts"`
|
||||
BoutNum string `json:"bout_num"`
|
||||
Display string `json:"display"`
|
||||
EndTs string `json:"end_ts"`
|
||||
FieldConf []string `json:"field_conf"`
|
||||
GameTime string `json:"game_time"`
|
||||
MapName string `json:"map_name"`
|
||||
Now string `json:"now"`
|
||||
Result string `json:"result"`
|
||||
RoundNum string `json:"round_num"`
|
||||
Status string `json:"status"`
|
||||
T1BoutFlags []string `json:"t1_bout_flags"`
|
||||
T1FhRounds string `json:"t1_fh_rounds"`
|
||||
T1Kill string `json:"t1_kill"`
|
||||
T1OtRounds string `json:"t1_ot_rounds"`
|
||||
T1QuickScore string `json:"t1_quick_score"`
|
||||
T1ScRounds string `json:"t1_sc_rounds"`
|
||||
T1Score string `json:"t1_score"`
|
||||
T2BoutFlags []string `json:"t2_bout_flags"`
|
||||
T2FhRounds string `json:"t2_fh_rounds"`
|
||||
T2Kill string `json:"t2_kill"`
|
||||
T2OtRounds string `json:"t2_ot_rounds"`
|
||||
T2QuickScore string `json:"t2_quick_score"`
|
||||
T2ScRounds string `json:"t2_sc_rounds"`
|
||||
T2Score string `json:"t2_score"`
|
||||
}
|
||||
|
||||
type TtInfo struct {
|
||||
AbbrEn string `json:"abbr_en"`
|
||||
AbbrZh string `json:"abbr_zh"`
|
||||
Bonus string `json:"bonus"`
|
||||
CityName string `json:"city_name"`
|
||||
Color string `json:"color"`
|
||||
Cover string `json:"cover"`
|
||||
DispName string `json:"disp_name"`
|
||||
EndTime string `json:"end_time"`
|
||||
Grade string `json:"grade"`
|
||||
GradeLabel string `json:"grade_label"`
|
||||
ID string `json:"id"`
|
||||
Logo string `json:"logo"`
|
||||
Mode string `json:"mode"`
|
||||
SpecialColor string `json:"special_color"`
|
||||
SpecialGradeLabel string `json:"special_grade_label"`
|
||||
StartTime string `json:"start_time"`
|
||||
Status string `json:"status"`
|
||||
}
|
||||
|
||||
type Status struct {
|
||||
Integer *int64
|
||||
String *string
|
||||
}
|
||||
|
||||
// 选手榜
|
||||
type PlayerRankResponse struct {
|
||||
Data PlayerRankData `json:"data"`
|
||||
Errcode int64 `json:"errcode"`
|
||||
Message interface{} `json:"message"`
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
|
||||
type PlayerRankData struct {
|
||||
Items []PlayerItem `json:"items"`
|
||||
TotalPage string `json:"total_page"`
|
||||
TotalRows string `json:"total_rows"`
|
||||
}
|
||||
|
||||
type PlayerItem struct {
|
||||
CountryLogo string `json:"country_logo"`
|
||||
FieldValues FieldValues `json:"field_values"`
|
||||
PlayerID string `json:"player_id"`
|
||||
PlayerName string `json:"player_name"`
|
||||
Portrait string `json:"portrait"`
|
||||
TeamLogo string `json:"team_logo"`
|
||||
}
|
||||
|
||||
type FieldValues struct {
|
||||
Rating string `json:"rating"`
|
||||
}
|
||||
|
||||
// 战队榜
|
||||
type TeamRankResponse struct {
|
||||
Data TeamRankData `json:"data"`
|
||||
Errcode int64 `json:"errcode"`
|
||||
Message interface{} `json:"message"`
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
|
||||
type TeamRankData struct {
|
||||
Items []TeamItem `json:"items"`
|
||||
TotalPage string `json:"total_page"`
|
||||
TotalRows string `json:"total_rows"`
|
||||
}
|
||||
|
||||
type TeamItem struct {
|
||||
CountryLogo string `json:"country_logo"`
|
||||
FieldValues TeamFieldValues `json:"field_values"`
|
||||
TeamID string `json:"team_id"`
|
||||
TeamLogo string `json:"team_logo"`
|
||||
TeamName string `json:"team_name"`
|
||||
}
|
||||
|
||||
type TeamFieldValues struct {
|
||||
AvgAssist string `json:"avg_assist"`
|
||||
AvgDeath string `json:"avg_death"`
|
||||
AvgKill string `json:"avg_kill"`
|
||||
AvgRound string `json:"avg_round"`
|
||||
CTFirstWinRate string `json:"ct_first_win_rate"`
|
||||
CTFirstWinRound string `json:"ct_first_win_round"`
|
||||
CTWinRate string `json:"ct_win_rate"`
|
||||
CTWinRound string `json:"ct_win_round"`
|
||||
FirstDeathNum string `json:"first_death_num"`
|
||||
FirstDeathRate string `json:"first_death_rate"`
|
||||
FirstFiveWinNum string `json:"first_five_win_num"`
|
||||
FirstFiveWinRate string `json:"first_five_win_rate"`
|
||||
FirstKill string `json:"first_kill"`
|
||||
FirstKillRate string `json:"first_kill_rate"`
|
||||
FirstTenWinNum string `json:"first_ten_win_num"`
|
||||
FirstTenWinRate string `json:"first_ten_win_rate"`
|
||||
GamePlayed string `json:"game_played"`
|
||||
GlobalBonus string `json:"global_bonus"`
|
||||
GlobalRank string `json:"global_rank"`
|
||||
Kd string `json:"kd"`
|
||||
KdDiff string `json:"kd_diff"`
|
||||
KdRate string `json:"kd_rate"`
|
||||
MapNum string `json:"map_num"`
|
||||
MapWinLoss string `json:"map_win_loss"`
|
||||
MapWinRate string `json:"map_win_rate"`
|
||||
Point string `json:"point"`
|
||||
Rank string `json:"rank"`
|
||||
RankChange string `json:"rank_change"`
|
||||
RankDiff string `json:"rank_diff"`
|
||||
Rating string `json:"rating"`
|
||||
RegionName string `json:"region_name"`
|
||||
Score string `json:"score"`
|
||||
TFirstWinRate string `json:"t_first_win_rate"`
|
||||
TFirstWinRound string `json:"t_first_win_round"`
|
||||
TWinRate string `json:"t_win_rate"`
|
||||
TWinRound string `json:"t_win_round"`
|
||||
TotalAssist string `json:"total_assist"`
|
||||
TotalDeath string `json:"total_death"`
|
||||
TotalKill string `json:"total_kill"`
|
||||
TotalRound string `json:"total_round"`
|
||||
ValvePoint string `json:"valve_point"`
|
||||
ValveRank string `json:"valve_rank"`
|
||||
WinRate string `json:"win_rate"`
|
||||
}
|
||||
Reference in New Issue
Block a user