scene.go 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. package model
  2. import (
  3. "time"
  4. )
  5. // Scene GRPCReqToGRPC
  6. type Scene struct {
  7. ID int `json:"id" gorm:"AUTO_INCREMENT;primary_key;" form:"id"`
  8. SceneName string `json:"scene_name" form:"scene_name"`
  9. SceneType int `json:"scene_type" form:"scene_type"`
  10. UserName string `json:"user_name" form:"user_name"`
  11. IsDraft int `json:"is_draft" form:"is_draft"`
  12. IsDebug bool `json:"is_debug" form:"is_debug"`
  13. IsBatch bool `json:"is_batch" gorm:"-"`
  14. Scripts []*Script `json:"scripts" gorm:"-"`
  15. ThreadGroup interface{} `json:"thread_group" gorm:"-"`
  16. ScriptPath string `json:"script_path" gorm:"-"`
  17. IsExecute bool `json:"is_execute" gorm:"-"`
  18. JmeterFilePath string `json:"jmeter_file_path"`
  19. Department string `json:"department" form:"department"`
  20. Project string `json:"project" form:"project"`
  21. APP string `json:"app" form:"app"`
  22. Fusing int `json:"fusing" form:"fusing"`
  23. IsUpdate bool `json:"is_update" form:"is_update" gorm:"-"`
  24. JmeterLog string `json:"jmeter_log"`
  25. ResJtl string `json:"res_jtl"`
  26. IsActive bool `json:"is_active" form:"is_active"`
  27. Ctime time.Time `json:"ctime" form:"ctime"`
  28. Mtime time.Time `json:"mtime" form:"mtime"`
  29. }
  30. // Draft Draft
  31. type Draft struct {
  32. SceneID int `json:"scene_id" form:"scene_id"`
  33. SceneName string `json:"scene_name" form:"scene_name"`
  34. }
  35. // QueryDraft QueryDraft
  36. type QueryDraft struct {
  37. Total int `json:"total"`
  38. Drafts []*Draft `json:"draft_list"`
  39. }
  40. // Relation Relation
  41. type Relation struct {
  42. GroupID int `json:"group_id"`
  43. Count int `json:"count"`
  44. }
  45. // QueryRelation Query Relation
  46. type QueryRelation struct {
  47. RelationList []*Relation `json:"relation_list"`
  48. }
  49. // QueryAPIs Query APIs
  50. type QueryAPIs struct {
  51. Total int `json:"total"`
  52. SceneID int `json:"scene_id"`
  53. SceneName string `json:"scene_name"`
  54. SceneType int `json:"scene_type"`
  55. Department string `json:"department"`
  56. Project string `json:"project"`
  57. App string `json:"app"`
  58. APIs []*TestAPI `json:"api_list"`
  59. }
  60. // TestAPI Test API
  61. type TestAPI struct {
  62. GroupID int `json:"group_id" form:"group_id"`
  63. RunOrder int `json:"run_order" form:"run_order"`
  64. ID int `json:"id" form:"id"`
  65. TestName string `json:"test_name" form:"test_name"`
  66. URL string `json:"url" form:"url"`
  67. OutputParams string `json:"output_params" form:"output_params"`
  68. ThreadsSum string `json:"threads_sum" form:"threads_sum"`
  69. LoadTime string `json:"load_time" form:"load_time"`
  70. }
  71. // ShowTree Show Tree
  72. type ShowTree struct {
  73. IsShow int `json:"is_show" form:"is_show"`
  74. Tree []*Tree `json:"tree" form:"tree"`
  75. }
  76. // RunOrder Run Order
  77. type RunOrder struct {
  78. SceneID int `json:"scene_id" form:"scene_id"`
  79. SceneType int `json:"scene_type" form:"scene_type"`
  80. }
  81. // RunOrderList Run Order List
  82. type RunOrderList struct {
  83. Total int `json:"total"`
  84. RunOrders []*RunOrder `json:"run_order_list"`
  85. }
  86. // Params Params
  87. type Params struct {
  88. ID int `json:"id" form:"id"`
  89. GroupID int `json:"group_id" form:"group_id"`
  90. RunOrder int `json:"run_order" form:"run_order"`
  91. OutputParams string `json:"output_params" form:"output_params"`
  92. }
  93. // ParamList ParamList
  94. type ParamList struct {
  95. ParamList []*Params `json:"param_list" form:"param_list"`
  96. }
  97. // SaveOrderReq Save Order Req
  98. type SaveOrderReq struct {
  99. GroupOrderList []*GroupOrder `json:"group_order_list"`
  100. }
  101. // GroupOrder Group Order
  102. type GroupOrder struct {
  103. ID int `json:"id"`
  104. TestName string `json:"test_name"`
  105. GroupID int `json:"group_id"`
  106. RunOrder int `json:"run_order"`
  107. }
  108. // TableName Table Name
  109. func (w Scene) TableName() string {
  110. return "scene"
  111. }
  112. //QuerySceneResponse query scene response
  113. type QuerySceneResponse struct {
  114. Scenes []*Scene `json:"scenes"`
  115. Pagination
  116. }
  117. //QuerySceneRequest query script request
  118. type QuerySceneRequest struct {
  119. Scene
  120. Pagination
  121. Executor string `json:"executor" form:"executor"`
  122. }
  123. // DoPtestSceneParam Do Ptest Scene Param
  124. type DoPtestSceneParam struct {
  125. SceneID int `json:"scene_id" form:"scene_id"`
  126. UserName string `json:"user_name" form:"user_name"`
  127. }
  128. // DoPtestSceneParams Do Ptests Scene Param
  129. type DoPtestSceneParams struct {
  130. SceneIDs []int `json:"scene_ids" form:"scene_ids"`
  131. UserName string `json:"user_name" form:"user_name"`
  132. }
  133. // SceneInfo Scene Info
  134. type SceneInfo struct {
  135. MaxLoadTime int `json:"max_load_time" form:"max_load_time"`
  136. TestNames []string `json:"test_names"`
  137. TestNameNicks []string `json:"test_name_nicks"`
  138. JmeterLog string `json:"jmeter_log"`
  139. ResJtl string `json:"res_jtl"`
  140. LoadTimes []int `json:"load_times"`
  141. SceneName string `json:"scene_name"`
  142. Scripts []*Script `json:"scripts"`
  143. }
  144. // APIInfo API Info
  145. type APIInfo struct {
  146. ID int `json:"id" form:"id"`
  147. TestName string `json:"test_name" form:"test_name"`
  148. URL string `json:"url" form:"url"`
  149. ThreadsSum int `json:"threads_sum" form:"threads_sum"`
  150. LoadTime int `json:"load_time" form:"load_time"`
  151. }
  152. // APIInfoList API Info List
  153. type APIInfoList struct {
  154. SceneID int `json:"scene_id" form:"scene_id"`
  155. Pagination
  156. ScriptList []*Script `json:"script_list"`
  157. }
  158. // APIInfoRequest API Info Request
  159. type APIInfoRequest struct {
  160. Script
  161. Pagination
  162. //DeliverySceneID int `json:"delivery_scene_id" form:"delivery_scene_id"`
  163. }
  164. // PreviewInfoList Preview Info List
  165. type PreviewInfoList struct {
  166. PreviewInfoList []*PreviewInfo `json:"preview_info_list"`
  167. }
  168. // PreviewInfo Preview Info
  169. type PreviewInfo struct {
  170. GroupInfo
  171. InfoList []*Preview `json:"info_list"`
  172. }
  173. // Preview Preview
  174. type Preview struct {
  175. ID int `json:"id"`
  176. TestName string `json:"test_name"`
  177. RunOrder int `json:"run_order"`
  178. GroupID int `json:"group_id"`
  179. ConstTimer int `json:"const_timer"`
  180. RandomTimer int `json:"random_timer"`
  181. }
  182. // PreviewList Preview List
  183. type PreviewList struct {
  184. PreList []*Preview `json:"pre_list"`
  185. }
  186. // GroupList Group List
  187. type GroupList struct {
  188. GroupList []*GroupInfo `json:"group_list"`
  189. }
  190. // GroupInfo Group Info
  191. type GroupInfo struct {
  192. GroupID int `json:"group_id"`
  193. ThreadsSum int `json:"threads_sum"`
  194. LoadTime int `json:"load_time"`
  195. ReadyTime int `json:"ready_time"`
  196. }
  197. // UsefulParams Useful Params
  198. type UsefulParams struct {
  199. OutputParams string `json:"output_params"`
  200. }
  201. // UsefulParamsList Useful Params
  202. type UsefulParamsList struct {
  203. ParamsList []*UsefulParams `json:"params_list"`
  204. }
  205. // Test test
  206. type Test struct {
  207. Count int `json:"count"`
  208. }
  209. // BindScene Bind Scene
  210. type BindScene struct {
  211. SceneID int `json:"scene_id"`
  212. ID string `json:"id"`
  213. }
  214. // DrawRelationList Draw Relation List
  215. type DrawRelationList struct {
  216. //Nodes []*string `json:"nodes"`
  217. Nodes []*Node `json:"nodes"`
  218. Edges []*Edge `json:"edges"`
  219. }
  220. // Node Node
  221. type Node struct {
  222. ID int `json:"id"`
  223. Name string `json:"name"`
  224. }
  225. // Edge Edge
  226. type Edge struct {
  227. Source string `json:"source"`
  228. Target string `json:"target"`
  229. }