Files
junhong_cmp_fiber/internal/model/dto/client_auth_dto.go
huang 2ef8b8a705
Some checks failed
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Has been cancelled
fix: 修复分页字段/角色DTO/套餐详情/批量分配Bug,新增C端测试登录接口和Hurl价格验证测试
- 修复B-2:27个分页DTO字段名统一(list→items, page_size→size,删除total_pages)
- 修复B-1:角色接口统一返回DTO(id小写,消除GORM大写字段名)
- 修复C-1:套餐详情接口(GET /packages/:id)补充代理佣金字段
- 修复C-2:批量分配已存在记录由500改为静默跳过
- 修复C-3:创建系列授权响应在事务提交后构建,packages数组不再为空
- 新增C端开发测试登录接口(POST /api/c/v1/auth/dev-login,仅logging.development=true时生效)
- 新增Hurl测试:card-price-verification-flow.hurl(导入卡→分配→C端价格验证)
- 新增测试Excel数据文件和dev.env测试变量
2026-03-31 09:54:08 +08:00

121 lines
5.2 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 dto
// ========================================
// A1 资产验证
// ========================================
// VerifyAssetRequest A1 资产验证请求
type VerifyAssetRequest struct {
Identifier string `json:"identifier" validate:"required,min=1,max=50" required:"true" minLength:"1" maxLength:"50" description:"资产标识符SN/IMEI/虚拟号/ICCID/MSISDN"`
}
// VerifyAssetResponse A1 资产验证响应
type VerifyAssetResponse struct {
AssetToken string `json:"asset_token" description:"资产令牌5分钟有效"`
ExpiresIn int `json:"expires_in" description:"过期时间(秒)"`
}
// ========================================
// A2 公众号登录
// ========================================
// WechatLoginRequest A2 公众号登录请求
type WechatLoginRequest struct {
Code string `json:"code" validate:"required" required:"true" description:"微信OAuth授权码"`
AssetToken string `json:"asset_token" validate:"required" required:"true" description:"A1返回的资产令牌"`
}
// WechatLoginResponse A2/A3 登录统一响应
type WechatLoginResponse struct {
Token string `json:"token" description:"登录JWT令牌"`
NeedBindPhone bool `json:"need_bind_phone" description:"是否需要绑定手机号"`
IsNewUser bool `json:"is_new_user" description:"是否新创建用户"`
}
// ========================================
// A3 小程序登录
// ========================================
// MiniappLoginRequest A3 小程序登录请求
type MiniappLoginRequest struct {
Code string `json:"code" validate:"required" required:"true" description:"小程序登录凭证"`
AssetToken string `json:"asset_token" validate:"required" required:"true" description:"A1返回的资产令牌"`
Nickname string `json:"nickname" description:"用户昵称(前端授权后传入)"`
AvatarURL string `json:"avatar_url" description:"用户头像URL前端授权后传入"`
}
// ========================================
// A4 发送验证码
// ========================================
// ClientSendCodeRequest A4 发送验证码请求
type ClientSendCodeRequest struct {
Phone string `json:"phone" validate:"required,len=11" required:"true" minLength:"11" maxLength:"11" description:"手机号"`
Scene string `json:"scene" validate:"required,oneof=bind_phone change_phone_old change_phone_new" required:"true" description:"业务场景 (bind_phone:绑定手机号, change_phone_old:换绑旧手机, change_phone_new:换绑新手机)"`
}
// ClientSendCodeResponse A4 发送验证码响应
type ClientSendCodeResponse struct {
CooldownSeconds int `json:"cooldown_seconds" description:"冷却秒数"`
}
// ========================================
// A5 绑定手机号
// ========================================
// BindPhoneRequest A5 绑定手机号请求
type BindPhoneRequest struct {
Phone string `json:"phone" validate:"required,len=11" required:"true" minLength:"11" maxLength:"11" description:"手机号"`
Code string `json:"code" validate:"required,len=6" required:"true" minLength:"6" maxLength:"6" description:"验证码"`
}
// BindPhoneResponse A5 绑定手机号响应
type BindPhoneResponse struct {
Phone string `json:"phone" description:"已绑定手机号"`
BoundAt string `json:"bound_at" description:"绑定时间"`
}
// ========================================
// A6 换绑手机号
// ========================================
// ChangePhoneRequest A6 换绑手机号请求
type ChangePhoneRequest struct {
OldPhone string `json:"old_phone" validate:"required,len=11" required:"true" minLength:"11" maxLength:"11" description:"旧手机号"`
OldCode string `json:"old_code" validate:"required,len=6" required:"true" minLength:"6" maxLength:"6" description:"旧手机号验证码"`
NewPhone string `json:"new_phone" validate:"required,len=11" required:"true" minLength:"11" maxLength:"11" description:"新手机号"`
NewCode string `json:"new_code" validate:"required,len=6" required:"true" minLength:"6" maxLength:"6" description:"新手机号验证码"`
}
// ChangePhoneResponse A6 换绑手机号响应
type ChangePhoneResponse struct {
Phone string `json:"phone" description:"换绑后手机号"`
ChangedAt string `json:"changed_at" description:"换绑时间"`
}
// ========================================
// A7 退出登录
// ========================================
// LogoutResponse A7 退出登录响应
type LogoutResponse struct {
Success bool `json:"success" description:"是否成功"`
}
// ========================================
// DevLogin 开发环境测试登录(仅开发模式可用)
// ========================================
// DevLoginRequest 开发环境测试登录请求
// ⚠️ 仅限 logging.development=true 时生效,严禁在生产环境暴露
type DevLoginRequest struct {
Identifier string `json:"identifier" validate:"required,min=1,max=50" required:"true" minLength:"1" maxLength:"50" description:"资产标识符ICCID/虚拟号等)"`
}
// DevLoginResponse 开发环境测试登录响应
type DevLoginResponse struct {
Token string `json:"token" description:"JWT 令牌"`
CustomerID uint `json:"customer_id" description:"客户ID"`
IsNewUser bool `json:"is_new_user" description:"是否新创建的测试客户"`
}