model.go 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  1. package managesdk
  2. type ServiceType string
  3. const (
  4. ServiceTypePerson ServiceType = "person"
  5. ServiceTypeResource ServiceType = "resource"
  6. ServiceTypeActivity ServiceType = "activity"
  7. ServiceTypePlan ServiceType = "plan"
  8. )
  9. const (
  10. DefaultPersonBaseURL = "http://10.0.0.210:30684/mbpms/api"
  11. DefaultResourceBaseURL = "http://10.0.0.210:30684/mbrms/api"
  12. DefaultActivityBaseURL = "http://10.0.0.210:30604/mbact/api"
  13. DefaultPlanBaseURL = "http://10.0.0.210:30604/mbact/api"
  14. )
  15. type Config struct {
  16. Type ServiceType
  17. BaseURL string
  18. Timeout int
  19. }
  20. type Response struct {
  21. Success bool `json:"success"`
  22. ErrCode int `json:"errCode"`
  23. Msg string `json:"msg"`
  24. }
  25. type IDResponse struct {
  26. Success bool `json:"success"`
  27. ErrCode int `json:"errCode"`
  28. Msg string `json:"msg"`
  29. Data string `json:"data"`
  30. }
  31. type MsgResponse struct {
  32. Success bool `json:"success"`
  33. ErrCode int `json:"errCode"`
  34. Msg string `json:"msg"`
  35. }
  36. type InfosData[T any] struct {
  37. Infos []T `json:"infos"`
  38. TotalCount int64 `json:"totalCount"`
  39. }
  40. type InfosResponse[T any] struct {
  41. Success bool `json:"success"`
  42. ErrCode int `json:"errCode"`
  43. Msg string `json:"msg"`
  44. Data InfosData[T] `json:"data"`
  45. }
  46. type InfoResponse[T any] struct {
  47. Success bool `json:"success"`
  48. ErrCode int `json:"errCode"`
  49. Msg string `json:"msg"`
  50. Data T `json:"data"`
  51. }
  52. type MapResponse struct {
  53. Success bool `json:"success"`
  54. ErrCode int `json:"errCode"`
  55. Msg string `json:"msg"`
  56. Data map[string]any `json:"data"`
  57. }
  58. type VersionResponse struct {
  59. Success bool `json:"success"`
  60. ErrCode int `json:"errCode"`
  61. Msg string `json:"msg"`
  62. Data map[string]any `json:"data"`
  63. }
  64. type BaseQueryParams struct {
  65. PageNo int `form:"pageNo"`
  66. PageSize int `form:"pageSize"`
  67. }
  68. type PersonInfo struct {
  69. ID string `json:"id"`
  70. Name string `json:"name"`
  71. UserID string `json:"userId"`
  72. ExtendPropertyValues map[string]any `json:"extendProperties"`
  73. TenantID string `json:"tenantId"`
  74. CreatedTime string `json:"createdTime"`
  75. LastUpdatedTime string `json:"lastUpdatedTime"`
  76. }
  77. type SavePersonParams struct {
  78. ID string `json:"id"`
  79. Name string `json:"name"`
  80. UserID string `json:"userId"`
  81. ExtendProperties map[string]any `json:"extendProperties"`
  82. TenantID string `json:"tenantId"`
  83. OperatorUserName string `json:"operatorUserName"`
  84. }
  85. type DeletePersonParams struct {
  86. ID string `form:"id"`
  87. OperatorUserName string `form:"operatorUserName"`
  88. }
  89. type QueryPersonsParams struct {
  90. Name string `form:"name"`
  91. UserID string `form:"userId"`
  92. ExtendPropertyValues map[string]any `form:"extendPropertyValues"`
  93. TenantID string `form:"tenantId"`
  94. BaseQueryParams
  95. }
  96. type GetPersonParams struct {
  97. ID string `form:"id"`
  98. }
  99. type GenderInfo struct {
  100. Gender string `json:"gender"`
  101. Label string `json:"label"`
  102. }
  103. type PersonStateInfo struct {
  104. State string `json:"state"`
  105. Label string `json:"label"`
  106. }
  107. type ResourceInfo struct {
  108. ID string `json:"id"`
  109. Name string `json:"name"`
  110. Code string `json:"code"`
  111. BusinessType string `json:"businessType"`
  112. ExtendPropertyValues map[string]any `json:"extendProperties"`
  113. TenantID string `json:"tenantId"`
  114. CreateUserID string `json:"createUserId"`
  115. LastUpdateUserID string `json:"lastUpdateUserId"`
  116. CreatedTime string `json:"createdTime"`
  117. LastUpdatedTime string `json:"lastUpdatedTime"`
  118. }
  119. type SaveResourceParams struct {
  120. ID string `json:"id"`
  121. Name string `json:"name"`
  122. Code string `json:"code"`
  123. BusinessType string `json:"businessType"`
  124. ExtendProperties map[string]any `json:"extendProperties"`
  125. TenantID string `json:"tenantId"`
  126. CreateUserID string `json:"createUserId"`
  127. UpdateUserID string `json:"updateUserId"`
  128. OperatorUserName string `json:"operatorUserName"`
  129. }
  130. type DeleteResourceParams struct {
  131. ID string `form:"id"`
  132. DeleteUserID string `form:"deleteUserId"`
  133. OperatorUserName string `form:"operatorUserName"`
  134. }
  135. type QueryResourcesParams struct {
  136. Name string `form:"name"`
  137. BusinessType string `form:"businessType"`
  138. ExtendPropertyValues map[string]any `form:"extendPropertyValues"`
  139. UserID string `form:"userId"`
  140. QueryMode string `form:"queryMode"`
  141. CreateUserID string `form:"createUserId"`
  142. TenantID string `form:"tenantId"`
  143. BaseQueryParams
  144. }
  145. type GetResourceParams struct {
  146. ID string `form:"id"`
  147. }
  148. type CategoryInfo struct {
  149. Category string `json:"category"`
  150. ExcludeField []string `json:"excludeField"`
  151. }
  152. type ResourceStateInfo struct {
  153. State string `json:"state"`
  154. Label string `json:"label"`
  155. }
  156. type OperateLogQueryParams struct {
  157. Resource string `form:"resource"`
  158. Action string `form:"action"`
  159. OperatorName string `form:"operatorName"`
  160. StartTime string `form:"startTime"`
  161. EndTime string `form:"endTime"`
  162. TenantID string `form:"tenantId"`
  163. BaseQueryParams
  164. }
  165. type OperateLogInfo struct {
  166. ID string `json:"id"`
  167. Resource string `json:"resource"`
  168. Action string `json:"action"`
  169. OperatorName string `json:"operatorName"`
  170. Content string `json:"content"`
  171. TenantID string `json:"tenantId"`
  172. CreatedTime string `json:"createdTime"`
  173. }
  174. // Activity 相关模型
  175. type ActivityInfo struct {
  176. ID string `json:"id"`
  177. Name string `json:"name"`
  178. Description string `json:"description"`
  179. ActorID string `json:"actorId"`
  180. BusinessType []string `json:"businessType"`
  181. ExtendPropertyValues map[string]any `json:"extendProperties"`
  182. TenantID string `json:"tenantId"`
  183. CreateUserID string `json:"createUserId"`
  184. LastUpdateUserID string `json:"lastUpdateUserId"`
  185. CreatedTime string `json:"createdTime"`
  186. LastUpdatedTime string `json:"lastUpdatedTime"`
  187. }
  188. type SaveActivityParams struct {
  189. ID string `json:"id,omitempty"`
  190. Name string `json:"name"`
  191. Description string `json:"description,omitempty"`
  192. ActorID string `json:"actorId"`
  193. BusinessType []string `json:"businessType"`
  194. ExtendProperties map[string]any `json:"extendProperties,omitempty"`
  195. TenantID string `json:"tenantId"`
  196. CreateUserID string `json:"createUserId,omitempty"`
  197. UpdateUserID string `json:"updateUserId"`
  198. OperatorUserName string `json:"operatorUserName"`
  199. }
  200. type QueryActivitiesParams struct {
  201. Name string `json:"name,omitempty"`
  202. ActorID string `json:"actorId,omitempty"`
  203. BusinessType []string `json:"businessType,omitempty"`
  204. ExtendPropertyValues map[string][]any `json:"extendPropertyValues,omitempty"`
  205. CreateUserID string `json:"createUserId,omitempty"`
  206. TenantID string `json:"tenantId"`
  207. PageNo int `json:"pageNo"`
  208. PageSize int `json:"pageSize"`
  209. }
  210. type DeleteActivityParams struct {
  211. ID string `json:"id"`
  212. BusinessType []string `json:"businessType"`
  213. DeleteWhole bool `json:"deleteWhole"`
  214. DeleteUserID string `json:"deleteUserId"`
  215. OperatorUserName string `json:"operatorUserName"`
  216. }
  217. type GetActivityParams struct {
  218. ID string `json:"id"`
  219. }
  220. // Plan 相关模型
  221. type PlanInfo struct {
  222. ID string `json:"id"`
  223. PlanType string `json:"planType"`
  224. Name string `json:"name"`
  225. Description string `json:"description"`
  226. ActorID string `json:"actorId"`
  227. State string `json:"state"`
  228. BusinessType []string `json:"businessType"`
  229. TaskIDs []string `json:"taskIds"`
  230. Attachments []string `json:"attachments"`
  231. ExtendPropertyValues map[string]any `json:"extendProperties"`
  232. StartTime string `json:"startTime"`
  233. EndTime string `json:"endTime"`
  234. CloseTime string `json:"closeTime"`
  235. RemindAdvanceDays int `json:"remindAdvanceDays"`
  236. RemindTimes []string `json:"remindTimes"`
  237. PeriodType string `json:"periodType"`
  238. TenantID string `json:"tenantId"`
  239. CreateUserID string `json:"createUserId"`
  240. LastUpdateUserID string `json:"lastUpdateUserId"`
  241. CreatedTime string `json:"createdTime"`
  242. LastUpdatedTime string `json:"lastUpdatedTime"`
  243. }
  244. type SavePlanParams struct {
  245. ID string `json:"id,omitempty"`
  246. PlanType string `json:"planType"`
  247. Name string `json:"name"`
  248. Description string `json:"description,omitempty"`
  249. ActorID string `json:"actorId"`
  250. State string `json:"state,omitempty"`
  251. BusinessType []string `json:"businessType"`
  252. TaskIDs []string `json:"taskIds,omitempty"`
  253. Attachments []string `json:"attachments,omitempty"`
  254. ExtendProperties map[string]any `json:"extendProperties,omitempty"`
  255. StartTime string `json:"startTime,omitempty"`
  256. EndTime string `json:"endTime,omitempty"`
  257. CloseTime string `json:"closeTime,omitempty"`
  258. RemindAdvanceDays int `json:"remindAdvanceDays,omitempty"`
  259. RemindTimes []string `json:"remindTimes,omitempty"`
  260. PeriodType string `json:"periodType,omitempty"`
  261. TenantID string `json:"tenantId"`
  262. CreateUserID string `json:"createUserId,omitempty"`
  263. UpdateUserID string `json:"updateUserId"`
  264. OperatorUserName string `json:"operatorUserName"`
  265. }
  266. type QueryPlansParams struct {
  267. PlanType string `json:"planType,omitempty"`
  268. Name string `json:"name,omitempty"`
  269. ActorID string `json:"actorId,omitempty"`
  270. State string `json:"state,omitempty"`
  271. BusinessType []string `json:"businessType,omitempty"`
  272. ExtendPropertyValues map[string][]any `json:"extendPropertyValues,omitempty"`
  273. CreateUserID string `json:"createUserId,omitempty"`
  274. TenantID string `json:"tenantId"`
  275. PageNo int `json:"pageNo"`
  276. PageSize int `json:"pageSize"`
  277. }
  278. type DeletePlanParams struct {
  279. ID string `json:"id"`
  280. BusinessType []string `json:"businessType"`
  281. DeleteWhole bool `json:"deleteWhole"`
  282. DeleteUserID string `json:"deleteUserId"`
  283. OperatorUserName string `json:"operatorUserName"`
  284. }
  285. type GetPlanParams struct {
  286. ID string `json:"id"`
  287. }