复制项目
This commit is contained in:
11
pkg/botstruct/check.go
Normal file
11
pkg/botstruct/check.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package botstruct
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"git.imall.cloud/openim/chat/pkg/common/constant"
|
||||
)
|
||||
|
||||
func IsAgentUserID(userID string) bool {
|
||||
return strings.HasPrefix(userID, constant.AgentUserIDPrefix)
|
||||
}
|
||||
11
pkg/botstruct/const.go
Normal file
11
pkg/botstruct/const.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package botstruct
|
||||
|
||||
const (
|
||||
Key = "key"
|
||||
AgentIDPrefix = "agent_"
|
||||
)
|
||||
|
||||
const (
|
||||
RoleDeveloper = "developer"
|
||||
RoleUser = "user"
|
||||
)
|
||||
13
pkg/botstruct/msg.go
Normal file
13
pkg/botstruct/msg.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package botstruct
|
||||
|
||||
// see openim-sdk-core\sdk_struct\sdk_struct.go
|
||||
|
||||
type TextElem struct {
|
||||
Content string `json:"content"`
|
||||
}
|
||||
|
||||
type AtElem struct {
|
||||
Text string `mapstructure:"text"`
|
||||
AtUserList []string `mapstructure:"atUserList" validate:"required,max=1000"`
|
||||
IsAtSelf bool `mapstructure:"isAtSelf"`
|
||||
}
|
||||
Reference in New Issue
Block a user