暂存一下,防止丢失
This commit is contained in:
@@ -89,10 +89,16 @@ type AgentOpenAPIPackageItem struct {
|
||||
|
||||
// AgentOpenAPIWalletBalanceResponse 开放接口预充值钱包余额响应
|
||||
type AgentOpenAPIWalletBalanceResponse struct {
|
||||
Balance int64 `json:"balance" description:"钱包余额(分)"`
|
||||
FrozenBalance int64 `json:"frozen_balance" description:"冻结余额(分)"`
|
||||
AvailableBalance int64 `json:"available_balance" description:"可用余额(分)"`
|
||||
Currency string `json:"currency" description:"币种"`
|
||||
Balance int64 `json:"balance" description:"钱包账面余额(分)"`
|
||||
FrozenBalance int64 `json:"frozen_balance" description:"冻结余额(分)"`
|
||||
CashAvailableBalance int64 `json:"cash_available_balance" description:"现金可用金额(分),等于账面余额减冻结余额"`
|
||||
CreditEnabled bool `json:"credit_enabled" description:"是否启用主钱包信用额度"`
|
||||
CreditLimit int64 `json:"credit_limit" description:"主钱包信用额度(分)"`
|
||||
AvailableBalance int64 `json:"available_balance" description:"总可用金额(分),等于现金可用金额加生效信用额度"`
|
||||
IsInDebt bool `json:"is_in_debt" description:"账面余额是否已形成欠款"`
|
||||
DebtAmount int64 `json:"debt_amount" description:"欠款金额(分),仅取负账面余额绝对值"`
|
||||
Version int `json:"version" description:"钱包乐观锁版本"`
|
||||
Currency string `json:"currency" description:"币种"`
|
||||
}
|
||||
|
||||
// AgentOpenAPIWalletTransactionListRequest 开放接口预充值钱包流水请求
|
||||
|
||||
94
internal/model/dto/notification_dto.go
Normal file
94
internal/model/dto/notification_dto.go
Normal file
@@ -0,0 +1,94 @@
|
||||
package dto
|
||||
|
||||
import "time"
|
||||
|
||||
// NotificationUnreadCountResponse 是后台账号未读数投影。
|
||||
type NotificationUnreadCountResponse struct {
|
||||
Count int64 `json:"count" description:"未读通知数量"`
|
||||
DisplayCount string `json:"display_count" description:"徽标显示文本,超过 99 时为 99+"`
|
||||
}
|
||||
|
||||
// NotificationListRequest 是后台通知基础分页参数。
|
||||
type NotificationListRequest struct {
|
||||
Category string `json:"category" query:"category" validate:"omitempty,oneof=approval expiry sync system" enums:"approval,expiry,sync,system" description:"通知类别 (approval:审批, expiry:临期, sync:同步, system:系统)"`
|
||||
Type string `json:"type" query:"type" validate:"omitempty,max=100" maxlength:"100" description:"稳定通知类型"`
|
||||
Severity string `json:"severity" query:"severity" validate:"omitempty,oneof=info warning error critical" enums:"info,warning,error,critical" description:"通知级别 (info:提示, warning:警告, error:错误, critical:严重)"`
|
||||
IsRead *bool `json:"is_read" query:"is_read" description:"已读状态;不传时查询全部"`
|
||||
Page int `json:"page" query:"page" validate:"omitempty,min=1,max=10000" minimum:"1" maximum:"10000" description:"页码,默认 1,最大 10000"`
|
||||
PageSize int `json:"page_size" query:"page_size" validate:"omitempty,min=1,max=50" minimum:"1" maximum:"50" description:"每页数量,默认 20,最大 50"`
|
||||
}
|
||||
|
||||
// NotificationItem 是后台账号可见的站内通知投影。
|
||||
type NotificationItem struct {
|
||||
ID uint `json:"id" description:"通知ID"`
|
||||
Category string `json:"category" description:"通知类别 (approval:审批, expiry:临期, sync:同步, system:系统)"`
|
||||
Type string `json:"type" description:"稳定通知类型"`
|
||||
Severity string `json:"severity" description:"通知级别 (info:提示, warning:警告, error:错误, critical:严重)"`
|
||||
Title string `json:"title" description:"纯文本标题"`
|
||||
Body string `json:"body" description:"纯文本正文"`
|
||||
RefType string `json:"ref_type" description:"受控资源类型"`
|
||||
RefID string `json:"ref_id" description:"受控资源ID"`
|
||||
RefKey string `json:"ref_key" description:"受控资源Key"`
|
||||
IsRead bool `json:"is_read" description:"是否已读"`
|
||||
ReadAt *time.Time `json:"read_at,omitempty" description:"首次已读时间(ISO 8601)"`
|
||||
CreatedAt time.Time `json:"created_at" description:"创建时间(ISO 8601)"`
|
||||
}
|
||||
|
||||
// NotificationListResponse 是后台通知基础分页结果。
|
||||
type NotificationListResponse struct {
|
||||
Items []NotificationItem `json:"items" description:"通知列表"`
|
||||
Total int64 `json:"total" description:"总数量"`
|
||||
Page int `json:"page" description:"页码"`
|
||||
Size int `json:"size" description:"每页数量"`
|
||||
}
|
||||
|
||||
// NotificationIDParams 是单条通知路径参数。
|
||||
type NotificationIDParams struct {
|
||||
ID uint `json:"id" path:"id" required:"true" description:"通知ID"`
|
||||
}
|
||||
|
||||
// NotificationReadResponse 是单条通知幂等已读结果。
|
||||
type NotificationReadResponse struct {
|
||||
Success bool `json:"success" description:"请求是否成功;通知不存在、属于别人或已经已读也返回 true"`
|
||||
}
|
||||
|
||||
// NotificationTargetResponse 是通知受控目标解析结果,不包含任意 URL。
|
||||
type NotificationTargetResponse struct {
|
||||
TargetType string `json:"target_type" description:"前端白名单目标类型;空表示不支持跳转"`
|
||||
TargetID *uint `json:"target_id,omitempty" description:"受控数值目标ID"`
|
||||
TargetKey string `json:"target_key,omitempty" description:"受控稳定目标Key"`
|
||||
Available bool `json:"available" description:"当前账号是否仍可访问目标"`
|
||||
}
|
||||
|
||||
// NotificationUnreadSummaryResponse 是后台账号未读通知的固定分类汇总。
|
||||
type NotificationUnreadSummaryResponse struct {
|
||||
Total int64 `json:"total" description:"未读通知总数"`
|
||||
Approval int64 `json:"approval" description:"审批类未读数量"`
|
||||
Expiry int64 `json:"expiry" description:"临期类未读数量"`
|
||||
Sync int64 `json:"sync" description:"同步类未读数量"`
|
||||
System int64 `json:"system" description:"系统类未读数量"`
|
||||
}
|
||||
|
||||
// NotificationReadAllRequest 是后台批量已读请求。
|
||||
type NotificationReadAllRequest struct {
|
||||
Category string `json:"category" validate:"omitempty,oneof=approval expiry sync system" enums:"approval,expiry,sync,system" description:"可选通知类别 (approval:审批, expiry:临期, sync:同步, system:系统)"`
|
||||
}
|
||||
|
||||
// NotificationReadAllResponse 是后台批量已读结果。
|
||||
type NotificationReadAllResponse struct {
|
||||
UpdatedCount int64 `json:"updated_count" description:"本次实际更新的通知数量"`
|
||||
}
|
||||
|
||||
// PersonalNotificationListRequest 是个人客户通知的简化分页参数。
|
||||
type PersonalNotificationListRequest struct {
|
||||
Page int `json:"page" query:"page" validate:"omitempty,min=1,max=10000" minimum:"1" maximum:"10000" description:"页码,默认 1,最大 10000"`
|
||||
PageSize int `json:"page_size" query:"page_size" validate:"omitempty,min=1,max=50" minimum:"1" maximum:"50" description:"每页数量,默认 20,最大 50"`
|
||||
}
|
||||
|
||||
// PersonalNotificationListResponse 是个人客户通知的简化分页结果。
|
||||
type PersonalNotificationListResponse struct {
|
||||
Items []NotificationItem `json:"items" description:"当前个人客户可见的业务通知列表"`
|
||||
Total int64 `json:"total" description:"总数量"`
|
||||
Page int `json:"page" description:"页码"`
|
||||
Size int `json:"size" description:"每页数量"`
|
||||
}
|
||||
@@ -31,15 +31,39 @@ type RoleListRequest struct {
|
||||
|
||||
// RoleResponse 角色响应
|
||||
type RoleResponse struct {
|
||||
ID uint `json:"id" description:"角色ID"`
|
||||
RoleName string `json:"role_name" description:"角色名称"`
|
||||
RoleDesc string `json:"role_desc" description:"角色描述"`
|
||||
RoleType int `json:"role_type" description:"角色类型 (1:平台角色, 2:客户角色)"`
|
||||
Status int `json:"status" description:"状态 (0:禁用, 1:启用)"`
|
||||
Creator uint `json:"creator" description:"创建人ID"`
|
||||
Updater uint `json:"updater" description:"更新人ID"`
|
||||
CreatedAt string `json:"created_at" description:"创建时间"`
|
||||
UpdatedAt string `json:"updated_at" description:"更新时间"`
|
||||
ID uint `json:"id" description:"角色ID"`
|
||||
RoleName string `json:"role_name" description:"角色名称"`
|
||||
RoleDesc string `json:"role_desc" description:"角色描述"`
|
||||
RoleType int `json:"role_type" description:"角色类型 (1:平台角色, 2:客户角色)"`
|
||||
Status int `json:"status" description:"状态 (0:禁用, 1:启用)"`
|
||||
DefaultCreditEnabled bool `json:"default_credit_enabled" description:"是否启用新建代理默认信用;仅客户角色有效"`
|
||||
DefaultCreditLimit int64 `json:"default_credit_limit" description:"新建代理默认信用额度(分);仅影响未来新建店铺"`
|
||||
DefaultCreditScope string `json:"default_credit_scope" description:"模板生效范围,固定为 new_shops_only"`
|
||||
Creator uint `json:"creator" description:"创建人ID"`
|
||||
Updater uint `json:"updater" description:"更新人ID"`
|
||||
CreatedAt string `json:"created_at" description:"创建时间"`
|
||||
UpdatedAt string `json:"updated_at" description:"更新时间"`
|
||||
}
|
||||
|
||||
// UpdateRoleDefaultCreditRequest 更新角色默认信用模板请求。
|
||||
type UpdateRoleDefaultCreditRequest struct {
|
||||
CreditEnabled *bool `json:"credit_enabled" validate:"required" required:"true" description:"是否启用新建代理默认信用"`
|
||||
CreditLimit *int64 `json:"credit_limit" validate:"required,min=0" required:"true" minimum:"0" description:"新建代理默认信用额度(分);关闭时必须为0,开启时必须大于0"`
|
||||
}
|
||||
|
||||
// UpdateRoleDefaultCreditParams 更新角色默认信用模板参数。
|
||||
type UpdateRoleDefaultCreditParams struct {
|
||||
IDReq
|
||||
UpdateRoleDefaultCreditRequest
|
||||
}
|
||||
|
||||
// RoleDefaultCreditResponse 角色默认信用模板响应。
|
||||
type RoleDefaultCreditResponse struct {
|
||||
RoleID uint `json:"role_id" description:"客户角色ID"`
|
||||
CreditEnabled bool `json:"credit_enabled" description:"是否启用新建代理默认信用"`
|
||||
CreditLimit int64 `json:"credit_limit" description:"新建代理默认信用额度(分)"`
|
||||
Scope string `json:"scope" description:"模板生效范围,固定为 new_shops_only"`
|
||||
AffectsExistingWallets bool `json:"affects_existing_wallets" description:"是否影响既有钱包,固定为 false"`
|
||||
}
|
||||
|
||||
// RolePageResult 角色分页响应
|
||||
|
||||
@@ -20,7 +20,14 @@ type ShopFundSummaryItem struct {
|
||||
Username string `json:"username" description:"主账号用户名"`
|
||||
Phone string `json:"phone" description:"主账号手机号"`
|
||||
MainBalance int64 `json:"main_balance" description:"预充值钱包余额(分)"`
|
||||
MainFrozenBalance int64 `json:"main_frozen_balance" description:"预充值钱包冻结余额(分,预留字段)"`
|
||||
MainFrozenBalance int64 `json:"main_frozen_balance" description:"预充值钱包冻结余额(分)"`
|
||||
CashAvailableBalance int64 `json:"cash_available_balance" description:"现金可用金额(分),等于主钱包余额减冻结金额"`
|
||||
CreditEnabled bool `json:"credit_enabled" description:"是否启用主钱包信用额度"`
|
||||
CreditLimit int64 `json:"credit_limit" description:"主钱包信用额度(分),关闭信用时为0"`
|
||||
AvailableBalance int64 `json:"available_balance" description:"总可用金额(分),等于现金可用金额加生效信用额度"`
|
||||
IsInDebt bool `json:"is_in_debt" description:"主钱包账面余额是否为负数"`
|
||||
DebtAmount int64 `json:"debt_amount" description:"主钱包欠款金额(分),仅取负账面余额绝对值"`
|
||||
Version int `json:"version" description:"主钱包当前版本号,并发写冲突后应重新查询"`
|
||||
TotalCommission int64 `json:"total_commission" description:"累计佣金总额(分)"`
|
||||
WithdrawnCommission int64 `json:"withdrawn_commission" description:"已提现佣金(分)"`
|
||||
UnwithdrawCommission int64 `json:"unwithdraw_commission" description:"未提现佣金(分)"`
|
||||
|
||||
@@ -1,64 +1,112 @@
|
||||
package dto
|
||||
|
||||
import "github.com/bytedance/sonic"
|
||||
|
||||
type ShopListRequest struct {
|
||||
Page int `json:"page" query:"page" validate:"omitempty,min=1" minimum:"1" description:"页码"`
|
||||
PageSize int `json:"page_size" query:"page_size" validate:"omitempty,min=1,max=100" minimum:"1" maximum:"100" description:"每页数量"`
|
||||
ShopName string `json:"shop_name" query:"shop_name" validate:"omitempty,max=100" maxLength:"100" description:"店铺名称模糊查询"`
|
||||
ShopCode string `json:"shop_code" query:"shop_code" validate:"omitempty,max=50" maxLength:"50" description:"店铺编号精确查询"`
|
||||
ContactPhone string `json:"contact_phone" query:"contact_phone" validate:"omitempty,len=11,numeric,ascii" minLength:"11" maxLength:"11" pattern:"^[0-9]{11}$" description:"联系电话精确查询(11位 ASCII 数字;空值不启用筛选;与其他条件按 AND 组合)"`
|
||||
ParentID *uint `json:"parent_id" query:"parent_id" validate:"omitempty,min=1" minimum:"1" description:"上级店铺ID"`
|
||||
Level *int `json:"level" query:"level" validate:"omitempty,min=1,max=7" minimum:"1" maximum:"7" description:"店铺层级 (1-7级)"`
|
||||
Status *int `json:"status" query:"status" validate:"omitempty,oneof=0 1" description:"状态 (0:禁用, 1:启用)"`
|
||||
Page int `json:"page" query:"page" validate:"omitempty,min=1" minimum:"1" description:"页码"`
|
||||
PageSize int `json:"page_size" query:"page_size" validate:"omitempty,min=1,max=100" minimum:"1" maximum:"100" description:"每页数量"`
|
||||
ShopName string `json:"shop_name" query:"shop_name" validate:"omitempty,max=100" maxLength:"100" description:"店铺名称模糊查询"`
|
||||
ShopCode string `json:"shop_code" query:"shop_code" validate:"omitempty,max=50" maxLength:"50" description:"店铺编号精确查询"`
|
||||
ContactPhone string `json:"contact_phone" query:"contact_phone" validate:"omitempty,len=11,numeric,ascii" minLength:"11" maxLength:"11" pattern:"^[0-9]{11}$" description:"联系电话精确查询(11位 ASCII 数字;空值不启用筛选;与其他条件按 AND 组合)"`
|
||||
BusinessOwnerAccountID *uint `json:"business_owner_account_id" query:"business_owner_account_id" validate:"omitempty,min=1" minimum:"1" description:"平台业务员账号ID精确筛选"`
|
||||
ParentID *uint `json:"parent_id" query:"parent_id" validate:"omitempty,min=1" minimum:"1" description:"上级店铺ID"`
|
||||
Level *int `json:"level" query:"level" validate:"omitempty,min=1,max=7" minimum:"1" maximum:"7" description:"店铺层级 (1-7级)"`
|
||||
Status *int `json:"status" query:"status" validate:"omitempty,oneof=0 1" description:"状态 (0:禁用, 1:启用)"`
|
||||
}
|
||||
|
||||
type CreateShopRequest struct {
|
||||
ShopName string `json:"shop_name" validate:"required,min=1,max=100" required:"true" minLength:"1" maxLength:"100" description:"店铺名称"`
|
||||
ShopCode string `json:"shop_code" validate:"required,min=1,max=50" required:"true" minLength:"1" maxLength:"50" description:"店铺编号"`
|
||||
ParentID *uint `json:"parent_id" validate:"omitempty,min=1" minimum:"1" description:"上级店铺ID(一级店铺可不填)"`
|
||||
ContactName string `json:"contact_name" validate:"omitempty,max=50" maxLength:"50" description:"联系人姓名"`
|
||||
ContactPhone string `json:"contact_phone" validate:"omitempty,len=11" minLength:"11" maxLength:"11" description:"联系人电话"`
|
||||
Province string `json:"province" validate:"omitempty,max=50" maxLength:"50" description:"省份"`
|
||||
City string `json:"city" validate:"omitempty,max=50" maxLength:"50" description:"城市"`
|
||||
District string `json:"district" validate:"omitempty,max=50" maxLength:"50" description:"区县"`
|
||||
Address string `json:"address" validate:"omitempty,max=255" maxLength:"255" description:"详细地址"`
|
||||
DefaultRoleID uint `json:"default_role_id" validate:"required,min=1" required:"true" minimum:"1" description:"店铺默认角色ID(必须是客户角色)"`
|
||||
InitPassword string `json:"init_password" validate:"required,min=8,max=32" required:"true" minLength:"8" maxLength:"32" description:"初始账号密码"`
|
||||
InitUsername string `json:"init_username" validate:"required,min=3,max=50" required:"true" minLength:"3" maxLength:"50" description:"初始账号用户名"`
|
||||
InitPhone string `json:"init_phone" validate:"required,len=11" required:"true" minLength:"11" maxLength:"11" description:"初始账号手机号"`
|
||||
ShopName string `json:"shop_name" validate:"required,min=1,max=100" required:"true" minLength:"1" maxLength:"100" description:"店铺名称"`
|
||||
ShopCode string `json:"shop_code" validate:"required,min=1,max=50" required:"true" minLength:"1" maxLength:"50" description:"店铺编号"`
|
||||
ParentID *uint `json:"parent_id" validate:"omitempty,min=1" minimum:"1" description:"上级店铺ID(一级店铺可不填)"`
|
||||
BusinessOwnerAccountID *uint `json:"business_owner_account_id" nullable:"true" description:"平台业务员账号ID;缺失时继承上级,null 表示空归属"`
|
||||
BusinessOwnerAccountIDSet bool `json:"-"`
|
||||
ContactName string `json:"contact_name" validate:"omitempty,max=50" maxLength:"50" description:"联系人姓名"`
|
||||
ContactPhone string `json:"contact_phone" validate:"omitempty,len=11" minLength:"11" maxLength:"11" description:"联系人电话"`
|
||||
Province string `json:"province" validate:"omitempty,max=50" maxLength:"50" description:"省份"`
|
||||
City string `json:"city" validate:"omitempty,max=50" maxLength:"50" description:"城市"`
|
||||
District string `json:"district" validate:"omitempty,max=50" maxLength:"50" description:"区县"`
|
||||
Address string `json:"address" validate:"omitempty,max=255" maxLength:"255" description:"详细地址"`
|
||||
DefaultRoleID uint `json:"default_role_id" validate:"required,min=1" required:"true" minimum:"1" description:"店铺默认角色ID(必须是客户角色)"`
|
||||
InitPassword string `json:"init_password" validate:"required,min=8,max=32" required:"true" minLength:"8" maxLength:"32" description:"初始账号密码"`
|
||||
InitUsername string `json:"init_username" validate:"required,min=3,max=50" required:"true" minLength:"3" maxLength:"50" description:"初始账号用户名"`
|
||||
InitPhone string `json:"init_phone" validate:"required,len=11" required:"true" minLength:"11" maxLength:"11" description:"初始账号手机号"`
|
||||
}
|
||||
|
||||
// UnmarshalJSON 解析创建店铺请求并保留业务员字段“缺失”和“显式 null”的差异。
|
||||
func (r *CreateShopRequest) UnmarshalJSON(data []byte) error {
|
||||
type plain CreateShopRequest
|
||||
var decoded plain
|
||||
if err := sonic.Unmarshal(data, &decoded); err != nil {
|
||||
return err
|
||||
}
|
||||
var fields map[string]any
|
||||
if err := sonic.Unmarshal(data, &fields); err != nil {
|
||||
return err
|
||||
}
|
||||
decoded.BusinessOwnerAccountIDSet = false
|
||||
if _, exists := fields["business_owner_account_id"]; exists {
|
||||
decoded.BusinessOwnerAccountIDSet = true
|
||||
}
|
||||
*r = CreateShopRequest(decoded)
|
||||
return nil
|
||||
}
|
||||
|
||||
type UpdateShopRequest struct {
|
||||
ShopName string `json:"shop_name" validate:"required,min=1,max=100" required:"true" minLength:"1" maxLength:"100" description:"店铺名称"`
|
||||
ContactName string `json:"contact_name" validate:"omitempty,max=50" maxLength:"50" description:"联系人姓名"`
|
||||
ContactPhone string `json:"contact_phone" validate:"omitempty,len=11" minLength:"11" maxLength:"11" description:"联系人电话"`
|
||||
Province string `json:"province" validate:"omitempty,max=50" maxLength:"50" description:"省份"`
|
||||
City string `json:"city" validate:"omitempty,max=50" maxLength:"50" description:"城市"`
|
||||
District string `json:"district" validate:"omitempty,max=50" maxLength:"50" description:"区县"`
|
||||
Address string `json:"address" validate:"omitempty,max=255" maxLength:"255" description:"详细地址"`
|
||||
Status int `json:"status" validate:"required,oneof=0 1" required:"true" description:"状态 (0:禁用, 1:启用)"`
|
||||
ShopName string `json:"shop_name" validate:"required,min=1,max=100" required:"true" minLength:"1" maxLength:"100" description:"店铺名称"`
|
||||
BusinessOwnerAccountID *uint `json:"business_owner_account_id" nullable:"true" description:"平台业务员账号ID;缺失时保持不变,null 表示清空"`
|
||||
BusinessOwnerAccountIDSet bool `json:"-"`
|
||||
ContactName string `json:"contact_name" validate:"omitempty,max=50" maxLength:"50" description:"联系人姓名"`
|
||||
ContactPhone string `json:"contact_phone" validate:"omitempty,len=11" minLength:"11" maxLength:"11" description:"联系人电话"`
|
||||
Province string `json:"province" validate:"omitempty,max=50" maxLength:"50" description:"省份"`
|
||||
City string `json:"city" validate:"omitempty,max=50" maxLength:"50" description:"城市"`
|
||||
District string `json:"district" validate:"omitempty,max=50" maxLength:"50" description:"区县"`
|
||||
Address string `json:"address" validate:"omitempty,max=255" maxLength:"255" description:"详细地址"`
|
||||
Status int `json:"status" validate:"oneof=0 1" required:"true" description:"状态 (0:禁用, 1:启用)"`
|
||||
}
|
||||
|
||||
// UnmarshalJSON 解析更新店铺请求并保留业务员字段“缺失”和“显式 null”的差异。
|
||||
func (r *UpdateShopRequest) UnmarshalJSON(data []byte) error {
|
||||
type plain UpdateShopRequest
|
||||
var decoded plain
|
||||
if err := sonic.Unmarshal(data, &decoded); err != nil {
|
||||
return err
|
||||
}
|
||||
var fields map[string]any
|
||||
if err := sonic.Unmarshal(data, &fields); err != nil {
|
||||
return err
|
||||
}
|
||||
decoded.BusinessOwnerAccountIDSet = false
|
||||
if _, exists := fields["business_owner_account_id"]; exists {
|
||||
decoded.BusinessOwnerAccountIDSet = true
|
||||
}
|
||||
*r = UpdateShopRequest(decoded)
|
||||
return nil
|
||||
}
|
||||
|
||||
// ShopResponse 店铺响应
|
||||
type ShopResponse struct {
|
||||
ID uint `json:"id" description:"店铺ID"`
|
||||
ShopName string `json:"shop_name" description:"店铺名称"`
|
||||
ShopCode string `json:"shop_code" description:"店铺编号"`
|
||||
ParentID *uint `json:"parent_id,omitempty" description:"上级店铺ID"`
|
||||
ParentShopName string `json:"parent_shop_name,omitempty" description:"上级店铺名称"`
|
||||
Level int `json:"level" description:"店铺层级 (1-7级)"`
|
||||
ContactName string `json:"contact_name" description:"联系人姓名"`
|
||||
ContactPhone string `json:"contact_phone" description:"联系人电话"`
|
||||
Province string `json:"province" description:"省份"`
|
||||
City string `json:"city" description:"城市"`
|
||||
District string `json:"district" description:"区县"`
|
||||
Address string `json:"address" description:"详细地址"`
|
||||
Status int `json:"status" description:"状态 (0:禁用, 1:启用)"`
|
||||
StatusName string `json:"status_name" description:"状态名称(中文)"`
|
||||
CreatedAt string `json:"created_at" description:"创建时间"`
|
||||
UpdatedAt string `json:"updated_at" description:"更新时间"`
|
||||
ID uint `json:"id" description:"店铺ID"`
|
||||
ShopName string `json:"shop_name" description:"店铺名称"`
|
||||
ShopCode string `json:"shop_code" description:"店铺编号"`
|
||||
ParentID *uint `json:"parent_id,omitempty" description:"上级店铺ID"`
|
||||
ParentShopName string `json:"parent_shop_name,omitempty" description:"上级店铺名称"`
|
||||
BusinessOwnerAccountID *uint `json:"business_owner_account_id" description:"平台业务员账号ID,null 表示未归属"`
|
||||
BusinessOwnerUsername string `json:"business_owner_username" description:"平台业务员账号名"`
|
||||
BusinessOwnerPhoneSummary string `json:"business_owner_phone_summary" description:"平台业务员手机号摘要(前三后四)"`
|
||||
BusinessOwnerAvailable bool `json:"business_owner_available" description:"平台业务员当前是否可用于通知接收"`
|
||||
Level int `json:"level" description:"店铺层级 (1-7级)"`
|
||||
ContactName string `json:"contact_name" description:"联系人姓名"`
|
||||
ContactPhone string `json:"contact_phone" description:"联系人电话"`
|
||||
Province string `json:"province" description:"省份"`
|
||||
City string `json:"city" description:"城市"`
|
||||
District string `json:"district" description:"区县"`
|
||||
Address string `json:"address" description:"详细地址"`
|
||||
Status int `json:"status" description:"状态 (0:禁用, 1:启用)"`
|
||||
StatusName string `json:"status_name" description:"状态名称(中文)"`
|
||||
CreatedAt string `json:"created_at" description:"创建时间"`
|
||||
UpdatedAt string `json:"updated_at" description:"更新时间"`
|
||||
}
|
||||
|
||||
// ShopPageResult 店铺分页响应
|
||||
// ShopPageResult 店铺分页响应
|
||||
type ShopPageResult struct {
|
||||
Items []ShopResponse `json:"items" description:"店铺列表"`
|
||||
@@ -86,3 +134,50 @@ type ShopCascadeItem struct {
|
||||
ShopName string `json:"shop_name" description:"店铺名称"`
|
||||
HasChildren bool `json:"has_children" description:"是否有下级店铺"`
|
||||
}
|
||||
|
||||
// ShopBusinessOwnerCandidateRequest 是平台业务员候选分页查询。
|
||||
type ShopBusinessOwnerCandidateRequest struct {
|
||||
Keyword string `json:"keyword" query:"keyword" validate:"omitempty,max=50" maxLength:"50" description:"用户名或手机号关键词"`
|
||||
Page int `json:"page" query:"page" validate:"omitempty,min=1,max=10000" minimum:"1" maximum:"10000" description:"页码,默认 1"`
|
||||
PageSize int `json:"page_size" query:"page_size" validate:"omitempty,min=1,max=100" minimum:"1" maximum:"100" description:"每页数量,默认 20,最大 100"`
|
||||
}
|
||||
|
||||
// ShopBusinessOwnerCandidate 是平台业务员候选最小投影。
|
||||
type ShopBusinessOwnerCandidate struct {
|
||||
ID uint `json:"id" description:"平台业务员账号ID"`
|
||||
Username string `json:"username" description:"平台业务员账号名"`
|
||||
PhoneSummary string `json:"phone_summary" description:"手机号摘要(前三后四)"`
|
||||
}
|
||||
|
||||
// ShopBusinessOwnerCandidatePageResult 是平台业务员候选分页结果。
|
||||
type ShopBusinessOwnerCandidatePageResult struct {
|
||||
Items []ShopBusinessOwnerCandidate `json:"items" description:"候选账号列表"`
|
||||
Total int64 `json:"total" description:"总数量"`
|
||||
Page int `json:"page" description:"当前页码"`
|
||||
Size int `json:"size" description:"每页数量"`
|
||||
}
|
||||
|
||||
// UpdateShopCreditLimitRequest 调整既有店铺实际信用额度请求。
|
||||
type UpdateShopCreditLimitRequest struct {
|
||||
CreditEnabled *bool `json:"credit_enabled" validate:"required" required:"true" description:"是否启用实际信用额度"`
|
||||
CreditLimit *int64 `json:"credit_limit" validate:"required,min=0" required:"true" minimum:"0" description:"实际信用额度(分);关闭时必须为0"`
|
||||
Version *int `json:"version" validate:"required,min=0" required:"true" minimum:"0" description:"主钱包乐观锁版本"`
|
||||
}
|
||||
|
||||
// UpdateShopCreditLimitParams 调整既有店铺实际信用额度参数。
|
||||
type UpdateShopCreditLimitParams struct {
|
||||
IDReq
|
||||
UpdateShopCreditLimitRequest
|
||||
}
|
||||
|
||||
// ShopCreditLimitResponse 店铺实际信用额度调整响应。
|
||||
type ShopCreditLimitResponse struct {
|
||||
ShopID uint `json:"shop_id" description:"店铺ID"`
|
||||
WalletID uint `json:"wallet_id" description:"代理主钱包ID"`
|
||||
Balance int64 `json:"balance" description:"账面余额(分)"`
|
||||
FrozenBalance int64 `json:"frozen_balance" description:"冻结金额(分)"`
|
||||
CreditEnabled bool `json:"credit_enabled" description:"是否启用实际信用额度"`
|
||||
CreditLimit int64 `json:"credit_limit" description:"实际信用额度(分)"`
|
||||
AvailableBalance int64 `json:"available_balance" description:"总可用金额(分)"`
|
||||
Version int `json:"version" description:"更新后的主钱包版本"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user