sop_stage.api 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  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. // Token
  55. Token []string `json:"token,optional"`
  56. }
  57. // The response data of sop node information | SopNode信息
  58. SopNodeInfo {
  59. BaseIDInfo
  60. // Status 1: normal 2: ban | 状态 1 正常 2 禁用
  61. Status *uint8 `json:"status,optional"`
  62. // 阶段 ID
  63. StageId *uint64 `json:"stageId,optional"`
  64. // 父节点 ID
  65. ParentId *uint64 `json:"parentId,optional"`
  66. // 节点名称
  67. Name *string `json:"name,optional"`
  68. // 触发条件类型 1 客户回复后触发 2 超时后触发
  69. ConditionType *int `json:"conditionType,optional"`
  70. // 触发语义列表 当为空时则代表用户回复任意内容后触发
  71. ConditionList []string `json:"conditionList,optional"`
  72. // 超时触发时间(分钟)
  73. NoReplyCondition *uint64 `json:"noReplyCondition,optional"`
  74. // 超时触发时间单位
  75. NoReplyUnit *string `json:"noReplyUnit,optional"`
  76. // 命中后发送的消息内容
  77. ActionMessage []Action `json:"actionMessage,optional"`
  78. // 命中后需要打的标签
  79. ActionLabelAdd []uint64 `json:"actionLabelAdd,optional"`
  80. // 命中后需要移除的标签
  81. ActionLabelDel []uint64 `json:"actionLabelDel,optional"`
  82. // 命中后转发的消息内容
  83. ActionForward *ActionForward `json:"actionForward,optional"`
  84. // 阶段信息
  85. StageInfo *SopStageInfo `json:"stageInfo,optional"`
  86. }
  87. // The response data of sop node information | SopNode信息
  88. SopNodeInfoWithLable {
  89. BaseIDInfo
  90. // Status 1: normal 2: ban | 状态 1 正常 2 禁用
  91. Status *uint8 `json:"status,optional"`
  92. // 阶段 ID
  93. StageId *uint64 `json:"stageId,optional"`
  94. // 父节点 ID
  95. ParentId *uint64 `json:"parentId,optional"`
  96. // 节点名称
  97. Name *string `json:"name,optional"`
  98. // 触发条件类型 1 客户回复后触发 2 超时后触发
  99. ConditionType *int `json:"conditionType,optional"`
  100. // 触发语义列表 当为空时则代表用户回复任意内容后触发
  101. ConditionList []string `json:"conditionList,optional"`
  102. // 超时触发时间(分钟)
  103. NoReplyCondition *uint64 `json:"noReplyCondition,optional"`
  104. // 超时触发时间单位
  105. NoReplyUnit *string `json:"noReplyUnit,optional"`
  106. // 命中后发送的消息内容
  107. ActionMessage []Action `json:"actionMessage,optional"`
  108. // 命中后需要打的标签
  109. ActionLabelAdd []uint64 `json:"actionLabelAdd,optional"`
  110. // 命中后需要移除的标签
  111. ActionLabelDel []uint64 `json:"actionLabelDel,optional"`
  112. // 命中后转发的消息内容
  113. ActionForward *ActionForward `json:"actionForward,optional"`
  114. ActionLabelAddList []string `json:"actionLabelAddList"`
  115. ActionLabelDelList []string `json:"actionLabelDelList"`
  116. }
  117. // The response data of sop stage list | SopStage列表数据
  118. SopStageListResp {
  119. BaseDataInfo
  120. // SopStage list data | SopStage列表数据
  121. Data SopStageListInfo `json:"data"`
  122. }
  123. // SopStage list data | SopStage列表数据
  124. SopStageListInfo {
  125. BaseListInfo
  126. // The API list data | SopStage列表数据
  127. Data []SopStageInfo `json:"data"`
  128. }
  129. // Get sop stage list request params | SopStage列表请求参数
  130. SopStageListReq {
  131. TaskId *uint64 `json:"taskId"`
  132. }
  133. // Batch get sop stage list request params | SopStage列表请求参数
  134. BatchSopStageListReq {
  135. TaskIds []uint64 `json:"taskIds"`
  136. }
  137. // SopStage information response | SopStage信息返回体
  138. SopStageInfoResp {
  139. BaseDataInfo
  140. // SopStage information | SopStage数据
  141. Data SopStageInfo `json:"data"`
  142. }
  143. // SopStage create response | SopStage创建回体
  144. SopStageCreateResp {
  145. BaseDataInfo
  146. // SopStage id | SopStage id
  147. Data uint64 `json:"data"`
  148. }
  149. // Move sop stage request params | 移动阶段请求参数
  150. SopStageMoveReq {
  151. BaseIDInfo
  152. // 阶段名称
  153. Offset *int `json:"offset,optional"`
  154. }
  155. StageCopyReq {
  156. // SopStage id | SopStage id
  157. Id uint64 `json:"id"`
  158. }
  159. )
  160. @server(
  161. group: sop_stage
  162. )
  163. service Wechat {
  164. // Get sop stage list | 获取SopStage列表
  165. @handler getApiSopStageList
  166. post /api/sop_stage/list (BatchSopStageListReq) returns (SopStageListResp)
  167. }
  168. @server(
  169. jwt: Auth
  170. group: sop_stage
  171. middleware: Authority
  172. )
  173. service Wechat {
  174. // Create sop stage information | 创建SopStage
  175. @handler createSopStage
  176. post /sop_stage/create (SopStageInfo) returns (SopStageCreateResp)
  177. // Update sop stage information | 更新SopStage
  178. @handler updateSopStage
  179. post /sop_stage/update (SopStageInfo) returns (BaseMsgResp)
  180. // Delete sop stage information | 删除SopStage信息
  181. @handler deleteSopStage
  182. post /sop_stage/delete (IDReq) returns (BaseMsgResp)
  183. // Get sop stage list | 获取SopStage列表
  184. @handler getSopStageList
  185. post /sop_stage/list (SopStageListReq) returns (SopStageListResp)
  186. // Get sop stage by ID | 通过ID获取SopStage
  187. @handler getSopStageById
  188. post /sop_stage (IDReq) returns (SopStageInfoResp)
  189. // Get sop stage by ID | 通过ID获取SopStage详情
  190. @handler getSopStageDetail
  191. post /sop_stage/detail (IDReq) returns (SopStageInfoResp)
  192. // Get sop stage move | 移动阶段顺序
  193. @handler moveSopStage
  194. post /sop_stage/move (SopStageMoveReq) returns (BaseMsgResp)
  195. // stage copy | SopStage 复制
  196. @handler sopStageCopy
  197. post /sop_stage/copy (StageCopyReq) returns (BaseMsgResp)
  198. }