feat(app): update

This commit is contained in:
Yangtao
2025-11-19 14:24:13 +08:00
parent 1eac66d7fd
commit 0c34585649
329 changed files with 10760 additions and 281 deletions

8
pkg/dto/admin/diamond.go Normal file
View File

@ -0,0 +1,8 @@
package dto_admin
type OperationReduceDiamondRequest struct {
Diamond string
UserNo string
Memo string
Pwd string
}

378
pkg/dto/admin/skill.go Normal file
View File

@ -0,0 +1,378 @@
package dto_admin
import (
"errors"
"github.com/shopspring/decimal"
)
type TSkillConfig struct {
// model_master.TSkillConfig
Children []*TSkillConfig `json:"children" gorm:"-"`
}
// UpdateOrderRequest 修改订单请求参数 /*
type UpdateOrderRequest struct {
OrderId string `json:"orderId"`
UpdateType string `json:"updateType"`
ChangeOrderCount float32 `json:"changeOrderCount"`
Reason string `json:"reason"`
}
// ReplenishOrderRequest 补单请求参数 /*
type ReplenishOrderRequest struct {
GuildId string `json:"guildId"`
BuyerUserId string `json:"buyerUserId"`
SellerUserId string `json:"sellerUserId"`
SellerSkillId string `json:"sellerSkillId"`
SkillConfigId string `json:"skillConfigId"`
OrderCount float64 `json:"orderCount"`
}
type FreeOfChargeOrder struct {
OrderId string `json:"orderId"`
Reason string `json:"reason"`
ChangeCount decimal.Decimal `json:"changeCount"`
}
type OrderRateResponse struct {
// model_master.TSkillOrderRate
OrderNo string `json:"order_no"`
UserNO string `json:"user_no"`
NickName string `json:"nick_name"`
SellerNickName string `json:"seller_nick_name"`
SellerUserNo string `json:"seller_user_no"`
}
type EarlyFinishOrderRequest struct {
OrderId string `json:"orderId"`
CompleteCount decimal.Decimal `json:"completeCount"`
}
type FinishOrderRequest struct {
OrderId string `json:"orderId"`
}
type DispatchOrderResponse struct {
// model_master.TDispatchOrder
ChatroomNo string `json:"chatroom_no"`
ChatroomName string `json:"chatroom_name"`
BuyerNo string `json:"buyer_no"`
BuyerNickName string `json:"buyer_nick_name"`
HostUserNo string `json:"host_user_no"`
HostUserNickName string `json:"host_user_nick_name"`
SkillName string `json:"skill_name"`
}
type SellerSkillUpdateResponse struct {
Id string
SkillStatus string
ServiceStatus string
AllowEditPrice string
SellerStar string
}
func (request *SellerSkillUpdateResponse) Check() (err error) {
if len(request.Id) == 0 {
err = errors.New("技能ID不能为空")
return
}
if request.SkillStatus != "1" && request.SkillStatus != "3" {
err = errors.New("技能状态不正确")
return
}
if request.ServiceStatus != "1" && request.ServiceStatus != "0" {
err = errors.New("技能服务状态不正确")
return
}
if len(request.AllowEditPrice) == 0 {
err = errors.New("价格修改状态不能为空")
return
}
if len(request.SellerStar) == 0 {
err = errors.New("明星状态不能为空")
return
}
return
}
type UpdateSkillLevelResponse struct {
Id string
ConfigId string
UserId string
}
func (request *UpdateSkillLevelResponse) Check() (err error) {
if len(request.Id) == 0 {
err = errors.New("陪玩技能ID不能为空")
return
}
if len(request.ConfigId) == 0 {
err = errors.New("技能等级不能为空")
return
}
if len(request.UserId) == 0 {
err = errors.New("用户id不能为空")
return
}
return
}
type UpdateSkillLevelInnerResponse struct {
ID string
ConfigId string
OperatorID string
}
func (request *UpdateSkillLevelInnerResponse) Check() (err error) {
if len(request.ID) == 0 {
err = errors.New("陪玩技能ID不能为空")
return
}
if len(request.ConfigId) == 0 {
err = errors.New("技能等级不能为空")
return
}
return
}
type SellerFaceVerifyResponse struct {
// model_master.TSellerFaceVerify
UserNo string `json:"user_no"`
NickName string `json:"nick_name"`
Avatar string `json:"avatar"`
SkillName string `json:"skill_name"`
}
type FreeOfChargeOrderForInner struct {
OrderId string
Reason string
ChangeCount decimal.Decimal
OperatorID string
}
type SellerSkillUpdateInnerResponse struct {
ID string
SkillStatus string
ServiceStatus string
AllowEditPrice string
SellerStar string
OperatorID string
}
func (request *SellerSkillUpdateInnerResponse) Check() (err error) {
if len(request.ID) == 0 {
err = errors.New("技能ID不能为空")
return
}
if request.SkillStatus != "1" && request.SkillStatus != "3" {
err = errors.New("技能状态不正确")
return
}
if request.ServiceStatus != "1" && request.ServiceStatus != "0" {
err = errors.New("技能服务状态不正确")
return
}
if len(request.AllowEditPrice) == 0 {
err = errors.New("价格修改状态不能为空")
return
}
if len(request.SellerStar) == 0 {
err = errors.New("明星状态不能为空")
return
}
if len(request.OperatorID) == 0 {
err = errors.New("操作人不能为空")
return
}
return
}
type AddSellerSkillInnerResponse struct {
GuildMemberID int32
SkillConfigID string
}
func (request *AddSellerSkillInnerResponse) Check() (err error) {
if request.GuildMemberID == 0 {
err = errors.New("用户ID不能为空")
return
}
if len(request.SkillConfigID) == 0 {
err = errors.New("技能配置ID不能为空")
return
}
return
}
type AddSkillInnerResponse struct {
SkillID string
}
func (request *AddSkillInnerResponse) Check() (err error) {
if len(request.SkillID) == 0 {
err = errors.New("技能ID不能为空")
return
}
return
}
type SkillConfigUpdateResponse struct {
ID string // 主键
SkillID string // 技能ID
DataType string // 类型 mode=游戏玩法 level=等级 service=服务类型(如三角洲体验单、物资单等) gender=性别 price=价格
ChildType string // 子分类:类型 mode=游戏玩法 level=等级 service=服务类型(如三角洲体验单、物资单等) gender=性别 price=价格 为空时表示为叶子节点
ParentID string // 父节点 modeskillId levelmodeId genderlevelId pricegenderId
Value string // 名称 mode玩法名称 level等级名称 gender性别名称 price价格内容
Comment string // 描述
RankPriority int32 // 节点排名权重,高权重可以兼容低权重
SortNo int32 // 排序从小到大
PriceMale int32 // 男陪价格
PriceFemale int32 // 女陪价格
UnitName string // 指定价格时的结算单位 如:小时、局等
UnitValue string // 指定价格时的阶段单位对应的值如小时对应60分钟
LevelRemark string // 等级的备注,下单时选择了等级可以显示备注
DifficultyValues string // 游戏难度:机密 绝密 长夜等 mode专用
DifficultyDefaultValue string // 游戏难度默认值
}
func (request *SkillConfigUpdateResponse) Check() (err error) {
if len(request.ID) == 0 {
err = errors.New("技能配置ID不能为空")
return
}
if len(request.SkillID) == 0 {
err = errors.New("技能ID不能为空")
return
}
if len(request.DataType) == 0 {
err = errors.New("数据类型不能为空")
return
}
if request.DataType == "mode" {
request.ChildType = "level"
request.RankPriority = 0
request.PriceMale = 0
request.PriceFemale = 0
request.UnitName = ""
request.UnitValue = ""
request.LevelRemark = ""
request.DifficultyDefaultValue = ""
request.DifficultyValues = ""
} else if request.DataType == "level" {
request.ChildType = "service"
request.PriceMale = 0
request.PriceFemale = 0
request.UnitName = ""
request.UnitValue = ""
request.LevelRemark = ""
request.DifficultyDefaultValue = ""
request.DifficultyValues = ""
} else if request.DataType == "service" {
request.ChildType = ""
request.RankPriority = 0
request.LevelRemark = ""
} else {
err = errors.New("数据类型不正确")
return
}
if len(request.ParentID) == 0 {
err = errors.New("父节点id不能为空")
return
}
if len(request.Value) == 0 {
err = errors.New("配置名称不能为空")
return
}
return
}
type SkillConfigAddRequest struct {
SkillID string // 技能ID
CategoryID int
DataType string // 类型 mode=游戏玩法 level=等级 service=服务类型(如三角洲体验单、物资单等) gender=性别 price=价格
ChildType string // 子节点类型
ParentID string // 父节点 modeskillId levelmodeId genderlevelId pricegenderId
Value string // 名称 mode玩法名称 level等级名称 gender性别名称 price价格内容
Comment string // 描述
RankPriority int32 // 节点排名权重,高权重可以兼容低权重
SortNo int32 // 排序从小到大
PriceMale int32 // 男陪价格
PriceFemale int32 // 女陪价格
UnitName string // 指定价格时的结算单位 如:小时、局等
UnitValue string // 指定价格时的阶段单位对应的值如小时对应60分钟
LevelRemark string // 等级的备注,下单时选择了等级可以显示备注
DifficultyValues string // 游戏难度:机密 绝密 长夜等 mode专用
DifficultyDefaultValue string // 游戏难度默认值
}
func (request *SkillConfigAddRequest) Check() (err error) {
if len(request.SkillID) == 0 {
err = errors.New("技能ID不能为空")
return
}
if request.CategoryID == 0 {
err = errors.New("技能类型不能为空")
return
}
if len(request.DataType) == 0 {
err = errors.New("数据类型不能为空")
return
}
if request.DataType == "mode" {
request.ChildType = "level"
request.RankPriority = 0
request.PriceMale = 0
request.PriceFemale = 0
request.UnitName = ""
request.UnitValue = ""
request.LevelRemark = ""
request.DifficultyDefaultValue = ""
request.DifficultyValues = ""
} else if request.DataType == "level" {
request.ChildType = "service"
request.PriceMale = 0
request.PriceFemale = 0
request.UnitName = ""
request.UnitValue = ""
request.LevelRemark = ""
request.DifficultyDefaultValue = ""
request.DifficultyValues = ""
} else if request.DataType == "service" {
request.ChildType = ""
request.RankPriority = 0
request.LevelRemark = ""
} else {
err = errors.New("数据类型不正确")
return
}
if len(request.ParentID) == 0 {
err = errors.New("父节点id不能为空")
return
}
if len(request.Value) == 0 {
err = errors.New("配置名称不能为空")
return
}
return
}
type TSkillResponse struct {
// model_master.TSkill
CategoryName string
}
type CheckSellerSkillInnerRequest struct {
SkillApplyID string
OperatorID string
}
func (request *CheckSellerSkillInnerRequest) Check() (err error) {
if len(request.SkillApplyID) == 0 {
err = errors.New("申请id不能为空")
return
}
if len(request.OperatorID) == 0 {
err = errors.New("操作人不能为空")
return
}
return
}

44
pkg/dto/admin/user.go Normal file
View File

@ -0,0 +1,44 @@
package dto_admin
import "errors"
type AdjustmentNobilityRequest struct {
UserId string
ExpValue int32
OutId string
BizType string
}
func (param AdjustmentNobilityRequest) Check() (err error) {
if len(param.UserId) == 0 {
err = errors.New("UserId不能为空")
return
}
if param.ExpValue == 0 {
err = errors.New("ExpValue不能为空")
return
}
if len(param.OutId) == 0 {
err = errors.New("OutId不能为空")
return
}
if len(param.BizType) == 0 {
err = errors.New("BizType不能为空")
return
}
return
}
type AddInnerUserRequest struct {
UserId string
}
func (param AddInnerUserRequest) Check() (err error) {
if len(param.UserId) == 0 {
err = errors.New("UserId不能为空")
return
}
return err
}