feat(app): update
This commit is contained in:
47
pkg/dto/request/UpdateChatroomInfoRequest.go
Normal file
47
pkg/dto/request/UpdateChatroomInfoRequest.go
Normal file
@ -0,0 +1,47 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user