Files
servicebase/pkg/dto/request/UpdateChatroomInfoRequest.go
2025-11-19 14:24:13 +08:00

48 lines
1.1 KiB
Go

package request
import (
"errors"
"github.com/anxpp/common-utils/str"
)
type UpdateChatroomInfoRequest struct {
BaseRequest
ChatroomId string
Announcement string
WelcomeMessage string
RoomName string
UpSeatType string //1=排麦 2=自由麦
IsRecordCharm string // 是否记录魅力值 1=记录 0=不记录
SendMessageTimeGap string // 发消息间隔时间 -1=不可以发 1=每1秒一次
SeatCountDown string // 麦序的倒计时秒数
}
// 注册用户信息签名验证
func (request *UpdateChatroomInfoRequest) 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.RoomName) == 0 {
err = errors.New("RoomName不能为空")
return
}
if len(request.SeatCountDown) > 0 {
if str.StringToInt(request.SeatCountDown) < 10 || str.StringToInt(request.SeatCountDown) > 9999 {
err = errors.New("SeatCountdown只能在10-9999之间")
return
}
}
return
}