first commit

This commit is contained in:
2026-09-11 01:41:52 +08:00
commit 9f22e6ccae
263 changed files with 28935 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
package dto
// AdRewardGrantRequest 广告激励额度发放请求。
// RewardType 取值:cos / ai / outfit_share / closet_share,映射到额度类型。
// 发放金额由服务端配置固定,前端不传金额,杜绝刷额度。
type AdRewardGrantRequest struct {
RewardType string `json:"reward_type" binding:"required"` // 激励类型
RefID string `json:"ref_id" binding:"required"` // 广告记录ID(幂等键)
}
// AdRewardGrantResponse 广告激励额度发放响应。
type AdRewardGrantResponse struct {
RefID string `json:"ref_id"` // 广告记录ID
QuotaType int8 `json:"quota_type"` // 额度类型 1=cos 2=AI 3=社区分享 4=衣柜分享
Amount int64 `json:"amount"` // 发放数量
}
+28
View File
@@ -0,0 +1,28 @@
package dto
// 发起AI推荐
type AIRecommendCreateRequest struct {
SceneType int8 `json:"scene_type" binding:"required,oneof=1 2"` // 场景类型 1=每日推荐 2=个性化场景
Scene string `json:"scene"` // 用户自定义场景描述
}
// AI推荐结果
type AIRecommendCreateResponse struct {
OutfitUUID string `json:"outfit_uuid"` // 穿搭UUID
OutfitName string `json:"outfit_name"` // 穿搭名称
OutfitDesc string `json:"outfit_desc"` // 穿搭描述
Scene string `json:"scene"` // 适合场景
Source int8 `json:"source"` // 来源 1=用户创建 2=AI推荐
Status int8 `json:"status"` // 状态 1=正常 2=封禁 3=待用户保存
OutfitItem []OutfitItem `json:"outfit_item"`
}
// AI推荐穿搭的衣物UUID
type OutfitItem struct {
ClothesUUID string `json:"clothes_uuid"` // 衣物UUID
}
// 保存AI推荐穿搭到我的搭配
type AIRecommendSaveRequest struct {
OutfitUUID string `json:"outfit_uuid" binding:"required"` // 穿搭UUID
}
+52
View File
@@ -0,0 +1,52 @@
package dto
// ClosetShareCreateRequest 创建衣柜分享
type ClosetShareCreateRequest struct {
ShareType int8 `json:"share_type" binding:"required,oneof=1 2"` // 1=部分衣物分享 2=全量快照分享
ClothesUUIDs []string `json:"clothes_uuids"` // 部分分享时必填(service校验)
ExpireTime int64 `json:"expire_time"` // 过期时间
}
// ClosetShareCreateResponse 创建分享响应
type ClosetShareCreateResponse struct {
ShareUUID string `json:"share_uuid"`
}
// ClosetShareDetailResponse 分享详情(访客视角)
type ClosetShareDetailResponse struct {
ShareUUID string `json:"share_uuid"`
OwnerName string `json:"owner_name"`
OwnerAvatar string `json:"owner_avatar"`
Clothes []ClothesGetByUUIDResponse `json:"clothes"`
ExpireTime int64 `json:"expire_time"`
Status int8 `json:"status"` // 1=正常 2=已取消 3=已过期 4=已封禁
IsOwner bool `json:"is_owner"`
}
// ClosetShareItemResponse 分享列表项
type ClosetShareItemResponse struct {
ShareUUID string `json:"share_uuid"` // 分享UUID
ShareType int8 `json:"share_type"` // 分享类型 1=部分衣物分享 2=全量快照分享
ClothesCount int `json:"clothes_count"` // 衣物数量
ExpireTime int64 `json:"expire_time"` // 过期时间
Status int8 `json:"status"` // 1=正常 2=已取消 3=已过期 4=已封禁
OwnerName string `json:"owner_name"` // 分享者昵称("分享给我的"列表返回)
OwnerAvatar string `json:"owner_avatar"` // 分享者头像("分享给我的"列表返回)
}
// ShareListRequest 我的分享列表
type ClosetShareListRequest struct {
PageRequest
Status int8 `form:"status" json:"status"` // 状态 1=正常 2=已取消 3=已过期 4=已封禁
}
// ShareListResponse 我的分享列表
type ShareListResponse struct {
PageResponse
List []ClosetShareItemResponse `json:"list"`
}
// ClosetShareCancelRequest 取消分享
type ClosetShareCancelRequest struct {
ShareUUID string `json:"share_uuid" binding:"required"`
}
+91
View File
@@ -0,0 +1,91 @@
package dto
// ClothesUploadRequest 上传衣物图片
type ClothesUploadRequest struct{}
// ClothesUploadResponse 上传衣物图片响应
type ClothesUploadResponse struct {
ClothesUUID string `json:"clothes_uuid"` // 衣物UUID
ImageProcessStatus int8 `json:"image_process_status"` // 1=抠图中 2=分类中 3=排队中 4=成功 5=失败
}
type ClothesProcessStatusGetByUUIDRequest struct {
ClothesUUID string `json:"clothes_uuid" binding:"required"`
}
type ClothesProcessStatusGetByUUIDResponse struct {
ImageProcessStatus int8 `json:"image_process_status"` // 1=抠图中 2=分类中 3=排队中 4=成功 5=失败
FailReason string `json:"fail_reason"`
}
// ClothesDeleteByUUIDRequest 删除衣物
type ClothesDeleteByUUIDRequest struct {
ClothesUUID string `json:"clothes_uuid" binding:"required"`
}
// ClothesDeleteResponse 删除衣物响应
type ClothesDeleteByUUIDResponse struct{}
// ClothesUpdateByUUIDRequest 修改衣物
type ClothesUpdateByUUIDRequest struct {
ClothesUUID string `json:"clothes_uuid" binding:"required"`
CategoryMain string `json:"category_main" binding:"max=64"` // 衣物大类 上装/下装/连衣裙/外套/鞋/配饰
CategorySub string `json:"category_sub" binding:"max=64"` // 衣物小类 T恤/牛仔裤/运动鞋/发带/戒指等
Style string `json:"style" binding:"max=64"` // 风格
ColorMain string `json:"color" binding:"max=64"` // 主颜色
ColorSub string `json:"color_sub" binding:"max=64"` // 副颜色
Thickness string `json:"thickness" binding:"max=64"` // 厚度
Version string `json:"version" binding:"max=64"` // 版型 宽松/修身/阔腿/紧身/常规合身
Material string `json:"material" binding:"max=64"` // 材质 牛仔布/针织/皮质/纯棉/羊毛等
Pattern string `json:"pattern" binding:"max=64"` // 花纹
SleeveType string `json:"sleeve_type" binding:"max=64"` // 袖型
ClothesType string `json:"clothes_type" binding:"max=64"` // 衣长类型 短款/常规/中长/长款
NecklineType string `json:"neckline_type" binding:"max=64"` // 领型
Formality string `json:"formality" binding:"max=16"` // 正式程度 1-5
Occasions string `json:"occasions" binding:"max=255"` // 适用场合
VisualImpact string `json:"visual_impact" binding:"max=16"` // 视觉冲击力 1-5
Name string `json:"name" binding:"max=64"` // 名称
Remark string `json:"remark" binding:"max=500"` // 备注
}
type ClothesUpdateByUUIDResponse struct{}
type ClothesGetByUUIDRequest struct {
ClothesUUID string `json:"clothes_uuid" binding:"required"` // 衣物UUID
}
// ClothesGetByUUIDResponse 衣物信息
type ClothesGetByUUIDResponse struct {
ClothesUUID string `json:"clothes_uuid"`
CategoryMain string `json:"category_main"`
CategorySub string `json:"category_sub"`
Style string `json:"style"`
ColorMain string `json:"color_main"`
ColorSub string `json:"color_sub"`
Thickness string `json:"thickness"`
Version string `json:"version"`
Material string `json:"material"`
Pattern string `json:"pattern"`
SleeveType string `json:"sleeve_type"`
ClothesType string `json:"clothes_type"`
NecklineType string `json:"neckline_type"`
Formality string `json:"formality"`
Occasions string `json:"occasions"`
VisualImpact string `json:"visual_impact"`
Name string `json:"name"`
Remark string `json:"remark"`
ProcessedImage string `json:"processed_image"`
}
// ClothesListRequest 衣物列表
type ClothesListRequest struct {
PageRequest
CategoryMain string `form:"category_main"` // 按大类筛选
CategorySub string `form:"category_sub"`
}
// ClothesListResponse 衣物列表
type ClothesListResponse struct {
PageResponse
List []ClothesGetByUUIDResponse `json:"list"`
}
+29
View File
@@ -0,0 +1,29 @@
package dto
// 收藏/取消收藏
type CollectRequest struct {
TargetUUID string `json:"target_uuid" binding:"required"`
Action int8 `json:"action" binding:"required,oneof=1 2"` // 1=收藏 2=取消
}
type CollectResponse struct{}
type CollectListRequest struct {
PageRequest
}
type CollectListResponse struct {
PageResponse
List []OutfitGetByUUIDResponse `json:"list"`
}
// CollectGetByTargetRequest 查询穿搭收藏状态
type CollectGetByTargetRequest struct {
TargetUUID string `json:"target_uuid" binding:"required"` // 穿搭UUID
}
// CollectGetByTargetResponse 查询穿搭收藏状态
type CollectGetByTargetResponse struct {
UserIsCollected bool `json:"is_collected"` // 是否已收藏
CollectCount int64 `json:"collect_count"` // 收藏数
}
+14
View File
@@ -0,0 +1,14 @@
package dto
// PageRequest 分页请求参数(GET query,嵌入各列表请求)
type PageRequest struct {
Page int `form:"page" binding:"omitempty,min=1"`
PageSize int `form:"page_size" binding:"omitempty,min=1,max=50"`
}
// PageResponse 分页响应(嵌入各列表响应)
type PageResponse struct {
Total int64 `json:"total"`
Page int `json:"page"`
PageSize int `json:"page_size"`
}
+34
View File
@@ -0,0 +1,34 @@
package dto
type GoodsGetByCodeRequest struct {
GoodsCode string `json:"goods_code" binding:"required"`
}
// GoodsGetByCodeResponse 商品信息
type GoodsGetByCodeResponse struct {
ID int64 `json:"id"`
GoodsCode string `json:"goods_code"`
GoodsName string `json:"goods_name"`
GoodsType int8 `json:"goods_type"` // 1=会员包 2=上传包
Price int64 `json:"price"` // 原价(分)
DiscountPrice int64 `json:"discount_price"` // 售价(分)
MemberDays int64 `json:"member_days"`
UploadQuota int64 `json:"upload_quota"`
AIRecommendQuota int64 `json:"ai_recommend_quota"`
ClosetShareQuota int64 `json:"closet_share_quota"`
OutfitShareQuota int64 `json:"outfit_share_quota"`
ValidDays int64 `json:"valid_days"` // 赠送额度有效期天数(加量包;会员包为 0 表示跟随 VIP)
Description string `json:"description"`
}
// GoodsListRequest 商品信息
type GoodsListRequest struct {
PageRequest
GoodsType int8 `form:"goods_type" json:"goods_type"` // 1=会员包 2=上传包 3=AI推荐包 4=衣柜分享包 5=搭配分享包
}
// GoodsListResponse 商品列表
type GoodsListResponse struct {
PageResponse
List []GoodsGetByCodeResponse `json:"list"`
}
+16
View File
@@ -0,0 +1,16 @@
package dto
type HoroscopeRequest struct{}
// HoroscopeResponse 今日运势
type HoroscopeResponse struct {
StatDate int64 `json:"stat_date"` // YYYYMMDD
Zodiac string `json:"zodiac"` // 星座
OverallScore int8 `json:"overall_score"` // 1-5分
LoveScore int8 `json:"love_score"` // 1-5分
CareerScore int8 `json:"career_score"` // 1-5分
WealthScore int8 `json:"wealth_score"` // 1-5分
DailyText string `json:"daily_text"` // 今日运势
LuckyColor string `json:"lucky_color"` // 今日幸运色
LuckyNumber string `json:"lucky_number"` // 今日幸运数字
}
+21
View File
@@ -0,0 +1,21 @@
package dto
// LikeCreateRequest 点赞/取消点赞
type LikeCreateRequest struct {
TargetUUID string `json:"target_uuid" binding:"required"` // 穿搭UUID
Action int8 `json:"action" binding:"required,oneof=1 2"` // 1=点赞 2=取消
}
// LikeResponse 点赞/取消点赞响应
type LikeResponse struct{}
// LikeGetByTargetIDRequest 获取穿搭的点赞数
type LikeGetByTargetIDRequest struct {
TargetUUID string `json:"target_uuid" binding:"required"` // 穿搭UUID
}
// LikeGetByTargetIDResponse 获取穿搭的点赞数
type LikeGetByTargetIDResponse struct {
UserIsLiked bool `json:"is_liked"` // 是否已点赞
LikeCount int64 `json:"like_count"` // 点赞数
}
+39
View File
@@ -0,0 +1,39 @@
package dto
// NotificationListRequest 通知列表
type NotificationListRequest struct {
PageRequest
IsRead int8 `form:"is_read" binding:"omitempty,oneof=1 2"` // 1=未读 2=已读,不传=全部
MsgType int8 `form:"msg_type" binding:"omitempty,oneof=1 2 3"` // 1=点赞 2=订单 3=系统,不传=全部
}
// NotificationGetByUUIDRequest 获取通知详情
type NotificationGetByUUIDRequest struct {
NotificationUUID string `json:"notification_uuid" binding:"required"`
}
// NotificationGetByUUIDResponse 通知项
type NotificationGetByUUIDResponse struct {
NotificationUUID string `json:"notification_uuid"` // 消息UUID
MsgType int8 `json:"msg_type"` // 1=点赞通知 2=订单通知 3=系统通知
Title string `json:"title"`
Content string `json:"content"`
IsRead int8 `json:"is_read"` // 1=未读 2=已读
CreatedAt int64 `json:"created_at"`
}
// NotificationListResponse 通知列表
type NotificationListResponse struct {
PageResponse
List []NotificationGetByUUIDResponse `json:"list"`
}
// NotificationReadRequest 标记已读
type NotificationReadRequest struct {
NotificationUUID string `json:"notification_uuid" binding:"required"`
}
// NotificationUnreadResponse 未读数
type NotificationUnreadResponse struct {
UnreadCount int64 `json:"unread_count"`
}
+86
View File
@@ -0,0 +1,86 @@
package dto
// OrderCreateRequest 创建订单
type OrderCreateRequest struct {
GoodsCode string `json:"goods_code" binding:"required"`
}
// OrderCreateResponse 创建订单响应
type OrderCreateResponse struct {
OrderNo string `json:"order_no"`
PayAmount int64 `json:"pay_amount"` // 应付(分)
ExpireTime int64 `json:"expire_time"` // 支付截止(秒),前端倒计时
PayParams *WechatPayParams `json:"pay_params"` // 小程序拉起支付参数
}
// WechatPayParams 微信小程序支付参数
type WechatPayParams struct {
TimeStamp string `json:"timeStamp"`
NonceStr string `json:"nonceStr"`
Package string `json:"package"`
SignType string `json:"signType"`
PaySign string `json:"paySign"`
}
// VirtualOrderCreateRequest 创建虚拟支付订单(小程序虚拟支付,覆盖 iOS/Android 全终端)
type VirtualOrderCreateRequest struct {
GoodsCode string `json:"goods_code" binding:"required"` // 商品编码
Platform string `json:"platform" binding:"required,oneof=android ios harmony windows"` // 支付平台(前端按 systemInfo.platform 上报)
}
// VirtualOrderCreateResponse 虚拟支付订单响应(前端据此调 wx.requestVirtualPayment)
type VirtualOrderCreateResponse struct {
OrderNo string `json:"order_no"` // 业务订单号(作为 outTradeNo)
PayAmount int64 `json:"pay_amount"` // 实付金额(分)
ExpireTime int64 `json:"expire_time"` // 支付截止(秒),前端倒计时
SignData string `json:"sign_data"` // 参与签名的 JSON 字符串(原样传给前端)
PaySig string `json:"pay_sig"` // 支付签名
Signature string `json:"signature"` // 用户态签名
}
// OrderResponse 订单信息
type OrderResponse struct {
OrderNo string `json:"order_no"`
GoodsName string `json:"goods_name"`
UnitPrice int64 `json:"unit_price"` // 单价(分)
PayAmount int64 `json:"pay_amount"` // 实付(分)
PayChannel int8 `json:"pay_channel"` // 支付渠道 1=微信支付 2=虚拟支付
OrderStatus int8 `json:"order_status"` // 1=待支付 2=已支付 3=已取消 4=已过期 5=已退款
MemberDays int64 `json:"member_days"`
ExpireTime int64 `json:"expire_time"`
PayTime int64 `json:"pay_time"`
RefundTime int64 `json:"refund_time"`
RefundAmount int64 `json:"refund_amount"`
CreatedAt int64 `json:"created_at"`
}
// OrderListRequest 订单列表
type OrderListRequest struct {
PageRequest
Status int8 `form:"status" binding:"omitempty,oneof=1 2 3 4 5"`
}
// OrderListResponse 订单列表
type OrderListResponse struct {
PageResponse
List []OrderResponse `json:"list"`
}
// OrderCancelRequest 取消订单
type OrderCancelRequest struct {
OrderNo string `json:"order_no" binding:"required"`
}
// RefundApplyRequest 申请退款
type RefundApplyRequest struct {
OrderNo string `json:"order_no" binding:"required"`
Reason string `json:"reason" binding:"required,max=200"`
}
// RefundResponse 退款信息
type RefundResponse struct {
RefundNo string `json:"refund_no"`
RefundAmount int64 `json:"refund_amount"`
Status int8 `json:"status"` // 0=待处理 1=退款中 2=成功 3=失败
ApplyTime int64 `json:"apply_time"`
}
+83
View File
@@ -0,0 +1,83 @@
package dto
// OutfitCreateRequest 创建穿搭
type OutfitCreateRequest struct {
OutfitName string `json:"outfit_name" binding:"required,max=32"` // 穿搭名称
OutfitDesc string `json:"outfit_desc" binding:"max=500"` // 穿搭描述
Scene string `json:"scene" binding:"max=100"` // 适合场景
Source int8 `json:"source" binding:"oneof=1 2"` // 1=用户创建 2=AI推荐
Items []OutfitItemRequest `json:"items" binding:"required,min=1,max=10"`
}
// OutfitItemRequest 穿搭中的衣物
type OutfitItemRequest struct {
ClothesUUID string `json:"clothes_uuid" binding:"required"`
}
// OutfitCreateResponse 创建穿搭响应
type OutfitCreateResponse struct {
OutfitUUID string `json:"outfit_uuid"`
OutfitName string `json:"outfit_name"`
OutfitDesc string `json:"outfit_desc"`
Scene string `json:"scene"`
Source int8 `json:"source"` // 1=用户创建 2=AI推荐
IsPublic int8 `json:"is_public"` // 1=不公开 2=公开
AuditStatus int8 `json:"audit_status"` // 1=待审核 2=通过 3=不通过
Items []OutfitItemResponse `json:"items"`
}
// OutfitItemResponse 穿搭明细
type OutfitItemResponse struct {
ClothesUUID string `json:"clothes_uuid"`
ProcessedImage string `json:"processed_image"` // 处理后图片可访问 URL(无则空)
}
// OutfitGetByUUIDRequest 获取穿搭详情
type OutfitGetByUUIDRequest struct {
OutfitUUID string `json:"outfit_uuid" binding:"required"` // 穿搭UUID
}
// OutfitGetByUUIDResponse 获取穿搭详情响应
type OutfitGetByUUIDResponse struct {
OutfitCreateResponse
}
// OutfitUpdateByUUIDRequest 修改穿搭
type OutfitUpdateByUUIDRequest struct {
OutfitUUID string `json:"outfit_uuid" binding:"required"` // 穿搭UUID
OutfitName string `json:"outfit_name" binding:"required,max=32"` // 穿搭名称
OutfitDesc string `json:"outfit_desc" binding:"max=500"` // 穿搭描述
Scene string `json:"scene" binding:"max=100"` // 适合场景
Items []OutfitItemRequest `json:"items" binding:"required,min=1,max=10"` // 穿搭中的衣物
}
// OutfitUpdateByUUIDResponse 修改穿搭响应
type OutfitUpdateByUUIDResponse struct{}
// OutfitListRequest 获取我的穿搭列表
type OutfitListRequest struct {
PageRequest
IsPublic int8 `form:"is_public" json:"is_public"` // 1=不公开 2=公开
Source int8 `form:"source" json:"source"` // 1=用户创建 2=AI推荐
}
// OutfitListResponse 我的穿搭列表响应
type OutfitListResponse struct {
PageResponse
List []OutfitCreateResponse `json:"list"`
}
// OutfitDeleteRequest 删除穿搭
type OutfitDeleteRequest struct {
OutfitUUID string `json:"outfit_uuid" binding:"required"`
}
// OutfitDeleteResponse 删除穿搭响应
type OutfitDeleteResponse struct{}
type OutfitPublicRequest struct {
OutfitUUID string `json:"outfit_uuid" binding:"required"` // 穿搭UUID
IsPublic int8 `json:"is_public" binding:"required,oneof=1 2"` // 1=不公开 2=公开
}
type OutfitPublicResponse struct{}
+44
View File
@@ -0,0 +1,44 @@
package dto
// QuotaInfoGetBySelfRequest 我的额度
type QuotaInfoGetBySelfRequest struct{}
// QuotaInfoGetBySelfResponse 我的额度
type QuotaInfoGetBySelfResponse struct {
Quotas []QuotaItemResponse `json:"quotas"`
}
// QuotaItemResponse 单项额度。
// Cos(quota_type=1):Total=永久总额度、Used=永久累计已用、Remain=永久剩余;
// AI/社区/衣柜(2/3/4):Total=每日总额度、Used=当日已用、Remain=当日剩余(次日 0 点重置)。
type QuotaItemResponse struct {
QuotaType int8 `json:"quota_type"` // 1=cos上传 2=AI 3=社区分享 4=衣柜分享
Total int64 `json:"total"` // 总额度(Cos 永久 / 每日额度)
Used int64 `json:"used"` // 已用(Cos 永久累计 / 当日已用)
Remain int64 `json:"remain"` // 剩余
}
// QuotaFlowListRequest 额度流水查询
type QuotaFlowListRequest struct {
PageRequest
QuotaType int8 `form:"quota_type" binding:"omitempty,oneof=1 2 3 4"` // 不传=全部
}
// QuotaFlowItemResponse 额度流水明细
type QuotaFlowItemResponse struct {
QuotaFlowUUID string `json:"quota_flow_uuid"` // 配额流水UUID
QuotaType int8 `json:"quota_type"` // 1=cos上传 2=AI 3=社区分享 4=衣柜分享
ChangeTarget int8 `json:"change_target"` // 1=配额调整 2=使用
ChangeType int8 `json:"change_type"` // 1=购买获赠 2=活动赠送 3=上传消耗 4=删除回退 5=人工调整
ChangeNum int64 `json:"change_num"` // 变更数量(正增负减)
NewValue int64 `json:"new_value"` // 变更后数值
Reason string `json:"reason"` // 变更原因/备注
OrderNo string `json:"order_no"` // 关联订单号(购买类)
CreatedAt int64 `json:"created_at"`
}
// QuotaFlowListResponse 额度流水列表
type QuotaFlowListResponse struct {
PageResponse
List []QuotaFlowItemResponse `json:"list"`
}
+68
View File
@@ -0,0 +1,68 @@
package dto
// UserWxLoginRequest 微信登录请求
type UserWxLoginRequest struct {
Code string `json:"code" binding:"required"` // 微信登录code
}
// UserWxLoginResponse 登录响应
type UserWxLoginResponse struct {
AccessToken string `json:"access_token"`
RefreshToken string `json:"refresh_token"`
ExpireTime int64 `json:"expire_time"` // access_token过期时间(秒)
UserInfo UserInfoGetBySelfResponse `json:"user_info"`
}
type UserInfoGetBySelfRequest struct{}
// UserInfoGetBySelfResponse 用户信息
type UserInfoGetBySelfResponse struct {
Username string `json:"username"`
Avatar string `json:"avatar"`
Sex int8 `json:"sex"` // 1=男 2=女
BirthDay int64 `json:"birth_day"` // 生日
Phone string `json:"phone"` // 手机号
IsNewUser bool `json:"is_new_user"` // 是否本次新注册用户
Status int8 `json:"status"` // 状态 1=正常 2=临时禁用 3=永久禁用 4=已注销
BanReason string `json:"ban_reason"` // 封禁原因
BanStart int64 `json:"ban_start"` // 封禁开始时间
BanExpire int64 `json:"ban_expire"` // 封禁到期时间
VIPType int8 `json:"vip_type"` // VIP类型 1=非会员 2=月度会员 3=年度会员 4=体验会员
VIPExpire int64 `json:"vip_expire"` // VIP到期时间
}
// UserProfileUpdateBySelfRequest 修改用户资料
type UserProfileUpdateBySelfRequest struct {
Username string `json:"username" binding:"max=32"` // 昵称
Avatar string `json:"avatar" binding:"max=500"` // 头像地址
Sex int8 `json:"sex" binding:"omitempty,oneof=0 1 2"` // 0=未知 1=男 2=女
BirthDay int64 `json:"birth_day"` // 生日
}
// UserProfileUpdateBySelfResponse 修改用户资料响应
type UserProfileUpdateBySelfResponse struct{}
// UserAvatarUploadRequest 上传头像(multipart,字段名 file)
type UserAvatarUploadRequest struct{}
// UserAvatarUploadResponse 上传头像响应
type UserAvatarUploadResponse struct {
Avatar string `json:"avatar"` // 头像可访问 URL
}
// UserRefreshTokenRequest 刷新用户token请求
type UserRefreshTokenRequest struct {
RefreshToken string `json:"refresh_token" binding:"required"`
// AccessToken 必填:旧 access token,用于刷新时立即吊销旧 access + 旧 refresh。
// 会话以 token 字符串为 key 存在 Redis 中,缺少旧 access token 无法精确删除其会话 key,
// 旧 token 会在 TTL 内继续可用;为空时返回 10000 + details:["缺少旧 access token"]。
// 注意:允许传入已过期的旧 access token(此时会话已随 TTL 消失,仅吊销旧 refresh 与集合条目)。
AccessToken string `json:"access_token"`
}
// UserRefreshTokenResponse 刷新用户token响应
type UserRefreshTokenResponse struct {
AccessToken string `json:"access_token"`
RefreshToken string `json:"refresh_token"`
ExpireTime int64 `json:"expire_time"` // access_token过期时间(秒)
}