marthe.go 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. package model
  2. import "go-common/library/ecode"
  3. // AddVersionRequest Add Version Request.
  4. type AddVersionRequest struct {
  5. ID int64 `json:"id"`
  6. BuglyProjectID int64 `json:"bugly_project_id"`
  7. Version string `json:"version"`
  8. Action int `json:"action"`
  9. }
  10. // AddProjectRequest Add Project Request.
  11. type AddProjectRequest struct {
  12. ID int64 `json:"id"`
  13. ProjectName string `json:"project_name"`
  14. ProjectID string `json:"project_id"`
  15. PlatformID string `json:"platform_id"`
  16. ExceptionType string `json:"exception_type"`
  17. }
  18. // AddCookieRequest Add Cookie Request.
  19. type AddCookieRequest struct {
  20. ID int64 `json:"id"`
  21. Cookie string `json:"cookie"`
  22. Token string `json:"token"`
  23. Status int `json:"status"`
  24. QQAccount int `json:"qq_account"`
  25. }
  26. // BuglyIssueImportRequest Bugly Issue Import Request.
  27. type BuglyIssueImportRequest struct {
  28. IssueImportInfo []*IssueImportInfo `json:"import_info"`
  29. }
  30. // IssueImportInfo Issue Import Info.
  31. type IssueImportInfo struct {
  32. ProjectID string `json:"project_id"`
  33. PlatformID string `json:"platform_id"`
  34. Version []string `json:"version"`
  35. }
  36. // Pagination Pagination.
  37. type Pagination struct {
  38. PageSize int `form:"page_size" json:"page_size"`
  39. PageNum int `form:"page_num" json:"page_num"`
  40. }
  41. // PaginationRep Pagination Response.
  42. type PaginationRep struct {
  43. PageSize int `json:"page_size"`
  44. PageNum int `json:"page_num"`
  45. Total int64 `json:"total"`
  46. }
  47. // Verify verify the value of pageNum and pageSize.
  48. func (p *Pagination) Verify() error {
  49. if p.PageNum < 0 {
  50. return ecode.MerlinIllegalPageNumErr
  51. } else if p.PageNum == 0 {
  52. p.PageNum = DefaultPageNum
  53. }
  54. if p.PageSize < 0 {
  55. return ecode.MerlinIllegalPageSizeErr
  56. } else if p.PageSize == 0 {
  57. p.PageSize = DefaultPageSize
  58. }
  59. return nil
  60. }
  61. // QueryBuglyVersionRequest Query Bugly Version Request.
  62. type QueryBuglyVersionRequest struct {
  63. Pagination
  64. Version string `json:"version"`
  65. ProjectName string `json:"project_name"`
  66. Action int `json:"action"`
  67. TaskStatus int `json:"task_status"`
  68. UpdateBy string `json:"update_by"`
  69. }
  70. // QueryBuglyBatchRunsRequest Query Bugly Batch Runs Request.
  71. type QueryBuglyBatchRunsRequest struct {
  72. Pagination
  73. Version string `json:"version"`
  74. Status int `json:"status"`
  75. BatchID string `json:"batch_id"`
  76. }
  77. // PaginateBuglyBatchRuns Paginate Bugly Batch Runs.
  78. type PaginateBuglyBatchRuns struct {
  79. PaginationRep
  80. BuglyBatchRuns []*BuglyBatchRun `json:"bugly_batch_runs"`
  81. }
  82. // QueryBugRecordsRequest Query Bug Records Request.
  83. type QueryBugRecordsRequest struct {
  84. Pagination
  85. ProjectTemplateID int64 `json:"project_template_id"`
  86. VersionTemplateID int64 `json:"version_template_id"`
  87. Operator string `json:"operator"`
  88. Status int `json:"status"`
  89. }
  90. // QueryTapdBugPriorityConfsRequest Query Tapd Bug Priority Confs Request.
  91. type QueryTapdBugPriorityConfsRequest struct {
  92. Pagination
  93. ProjectTemplateID int64 `json:"project_template_id"`
  94. UpdateBy string `json:"update_by"`
  95. Status int `json:"status"`
  96. }
  97. // PaginateTapdBugPriorityConfs Paginate Tapd Bug Priority Confs.
  98. type PaginateTapdBugPriorityConfs struct {
  99. PaginationRep
  100. TapdBugPriorityConfs []*TapdBugPriorityConf `json:"tapd_bug_priority_confs"`
  101. }
  102. // PaginateBugRecords Paginate Bug Records.
  103. type PaginateBugRecords struct {
  104. PaginationRep
  105. TapdBugRecords []*TapdBugRecord `json:"tapd_bug_records"`
  106. }
  107. // QueryBuglyCookiesRequest Query Bugly Batch Runs Request.
  108. type QueryBuglyCookiesRequest struct {
  109. Pagination
  110. QQAccount int `json:"qq_account"`
  111. Status int `json:"status"`
  112. }
  113. // PaginateBuglyCookies Paginate Bugly Cookies.
  114. type PaginateBuglyCookies struct {
  115. PaginationRep
  116. BuglyCookies []*BuglyCookie `json:"bugly_cookies"`
  117. }
  118. // PaginateBuglyProjectVersions Paginate Bugly Project Versions.
  119. type PaginateBuglyProjectVersions struct {
  120. PaginationRep
  121. BuglyProjectVersions []*BuglyProjectVersion `json:"bugly_project_versions"`
  122. }
  123. // QueryTapdBugTemplateRequest Query tapd Bug Template Request.
  124. type QueryTapdBugTemplateRequest struct {
  125. Pagination
  126. ProjectName string `json:"project_name"`
  127. UpdateBy string `json:"update_by"`
  128. }
  129. // QueryTapdBugVersionTemplateRequest Query Tapd Bug Version Template Request.
  130. type QueryTapdBugVersionTemplateRequest struct {
  131. Pagination
  132. ProjectID int64 `json:"project_template_id"`
  133. Version string `json:"version"`
  134. UpdateBy string `json:"update_by"`
  135. }
  136. // PaginateTapdBugTemplates Paginate Tapd Bug Template.
  137. type PaginateTapdBugTemplates struct {
  138. PaginationRep
  139. TapdBugTemplateWithProjectNames []*TapdBugTemplateWithProjectName `json:"tapd_bug_templates"`
  140. }
  141. // TapdBugTemplateWithProjectName Paginate Tapd Bug Template.
  142. type TapdBugTemplateWithProjectName struct {
  143. *TapdBugTemplate
  144. ProjectName string `json:"project_name"`
  145. }
  146. // PaginateTapdBugVersionTemplates Paginate Tapd Bug Version Template.
  147. type PaginateTapdBugVersionTemplates struct {
  148. PaginationRep
  149. TapdBugVersionTemplates []*TapdBugVersionTemplate `json:"tapd_bug_version_templates"`
  150. }
  151. // UpdateTapdBugTplRequest Update Tapd Bug Tpl Request.
  152. type UpdateTapdBugTplRequest struct {
  153. ID int64 `json:"id" `
  154. WorkspaceID string `json:"workspace_id"`
  155. BuglyProjectId int64 `json:"bugly_project_id" `
  156. IssueFilterSQL string `json:"issue_filter_sql"`
  157. SeverityKey string `json:"severity_key"`
  158. TapdProperty
  159. }
  160. // UpdateTapdBugVersionTplRequest Update Tapd Bug Tpl Request.
  161. type UpdateTapdBugVersionTplRequest struct {
  162. ID int64 `json:"id" `
  163. Version string `json:"version" `
  164. ProjectTemplateID int64 `json:"project_template_id"`
  165. IssueFilterSQL string `json:"issue_filter_sql"`
  166. SeverityKey string `json:"severity_key"`
  167. TapdProperty
  168. }
  169. // QueryBuglyIssueRequest Query Bugly Issue Request.
  170. type QueryBuglyIssueRequest struct {
  171. Pagination
  172. IssueNo string `json:"issue_no"`
  173. Title string `json:"title"`
  174. ExceptionMsg string `json:"exception_msg" `
  175. KeyStack string `json:"key_stack"`
  176. Detail string `json:"detail"`
  177. Tags string `json:"tags"`
  178. Version string `json:"version" `
  179. ProjectID string `json:"project_id"`
  180. TapdBugID string `json:"tapd_bug_id"`
  181. }
  182. // PaginateBuglyIssues Paginate Bugly Issues.
  183. type PaginateBuglyIssues struct {
  184. PaginationRep
  185. BuglyIssues []*BuglyIssue `json:"bugly_issues"`
  186. }
  187. // UpdateTapdBugPriorityConfRequest Update Tapd Bug Priority Conf Request.
  188. type UpdateTapdBugPriorityConfRequest struct {
  189. ID int64 `json:"id" `
  190. ProjectTemplateID int64 `json:"project_template_id"`
  191. Urgent int `json:"urgent"`
  192. High int `json:"high"`
  193. Medium int `json:"medium"`
  194. StartTime string `json:"start_time"`
  195. EndTime string `json:"end_time"`
  196. Status int `json:"status"`
  197. }
  198. // QueryBuglyProjectRequest Query Bugly Project Request.
  199. type QueryBuglyProjectRequest struct {
  200. Pagination
  201. ProjectName string `json:"project_name"`
  202. ProjectID string `json:"project_id"`
  203. PlatformID string `json:"platform_id"`
  204. UpdateBy string `json:"update_by"`
  205. }
  206. // PaginateBuglyProjects Paginate Bugly Projects.
  207. type PaginateBuglyProjects struct {
  208. PaginationRep
  209. BuglyProjects []*BuglyProject `json:"bugly_projects"`
  210. }
  211. // BuglyProjectVersion Bugly Project Version.
  212. type BuglyProjectVersion struct {
  213. BuglyVersion
  214. ProjectName string `json:"project_name"`
  215. ExceptionType string `json:"exception_type"`
  216. }
  217. // TapdBugTemplateShortResponse Tapd Bug Template Short Response.
  218. type TapdBugTemplateShortResponse struct {
  219. ID int64 `json:"id"`
  220. WorkspaceID string `json:"workspace_id"`
  221. BuglyProjectId int64 `json:"bugly_project_id"`
  222. BuglyProjectName string `json:"project_name"`
  223. }