rcvr.go 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361
  1. // Copyright 2019 getensh.com. All rights reserved.
  2. // Use of this source code is governed by getensh.com.
  3. package impl
  4. import (
  5. impl_v7 "adm-management/impl/v1/announcement_management"
  6. impl_v5 "adm-management/impl/v1/api_management"
  7. impl_v8 "adm-management/impl/v1/data_import"
  8. impl_v1 "adm-management/impl/v1/data_management"
  9. impl_v4 "adm-management/impl/v1/field_management"
  10. impl_v3 "adm-management/impl/v1/manual_task"
  11. impl_v6 "adm-management/impl/v1/style_map_management"
  12. impl_v2 "adm-management/impl/v1/task_management"
  13. "adm-management/pb"
  14. pb_v1 "adm-management/pb/v1"
  15. "context"
  16. "git.getensh.com/common/gopkgsv2/tasker/rpctasker"
  17. "google.golang.org/grpc"
  18. )
  19. // 具体实现
  20. type Rcvr struct{}
  21. func Register(s *grpc.Server) {
  22. pb.RegisterManagementServer(s, &Rcvr{})
  23. }
  24. func (c *Rcvr) DataList(ctx context.Context, req *pb_v1.DataListRequest) (reply *pb_v1.DataListReply, err error) {
  25. t1 := func() error {
  26. reply, err = impl_v1.DataList(ctx, req)
  27. return err
  28. }
  29. return reply, rpctasker.Exec(ctx, t1)
  30. }
  31. func (c *Rcvr) TableStruct(ctx context.Context, req *pb_v1.TableStructRequest) (reply *pb_v1.TableStructReply, err error) {
  32. t1 := func() error {
  33. reply, err = impl_v1.TableStruct(ctx, req)
  34. return err
  35. }
  36. return reply, rpctasker.Exec(ctx, t1)
  37. }
  38. func (c *Rcvr) SearchData(ctx context.Context, req *pb_v1.SearchDataRequest) (reply *pb_v1.SearchDataReply, err error) {
  39. t1 := func() error {
  40. reply, err = impl_v1.SearchData(ctx, req)
  41. return err
  42. }
  43. return reply, rpctasker.Exec(ctx, t1)
  44. }
  45. func (c *Rcvr) SearchLevel(ctx context.Context, req *pb_v1.SearchLevelRequest) (reply *pb_v1.SearchLevelReply, err error) {
  46. t1 := func() error {
  47. reply, err = impl_v1.SearchLevel(ctx, req)
  48. return err
  49. }
  50. return reply, rpctasker.Exec(ctx, t1)
  51. }
  52. func (c *Rcvr) Relation(ctx context.Context, req *pb_v1.RelationRequest) (reply *pb_v1.RelationReply, err error) {
  53. t1 := func() error {
  54. reply, err = impl_v1.Relation(ctx, req)
  55. return err
  56. }
  57. return reply, rpctasker.Exec(ctx, t1)
  58. }
  59. func (c *Rcvr) Switch(ctx context.Context, req *pb_v1.SwitchRequest) (reply *pb_v1.SwitchReply, err error) {
  60. t1 := func() error {
  61. reply, err = impl_v1.Switch(ctx, req)
  62. return err
  63. }
  64. return reply, rpctasker.Exec(ctx, t1)
  65. }
  66. func (c *Rcvr) TaskList(ctx context.Context, req *pb_v1.TaskListRequest) (reply *pb_v1.TaskListReply, err error) {
  67. t1 := func() error {
  68. reply, err = impl_v2.TaskList(ctx, req)
  69. return err
  70. }
  71. return reply, rpctasker.Exec(ctx, t1)
  72. }
  73. func (c *Rcvr) SearchTask(ctx context.Context, req *pb_v1.SearchTaskRequest) (reply *pb_v1.SearchTaskReply, err error) {
  74. t1 := func() error {
  75. reply, err = impl_v2.SearchTask(ctx, req)
  76. return err
  77. }
  78. return reply, rpctasker.Exec(ctx, t1)
  79. }
  80. func (c *Rcvr) Dependency(ctx context.Context, req *pb_v1.DependencyRequest) (reply *pb_v1.DependencyReply, err error) {
  81. t1 := func() error {
  82. reply, err = impl_v2.Dependency(ctx, req)
  83. return err
  84. }
  85. return reply, rpctasker.Exec(ctx, t1)
  86. }
  87. func (c *Rcvr) DataSourceRelation(ctx context.Context, req *pb_v1.DataSourceRelationRequest) (reply *pb_v1.DataSourceRelationReply, err error) {
  88. t1 := func() error {
  89. reply, err = impl_v2.DataSourceRelation(ctx, req)
  90. return err
  91. }
  92. return reply, rpctasker.Exec(ctx, t1)
  93. }
  94. func (c *Rcvr) ManualTask(ctx context.Context, req *pb_v1.ManualTaskRequest) (reply *pb_v1.ManualTaskReply, err error) {
  95. t1 := func() error {
  96. reply, err = impl_v3.ManualTask(ctx, req)
  97. return err
  98. }
  99. return reply, rpctasker.Exec(ctx, t1)
  100. }
  101. func (c *Rcvr) Source(ctx context.Context, req *pb_v1.SourceRequest) (reply *pb_v1.SourceReply, err error) {
  102. t1 := func() error {
  103. reply, err = impl_v3.Source(ctx, req)
  104. return err
  105. }
  106. return reply, rpctasker.Exec(ctx, t1)
  107. }
  108. func (c *Rcvr) Task(ctx context.Context, req *pb_v1.TaskRequest) (reply *pb_v1.TaskReply, err error) {
  109. t1 := func() error {
  110. reply, err = impl_v3.Task(ctx, req)
  111. return err
  112. }
  113. return reply, rpctasker.Exec(ctx, t1)
  114. }
  115. func (c *Rcvr) Create(ctx context.Context, req *pb_v1.CreateRequest) (reply *pb_v1.CreateReply, err error) {
  116. t1 := func() error {
  117. reply, err = impl_v3.Create(ctx, req)
  118. return err
  119. }
  120. return reply, rpctasker.Exec(ctx, t1)
  121. }
  122. func (c *Rcvr) UploadFile(ctx context.Context, req *pb_v1.UploadFileRequest) (reply *pb_v1.UploadFileReply, err error) {
  123. t1 := func() error {
  124. reply, err = impl_v3.UploadFile(ctx, req)
  125. return err
  126. }
  127. return reply, rpctasker.Exec(ctx, t1)
  128. }
  129. func (c *Rcvr) Field(ctx context.Context, req *pb_v1.FieldRequest) (reply *pb_v1.FieldReply, err error) {
  130. t1 := func() error {
  131. reply, err = impl_v4.Field(ctx, req)
  132. return err
  133. }
  134. return reply, rpctasker.Exec(ctx, t1)
  135. }
  136. func (c *Rcvr) Excel(ctx context.Context, req *pb_v1.ExcelRequest) (reply *pb_v1.ExcelReply, err error) {
  137. t1 := func() error {
  138. reply, err = impl_v4.Excel(ctx, req)
  139. return err
  140. }
  141. return reply, rpctasker.Exec(ctx, t1)
  142. }
  143. func (c *Rcvr) APIList(ctx context.Context, req *pb_v1.APIListRequest) (reply *pb_v1.APIListReply, err error) {
  144. t1 := func() error {
  145. reply, err = impl_v5.APIList(ctx, req)
  146. return err
  147. }
  148. return reply, rpctasker.Exec(ctx, t1)
  149. }
  150. func (c *Rcvr) CheckAPI(ctx context.Context, req *pb_v1.CheckAPIRequest) (reply *pb_v1.CheckAPIReply, err error) {
  151. t1 := func() error {
  152. reply, err = impl_v5.CheckAPI(ctx, req)
  153. return err
  154. }
  155. return reply, rpctasker.Exec(ctx, t1)
  156. }
  157. func (c *Rcvr) DeleteAPI(ctx context.Context, req *pb_v1.DeleteAPIRequest) (reply *pb_v1.DeleteAPIReply, err error) {
  158. t1 := func() error {
  159. reply, err = impl_v5.DeleteAPI(ctx, req)
  160. return err
  161. }
  162. return reply, rpctasker.Exec(ctx, t1)
  163. }
  164. func (c *Rcvr) KeyList(ctx context.Context, req *pb_v1.KeyListRequest) (reply *pb_v1.KeyListReply, err error) {
  165. t1 := func() error {
  166. reply, err = impl_v5.KeyList(ctx, req)
  167. return err
  168. }
  169. return reply, rpctasker.Exec(ctx, t1)
  170. }
  171. func (c *Rcvr) CreateKey(ctx context.Context, req *pb_v1.CreateKeyRequest) (reply *pb_v1.CreateKeyReply, err error) {
  172. t1 := func() error {
  173. reply, err = impl_v5.CreateKey(ctx, req)
  174. return err
  175. }
  176. return reply, rpctasker.Exec(ctx, t1)
  177. }
  178. func (c *Rcvr) DeleteKey(ctx context.Context, req *pb_v1.DeleteKeyRequest) (reply *pb_v1.DeleteKeyReply, err error) {
  179. t1 := func() error {
  180. reply, err = impl_v5.DeleteKey(ctx, req)
  181. return err
  182. }
  183. return reply, rpctasker.Exec(ctx, t1)
  184. }
  185. func (c *Rcvr) AllAPI(ctx context.Context, req *pb_v1.AllAPIRequest) (reply *pb_v1.AllAPIReply, err error) {
  186. t1 := func() error {
  187. reply, err = impl_v5.AllAPI(ctx, req)
  188. return err
  189. }
  190. return reply, rpctasker.Exec(ctx, t1)
  191. }
  192. func (c *Rcvr) AllKey(ctx context.Context, req *pb_v1.AllKeyRequest) (reply *pb_v1.AllKeyReply, err error) {
  193. t1 := func() error {
  194. reply, err = impl_v5.AllKey(ctx, req)
  195. return err
  196. }
  197. return reply, rpctasker.Exec(ctx, t1)
  198. }
  199. func (c *Rcvr) UseAPI(ctx context.Context, req *pb_v1.UseAPIRequest) (reply *pb_v1.UseAPIReply, err error) {
  200. t1 := func() error {
  201. reply, err = impl_v5.UseAPI(ctx, req)
  202. return err
  203. }
  204. return reply, rpctasker.Exec(ctx, t1)
  205. }
  206. func (c *Rcvr) UpdateAPI(ctx context.Context, req *pb_v1.UpdateAPIRequest) (reply *pb_v1.UpdateAPIReply, err error) {
  207. t1 := func() error {
  208. reply, err = impl_v5.UpdateAPI(ctx, req)
  209. return err
  210. }
  211. return reply, rpctasker.Exec(ctx, t1)
  212. }
  213. func (c *Rcvr) StyleMap(ctx context.Context, req *pb_v1.StyleMapRequest) (reply *pb_v1.StyleMapReply, err error) {
  214. t1 := func() error {
  215. reply, err = impl_v6.StyleMap(ctx, req)
  216. return err
  217. }
  218. return reply, rpctasker.Exec(ctx, t1)
  219. }
  220. func (c *Rcvr) EditMap(ctx context.Context, req *pb_v1.EditMapRequest) (reply *pb_v1.EditMapReply, err error) {
  221. t1 := func() error {
  222. reply, err = impl_v6.EditMap(ctx, req)
  223. return err
  224. }
  225. return reply, rpctasker.Exec(ctx, t1)
  226. }
  227. func (c *Rcvr) AllSource(ctx context.Context, req *pb_v1.AllSourceRequest) (reply *pb_v1.AllSourceReply, err error) {
  228. t1 := func() error {
  229. reply, err = impl_v6.AllSource(ctx, req)
  230. return err
  231. }
  232. return reply, rpctasker.Exec(ctx, t1)
  233. }
  234. func (c *Rcvr) AnnouncementList(ctx context.Context, req *pb_v1.AnnouncementRequest) (reply *pb_v1.AnnouncementReply, err error) {
  235. t1 := func() error {
  236. reply, err = impl_v7.AnnouncementList(ctx, req)
  237. return err
  238. }
  239. return reply, rpctasker.Exec(ctx, t1)
  240. }
  241. func (c *Rcvr) Edit(ctx context.Context, req *pb_v1.EditRequest) (reply *pb_v1.EditReply, err error) {
  242. t1 := func() error {
  243. reply, err = impl_v7.EditList(ctx, req)
  244. return err
  245. }
  246. return reply, rpctasker.Exec(ctx, t1)
  247. }
  248. func (c *Rcvr) DataImportTemplate(ctx context.Context, req *pb_v1.DataImportTemplateRequest) (reply *pb_v1.DataImportTemplateReply, err error) {
  249. t1 := func() error {
  250. reply, err = impl_v8.DataImportTemplate(ctx, req)
  251. return err
  252. }
  253. return reply, rpctasker.Exec(ctx, t1)
  254. }
  255. func (c *Rcvr) CreateTemplate(ctx context.Context, req *pb_v1.CreateTemplateRequest) (reply *pb_v1.CreateTemplateReply, err error) {
  256. t1 := func() error {
  257. reply, err = impl_v8.CreateTemplate(ctx, req)
  258. return err
  259. }
  260. return reply, rpctasker.Exec(ctx, t1)
  261. }
  262. func (c *Rcvr) EditTemplate(ctx context.Context, req *pb_v1.EditTemplateRequest) (reply *pb_v1.EditTemplateReply, err error) {
  263. t1 := func() error {
  264. reply, err = impl_v8.EditTemplate(ctx, req)
  265. return err
  266. }
  267. return reply, rpctasker.Exec(ctx, t1)
  268. }
  269. func (c *Rcvr) DeleteTemplate(ctx context.Context, req *pb_v1.DeleteTemplateRequest) (reply *pb_v1.DeleteTemplateReply, err error) {
  270. t1 := func() error {
  271. reply, err = impl_v8.DeleteTemplate(ctx, req)
  272. return err
  273. }
  274. return reply, rpctasker.Exec(ctx, t1)
  275. }
  276. func (c *Rcvr) DataImport(ctx context.Context, req *pb_v1.DataImportRequest) (reply *pb_v1.DataImportReply, err error) {
  277. t1 := func() error {
  278. reply, err = impl_v8.DataImport(ctx, req)
  279. return err
  280. }
  281. return reply, rpctasker.Exec(ctx, t1)
  282. }