model.go 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. package managesdk
  2. type ServiceType string
  3. const (
  4. ServiceTypePerson ServiceType = "person"
  5. ServiceTypeResource ServiceType = "resource"
  6. )
  7. const (
  8. DefaultPersonBaseURL = "http://10.0.0.210:30684/mbpms/api"
  9. DefaultResourceBaseURL = "http://10.0.0.210:30684/mbrms/api"
  10. )
  11. type Config struct {
  12. Type ServiceType
  13. BaseURL string
  14. Timeout int
  15. }
  16. type Response struct {
  17. Success bool `json:"success"`
  18. ErrCode int `json:"errCode"`
  19. Msg string `json:"msg"`
  20. }
  21. type IDResponse struct {
  22. Success bool `json:"success"`
  23. ErrCode int `json:"errCode"`
  24. Msg string `json:"msg"`
  25. Data string `json:"data"`
  26. }
  27. type MsgResponse struct {
  28. Success bool `json:"success"`
  29. ErrCode int `json:"errCode"`
  30. Msg string `json:"msg"`
  31. }
  32. type InfosData[T any] struct {
  33. Infos []T `json:"infos"`
  34. TotalCount int64 `json:"totalCount"`
  35. }
  36. type InfosResponse[T any] struct {
  37. Success bool `json:"success"`
  38. ErrCode int `json:"errCode"`
  39. Msg string `json:"msg"`
  40. Data InfosData[T] `json:"data"`
  41. }
  42. type InfoResponse[T any] struct {
  43. Success bool `json:"success"`
  44. ErrCode int `json:"errCode"`
  45. Msg string `json:"msg"`
  46. Data T `json:"data"`
  47. }
  48. type MapResponse struct {
  49. Success bool `json:"success"`
  50. ErrCode int `json:"errCode"`
  51. Msg string `json:"msg"`
  52. Data map[string]any `json:"data"`
  53. }
  54. type VersionResponse struct {
  55. Success bool `json:"success"`
  56. ErrCode int `json:"errCode"`
  57. Msg string `json:"msg"`
  58. Data map[string]any `json:"data"`
  59. }
  60. type BaseQueryParams struct {
  61. PageNo int `form:"pageNo"`
  62. PageSize int `form:"pageSize"`
  63. }
  64. type PersonInfo struct {
  65. ID string `json:"id"`
  66. Name string `json:"name"`
  67. UserID string `json:"userId"`
  68. ExtendPropertyValues map[string]any `json:"extendProperties"`
  69. TenantID string `json:"tenantId"`
  70. CreatedTime string `json:"createdTime"`
  71. LastUpdatedTime string `json:"lastUpdatedTime"`
  72. }
  73. type SavePersonParams struct {
  74. ID string `json:"id"`
  75. Name string `json:"name"`
  76. UserID string `json:"userId"`
  77. ExtendProperties map[string]any `json:"extendProperties"`
  78. TenantID string `json:"tenantId"`
  79. OperatorUserName string `json:"operatorUserName"`
  80. }
  81. type DeletePersonParams struct {
  82. ID string `form:"id"`
  83. OperatorUserName string `form:"operatorUserName"`
  84. }
  85. type QueryPersonsParams struct {
  86. Name string `form:"name"`
  87. UserID string `form:"userId"`
  88. ExtendPropertyValues map[string]any `form:"extendPropertyValues"`
  89. TenantID string `form:"tenantId"`
  90. BaseQueryParams
  91. }
  92. type GetPersonParams struct {
  93. ID string `form:"id"`
  94. }
  95. type GenderInfo struct {
  96. Gender string `json:"gender"`
  97. Label string `json:"label"`
  98. }
  99. type PersonStateInfo struct {
  100. State string `json:"state"`
  101. Label string `json:"label"`
  102. }
  103. type ResourceInfo struct {
  104. ID string `json:"id"`
  105. Name string `json:"name"`
  106. Code string `json:"code"`
  107. BusinessType string `json:"businessType"`
  108. ExtendPropertyValues map[string]any `json:"extendProperties"`
  109. TenantID string `json:"tenantId"`
  110. CreateUserID string `json:"createUserId"`
  111. LastUpdateUserID string `json:"lastUpdateUserId"`
  112. CreatedTime string `json:"createdTime"`
  113. LastUpdatedTime string `json:"lastUpdatedTime"`
  114. }
  115. type SaveResourceParams struct {
  116. ID string `json:"id"`
  117. Name string `json:"name"`
  118. Code string `json:"code"`
  119. BusinessType string `json:"businessType"`
  120. ExtendProperties map[string]any `json:"extendProperties"`
  121. TenantID string `json:"tenantId"`
  122. CreateUserID string `json:"createUserId"`
  123. UpdateUserID string `json:"updateUserId"`
  124. OperatorUserName string `json:"operatorUserName"`
  125. }
  126. type DeleteResourceParams struct {
  127. ID string `form:"id"`
  128. DeleteUserID string `form:"deleteUserId"`
  129. OperatorUserName string `form:"operatorUserName"`
  130. }
  131. type QueryResourcesParams struct {
  132. Name string `form:"name"`
  133. BusinessType string `form:"businessType"`
  134. ExtendPropertyValues map[string]any `form:"extendPropertyValues"`
  135. UserID string `form:"userId"`
  136. QueryMode string `form:"queryMode"`
  137. CreateUserID string `form:"createUserId"`
  138. TenantID string `form:"tenantId"`
  139. BaseQueryParams
  140. }
  141. type GetResourceParams struct {
  142. ID string `form:"id"`
  143. }
  144. type CategoryInfo struct {
  145. Category string `json:"category"`
  146. ExcludeField []string `json:"excludeField"`
  147. }
  148. type ResourceStateInfo struct {
  149. State string `json:"state"`
  150. Label string `json:"label"`
  151. }
  152. type OperateLogQueryParams struct {
  153. Resource string `form:"resource"`
  154. Action string `form:"action"`
  155. OperatorName string `form:"operatorName"`
  156. StartTime string `form:"startTime"`
  157. EndTime string `form:"endTime"`
  158. TenantID string `form:"tenantId"`
  159. BaseQueryParams
  160. }
  161. type OperateLogInfo struct {
  162. ID string `json:"id"`
  163. Resource string `json:"resource"`
  164. Action string `json:"action"`
  165. OperatorName string `json:"operatorName"`
  166. Content string `json:"content"`
  167. TenantID string `json:"tenantId"`
  168. CreatedTime string `json:"createdTime"`
  169. }