sop_stage.api 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. import "../base.api"
  2. type (
  3. // The response data of sop stage information | SopStage信息
  4. SopStageInfo {
  5. BaseIDInfo
  6. // Status 1: normal 2: ban | 状态 1 正常 2 禁用
  7. Status *uint8 `json:"status,optional"`
  8. // SOP 任务 ID
  9. TaskId *uint64 `json:"taskId,optional"`
  10. // 阶段名称
  11. Name *string `json:"name,optional"`
  12. // 客群筛选条件类型 1 按标签筛选 2 按客户基本信息筛选
  13. ConditionType *int `json:"conditionType,optional"`
  14. // 筛选条件关系 1 满足所有条件(and) 2 满足任意条件(or)
  15. ConditionOperator *int `json:"conditionOperator,optional"`
  16. // 筛选条件列表
  17. ConditionList []Condition `json:"conditionList,optional"`
  18. // 命中后发送的消息内容
  19. ActionMessage []Action `json:"actionMessage,optional"`
  20. // 命中后需要打的标签
  21. ActionLabelAdd []uint64 `json:"actionLabelAdd,optional"`
  22. // 命中后需要移除的标签
  23. ActionLabelDel []uint64 `json:"actionLabelDel,optional"`
  24. // 命中后转发的消息内容
  25. ActionForward *ActionForward `json:"actionForward,optional"`
  26. // 阶段顺序
  27. IndexSort *int `json:"indexSort,optional"`
  28. // sop 任务信息
  29. TaskInfo *SopTaskInfo `json:"taskInfo,optional"`
  30. // node 信息
  31. NodeList []SopNodeInfo `json:"nodeList,optional"`
  32. }
  33. // The response data of sop task information | SopTask信息
  34. SopTaskInfo {
  35. BaseIDInfo
  36. // Status 1: normal 2: ban | 状态 1 正常 2 禁用
  37. Status *uint8 `json:"status,optional"`
  38. // SOP 任务名称
  39. Name *string `json:"name,optional"`
  40. // 机器人微信 id 列表
  41. BotWxidList []string `json:"botWxidList,optional"`
  42. // 标签类型:1好友,2群组,3企业微信联系人
  43. Type *int `json:"type,optional"`
  44. // 任务计划开始时间
  45. PlanStartTime *int64 `json:"planStartTime,optional"`
  46. // 任务计划结束时间
  47. PlanEndTime *int64 `json:"planEndTime,optional"`
  48. // 创建者 id
  49. CreatorId *string `json:"creatorId,optional"`
  50. // 阶段信息
  51. StageList []SopStageInfo `json:"stageList,optional"`
  52. // 组织ID
  53. OrganizationId *uint64 `json:"organizationId,optional"`
  54. }
  55. // The response data of sop node information | SopNode信息
  56. SopNodeInfo {
  57. BaseIDInfo
  58. // Status 1: normal 2: ban | 状态 1 正常 2 禁用
  59. Status *uint8 `json:"status,optional"`
  60. // 阶段 ID
  61. StageId *uint64 `json:"stageId,optional"`
  62. // 父节点 ID
  63. ParentId *uint64 `json:"parentId,optional"`
  64. // 节点名称
  65. Name *string `json:"name,optional"`
  66. // 触发条件类型 1 客户回复后触发 2 超时后触发
  67. ConditionType *int `json:"conditionType,optional"`
  68. // 触发语义列表 当为空时则代表用户回复任意内容后触发
  69. ConditionList []string `json:"conditionList,optional"`
  70. // 超时触发时间(分钟)
  71. NoReplyCondition *uint64 `json:"noReplyCondition,optional"`
  72. // 超时触发时间单位
  73. NoReplyUnit *string `json:"noReplyUnit,optional"`
  74. // 命中后发送的消息内容
  75. ActionMessage []Action `json:"actionMessage,optional"`
  76. // 命中后需要打的标签
  77. ActionLabelAdd []uint64 `json:"actionLabelAdd,optional"`
  78. // 命中后需要移除的标签
  79. ActionLabelDel []uint64 `json:"actionLabelDel,optional"`
  80. // 命中后转发的消息内容
  81. ActionForward *ActionForward `json:"actionForward,optional"`
  82. // 阶段信息
  83. StageInfo *SopStageInfo `json:"stageInfo,optional"`
  84. }
  85. // The response data of sop stage list | SopStage列表数据
  86. SopStageListResp {
  87. BaseDataInfo
  88. // SopStage list data | SopStage列表数据
  89. Data SopStageListInfo `json:"data"`
  90. }
  91. // SopStage list data | SopStage列表数据
  92. SopStageListInfo {
  93. BaseListInfo
  94. // The API list data | SopStage列表数据
  95. Data []SopStageInfo `json:"data"`
  96. }
  97. // Get sop stage list request params | SopStage列表请求参数
  98. SopStageListReq {
  99. TaskId *uint64 `json:"taskId"`
  100. }
  101. // SopStage information response | SopStage信息返回体
  102. SopStageInfoResp {
  103. BaseDataInfo
  104. // SopStage information | SopStage数据
  105. Data SopStageInfo `json:"data"`
  106. }
  107. // SopStage create response | SopStage创建回体
  108. SopStageCreateResp {
  109. BaseDataInfo
  110. // SopStage id | SopStage id
  111. Data uint64 `json:"data"`
  112. }
  113. // Move sop stage request params | 移动阶段请求参数
  114. SopStageMoveReq {
  115. BaseIDInfo
  116. // 阶段名称
  117. Offset *int `json:"offset,optional"`
  118. }
  119. )
  120. @server(
  121. jwt: Auth
  122. group: sop_stage
  123. middleware: Authority
  124. )
  125. service Wechat {
  126. // Create sop stage information | 创建SopStage
  127. @handler createSopStage
  128. post /sop_stage/create (SopStageInfo) returns (SopStageCreateResp)
  129. // Update sop stage information | 更新SopStage
  130. @handler updateSopStage
  131. post /sop_stage/update (SopStageInfo) returns (BaseMsgResp)
  132. // Delete sop stage information | 删除SopStage信息
  133. @handler deleteSopStage
  134. post /sop_stage/delete (IDReq) returns (BaseMsgResp)
  135. // Get sop stage list | 获取SopStage列表
  136. @handler getSopStageList
  137. post /sop_stage/list (SopStageListReq) returns (SopStageListResp)
  138. // Get sop stage by ID | 通过ID获取SopStage
  139. @handler getSopStageById
  140. post /sop_stage (IDReq) returns (SopStageInfoResp)
  141. // Get sop stage by ID | 通过ID获取SopStage详情
  142. @handler getSopStageDetail
  143. post /sop_stage/detail (IDReq) returns (SopStageInfoResp)
  144. // Get sop stage move | 移动阶段顺序
  145. @handler moveSopStage
  146. post /sop_stage/move (SopStageMoveReq) returns (BaseMsgResp)
  147. }