forked from dodo-open/dodo-open-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
channel-voice.go
71 lines (63 loc) · 2.57 KB
/
channel-voice.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
package model
import "errors"
// GetChannelVoiceMemberStatusReq 获取成员语音频道状态
// [https://open.imdodo.com/dev/api/channel-voice.html#%E8%8E%B7%E5%8F%96%E6%88%90%E5%91%98%E8%AF%AD%E9%9F%B3%E9%A2%91%E9%81%93%E7%8A%B6%E6%80%81]
type GetChannelVoiceMemberStatusReq struct {
IslandSourceId string `json:"islandSourceId"`
DodoSourceId string `json:"dodoSourceId"`
}
func (p *GetChannelVoiceMemberStatusReq) ValidParams() error {
if p.IslandSourceId == "" {
return errors.New("invalid parameter islandSourceId (empty detected)")
}
if p.DodoSourceId == "" {
return errors.New("invalid parameter dodoSourceId (empty detected)")
}
return nil
}
// GetChannelVoiceMemberStatusRsp 获取成员语音频道状态
// [https://open.imdodo.com/dev/api/channel-voice.html#%E8%8E%B7%E5%8F%96%E6%88%90%E5%91%98%E8%AF%AD%E9%9F%B3%E9%A2%91%E9%81%93%E7%8A%B6%E6%80%81]
type GetChannelVoiceMemberStatusRsp struct {
ChannelId string `json:"channelId"`
MicStatus int `json:"micStatus"`
SpkStatus int `json:"spkStatus"`
MicSortStatus int `json:"micSortStatus"`
}
// SetChannelVoiceMemberMoveReq 移动语音频道成员
// [https://open.imdodo.com/dev/api/channel-voice.html#%E7%A7%BB%E5%8A%A8%E8%AF%AD%E9%9F%B3%E9%A2%91%E9%81%93%E6%88%90%E5%91%98]
type SetChannelVoiceMemberMoveReq struct {
IslandSourceId string `json:"islandSourceId"`
DodoSourceId string `json:"dodoSourceId"`
ChannelId string `json:"channelId"`
}
func (p *SetChannelVoiceMemberMoveReq) ValidParams() error {
if p.IslandSourceId == "" {
return errors.New("invalid parameter islandSourceId (empty detected)")
}
if p.DodoSourceId == "" {
return errors.New("invalid parameter dodoSourceId (empty detected)")
}
if p.ChannelId == "" {
return errors.New("invalid parameter channelId (empty detected)")
}
return nil
}
// SetChannelVoiceMemberEditReq 管理语音中的成员
// [https://open.imdodo.com/dev/api/channel-voice.html#%E7%AE%A1%E7%90%86%E8%AF%AD%E9%9F%B3%E4%B8%AD%E7%9A%84%E6%88%90%E5%91%98]
type SetChannelVoiceMemberEditReq struct {
ChannelId string `json:"channelId"`
DodoSourceId string `json:"dodoSourceId"`
OperateType int `json:"operateType"`
}
func (p *SetChannelVoiceMemberEditReq) ValidParams() error {
if p.OperateType != 0 && p.OperateType != 1 && p.OperateType != 2 && p.OperateType != 3 {
return errors.New("invalid parameter operateType (empty detected)")
}
if p.DodoSourceId == "" {
return errors.New("invalid parameter dodoSourceId (empty detected)")
}
if p.ChannelId == "" {
return errors.New("invalid parameter channelId (empty detected)")
}
return nil
}