f
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
package commands
|
||||
|
||||
// SubPortalRegisterCommand 子站注册(邀请码必填)
|
||||
type SubPortalRegisterCommand struct {
|
||||
Phone string `json:"phone" binding:"required"`
|
||||
Password string `json:"password" binding:"required"`
|
||||
ConfirmPassword string `json:"confirm_password" binding:"required"`
|
||||
Code string `json:"code" binding:"required"`
|
||||
InviteToken string `json:"invite_token" binding:"required"`
|
||||
}
|
||||
|
||||
// CreateInvitationCommand 主账号创建邀请
|
||||
type CreateInvitationCommand struct {
|
||||
ParentUserID string
|
||||
// ExpiresInHours 可选,0 用默认 168 小时
|
||||
ExpiresInHours int `json:"expires_in_hours"`
|
||||
}
|
||||
|
||||
// AllocateToChildCommand 主账号向下属划余额
|
||||
type AllocateToChildCommand struct {
|
||||
ParentUserID string
|
||||
ChildUserID string `json:"child_user_id" binding:"required"`
|
||||
Amount string `json:"amount" binding:"required"`
|
||||
VerifyCode string `json:"verify_code" binding:"required,len=6"`
|
||||
}
|
||||
|
||||
// AssignChildSubscriptionCommand 为下属代配订阅
|
||||
type AssignChildSubscriptionCommand struct {
|
||||
ParentUserID string
|
||||
ChildUserID string `json:"child_user_id" binding:"required"`
|
||||
ProductID string `json:"product_id" binding:"required"`
|
||||
Price string `json:"price" binding:"required"`
|
||||
UIComponentPrice string `json:"ui_component_price"`
|
||||
}
|
||||
|
||||
// ListChildAllocationsCommand 下属划拨记录查询
|
||||
type ListChildAllocationsCommand struct {
|
||||
ParentUserID string
|
||||
ChildUserID string `json:"child_user_id" form:"child_user_id" binding:"required"`
|
||||
Page int `json:"page" form:"page"`
|
||||
PageSize int `json:"page_size" form:"page_size"`
|
||||
}
|
||||
|
||||
// ListChildSubscriptionsCommand 下属订阅列表查询
|
||||
type ListChildSubscriptionsCommand struct {
|
||||
ParentUserID string
|
||||
ChildUserID string `json:"child_user_id" form:"child_user_id" binding:"required"`
|
||||
}
|
||||
|
||||
// RemoveChildSubscriptionCommand 删除下属订阅
|
||||
type RemoveChildSubscriptionCommand struct {
|
||||
ParentUserID string
|
||||
ChildUserID string `json:"child_user_id" binding:"required"`
|
||||
SubscriptionID string `json:"subscription_id" binding:"required"`
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package responses
|
||||
|
||||
import "time"
|
||||
|
||||
// CreateInvitationResponse 创建邀请
|
||||
type CreateInvitationResponse struct {
|
||||
InviteToken string `json:"invite_token" description:"仅返回一次,请转达被邀请人"`
|
||||
InviteURL string `json:"invite_url" description:"子站注册完整链接"`
|
||||
ExpiresAt time.Time `json:"expires_at"`
|
||||
InvitationID string `json:"invitation_id"`
|
||||
}
|
||||
|
||||
// SubordinateListItem 下属一条
|
||||
type SubordinateListItem struct {
|
||||
ChildUserID string `json:"child_user_id"`
|
||||
Phone string `json:"phone,omitempty"`
|
||||
LinkID string `json:"link_id"`
|
||||
RegisteredAt time.Time `json:"registered_at"`
|
||||
CompanyName string `json:"company_name"`
|
||||
IsCertified bool `json:"is_certified"`
|
||||
Balance string `json:"balance"`
|
||||
}
|
||||
|
||||
// SubordinateListResponse 列表
|
||||
type SubordinateListResponse struct {
|
||||
Total int64 `json:"total"`
|
||||
Items []SubordinateListItem `json:"items"`
|
||||
}
|
||||
|
||||
// SubPortalRegisterResponse 子站注册
|
||||
type SubPortalRegisterResponse struct {
|
||||
ID string `json:"id"`
|
||||
Phone string `json:"phone"`
|
||||
}
|
||||
|
||||
// ChildAllocationItem 下属划拨记录
|
||||
type ChildAllocationItem struct {
|
||||
ID string `json:"id"`
|
||||
Amount string `json:"amount"`
|
||||
BusinessRef string `json:"business_ref"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
}
|
||||
|
||||
// ChildAllocationListResponse 下属划拨记录列表
|
||||
type ChildAllocationListResponse struct {
|
||||
Total int64 `json:"total"`
|
||||
Items []ChildAllocationItem `json:"items"`
|
||||
}
|
||||
|
||||
// ChildSubscriptionItem 下属订阅项
|
||||
type ChildSubscriptionItem struct {
|
||||
ID string `json:"id"`
|
||||
ProductID string `json:"product_id"`
|
||||
Price string `json:"price"`
|
||||
UIComponentPrice string `json:"ui_component_price"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
}
|
||||
Reference in New Issue
Block a user