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 }