s_robot_config.go 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. package schema
  2. import "time"
  3. // RobotConfig RobotConfig对象
  4. type RobotConfig struct {
  5. RecordID string `json:"record_id"` // 记录id
  6. OrgId string `json:"org_id"` // 组织机构id
  7. OrgName string `json:"org_name"` // 组织机构名称
  8. Name string `json:"name"` // 机器人名称
  9. Type int `json:"type"` // 机器人类型 1钉钉机器人 2 其他机器人
  10. ReplyType int `json:"reply_type"` // 钉钉机器人回复类型 1: 文本回复 2: 卡片回复
  11. APPID string `json:"app_id"` // APP ID
  12. ClientId string `json:"client_id"` // 客户端ID
  13. ClientSecret string `json:"client_secret"` // 客户端密钥
  14. Webhook string `json:"webhook"` // 消息接收WebHook
  15. CardTemplateId string `json:"card_template_id"` // 卡片模板ID
  16. AssistantId string `json:"assistant_id"` // 助手id
  17. SessionId string `json:"session_id"` // 会话id
  18. CreatedAt time.Time `json:"created_at"` // 创建时间
  19. CreatorId string `json:"creator_id"` // 创建者
  20. CreatorName string `json:"creator_name"` // 创建者名称
  21. Datasets Datasets `json:"datasets"` // 关联知识库
  22. }
  23. // RobotConfigQueryParam 查询条件
  24. type RobotConfigQueryParam struct {
  25. RecordIDs []string
  26. OrgId string
  27. UserId string
  28. ReplyType int // 回复类型 1: 文本回复 2: 卡片回复
  29. }
  30. // RobotConfigQueryOptions RobotConfig对象查询可选参数项
  31. type RobotConfigQueryOptions struct {
  32. PageParam *PaginationParam // 分页参数
  33. }
  34. type RobotConfigs []*RobotConfig
  35. // RobotConfigQueryResult RobotConfig对象查询结果
  36. type RobotConfigQueryResult struct {
  37. Data RobotConfigs
  38. PageResult *PaginationResult
  39. }
  40. // FillCreator 填充创建者信息
  41. func (a RobotConfigs) FillCreator(users Users) {
  42. for _, r := range a {
  43. for _, u := range users {
  44. if r.CreatorId == u.RecordID {
  45. r.CreatorName = u.RealName
  46. continue
  47. }
  48. }
  49. }
  50. }