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

View File

@ -0,0 +1,24 @@
package request
import "errors"
type AddToBlackListRequest struct {
AccessToken string
TargetUserId string
}
// 参数合法性检验
func (request *AddToBlackListRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.TargetUserId) == 0 {
err = errors.New("TargetUserId不能为空")
return
}
return
}

View File

@ -0,0 +1,91 @@
package request
import "errors"
// 代理用户登录
type AgentUserLoginRequest struct {
AgentId string `json:"agentId"`
Uid string `json:"uid"`
UserName string `json:"userName"`
Gender string `json:"gender"`
Mobile string `json:"mobile"`
Signature string `json:"signature"`
}
// 参数合法性检验
func (request *AgentUserLoginRequest) CheckParameter() (err error) {
// 代理用户的ID
if len(request.AgentId) == 0 {
err = errors.New("agentId不能为空")
return
}
if len(request.Uid) == 0 {
err = errors.New("uid不能为空")
return
}
if len(request.UserName) == 0 {
err = errors.New("userName不能为空")
return
}
if len(request.Gender) == 0 {
err = errors.New("gender不能为空")
return
}
if len(request.Signature) == 0 {
err = errors.New("signature不能为空")
return
}
return
}
// 内部用户登录
type InnerUserLoginRequest struct {
Mobile string `json:"mobile"`
Signature string `json:"signature"`
}
// 参数合法性检验
func (request *InnerUserLoginRequest) CheckParameter() (err error) {
// 代理用户的ID
if len(request.Mobile) == 0 {
err = errors.New("agentId不能为空")
return
}
if len(request.Signature) == 0 {
err = errors.New("signature不能为空")
return
}
return
}
// 代理获取推广房间
type AgentPromoteRoomRequest struct {
AgentId string `json:"agentId"`
AccessToken string `json:"accessToken"`
Signature string `json:"signature"`
}
// 参数合法性检验
func (request *AgentPromoteRoomRequest) CheckParameter() (err error) {
// 代理用户的ID
if len(request.AgentId) == 0 {
err = errors.New("未登录不能为空")
return
}
if len(request.AccessToken) == 0 {
err = errors.New("token不能为空")
return
}
if len(request.Signature) == 0 {
err = errors.New("signature不能为空")
return
}
return
}

View File

@ -0,0 +1,51 @@
package request
import (
"errors"
"gitea.ddegame.cn/open/servicebase/pkg/common/HyTools"
)
// 代理商上分接口
type AgentTransferRequest struct {
AgentId string
Uid string
OrderId string
Diamond string
Signature string
}
// 参数合法性检验
func (request *AgentTransferRequest) CheckParameter() (err error) {
if len(request.AgentId) == 0 {
err = errors.New("AgentId不能为空")
return
}
if len(request.Uid) == 0 {
err = errors.New("Uid不能为空")
return
}
if len(request.OrderId) == 0 {
err = errors.New("OrderId不能为空")
return
}
if len(request.Diamond) == 0 {
err = errors.New("Diamond不能为空")
return
}
if HyTools.StringToInt(request.Diamond) <= 0 {
err = errors.New("Diamond不能为负数")
return
}
if len(request.Signature) == 0 {
err = errors.New("Signature不能为空")
return
}
return
}

View File

@ -0,0 +1,24 @@
package request
import "errors"
type BaseDispatchOrderIdRequest struct {
BaseRequest
DispatchOrderId string
}
// 参数合法性检验
func (request *BaseDispatchOrderIdRequest) CheckParameter() (err error) {
if len(request.DispatchOrderId) == 0 {
err = errors.New("DispatchOrderId不能为空")
return
}
return
}
type DispatchOrderCompleteRequest struct {
BaseDispatchOrderIdRequest
SellerUserId string
}

View File

@ -0,0 +1,153 @@
package request
import (
"errors"
"gitea.ddegame.cn/open/servicebase/pkg/tools"
"github.com/shopspring/decimal"
)
type BaseOrderIdRequest struct {
BaseRequest
OrderId string
OrderCountComplete string // 实际完成的订单量(局)
}
// 参数合法性检验
func (request *BaseOrderIdRequest) CheckParameter() (err error) {
if len(request.OrderId) == 0 {
err = errors.New("OrderId不能为空")
return
}
return
}
type PayOrderIdRequest struct {
BaseRequest
OrderId string
BuyerUserId string
}
// 参数合法性检验
func (request *PayOrderIdRequest) CheckParameter() (err error) {
if len(request.OrderId) == 0 {
err = errors.New("OrderId不能为空")
return
}
return
}
type SellerOrderIdRequest struct {
BaseRequest
OrderId string
SellerUserId string
}
// 参数合法性检验
func (request *SellerOrderIdRequest) CheckParameter() (err error) {
if len(request.OrderId) == 0 {
err = errors.New("OrderId不能为空")
return
}
return
}
// 卖家提前完成订单
type BuyerEarlyFinishOrderRequest struct {
BaseOrderIdRequest
OrderCountComplete string // 实际完成得订单量
OrderAmountPaid string // 实际应支付的订单金额
}
// 参数合法性检验
func (request *BuyerEarlyFinishOrderRequest) CheckParameter() (err error) {
if len(request.OrderId) == 0 {
err = errors.New("OrderId不能为空")
return
}
return
}
type FreeOfChargeOrderRequest struct {
BaseRequest
OrderId string
ChangeCount string // 完成单数
}
// 参数合法性检验
func (request *FreeOfChargeOrderRequest) CheckParameter() (err error) {
if len(request.OrderId) == 0 {
err = errors.New("OrderId不能为空")
return
}
if len(request.ChangeCount) == 0 {
err = errors.New("完成单数不能为空")
return
}
var count decimal.Decimal
if count, err = decimal.NewFromString(request.ChangeCount); err != nil {
err = errors.New("完成单数不能为非数字")
return
}
if !tools.IsHalfMultiple(count) {
err = errors.New("完成单数必须为0.5的倍数")
return
}
if count.LessThanOrEqual(decimal.NewFromInt(0)) {
err = errors.New("完成单数不能小于等于零")
return
}
return
}
type ReduceOrderRequest struct {
BaseRequest
OrderId string
ChangeCount string // 完成单数
}
// 参数合法性检验
func (request *ReduceOrderRequest) CheckParameter() (err error) {
if len(request.OrderId) == 0 {
err = errors.New("OrderId不能为空")
return
}
if len(request.ChangeCount) == 0 {
err = errors.New("减少单数不能为空")
return
}
var count decimal.Decimal
if count, err = decimal.NewFromString(request.ChangeCount); err != nil {
err = errors.New("减少数不能为非数字")
return
}
if !tools.IsHalfMultiple(count) {
err = errors.New("减少单数必须为0.5的倍数")
return
}
if count.LessThanOrEqual(decimal.NewFromInt(0)) {
err = errors.New("减少单数不能小于等于零")
return
}
return
}
// 卖家提前完成订单
type SellerFinishOrderRequest struct {
BaseOrderIdRequest
OrderCountComplete string // 实际完成的订单量(局)
}
// 参数合法性检验
func (request *SellerFinishOrderRequest) CheckParameter() (err error) {
if len(request.OrderId) == 0 {
err = errors.New("OrderId不能为空")
return
}
if len(request.OrderCountComplete) == 0 {
err = errors.New("OrderId不能为空")
return
}
return
}

View File

@ -0,0 +1,31 @@
package request
import "errors"
// 分页获取个人数据
type BasePageRequest struct {
AccessToken string
PageNo string
PageSize string
}
// 参数合法性检验
func (request *BasePageRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.PageNo) == 0 {
err = errors.New("PageNo不能为空")
return
}
if len(request.PageSize) == 0 {
err = errors.New("PageSize不能为空")
return
}
return
}

View File

@ -0,0 +1,34 @@
package request
import (
"errors"
"gitea.ddegame.cn/open/servicebase/pkg/common/HyTools"
)
// 分页获取基础
type BasePagingRequest struct {
AccessToken string
AnchorId string // 分页锚点
PageSize string
}
// 参数合法性检验
func (request *BasePagingRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.PageSize) == 0 {
err = errors.New("PageSize不能为空")
return
}
if HyTools.StringToInt(request.PageSize) < 1 {
err = errors.New("PageSize不合法")
return
}
return
}

View File

@ -0,0 +1,62 @@
package request
import (
"errors"
"gitea.ddegame.cn/open/servicebase/pkg/tools"
)
type BaseRequest struct {
AccessToken string
}
// 参数合法性检验
func (request *BaseRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
return
}
type IdReq struct {
BaseRequest
BizId string
}
func (request *IdReq) CheckParameter() (e error) {
if e = request.BaseRequest.CheckParameter(); e != nil {
return
}
if len(request.BizId) == 0 {
return errors.New("BizId不能为空")
}
return
}
type BasePageReq struct {
BaseRequest
Page string
Size string
}
func (d *BasePageReq) Check() (e error) {
if e = d.BaseRequest.CheckParameter(); e != nil {
return
}
if len(d.Page) == 0 {
d.Page = "0"
}
if len(d.Size) == 0 {
d.Size = "10"
}
return
}
func (d *BasePageReq) Offset() int {
return tools.StrToInt(d.Page) * tools.StrToInt(d.Size)
}
func (d *BasePageReq) Limit() int {
return tools.StrToInt(d.Size)
}

View File

@ -0,0 +1,24 @@
package request
import "errors"
type BaseSkillRequest struct {
AccessToken string
SkillId string
}
// 参数合法性检验
func (request *BaseSkillRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.SkillId) == 0 {
err = errors.New("SkillId不能为空")
return
}
return
}

View File

@ -0,0 +1,24 @@
package request
import "errors"
type BaseTimelineRequest struct {
AccessToken string
TimelineId string
}
// 参数合法性检验
func (request *BaseTimelineRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.TimelineId) == 0 {
err = errors.New("TimelineId不能为空")
return
}
return
}

View File

@ -0,0 +1,24 @@
package request
import "errors"
type BaseUserSkillRequest struct {
AccessToken string
UserSkillId string
}
// 参数合法性检验
func (request *BaseUserSkillRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.UserSkillId) == 0 {
err = errors.New("UserSkillId不能为空")
return
}
return
}

View File

@ -0,0 +1,25 @@
package request
import "errors"
// 购买聊天室表情
type BuyChatroomEmojiRequest struct {
AccessToken string
EmojiId string
}
// 参数合法性检验
func (request *BuyChatroomEmojiRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.EmojiId) == 0 {
err = errors.New("PageNo不能为空")
return
}
return
}

View File

@ -0,0 +1,120 @@
package request
import (
"errors"
"unicode/utf8"
)
type BuyerRateSkillOrderRequest struct {
AccessToken string
OrderId string
RateScore string
RateContent string
IsHidden string
ImageUrl string
}
// 参数合法性检验
func (request *BuyerRateSkillOrderRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.OrderId) == 0 {
err = errors.New("OrderId不能为空")
return
}
if len(request.RateScore) == 0 {
err = errors.New("RateScore不能为空")
return
}
return
}
type BuyerDelRateSkillOrderRequest struct {
AccessToken string
RateID string
}
// 参数合法性检验
func (request *BuyerDelRateSkillOrderRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.RateID) == 0 {
err = errors.New("RateID不能为空")
return
}
return
}
type ReplyRateSkillOrderReq struct {
AccessToken string
RateId string
OrderId string
Content string
ToReplyID string
ReplyRole string // seller、buyer
ImageUrl string
}
// CheckParameter 参数合法性检验
func (request *ReplyRateSkillOrderReq) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.RateId) == 0 {
err = errors.New("RateId不能为空")
return
}
if len(request.OrderId) == 0 {
err = errors.New("OrderID不能为空")
return
}
if len(request.Content) == 0 {
err = errors.New("Content不能为空")
return
}
if utf8.RuneCountInString(request.Content) > 300 {
err = errors.New("Content不能超过300字")
return
}
if request.ReplyRole != "seller" && request.ReplyRole != "buyer" {
err = errors.New("ReplyRole错误")
return
}
return
}
type DelReplyRateSkillOrderReq struct {
AccessToken string
ReplyID string
}
// CheckParameter 参数合法性检验
func (request *DelReplyRateSkillOrderReq) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.ReplyID) == 0 {
err = errors.New("ReplyID不能为空")
return
}
return
}

View File

@ -0,0 +1,30 @@
package request
import "errors"
type ChangePasswordRequest struct {
BaseRequest
OldPassword string
NewPassword string
}
// 签名验证
func (request *ChangePasswordRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.OldPassword) == 0 {
err = errors.New("OldPassword不能为空")
return
}
if len(request.NewPassword) == 0 {
err = errors.New("NewPassword不能为空")
return
}
return
}

View File

@ -0,0 +1,77 @@
package request
import "errors"
type ChatroomBaseRequest struct {
BaseRequest
ChatroomId string
//ViewPosition string // 房间右侧ROOM_RIGHT 普通礼物栏GIFT_NORMAL 礼物背包GIFT_BAG
}
// 参数合法性检验
func (request *ChatroomBaseRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.ChatroomId) == 0 {
err = errors.New("ChatroomId不能为空")
return
}
return
}
// 获取访问过的
type GetVisitedChatroomListRequest struct {
BaseRequest
BaseGuildRequest
PageCode string // PD_HOME PD_ALL
}
// 参数合法性检验
func (request *GetVisitedChatroomListRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.PageCode) == 0 {
err = errors.New("PageCode不能为空")
return
}
return
}
// 送人进房
type TakeUsersToRoomRequest struct {
BaseRequest
ChatroomNo string
UserIds string
Reason string // 送人进房的理由 order-audition=订单试音 order-confirm=订单确认
}
// 参数合法性检验
func (request *TakeUsersToRoomRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.ChatroomNo) == 0 {
err = errors.New("ChatroomNo不能为空")
return
}
if len(request.UserIds) == 0 {
err = errors.New("用户不能为空")
return
}
return
}

View File

@ -0,0 +1,52 @@
package request
import (
"errors"
"gitea.ddegame.cn/open/servicebase/pkg/htools"
)
// 聊天室命令请求
type ChatroomCmdRequest struct {
BaseRequest
ChatroomId string // 聊天室ID
CurrentUserId string `json:"-"` // 当前操作用户
CmdCode string // 命令code
SeatIndex string // 当前操作用户座位编号 新增加boss座位 , seatIndex 为99
TargetUserId string // 被操作用户ID
TargetSeatIndex string // 被操作用户位置 新增加boss座位 , seatIndex 为99
SeatType string // 座位类型 黄金=1 白银=2 青铜=3 老板=4 陪陪(大神)=5
TemplateId string // 模板
RoomName string // 房间名称
CountDownSeconds string // 倒计时时长 30 60 120 300秒
AllowQueue string // 允许还是禁止排队 1=允许 0=禁止
}
// 参数合法性检验
func (request *ChatroomCmdRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.ChatroomId) == 0 {
err = errors.New("ChatroomId不能为空")
return
}
if len(request.CmdCode) == 0 {
err = errors.New("CmdCode不能为空")
return
}
if len(request.SeatType) > 0 {
seatTypeList := []string{"1", "2", "3", "4", "5"}
if !htools.CheckStringIsInArray(seatTypeList, request.SeatType) {
err = errors.New("座位类型错误")
return
}
}
return
}

View File

@ -0,0 +1,31 @@
package request
import "errors"
// 踢人请求
type ChatroomKickOutUserRequest struct {
BaseRequest
ChatroomId string
TargetUserId string // 被踢出的用户Id
}
// 参数合法性检验
func (request *ChatroomKickOutUserRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.ChatroomId) == 0 {
err = errors.New("ChatroomId不能为空")
return
}
if len(request.TargetUserId) == 0 {
err = errors.New("TargetUserId不能为空")
return
}
return
}

View File

@ -0,0 +1,25 @@
package request
import "errors"
type ChatroomRankRequest struct {
BaseRequest
ChatroomId string
RankType string // week=周榜 month=月榜 all=总榜 day=日榜
}
// 参数合法性检验
func (request *ChatroomRankRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.ChatroomId) == 0 {
err = errors.New("ChatroomId不能为空")
return
}
return
}

View File

@ -0,0 +1,54 @@
package request
import (
"errors"
"gitea.ddegame.cn/open/servicebase/pkg/common"
)
// 购买聊天室表情
type ChatroomBuyGuardSeatRequest struct {
AccessToken string
ChatroomId string
ConfigId string // 配置ID
SeatType string
HostUserId string
}
// 参数合法性检验
func (request *ChatroomBuyGuardSeatRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.SeatType) == 0 {
err = errors.New("SeatType不能为空")
return
}
if len(request.ChatroomId) == 0 {
err = errors.New("ChatroomId不能为空")
return
}
if len(request.HostUserId) == 0 {
err = errors.New("ChatroomId不能为空")
return
}
if len(request.ConfigId) == 0 {
err = errors.New("ConfigId不能为空")
return
}
if request.SeatType != common.CHATROOM_SEAT_TYPE_GOLD_GUARD_SEAT && request.SeatType != common.CHATROOM_SEAT_TYPE_SILVER_GUARD_SEAT &&
request.SeatType != common.CHATROOM_SEAT_TYPE_BRONZE_GUARD_SEAT {
err = errors.New("座位类型错误")
return
}
return
}

View File

@ -0,0 +1,27 @@
package request
import (
"errors"
)
// 购买聊天室表情
type ChatroomRockSkewerRequest struct {
AccessToken string
ChatroomId string
}
// 参数合法性检验
func (request *ChatroomRockSkewerRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.ChatroomId) == 0 {
err = errors.New("ChatroomId不能为空")
return
}
return
}

View File

@ -0,0 +1,40 @@
package request
import (
"errors"
"gitea.ddegame.cn/open/servicebase/pkg/common"
)
type ClearChatroomCharmRequest struct {
BaseRequest
ChatroomId string
TargetUserId string
ActionType string // 1=清除整个房间的魅力 2=清除个人的魅力
}
// 参数合法性检验
func (request *ClearChatroomCharmRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.ChatroomId) == 0 {
err = errors.New("ChatroomId不能为空")
return
}
if len(request.ActionType) == 0 {
err = errors.New("ActionType不能为空")
return
}
if request.ActionType == common.CLEAR_CHATROOM_CHARM_TYPE_ONE_USER && len(request.TargetUserId) == 0 {
err = errors.New("UserId不能为空")
return
}
return
}

View File

@ -0,0 +1,30 @@
package request
import "errors"
type CollectRoomRequest struct {
BaseRequest
ChatroomId string
ActionType string //1=收藏 0=取消收藏
}
// 参数合法性检验
func (request *CollectRoomRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.ChatroomId) == 0 {
err = errors.New("ChatroomId不能为空")
return
}
if len(request.ActionType) == 0 {
err = errors.New("ActionType不能为空")
return
}
return
}

View File

@ -0,0 +1,10 @@
package request
type CommonRequest struct {
}
// 参数合法性检验
func (request *CommonRequest) CheckParameter() (err error) {
return
}

View File

@ -0,0 +1,43 @@
package request
import (
"errors"
)
type CompleteUserInfoRequest struct {
Mobile string
Birthday string
NickName string
Gender string
Avatar string
}
// 注册用户信息签名验证
func (request *CompleteUserInfoRequest) CheckParameter() (err error) {
if len(request.Mobile) == 0 {
err = errors.New("手机号不能为空")
return
}
if len(request.NickName) == 0 {
err = errors.New("昵称不能为空")
return
}
if len(request.Gender) == 0 {
err = errors.New("性别不能为空")
return
}
if len(request.Avatar) == 0 {
err = errors.New("头像不能为空")
return
}
if len(request.NickName) > 30 {
err = errors.New("昵称长度不能超过30")
return
}
return
}

View File

@ -0,0 +1,32 @@
package request
import "errors"
type CreateMallOrderRequest struct {
BaseRequest
BuyAmount string // 下单数量
GetterId string // 获得者Id
PriceId string // 价格ID
UserDiscountId string // 优惠ID
}
// 参数合法性检验
func (request *CreateMallOrderRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.BuyAmount) == 0 {
err = errors.New("BuyAmount不能为空")
return
}
if len(request.PriceId) == 0 {
err = errors.New("PriceId 不能为空")
return
}
return
}

View File

@ -0,0 +1,30 @@
package request
import "errors"
type CreatePointOrderRequest struct {
BaseRequest
BuyAmount string // 下单数量
PriceId string // 价格ID
}
// 参数合法性检验
func (request *CreatePointOrderRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.BuyAmount) == 0 {
err = errors.New("BuyAmount不能为空")
return
}
if len(request.PriceId) == 0 {
err = errors.New("PriceId不能为空")
return
}
return
}

View File

@ -0,0 +1,95 @@
package request
import (
"errors"
"gitea.ddegame.cn/open/servicebase/pkg/common/HyTools"
)
// 技能下单
type CreateGuildSkillOrderRequest struct {
AccessToken string
GuildId string
BuyerUserId string
UserSkillId string
BeginTime string
OrderCount string
OrderExt string
BuyerMemo string
PriceId string // 价格ID
ChatroomId string // 从哪个聊天室进来的下单
DispatchOrderId string // 当前聊天室的派单ID
DispatchHostUserId string // 当前聊天室的派单人
}
// 参数合法性检验
func (request *CreateGuildSkillOrderRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.UserSkillId) == 0 {
err = errors.New("UserSkillId不能为空")
return
}
// if len(request.BeginTime) == 0 {
// err = errors.New("BeginTime不能为空")
// return
// }
if len(request.OrderCount) == 0 {
err = errors.New("OrderCount不能为空")
return
}
if len(request.PriceId) == 0 {
err = errors.New("PriceId不能为空")
return
}
if HyTools.StringToFloat64(request.OrderCount) < 0 || HyTools.StringToFloat64(request.OrderCount) > 999 {
err = errors.New("OrderCount不合法")
return
}
return
}
// 技能下单-再来一单
type ReplicateSkillOrderRequest struct {
BaseOrderIdRequest
OrderCount string
BuyerMemo string
}
// 参数合法性检验
func (request *ReplicateSkillOrderRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.OrderCount) == 0 {
err = errors.New("OrderCount不能为空")
return
}
if HyTools.StringToFloat64(request.OrderCount) < 0 || HyTools.StringToFloat64(request.OrderCount) > 999 {
err = errors.New("OrderCount不合法")
return
}
return
}
type CreateSkillOrderDispatchRequest struct {
AccessToken string
DispatchOrderId string // 当前聊天室的派单ID
}
// 参数合法性检验
func (request *CreateSkillOrderDispatchRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.DispatchOrderId) == 0 {
err = errors.New("DispatchOrderId不能为空")
return
}
return
}

View File

@ -0,0 +1,69 @@
package request
import (
"errors"
)
// 动态的图片对象
type TimelineImgDTO struct {
ImgPhotoKey string
Width string
Height string
}
// 动态的视频对象
type TimelineVideoDTO struct {
VideoKey string
Width string
Height string
Duration string
}
type CreateTimelineRequest struct {
AccessToken string
ContentType string //1=图片 2=视频
TextContent string
ImgUrls string
ImgSizes string
ImgList string //json字符串
VideoDTO string //json字符串
CityName string // 城市名
AddressName string
Latitude string
Longitude string
UserSkillId string
}
// 参数合法性检验
func (request *CreateTimelineRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
// if utf8.RuneCountInString(request.TextContent) > 140 {
// err = errors.New("内容最多140个字")
// return
// }
if len([]rune(request.TextContent)) > 1000 {
return errors.New("不能超过1000字")
}
// 视频
if request.ContentType == "2" {
if len(request.VideoDTO) == 0 {
err = errors.New("VideoDTO不能为空")
return
}
} else {
if len(request.ImgUrls) == 0 && len(request.ImgList) == 0 {
err = errors.New("ImgUrls不能为空")
return
}
}
return
}

View File

@ -0,0 +1,24 @@
package request
import "errors"
type GetMatchUserRequest struct {
BaseRequest
SkillId string // 技能ID
SkillMode string // 航天 大坝等
SkillLevel string // 211 大专 985 等
Gender string // 性别 女=0 男=1
}
// 参数合法性检验
func (request *GetMatchUserRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.SkillId) == 0 {
err = errors.New("SkillId不能为空")
return
}
return
}

View File

@ -0,0 +1,24 @@
package request
import "errors"
type DeleteReplyRequest struct {
BaseRequest
ReplyId string
}
// 参数合法性检验
func (request *DeleteReplyRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.ReplyId) == 0 {
err = errors.New("ReplyId不能为空")
return
}
return
}

View File

@ -0,0 +1,24 @@
package request
import "errors"
type DeleteTimelineRequest struct {
AccessToken string
TimelineId string
}
// 参数合法性检验
func (request *DeleteTimelineRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.TimelineId) == 0 {
err = errors.New("TimelineId不能为空")
return
}
return
}

View File

@ -0,0 +1,69 @@
package request
import "errors"
type DeleteUserCheckRequest struct {
AccessToken string
Mobile string
VerificationCode string
}
// 参数合法性检验
func (request *DeleteUserCheckRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.Mobile) == 0 {
err = errors.New("Mobile不能为空")
return
}
if len(request.VerificationCode) == 0 {
err = errors.New("VerificationCode不能为空")
return
}
return
}
type DeleteUserApplyRequest struct {
AccessToken string
VerificationCode string
CertImgFront string
CertImgBacked string
CertImgInHand string
}
// 参数合法性检验
func (request *DeleteUserApplyRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.VerificationCode) == 0 {
err = errors.New("VerificationCode不能为空")
return
}
// if len(request.CertImgFront) == 0 {
// err = errors.New("CertImgFront不能为空")
// return
// }
// if len(request.CertImgBacked) == 0 {
// err = errors.New("CertImgBack不能为空")
// return
// }
// if len(request.CertImgInHand) == 0 {
// err = errors.New("CertImgInHand不能为空")
// return
// }
return
}

View File

@ -0,0 +1,24 @@
package request
import "errors"
type DeleteUserPhotoRequest struct {
BaseRequest
UserPhotoModelId string
}
// 参数合法性检验
func (request *DeleteUserPhotoRequest) CheckParameter() (err error) {
if len(request.UserPhotoModelId) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
return
}

View File

@ -0,0 +1,131 @@
package request
import (
"encoding/json"
"errors"
"gitea.ddegame.cn/open/servicebase/pkg/common/HyTools"
"github.com/shopspring/decimal"
)
// 派单请求
type DispatchOrderRequest struct {
BaseRequest
GuildId string // 公会ID
ChatroomId string // 聊天室ID
SkillId string // 技能ID
SkillMode string // 玩法
SkillLevel string // 等级
SkillService string // 单子类型
Gender string // 性别
Hours string // 时长
ConfigId string // 配置ID
CustomerRequirement string // 用户需求
}
// 判断decimal是否是0.5的倍数
func isHalfMultiple(d decimal.Decimal) bool {
// 乘以2后检查是否为整数
multiplied := d.Mul(decimal.NewFromInt(2))
// 将整数部分转换为decimal类型后再比较
intPart := decimal.NewFromInt(multiplied.IntPart())
return multiplied.Equal(intPart)
}
// 签名验证
func (request *DispatchOrderRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.SkillId) == 0 {
err = errors.New("SkillId不能为空")
return
}
if len(request.ChatroomId) == 0 {
err = errors.New("ChatroomId不能为空")
return
}
if HyTools.StringToInt(request.Hours) <= 0 || HyTools.StringToInt(request.Hours) > 999 {
err = errors.New("时长不合法")
return
}
//var hours decimal.Decimal
//hours, err = decimal.NewFromString(request.Hours)
//if err != nil {
// err = errors.New("时长不正确")
// return
//}
//if !isHalfMultiple(hours) {
// err = errors.New("时长必须为0.5的倍数")
// return
//}
return
}
// 派单请求
type DispatchOrderCommonRequest struct {
BaseRequest
GuildId string // 公会ID
ChatroomId string // 房间ID客服下单
HostUserId string // 派单用户ID客服下单
BuyerId string // 买家ID用户自己下单
SkillId string // 技能ID
Hours string // 时长
Comment string // 备注
NeedsAudition string // 是否试音 T=是 F=否
OrderList string
Orders []DispatchOrderCommonItemRequest
CompanionType string // 陪玩类型 single double
}
type DispatchOrderCommonItemRequest struct {
ConfigId string // 价格配置ID
Mode string //
Level string //
Service string //
Gender string //
Price string //
}
// 签名验证
func (request *DispatchOrderCommonRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.SkillId) == 0 {
err = errors.New("SkillId不能为空")
return
}
if e := json.Unmarshal([]byte(request.OrderList), &request.Orders); e != nil {
err = errors.New("数据格式错误")
return
}
if len(request.Orders) == 0 {
err = errors.New("至少要选择一个陪玩")
return
}
if HyTools.StringToInt(request.Hours) <= 0 || HyTools.StringToInt(request.Hours) > 999 {
err = errors.New("时长不合法")
return
}
//var hours decimal.Decimal
//hours, err = decimal.NewFromString(request.Hours)
//if err != nil {
// err = errors.New("时长不正确")
// return
//}
//if !isHalfMultiple(hours) {
// err = errors.New("时长必须为0.5的倍数")
// return
//}
for _, item := range request.Orders {
if len(item.Gender) > 0 && (HyTools.StringToInt(item.Price) <= 0 || HyTools.StringToInt(item.Price) > 99999) {
err = errors.New("价格不合法")
return
}
}
return
}

View File

@ -0,0 +1,22 @@
package request
import "errors"
type EnterRoomRequest struct {
BaseRequest
ChatroomId string
RoomPwd string
}
// 参数合法性检验
func (request *EnterRoomRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.ChatroomId) == 0 {
err = errors.New("ChatroomId不能为空")
return
}
return
}

View File

@ -0,0 +1,69 @@
package request
import "github.com/shopspring/decimal"
type CreateExaminerReq struct {
BaseRequest
UserId string
SkillId string
}
type BindExaminerSkillReq struct {
BaseRequest
UserId string
SkillId string
}
type DownExaminerReq struct {
BaseRequest
UserId string
Reason string
Status string // down | normal
}
type CreateExamReq struct {
BaseRequest
SkillId string
MapId string
LevelId string
GenderRequirement string // F | M | N
Requirement string // single | double
CandidateStatus string // employed | unemployed
FirstFree string // y | n
UpStart string
UpEnd string
RightNow bool
EmployedPrice decimal.Decimal
UnEmployedPrice decimal.Decimal
}
type UpdateExamReq struct {
CreateExamReq
ExamId string
Status string // down
}
type CreateNoticeReq struct {
BaseRequest
Id string
Content string
ImgUrl string
UpStart string
UpEnd string
RightNow bool
}
type ReviewExamApprovalReq struct {
BaseRequest
OrderNo string
ReviewId string
Action string // accept deny
Reason string
}
type SupportOrderReq struct {
BaseRequest
Content string
SupportId string
OrderNo string
}

View File

@ -0,0 +1,173 @@
package request
import (
"errors"
"unicode/utf8"
)
type GetExamNoticeReq struct {
BaseRequest
}
type GetExaminerReq struct {
BasePageRequest
SkillId string
LevelId string
MapId string
Requirement string // single double
SearchKey string
}
func (r *GetExaminerReq) CheckParameter() error {
err := r.BasePageRequest.CheckParameter()
if err != nil {
return err
}
if r.SkillId == "" {
return errors.New("SkillId不能为空")
}
return nil
}
type CreateExamOrderReq struct {
BaseRequest
ExaminerId string
ExamId string
}
func (r *CreateExamOrderReq) CheckParameter() error {
err := r.BaseRequest.CheckParameter()
if err != nil {
return err
}
if r.ExaminerId == "" {
return errors.New("ExaminerId不能为空")
}
if r.ExamId == "" {
return errors.New("ExamId不能为空")
}
return nil
}
type GetExamOrderListReq struct {
BasePageRequest
}
func (r *GetExamOrderListReq) CheckParameter() error {
err := r.BasePageRequest.CheckParameter()
if err != nil {
return err
}
return nil
}
type SubmitExamOrderReviewReq struct {
BaseRequest
OrderNo string
StartTime string
EndTime string
Remark string
Url string
Desc string
VideoUrl string
}
func (r *SubmitExamOrderReviewReq) CheckParameter() error {
err := r.BaseRequest.CheckParameter()
if err != nil {
return err
}
if r.OrderNo == "" {
return errors.New("OrderNo不能为空")
}
if r.StartTime == "" {
return errors.New("StartTime不能为空")
}
if r.EndTime == "" {
return errors.New("EndTime不能为空")
}
if utf8.RuneCountInString(r.Remark) > 300 {
return errors.New("Remark不能超过300字")
}
return nil
}
type CompleteExamOrderReq struct {
BaseRequest
OrderNo string
}
func (r *CompleteExamOrderReq) CheckParameter() error {
err := r.BaseRequest.CheckParameter()
if err != nil {
return err
}
if r.OrderNo == "" {
return errors.New("OrderNo不能为空")
}
return nil
}
type ExamImg struct {
Url string
Desc string
}
type GetExamReq struct {
BaseRequest
SkillId string
LevelId string
MapId string
Requirement string // single double
}
func (r *GetExamReq) CheckParameter() error {
err := r.BaseRequest.CheckParameter()
if err != nil {
return err
}
if r.SkillId == "" {
return errors.New("SkillId不能为空")
}
return nil
}
type ApplyExamOrderCustomerServiceReq struct {
BaseRequest
OrderNo string
Reason string
}
func (r *ApplyExamOrderCustomerServiceReq) CheckParameter() error {
err := r.BaseRequest.CheckParameter()
if err != nil {
return err
}
if r.OrderNo == "" {
return errors.New("OrderNo不能为空")
}
if utf8.RuneCountInString(r.Reason) > 100 {
return errors.New("Reason不能超过100字")
}
return nil
}
type RateExamOrderReq struct {
BaseRequest
OrderNo string
Content string
}
func (r *RateExamOrderReq) CheckParameter() error {
err := r.BaseRequest.CheckParameter()
if err != nil {
return err
}
if r.OrderNo == "" {
return errors.New("OrderNo不能为空")
}
if utf8.RuneCountInString(r.Content) > 100 {
return errors.New("Content不能超过100字")
}
return nil
}

View File

@ -0,0 +1,45 @@
package request
import (
"errors"
"strings"
)
type FindTreasureRequest struct {
BaseRequest
PriceType string
BoxIds string
}
// 签名验证
func (request *FindTreasureRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.PriceType) == 0 {
err = errors.New("PriceType不能为空")
return
}
if request.PriceType != "1" && request.PriceType != "2" && request.PriceType != "3" {
err = errors.New("PriceType非法")
return
}
if len(request.BoxIds) == 0 {
err = errors.New("BoxIds不能为空")
return
}
idList := strings.Split(request.BoxIds, ",")
if len(idList) < 1 || len(idList) > 9 {
err = errors.New("BoxIds非法")
return
}
return
}

View File

@ -0,0 +1,32 @@
package request
import "errors"
// 首次绑定手机号
type FirstTimeBindMobileRequest struct {
AccessToken string
Mobile string
Vericode string
RegionCode string
}
// 参数合法性检验
func (request *FirstTimeBindMobileRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.Mobile) == 0 {
err = errors.New("Mobile不能为空")
return
}
if len(request.Vericode) == 0 {
err = errors.New("Vericode不能为空")
return
}
return
}

View File

@ -0,0 +1,24 @@
package request
import "errors"
type FirstTimeSetPasswordRequest struct {
AccessToken string
Password string
}
// 参数合法性检验
func (request *FirstTimeSetPasswordRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.Password) == 0 {
err = errors.New("Password不能为空")
return
}
return
}

View File

@ -0,0 +1,24 @@
package request
import "errors"
type FollowUserRequest struct {
BaseRequest
TargetUserId string
}
// 参数合法性检验
func (request *FollowUserRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.TargetUserId) == 0 {
err = errors.New("TargetUserId不能为空")
return
}
return
}

View File

@ -0,0 +1,18 @@
package request
type GeneralRankRequest struct {
BasePageRequest
}
func (r *GeneralRankRequest) CheckParameter() (err error) {
err = r.BasePageRequest.CheckParameter()
if err != nil {
return err
}
return
}
type GeneralGiftRequest struct {
BaseRequest
RankCode string
}

View File

@ -0,0 +1,20 @@
package request
import "errors"
type GetBannerListRequest struct {
BaseRequest
PositionCode string
GuildId string
}
// 参数合法性检验
func (request *GetBannerListRequest) CheckParameter() (err error) {
if len(request.PositionCode) == 0 {
err = errors.New("PositionCode不能为空")
return
}
return
}

View File

@ -0,0 +1,25 @@
package request
import "errors"
type GetChatroomActivityRequest struct {
BaseRequest
ChatroomId string
ViewPosition string // 房间右侧ROOM_RIGHT 普通礼物栏GIFT_NORMAL 礼物背包GIFT_BAG
}
// 参数合法性检验
func (request *GetChatroomActivityRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.ChatroomId) == 0 {
err = errors.New("ChatroomId不能为空")
return
}
return
}

View File

@ -0,0 +1,24 @@
package request
import "errors"
type GetChatroomBlackReasonRequest struct {
BaseRequest
TemplateId string
}
// 参数合法性检验
func (request *GetChatroomBlackReasonRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.TemplateId) == 0 {
err = errors.New("ChatroomId不能为空")
return
}
return
}

View File

@ -0,0 +1,56 @@
package request
import "errors"
type GetChatroomListRequest struct {
BaseGuildRequest
TabId string
PageNo string
PageSize string
}
// 参数合法性检验
func (request *GetChatroomListRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.TabId) == 0 {
err = errors.New("TabId不能为空")
return
}
if len(request.PageNo) == 0 {
err = errors.New("PageNo不能为空")
return
}
if len(request.PageSize) == 0 {
err = errors.New("PageSize不能为空")
return
}
return
}
type GetChatroomChildrenListRequest struct {
BaseRequest
CurrentRoomId string
UseDefaultGroup *bool
RootId string
PageNo string
PageSize string
}
// 参数合法性检验
func (request *GetChatroomChildrenListRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
return
}

View File

@ -0,0 +1,30 @@
package request
import "errors"
type GetChatroomOnlineGuardListRequest struct {
BaseRequest
HostUserId string
ChatroomId string
}
// 参数合法性检验
func (request *GetChatroomOnlineGuardListRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.HostUserId) == 0 {
err = errors.New("HostUserId不能为空")
return
}
if len(request.ChatroomId) == 0 {
err = errors.New("ChatroomId不能为空")
return
}
return
}

View File

@ -0,0 +1,58 @@
package request
import "errors"
type GetDispatchOrderCenterDataListRequest struct {
BaseRequest
LastCreateTime string
PageNo string
PageSize string
Status string // 接单状态 taked=已接单 预留
}
// 参数合法性检验
func (request *GetDispatchOrderCenterDataListRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
return
}
type GetDispatchOrderCenterDataHistoryListRequest struct {
BaseRequest
LastCreateTime string
PageNo string
PageSize string
//DispatchStatus string // 派单状态 dispatching-派单中 success-派单完成
//TakeStatus string // 接单状态 take=已接单 notTake 未接单 预留
}
// 参数合法性检验
func (request *GetDispatchOrderCenterDataHistoryListRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
return
}
type GetActiveOrderListRequest struct {
BaseRequest
ChatroomId string
}
// 参数合法性检验
func (request *GetActiveOrderListRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.ChatroomId) == 0 {
err = errors.New("ChartoomId不能为空")
return
}
return
}

View File

@ -0,0 +1,23 @@
package request
import "errors"
// 获取物品兑换配置表
type GetGoodsExchangeConfigRequest struct {
AccessToken string
GoodsId string
ActId string
}
// 参数合法性检验
func (request *GetGoodsExchangeConfigRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.GoodsId) == 0 && len(request.ActId) == 0 {
err = errors.New("GoodsId和ActId不能同时为空")
return
}
return
}

View File

@ -0,0 +1,26 @@
package request
import "errors"
type GetGoodsOrderListRequest struct {
BaseRequest
GoodsId string
PageNo string
PageSize string
}
// 参数合法性检验
func (request *GetGoodsOrderListRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.GoodsId) == 0 {
err = errors.New("GoodsId不能为空")
return
}
return
}

View File

@ -0,0 +1,20 @@
package request
import "errors"
type GetHomeDataRequest struct {
BaseRequest
PageCode string
GuildId string
}
// 参数合法性检验
func (request *GetHomeDataRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
return
}

View File

@ -0,0 +1,24 @@
package request
import "errors"
type GetHostGuardListRequest struct {
BaseRequest
HostUserId string
}
// 参数合法性检验
func (request *GetHostGuardListRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.HostUserId) == 0 {
err = errors.New("HostUserId不能为空")
return
}
return
}

View File

@ -0,0 +1,25 @@
package request
import "errors"
// 获取本机手机号
type GetLocalMobileRequest struct {
YiDunAccessToken string
YiDunToken string
}
// 参数合法性检验
func (request *GetLocalMobileRequest) CheckParameter() (err error) {
if len(request.YiDunAccessToken) == 0 {
err = errors.New("YiDunAccessToken不能为空")
return
}
if len(request.YiDunToken) == 0 {
err = errors.New("YiDunToken不能为空")
return
}
return
}

View File

@ -0,0 +1,32 @@
package request
import "errors"
// 分页获取音乐
type GetMusicListRequest struct {
AccessToken string
Keyword string
PageNo string
PageSize string
}
// 参数合法性检验
func (request *GetMusicListRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.PageNo) == 0 {
err = errors.New("PageNo不能为空")
return
}
if len(request.PageSize) == 0 {
err = errors.New("PageSize不能为空")
return
}
return
}

View File

@ -0,0 +1,26 @@
package request
import "errors"
type GetMyHitEggPrizeListRequest struct {
BasePageRequest
SortType string //time=按时间 price=礼物价格
}
// 参数合法性检验
func (request *GetMyHitEggPrizeListRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.SortType) > 0 {
if request.SortType != "time" && request.SortType != "price" {
err = errors.New("OrderType参数错误")
return
}
}
return
}

View File

@ -0,0 +1,58 @@
package request
import (
"errors"
"gitea.ddegame.cn/open/servicebase/pkg/common/order"
)
type GetSkillLevelListRequest struct {
AccessToken string
SkillId string
}
// 参数合法性检验
func (request *GetSkillLevelListRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.SkillId) == 0 {
err = errors.New("SkillId不能为空")
return
}
return
}
type GetOrderRankReq struct {
BasePageRequest
Category string // day week month
GuildId string
GroupByFields []string
}
// 参数合法性检验
func (request *GetOrderRankReq) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if request.Category != "week" && request.Category != "day" && request.Category != "month" {
err = errors.New("参数Category错误不支持")
return
}
if len(request.GroupByFields) != 0 {
for _, field := range request.GroupByFields {
_, ok := order.WhitelistFields[field]
if !ok {
err = errors.New("包含不支持的字段")
return
}
}
}
return
}

View File

@ -0,0 +1,27 @@
package request
import "errors"
type GetSkillSkuListRequestH5 struct {
AccessToken string
SkillId string
ShortName string
SortBy string // 排序 1=智能 2=最新 3=人气
Gender string // 性别 0=女 1=男 ""=不限
Online string // 在线 1=在线 ""=不限
Area string // 分区
SkillLevel string // 技能等级 ""=不限
AnchorId string // 分页锚点ID
PageSize string
}
// 参数合法性检验
func (request *GetSkillSkuListRequestH5) CheckParameter() (err error) {
if len(request.SkillId) == 0 {
err = errors.New("SkillId不能为空")
return
}
return
}

View File

@ -0,0 +1,56 @@
package request
import "errors"
type GetSkillSkuListRequest struct {
AccessToken string
GuildId string
SkillId string
SortBy string // 排序 1=智能 2=最新 3=人气 4=附近
Gender string // 性别 0=女 1=男 ""=不限
Online string // 在线 1=在线 ""=不限
PriceOrder string // 价格 1=升序 2=降序 否则不排序
Area string // 分区
SkillMode string // 技能玩法 ""=不限
SkillLevel string // 技能等级 ""=不限
AnchorId string // 分页锚点ID
OrderStatus string // 陪玩状态 idle=空闲 accepting=接单中
PageSize string
Key string
}
// 参数合法性检验
func (request *GetSkillSkuListRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
// if len(request.SkillId) == 0 {
// err = errors.New("SkillId不能为空")
// return
// }
return
}
type SearchSkillSkuListRequest struct {
AccessToken string
GuildId string
Key string
AnchorId string
PageSize string
}
// 参数合法性检验
func (request *SearchSkillSkuListRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.PageSize) == 0 {
request.PageSize = "20"
}
return
}

View File

@ -0,0 +1,37 @@
package request
import "errors"
// 分页获取资质列表数据
type GetSkillUserListRequest struct {
AccessToken string
SkillId string
PageNo string
PageSize string
}
// 参数合法性检验
func (request *GetSkillUserListRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.SkillId) == 0 {
err = errors.New("SkillId不能为空")
return
}
if len(request.PageNo) == 0 {
err = errors.New("PageNo不能为空")
return
}
if len(request.PageSize) == 0 {
err = errors.New("PageSize不能为空")
return
}
return
}

View File

@ -0,0 +1,33 @@
package request
import "errors"
type GetTimelineByCategoryRequest struct {
BaseRequest
CategoryId string
PageNo string
PageSize string
Lat string
Lng string
}
// 获取用户动态
func (request *GetTimelineByCategoryRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.CategoryId) == 0 {
err = errors.New("CategoryId不能为空")
return
}
if len(request.PageSize) == 0 || len(request.PageNo) == 0 {
err = errors.New("PageNo或PageSize不能为空")
return
}
return
}
type GetTimelineNewCntFollowRequest struct {
BaseRequest
}

View File

@ -0,0 +1,31 @@
package request
import "errors"
type GetTimelineReplyChildrenRequest struct {
BaseRequest
ReplyId string
PageNo string
PageSize string
}
// 获取用户动态
func (request *GetTimelineReplyChildrenRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.ReplyId) == 0 {
err = errors.New("ReplyId不能为空")
return
}
if len(request.PageSize) == 0 || len(request.PageNo) == 0 {
err = errors.New("PageNo或PageSize不能为空")
return
}
return
}

View File

@ -0,0 +1,26 @@
package request
import "errors"
type GetTimelineReplyListRequest struct {
BaseRequest
TimelineId string
PageNo string
PageSize string
}
// 获取用户动态
func (request *GetTimelineReplyListRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.TimelineId) == 0 {
err = errors.New("TargetUserId不能为空")
return
}
return
}

View File

@ -0,0 +1,18 @@
package request
import "errors"
type GetUserAccountRequest struct {
BaseRequest
}
// 参数合法性检验
func (request *GetUserAccountRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
return
}

View File

@ -0,0 +1,20 @@
package request
import "errors"
type GetUserChatroomRequest struct {
AccessToken string
TargetUserId string // 获取哪个用户的 获取自己的不传
}
// 参数合法性检验
func (request *GetUserChatroomRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
return
}

View File

@ -0,0 +1,56 @@
package request
import "errors"
type GetUserDetailRequest struct {
BaseGuildRequest
GuildId string
TargetUserId string
}
// 注册用户信息签名验证
func (request *GetUserDetailRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.TargetUserId) == 0 {
err = errors.New("TargetUserId不能为空")
return
}
if len(request.GuildId) == 0 {
request.GuildId = "-1"
}
return
}
type GetCreateOrderRequest struct {
BaseRequest
TargetUserId string
UserSkillId string
}
// 注册用户信息签名验证
func (request *GetCreateOrderRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.TargetUserId) == 0 {
err = errors.New("TargetUserId不能为空")
return
}
if len(request.UserSkillId) == 0 {
err = errors.New("技能ID不能为空")
return
}
return
}

View File

@ -0,0 +1,38 @@
package request
import "errors"
type GetUserDiamondJournalRequest struct {
BaseRequest
ActionType string //1=收入 2=支出
PageNo string
PageSize string
}
// 参数合法性检验
func (request *GetUserDiamondJournalRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.PageNo) == 0 {
err = errors.New("PageNo不能为空")
return
}
if len(request.PageSize) == 0 {
err = errors.New("PageSize不能为空")
return
}
if len(request.ActionType) > 0 {
if request.ActionType != "1" && request.ActionType != "2" {
err = errors.New("ActionType参数错误")
return
}
}
return
}

View File

@ -0,0 +1,27 @@
package request
import (
"errors"
)
// 购买聊天室表情
type GetUserGuardSeatRequest struct {
AccessToken string
HostUserId string
}
// 参数合法性检验
func (request *GetUserGuardSeatRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.HostUserId) == 0 {
err = errors.New("HostUserId不能为空")
return
}
return
}

View File

@ -0,0 +1,19 @@
package request
import "errors"
type GetUserSkillDetailH5Request struct {
AccessToken string
UserSkillId string
}
// 参数合法性检验
func (request *GetUserSkillDetailH5Request) CheckParameter() (err error) {
if len(request.UserSkillId) == 0 {
err = errors.New("UserSkillId不能为空")
return
}
return
}

View File

@ -0,0 +1,24 @@
package request
import "errors"
type GetUserSkillDetailRequest struct {
AccessToken string
UserSkillId string
}
// 参数合法性检验
func (request *GetUserSkillDetailRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.UserSkillId) == 0 {
err = errors.New("UserSkillId不能为空")
return
}
return
}

View File

@ -0,0 +1,21 @@
package request
import "errors"
type GetUserSkillRateListH5Request struct {
AccessToken string
UserSkillId string
PageNo string
PageSize string
}
// 参数合法性检验
func (request *GetUserSkillRateListH5Request) CheckParameter() (err error) {
if len(request.UserSkillId) == 0 {
err = errors.New("SkillId不能为空")
return
}
return
}

View File

@ -0,0 +1,45 @@
package request
import "errors"
type GetUserSkillRateListRequest struct {
AccessToken string
UserSkillId string
PageNo string
PageSize string
}
// 参数合法性检验
func (request *GetUserSkillRateListRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.UserSkillId) == 0 {
err = errors.New("SkillId不能为空")
return
}
return
}
type GetUserSkillRateListByUserIDRequest struct {
AccessToken string
UserId string
PageNo string
PageSize string
}
// 参数合法性检验
func (request *GetUserSkillRateListByUserIDRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.UserId) == 0 {
err = errors.New("用户ID不能为空")
return
}
return
}

View File

@ -0,0 +1,25 @@
package request
import "errors"
type GetUserStoreModelRequest struct {
AccessToken string
GoodsId string
WithProp string
}
// 参数合法性检验
func (request *GetUserStoreModelRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.GoodsId) == 0 {
err = errors.New("GoodsId不能为空")
return
}
return
}

View File

@ -0,0 +1,26 @@
package request
import "errors"
type GetUserTimelineRequest struct {
BaseRequest
TargetUserId string
PageNo string
PageSize string
}
// 获取用户动态
func (request *GetUserTimelineRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.TargetUserId) == 0 {
err = errors.New("TargetUserId不能为空")
return
}
return
}

View File

@ -0,0 +1,25 @@
package request
import "errors"
type GetUserVisitLogRequest struct {
BaseRequest
AnchorId string
PageSize string
}
// 签名验证
func (request *GetUserVisitLogRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.PageSize) == 0 {
err = errors.New("PageSize不能为空")
return
}
return
}

View File

@ -0,0 +1,31 @@
package request
import "errors"
// 物品兑换
type GoodsExchangeRequest struct {
AccessToken string
ConfigId string
TargetCount string
}
// 参数合法性检验
func (request *GoodsExchangeRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.ConfigId) == 0 {
err = errors.New("ConfigId不能为空")
return
}
if len(request.TargetCount) == 0 {
err = errors.New("TargetCount不能为空")
return
}
return
}

16
pkg/dto/request/Guild.go Normal file
View File

@ -0,0 +1,16 @@
package request
type GuildPageReq struct {
BasePageReq
SkillId string
Key string
SelfOperated string
}
func (d *GuildPageReq) Check() (e error) {
d.BasePageReq.Check()
if err := d.BasePageReq.BaseRequest.CheckParameter(); err != nil {
return err
}
return
}

View File

@ -0,0 +1,31 @@
package request
import "github.com/anxpp/beego/context"
type HeaderModel struct {
ClientVersion string
DeviceId string
Platform string
MarketChannel string
DeviceModel string
TimeStamp string
BundleId string
OsVersion string
ApiVersionNum string
}
func GetHeaderModel(ctx *context.Context) HeaderModel {
model := HeaderModel{}
model.ClientVersion = ctx.Input.Header("ClientVersion")
model.DeviceId = ctx.Input.Header("DeviceId")
model.Platform = ctx.Input.Header("Platform")
model.MarketChannel = ctx.Input.Header("MarketChannel")
model.DeviceModel = ctx.Input.Header("DeviceModel")
model.BundleId = ctx.Input.Header("BundleId")
model.OsVersion = ctx.Input.Header("OsVersion")
model.ApiVersionNum = ctx.Input.Header("ApiVersionNum")
model.TimeStamp = ctx.Input.Header("TimeStamp")
return model
}

View File

@ -0,0 +1,31 @@
package request
import (
"errors"
)
type HitEggRequest struct {
BaseRequest
HitCount string
}
// 签名验证
func (request *HitEggRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.HitCount) == 0 {
err = errors.New("HitCount不能为空")
return
}
if request.HitCount != "1" && request.HitCount != "10" && request.HitCount != "100" {
err = errors.New("HitCount非法")
return
}
return
}

View File

@ -0,0 +1,24 @@
package request
import "errors"
type LeaveRoomRequest struct {
BaseRequest
ChatroomId string
}
// 参数合法性检验
func (request *LeaveRoomRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.ChatroomId) == 0 {
err = errors.New("ChatroomId不能为空")
return
}
return
}

View File

@ -0,0 +1,51 @@
package request
import "errors"
type NoticeListRequest struct {
AccessToken string
GuildId string
Page string //
Size string //
}
// 参数合法性检验
func (request *NoticeListRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.Page) == 0 {
err = errors.New("页码不能为空")
return
}
if len(request.Size) == 0 {
err = errors.New("页大小不能为空")
return
}
return
}
type NoticeDetailRequest struct {
AccessToken string
GuildId string
Id string
}
// 参数合法性检验
func (request *NoticeDetailRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.Id) == 0 {
err = errors.New("id不能为空")
return
}
return
}

View File

@ -0,0 +1,135 @@
package request
import (
"errors"
)
type CreateTalkRoomRequest struct {
BaseRequest
RootId string
RoomName string
}
// 参数合法性检验
func (request *CreateTalkRoomRequest) CheckParameter() (err error) {
if len(request.RootId) == 0 {
return errors.New("RootId 不能为空")
}
if len(request.RoomName) == 0 {
return errors.New("RoomName 不能为空")
}
if request.AccessToken != "admin_inner_client" {
return errors.New("AccessToken 不能为空")
}
return
}
type OpenRoomRequest struct {
BaseRequest
UserId string
RoomName string
TabId string // 聊天室分类ID
RoomAvatar string // 房间头像
}
// 参数合法性检验
func (request *OpenRoomRequest) CheckParameter() (err error) {
if len(request.UserId) == 0 {
err = errors.New("UserId不能为空")
return
}
return
}
type InnerOpenRoomRequest struct {
OpenRoomRequest
GuildId string
}
type CreateRoomGroupRequest struct {
BaseRequest
Name string
Comment string
SortNo string
RootChatroomId string // 根房间ID
ParentChatroomId string // 父房间ID
}
// 参数合法性检验
func (request *CreateRoomGroupRequest) CheckParameter() (err error) {
if len(request.RootChatroomId) == 0 {
request.RootChatroomId = request.ParentChatroomId
}
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.Name) == 0 {
err = errors.New("Name不能为空")
return
}
if len(request.ParentChatroomId) == 0 {
err = errors.New("ParentChatroomId不能为空")
return
}
return
}
type UpdateRoomGroupRequest struct {
BaseRequest
GroupId string
Name string
Comment string
SortNo string
}
// 参数合法性检验
func (request *UpdateRoomGroupRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.Name) == 0 {
err = errors.New("Name不能为空")
return
}
return
}
type CreateChildRoomRequest struct {
BaseRequest
RoomName string
GroupId string // 分组ID
RootChatroomId string // 根房间ID
ParentChatroomId string // 父房间ID
TemplateId string // 模板ID
}
// 参数合法性检验
func (request *CreateChildRoomRequest) CheckParameter() (err error) {
if len(request.RootChatroomId) == 0 {
request.RootChatroomId = request.ParentChatroomId
}
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.RoomName) == 0 {
err = errors.New("RoomName不能为空")
return
}
if len(request.ParentChatroomId) == 0 {
err = errors.New("ParentChatroomId不能为空")
return
}
if len(request.TemplateId) > 0 {
if request.TemplateId != "5007" && request.TemplateId != "5008" {
err = errors.New("模板ID不合法")
return
}
}
return
}

View File

@ -0,0 +1,56 @@
package request
import "errors"
type PraiseReplyRequest struct {
BaseRequest
ReplyId string
}
// 参数合法性检验
func (request *PraiseReplyRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.ReplyId) == 0 {
err = errors.New("ReplyId不能为空")
return
}
return
}
// 设置推荐状态
type SetTimelineRecommandStatusRequest struct {
BaseRequest
TimelineId string
RecommandStatus string // 1=上热门 0=下热门
}
// 参数合法性检验
func (request *SetTimelineRecommandStatusRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.TimelineId) == 0 {
err = errors.New("动态ID不能为空")
return
}
if len(request.RecommandStatus) == 0 {
err = errors.New("缺少状态参数")
return
}
if request.RecommandStatus != "0" && request.RecommandStatus != "1" {
err = errors.New("状态参数错误")
return
}
return
}

View File

@ -0,0 +1,65 @@
package request
import (
"errors"
"gitea.ddegame.cn/open/servicebase/pkg/common/HyTools"
)
// 聊天室赠送活动礼物的请求
type PresentActivityGiftFromChatRoomRequest struct {
BaseRequest
ChatroomId string
ReceiveUserIds string // 赠送的目标用户ID列表json字符串数组
Count string // 礼物数量
ActId string
ActPrice string
HostUserId string // 主持人ID
IsBatch string // 0=打赏个人 1= 打赏全麦
}
// 注册用户信息签名验证
func (request *PresentActivityGiftFromChatRoomRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.ChatroomId) == 0 {
err = errors.New("ChatroomRoomId不能为空")
return
}
if len(request.ReceiveUserIds) == 0 {
err = errors.New("ReceiveUserIds不能为空")
return
}
if len(request.Count) == 0 {
err = errors.New("Count不能为空")
return
}
if len(request.ActId) == 0 {
err = errors.New("ActId不能为空")
return
}
if len(request.IsBatch) == 0 {
err = errors.New("IsBatch不能为空")
return
}
if request.IsBatch != "0" && request.IsBatch != "1" {
err = errors.New("IsBatch只能是0或1")
return
}
if HyTools.StringToInt(request.ActPrice) <= 0 {
err = errors.New("ActPrice不合法")
return
}
return
}

View File

@ -0,0 +1,172 @@
package request
import (
"errors"
"gitea.ddegame.cn/open/servicebase/pkg/htools"
)
// PresentGiftFromChatRoomRequest 聊天室打赏的请求
type PresentGiftFromChatRoomRequest struct {
BaseRequest
ChatroomId string
ReceiveUserId string
ReceiveUserIds string // 打赏全麦的用户ID
GiftCount string // 礼物数量
GiftId string
GiftDiamond string
HostUserId string // 主持人ID
IsBatch string // 0=打赏个人 1= 打赏全麦
BoxId string // 背包ID
IsFromGiftBox string // 是否从礼物盒打赏
}
// 注册用户信息签名验证
func (request *PresentGiftFromChatRoomRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.ChatroomId) == 0 {
err = errors.New("ChatroomRoomId不能为空")
return
}
if len(request.GiftId) == 0 {
err = errors.New("GiftId不能为空")
return
}
if len(request.GiftDiamond) == 0 {
err = errors.New("GiftDiamond不能为空")
return
}
if len(request.GiftCount) == 0 {
err = errors.New("GiftCount不能为空")
return
}
if len(request.IsBatch) == 0 {
err = errors.New("IsBatch不能为空")
return
}
if request.IsBatch != "0" && request.IsBatch != "1" {
err = errors.New("IsBatch只能是0或1")
return
}
/*
if request.IsBatch == "0"{
if len(request.ReceiveUserId) == 0 {
err = errors.New("ReceiveUserId不能为空")
return
}
}else if request.IsBatch == "1"{
if len(request.ReceiveUserIds) == 0 {
err = errors.New("ReceiveUserIds不能为空")
return
}
}*/
if htools.StringToInt(request.GiftDiamond) < 0 {
err = errors.New("GiftDiamond不合法")
return
}
if htools.StringToInt(request.GiftCount) <= 0 {
err = errors.New("GiftCount不合法")
return
}
if request.IsFromGiftBox == "1" {
if len(request.BoxId) == 0 {
err = errors.New("背包礼物打赏缺少BoxId")
return
}
}
return
}
// 动态/消息 打赏
type PresentGiftRequest struct {
BaseRequest
FromType string // IM TIMELINE
TimelineId string
TargetUserId string
GiftCount string // 礼物数量
GiftId string
BoxId string // 背包ID
IsFromGiftBox string // 是否从礼物盒打赏
}
// 注册用户信息签名验证
func (request *PresentGiftRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.FromType) == 0 {
err = errors.New("打赏方式不能为空")
return
}
if len(request.GiftId) == 0 {
err = errors.New("GiftId不能为空")
return
}
if len(request.GiftCount) == 0 {
err = errors.New("GiftCount不能为空")
return
}
if htools.StringToInt(request.GiftCount) <= 0 {
err = errors.New("GiftCount不合法")
return
}
if request.IsFromGiftBox == "1" {
if len(request.BoxId) == 0 {
err = errors.New("背包礼物打赏缺少BoxId")
return
}
}
if request.FromType == "IM" && len(request.TargetUserId) == 0 {
err = errors.New("消息打赏缺少目标用户")
return
}
if request.FromType == "TIMELINE" && len(request.TimelineId) == 0 {
err = errors.New("动态打赏缺少动态ID")
return
}
return
}
// 获取动态打赏列表
type GetTimelinePresentListRequest struct {
BaseRequest
TimelineId string
AnchorId string
}
// 获取动态打赏列表
func (request *GetTimelinePresentListRequest) GetTimelinePresentListRequest() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.TimelineId) == 0 {
err = errors.New("缺少动态ID")
return
}
return
}

View File

@ -0,0 +1,18 @@
package request
import "errors"
type RefreshAccessTokenRequest struct {
BaseRequest
}
// 注册用户信息签名验证
func (request *RefreshAccessTokenRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
return
}

View File

@ -0,0 +1,30 @@
package request
import "github.com/shopspring/decimal"
const (
WxPayChannelCode = "WxPay"
AlipayChannelCode = "AliPay"
)
type RefundReq[T any] struct {
TransactionId string // 支付单号
OutTransactionId string // DD game内部唯一支付单号
OutRefundNo string // 退款单号DD Game内部退款唯一单号
Reason string // 退款原因 1、该退款原因参数的长度不得超过80个字节2、当订单退款金额小于等于1元且为部分退款时退款原因将不会在消息中体现。
RefundDetail T
ChannelCode string //渠道 Code WxPay|AliPay
}
type AliPayRefund struct {
RefundAmount decimal.Decimal // 退款金额alipay单位是元(两位小数),此处统一成分
}
type WxPayRefund struct {
RefundAmount decimal.Decimal // 退款金额wx单位是分,alipay单位是元(两位小数),此处统一成分
PayAmount decimal.Decimal // 原支付订单的金额
}
func (req *RefundReq[T]) CheckParameter() (err error) {
return nil
}

View File

@ -0,0 +1,22 @@
package request
import "errors"
type RelationCancelRequest struct {
BaseRequest
UserRelationId string
Message string
}
// 参数合法性检验
func (request *RelationCancelRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken 不能为空")
return
}
if len(request.UserRelationId) == 0 {
err = errors.New("RelationId 不能为空")
return
}
return
}

View File

@ -0,0 +1,31 @@
package request
import "errors"
type RelationGiftRequest struct {
BaseRequest
TargetUserId string
UserStoreId string
Count string
}
// 参数合法性检验
func (request *RelationGiftRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken 不能为空 ")
return
}
if len(request.Count) == 0 {
err = errors.New("Count 不能为空 ")
return
}
if len(request.TargetUserId) == 0 {
err = errors.New("TargetUserId 不能为空 ")
return
}
if len(request.UserStoreId) == 0 {
err = errors.New("UserStoreId 不能为空 ")
return
}
return
}

View File

@ -0,0 +1,21 @@
package request
import "errors"
type RelationInviteApplyRequest struct {
BaseRequest
ApplyId string
}
// 参数合法性检验
func (request *RelationInviteApplyRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken 不能为空")
return
}
if len(request.ApplyId) == 0 {
err = errors.New("ApplyId 不能为空")
return
}
return
}

View File

@ -0,0 +1,27 @@
package request
import "errors"
type RelationInviteRequest struct {
BaseRequest
RelationId string
TargetUserId string
Message string
}
// 参数合法性检验
func (request *RelationInviteRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken 不能为空")
return
}
if len(request.TargetUserId) == 0 {
err = errors.New("TargetUserId 不能为空")
return
}
if len(request.RelationId) == 0 {
err = errors.New("RelationId 不能为空")
return
}
return
}

View File

@ -0,0 +1,24 @@
package request
import "errors"
type RemoveFromBlackListRequest struct {
BaseRequest
TargetUserId string
}
// 参数合法性检验
func (request *RemoveFromBlackListRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.TargetUserId) == 0 {
err = errors.New("TargetUserId不能为空")
return
}
return
}

View File

@ -0,0 +1,31 @@
package request
import "errors"
type ReplyTimelineRequest struct {
BaseRequest
TimelineId string
ToReplyId string
ReplyContent string
}
// 参数合法性检验
func (request *ReplyTimelineRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.TimelineId) == 0 {
err = errors.New("TimelineId不能为空")
return
}
if len(request.ReplyContent) == 0 {
err = errors.New("ReplyText不能为空")
return
}
return
}

View File

@ -0,0 +1,32 @@
package request
import "errors"
type ReportChatroomRequest struct {
BaseRequest
ChatroomId string
Reason string // 举报原因
PicUrls string
ContentExt string
}
// 参数合法性检验
func (request *ReportChatroomRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.ChatroomId) == 0 {
err = errors.New("ChatroomId不能为空")
return
}
if len(request.Reason) == 0 {
err = errors.New("ChatroomId不能为空")
return
}
return
}

View File

@ -0,0 +1,32 @@
package request
import "errors"
type ReportTimelineRequest struct {
BaseRequest
TargetTimelineId string
Reason string // 举报原因
ContentExt string
PicUrls string //json字符串
}
// 参数合法性检验
func (request *ReportTimelineRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.TargetTimelineId) == 0 {
err = errors.New("TargetTimelineId不能为空")
return
}
if len(request.Reason) == 0 {
err = errors.New("Reason不能为空")
return
}
return
}

View File

@ -0,0 +1,125 @@
package request
import "errors"
type ReportUserRequest struct {
BaseRequest
TargetUserId string
Reason string // 举报原因
PicUrls string
ContentExt string
}
// 参数合法性检验
func (request *ReportUserRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.TargetUserId) == 0 {
err = errors.New("TargetUserId不能为空")
return
}
if len(request.Reason) == 0 {
err = errors.New("Reason不能为空")
return
}
return
}
type UserTicketRequest struct {
BaseRequest
TicketType string // 工单类型
ComplaintType string // 投诉类型
TargetUserId string // 目标用户ID
OrderNo string // 关联订单号
Title string // 标题
Reason string // 售后原因
Content string // 内容
PicUrls string // 图片链接,逗号分隔
}
// 参数合法性检验
func (request *UserTicketRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.TicketType) == 0 {
err = errors.New("TicketType不能为空")
return
}
if len(request.TicketType) == 0 {
err = errors.New("Title不能为空")
return
}
return
}
type UserReplyTicketRequest struct {
BaseRequest
TicketId string // 工单ID
Content string // 内容
PicUrls string // 图片链接,逗号分隔
}
// 参数合法性检验
func (request *UserReplyTicketRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.Content) == 0 && len(request.PicUrls) == 0 {
err = errors.New("内容不能为空")
return
}
return
}
type GetUserTicketPage struct {
BaseRequest
TicketType string // 工单类型 complaint=投诉 suggestion=建议
PageNo string // 页码
PageSize string // 页长
}
// 参数合法性检验
func (request *GetUserTicketPage) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.PageNo) == 0 {
err = errors.New("PageNo不能为空")
return
}
if len(request.PageSize) == 0 {
err = errors.New("PageSize不能为空")
return
}
return
}
type GetUserTicketDetail struct {
BaseRequest
TicketId string
}
// 参数合法性检验
func (request *GetUserTicketDetail) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.TicketId) == 0 {
err = errors.New("TicketId不能为空")
return
}
return
}

View File

@ -0,0 +1,30 @@
package request
import "errors"
type ResetPasswordRequest struct {
Mobile string
Vericode string
NewPassword string
}
// 签名验证
func (request *ResetPasswordRequest) CheckParameter() (err error) {
if len(request.Mobile) == 0 {
err = errors.New("Mobile不能为空")
return
}
if len(request.Vericode) == 0 {
err = errors.New("Vericode不能为空")
return
}
if len(request.NewPassword) == 0 {
err = errors.New("NewPassword不能为空")
return
}
return
}

View File

@ -0,0 +1,31 @@
package request
import (
"errors"
"gitea.ddegame.cn/open/servicebase/pkg/htools"
)
// RevenueExchangeDiamondRequest 魅力值兑换钻石请求
type RevenueExchangeDiamondRequest struct {
AccessToken string
FromAmountType string
ToAmountType string
RevenueAmount string
}
// CheckParameter 参数合法性检验
func (request *RevenueExchangeDiamondRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
return errors.New("AccessToken不能为空")
}
if len(request.RevenueAmount) == 0 {
return errors.New("PageNo不能为空")
}
revenueInt := htools.StringToInt(request.RevenueAmount)
// 最多每次兑换500000
if revenueInt <= 0 || revenueInt > 1000000 {
return errors.New("参数不合法")
}
return
}

View File

@ -0,0 +1,27 @@
package request
type RichRequest struct {
BasePageRequest
GuildId string
}
func (r *RichRequest) CheckParameter() (err error) {
err = r.BasePageRequest.CheckParameter()
if err != nil {
return err
}
return
}
type PopularityRequest struct {
BasePageRequest
GuildId string
}
func (r *PopularityRequest) CheckParameter() (err error) {
err = r.BasePageRequest.CheckParameter()
if err != nil {
return err
}
return
}

View File

@ -0,0 +1,24 @@
package request
import "errors"
type SearchFollowUserRequest struct {
BaseRequest
Keyword string
}
// 参数合法性检验
func (request *SearchFollowUserRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.Keyword) == 0 {
err = errors.New("Keyword不能为空")
return
}
return
}

View File

@ -0,0 +1,47 @@
package request
import "errors"
type SearchRequest struct {
BaseRequest
InputNo string
}
// 参数合法性检验
func (request *SearchRequest) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.InputNo) == 0 {
err = errors.New("InputNo不能为空")
return
}
return
}
// 新搜索对象
type SearchV2Request struct {
BaseRequest
Keyword string // 关键词
TypeCode string // 搜索类型 1=人 2=聊天室
}
// 参数合法性检验
func (request *SearchV2Request) CheckParameter() (err error) {
if len(request.AccessToken) == 0 {
err = errors.New("AccessToken不能为空")
return
}
if len(request.Keyword) == 0 {
err = errors.New("InputNo不能为空")
return
}
return
}

Some files were not shown because too many files have changed in this diff Show More