init_api_data.go 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693
  1. package base
  2. import (
  3. "github.com/suyuan32/simple-admin-common/utils/pointy"
  4. "github.com/suyuan32/simple-admin-core/rpc/types/core"
  5. )
  6. func (l *InitDatabaseLogic) insertApiData() (err error) {
  7. // Agent
  8. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  9. ServiceName: pointy.GetPointer("Wechat"),
  10. Path: pointy.GetPointer("/agent/create"),
  11. Description: pointy.GetPointer("apiDesc.createAgent"),
  12. ApiGroup: pointy.GetPointer("agent"),
  13. Method: pointy.GetPointer("POST"),
  14. })
  15. if err != nil {
  16. return err
  17. }
  18. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  19. ServiceName: pointy.GetPointer("Wechat"),
  20. Path: pointy.GetPointer("/agent/update"),
  21. Description: pointy.GetPointer("apiDesc.updateAgent"),
  22. ApiGroup: pointy.GetPointer("agent"),
  23. Method: pointy.GetPointer("POST"),
  24. })
  25. if err != nil {
  26. return err
  27. }
  28. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  29. ServiceName: pointy.GetPointer("Wechat"),
  30. Path: pointy.GetPointer("/agent/delete"),
  31. Description: pointy.GetPointer("apiDesc.deleteAgent"),
  32. ApiGroup: pointy.GetPointer("agent"),
  33. Method: pointy.GetPointer("POST"),
  34. })
  35. if err != nil {
  36. return err
  37. }
  38. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  39. ServiceName: pointy.GetPointer("Wechat"),
  40. Path: pointy.GetPointer("/agent/list"),
  41. Description: pointy.GetPointer("apiDesc.getAgentList"),
  42. ApiGroup: pointy.GetPointer("agent"),
  43. Method: pointy.GetPointer("POST"),
  44. })
  45. if err != nil {
  46. return err
  47. }
  48. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  49. ServiceName: pointy.GetPointer("Wechat"),
  50. Path: pointy.GetPointer("/agent"),
  51. Description: pointy.GetPointer("apiDesc.getAgentById"),
  52. ApiGroup: pointy.GetPointer("agent"),
  53. Method: pointy.GetPointer("POST"),
  54. })
  55. if err != nil {
  56. return err
  57. }
  58. // BatchMsg
  59. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  60. ServiceName: pointy.GetPointer("Wechat"),
  61. Path: pointy.GetPointer("/batch_msg/create"),
  62. Description: pointy.GetPointer("apiDesc.createBatchMsg"),
  63. ApiGroup: pointy.GetPointer("batch_msg"),
  64. Method: pointy.GetPointer("POST"),
  65. })
  66. if err != nil {
  67. return err
  68. }
  69. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  70. ServiceName: pointy.GetPointer("Wechat"),
  71. Path: pointy.GetPointer("/batch_msg/update"),
  72. Description: pointy.GetPointer("apiDesc.updateBatchMsg"),
  73. ApiGroup: pointy.GetPointer("batch_msg"),
  74. Method: pointy.GetPointer("POST"),
  75. })
  76. if err != nil {
  77. return err
  78. }
  79. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  80. ServiceName: pointy.GetPointer("Wechat"),
  81. Path: pointy.GetPointer("/batch_msg/delete"),
  82. Description: pointy.GetPointer("apiDesc.deleteBatchMsg"),
  83. ApiGroup: pointy.GetPointer("batch_msg"),
  84. Method: pointy.GetPointer("POST"),
  85. })
  86. if err != nil {
  87. return err
  88. }
  89. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  90. ServiceName: pointy.GetPointer("Wechat"),
  91. Path: pointy.GetPointer("/batch_msg/list"),
  92. Description: pointy.GetPointer("apiDesc.getBatchMsgList"),
  93. ApiGroup: pointy.GetPointer("batch_msg"),
  94. Method: pointy.GetPointer("POST"),
  95. })
  96. if err != nil {
  97. return err
  98. }
  99. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  100. ServiceName: pointy.GetPointer("Wechat"),
  101. Path: pointy.GetPointer("/batch_msg"),
  102. Description: pointy.GetPointer("apiDesc.getBatchMsgById"),
  103. ApiGroup: pointy.GetPointer("batch_msg"),
  104. Method: pointy.GetPointer("POST"),
  105. })
  106. if err != nil {
  107. return err
  108. }
  109. // MessageRecords
  110. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  111. ServiceName: pointy.GetPointer("Wechat"),
  112. Path: pointy.GetPointer("/message_records/create"),
  113. Description: pointy.GetPointer("apiDesc.createMessageRecords"),
  114. ApiGroup: pointy.GetPointer("message_records"),
  115. Method: pointy.GetPointer("POST"),
  116. })
  117. if err != nil {
  118. return err
  119. }
  120. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  121. ServiceName: pointy.GetPointer("Wechat"),
  122. Path: pointy.GetPointer("/message_records/update"),
  123. Description: pointy.GetPointer("apiDesc.updateMessageRecords"),
  124. ApiGroup: pointy.GetPointer("message_records"),
  125. Method: pointy.GetPointer("POST"),
  126. })
  127. if err != nil {
  128. return err
  129. }
  130. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  131. ServiceName: pointy.GetPointer("Wechat"),
  132. Path: pointy.GetPointer("/message_records/delete"),
  133. Description: pointy.GetPointer("apiDesc.deleteMessageRecords"),
  134. ApiGroup: pointy.GetPointer("message_records"),
  135. Method: pointy.GetPointer("POST"),
  136. })
  137. if err != nil {
  138. return err
  139. }
  140. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  141. ServiceName: pointy.GetPointer("Wechat"),
  142. Path: pointy.GetPointer("/message_records/list"),
  143. Description: pointy.GetPointer("apiDesc.getMessageRecordsList"),
  144. ApiGroup: pointy.GetPointer("message_records"),
  145. Method: pointy.GetPointer("POST"),
  146. })
  147. if err != nil {
  148. return err
  149. }
  150. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  151. ServiceName: pointy.GetPointer("Wechat"),
  152. Path: pointy.GetPointer("/message_records"),
  153. Description: pointy.GetPointer("apiDesc.getMessageRecordsById"),
  154. ApiGroup: pointy.GetPointer("message_records"),
  155. Method: pointy.GetPointer("POST"),
  156. })
  157. if err != nil {
  158. return err
  159. }
  160. // SopNode
  161. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  162. ServiceName: pointy.GetPointer("Wechat"),
  163. Path: pointy.GetPointer("/sop_node/create"),
  164. Description: pointy.GetPointer("apiDesc.createSopNode"),
  165. ApiGroup: pointy.GetPointer("sop_node"),
  166. Method: pointy.GetPointer("POST"),
  167. })
  168. if err != nil {
  169. return err
  170. }
  171. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  172. ServiceName: pointy.GetPointer("Wechat"),
  173. Path: pointy.GetPointer("/sop_node/update"),
  174. Description: pointy.GetPointer("apiDesc.updateSopNode"),
  175. ApiGroup: pointy.GetPointer("sop_node"),
  176. Method: pointy.GetPointer("POST"),
  177. })
  178. if err != nil {
  179. return err
  180. }
  181. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  182. ServiceName: pointy.GetPointer("Wechat"),
  183. Path: pointy.GetPointer("/sop_node/delete"),
  184. Description: pointy.GetPointer("apiDesc.deleteSopNode"),
  185. ApiGroup: pointy.GetPointer("sop_node"),
  186. Method: pointy.GetPointer("POST"),
  187. })
  188. if err != nil {
  189. return err
  190. }
  191. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  192. ServiceName: pointy.GetPointer("Wechat"),
  193. Path: pointy.GetPointer("/sop_node/list"),
  194. Description: pointy.GetPointer("apiDesc.getSopNodeList"),
  195. ApiGroup: pointy.GetPointer("sop_node"),
  196. Method: pointy.GetPointer("POST"),
  197. })
  198. if err != nil {
  199. return err
  200. }
  201. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  202. ServiceName: pointy.GetPointer("Wechat"),
  203. Path: pointy.GetPointer("/sop_node"),
  204. Description: pointy.GetPointer("apiDesc.getSopNodeById"),
  205. ApiGroup: pointy.GetPointer("sop_node"),
  206. Method: pointy.GetPointer("POST"),
  207. })
  208. if err != nil {
  209. return err
  210. }
  211. // SopStage
  212. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  213. ServiceName: pointy.GetPointer("Wechat"),
  214. Path: pointy.GetPointer("/sop_stage/create"),
  215. Description: pointy.GetPointer("apiDesc.createSopStage"),
  216. ApiGroup: pointy.GetPointer("sop_stage"),
  217. Method: pointy.GetPointer("POST"),
  218. })
  219. if err != nil {
  220. return err
  221. }
  222. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  223. ServiceName: pointy.GetPointer("Wechat"),
  224. Path: pointy.GetPointer("/sop_stage/update"),
  225. Description: pointy.GetPointer("apiDesc.updateSopStage"),
  226. ApiGroup: pointy.GetPointer("sop_stage"),
  227. Method: pointy.GetPointer("POST"),
  228. })
  229. if err != nil {
  230. return err
  231. }
  232. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  233. ServiceName: pointy.GetPointer("Wechat"),
  234. Path: pointy.GetPointer("/sop_stage/delete"),
  235. Description: pointy.GetPointer("apiDesc.deleteSopStage"),
  236. ApiGroup: pointy.GetPointer("sop_stage"),
  237. Method: pointy.GetPointer("POST"),
  238. })
  239. if err != nil {
  240. return err
  241. }
  242. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  243. ServiceName: pointy.GetPointer("Wechat"),
  244. Path: pointy.GetPointer("/sop_stage/list"),
  245. Description: pointy.GetPointer("apiDesc.getSopStageList"),
  246. ApiGroup: pointy.GetPointer("sop_stage"),
  247. Method: pointy.GetPointer("POST"),
  248. })
  249. if err != nil {
  250. return err
  251. }
  252. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  253. ServiceName: pointy.GetPointer("Wechat"),
  254. Path: pointy.GetPointer("/sop_stage"),
  255. Description: pointy.GetPointer("apiDesc.getSopStageById"),
  256. ApiGroup: pointy.GetPointer("sop_stage"),
  257. Method: pointy.GetPointer("POST"),
  258. })
  259. if err != nil {
  260. return err
  261. }
  262. // SopTask
  263. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  264. ServiceName: pointy.GetPointer("Wechat"),
  265. Path: pointy.GetPointer("/sop_task/create"),
  266. Description: pointy.GetPointer("apiDesc.createSopTask"),
  267. ApiGroup: pointy.GetPointer("sop_task"),
  268. Method: pointy.GetPointer("POST"),
  269. })
  270. if err != nil {
  271. return err
  272. }
  273. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  274. ServiceName: pointy.GetPointer("Wechat"),
  275. Path: pointy.GetPointer("/sop_task/update"),
  276. Description: pointy.GetPointer("apiDesc.updateSopTask"),
  277. ApiGroup: pointy.GetPointer("sop_task"),
  278. Method: pointy.GetPointer("POST"),
  279. })
  280. if err != nil {
  281. return err
  282. }
  283. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  284. ServiceName: pointy.GetPointer("Wechat"),
  285. Path: pointy.GetPointer("/sop_task/delete"),
  286. Description: pointy.GetPointer("apiDesc.deleteSopTask"),
  287. ApiGroup: pointy.GetPointer("sop_task"),
  288. Method: pointy.GetPointer("POST"),
  289. })
  290. if err != nil {
  291. return err
  292. }
  293. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  294. ServiceName: pointy.GetPointer("Wechat"),
  295. Path: pointy.GetPointer("/sop_task/list"),
  296. Description: pointy.GetPointer("apiDesc.getSopTaskList"),
  297. ApiGroup: pointy.GetPointer("sop_task"),
  298. Method: pointy.GetPointer("POST"),
  299. })
  300. if err != nil {
  301. return err
  302. }
  303. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  304. ServiceName: pointy.GetPointer("Wechat"),
  305. Path: pointy.GetPointer("/sop_task"),
  306. Description: pointy.GetPointer("apiDesc.getSopTaskById"),
  307. ApiGroup: pointy.GetPointer("sop_task"),
  308. Method: pointy.GetPointer("POST"),
  309. })
  310. if err != nil {
  311. return err
  312. }
  313. // LabelRelationship
  314. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  315. ServiceName: pointy.GetPointer("Wechat"),
  316. Path: pointy.GetPointer("/label_relationship/create"),
  317. Description: pointy.GetPointer("apiDesc.createLabelRelationship"),
  318. ApiGroup: pointy.GetPointer("label_relationship"),
  319. Method: pointy.GetPointer("POST"),
  320. })
  321. if err != nil {
  322. return err
  323. }
  324. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  325. ServiceName: pointy.GetPointer("Wechat"),
  326. Path: pointy.GetPointer("/label_relationship/update"),
  327. Description: pointy.GetPointer("apiDesc.updateLabelRelationship"),
  328. ApiGroup: pointy.GetPointer("label_relationship"),
  329. Method: pointy.GetPointer("POST"),
  330. })
  331. if err != nil {
  332. return err
  333. }
  334. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  335. ServiceName: pointy.GetPointer("Wechat"),
  336. Path: pointy.GetPointer("/label_relationship/delete"),
  337. Description: pointy.GetPointer("apiDesc.deleteLabelRelationship"),
  338. ApiGroup: pointy.GetPointer("label_relationship"),
  339. Method: pointy.GetPointer("POST"),
  340. })
  341. if err != nil {
  342. return err
  343. }
  344. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  345. ServiceName: pointy.GetPointer("Wechat"),
  346. Path: pointy.GetPointer("/label_relationship/list"),
  347. Description: pointy.GetPointer("apiDesc.getLabelRelationshipList"),
  348. ApiGroup: pointy.GetPointer("label_relationship"),
  349. Method: pointy.GetPointer("POST"),
  350. })
  351. if err != nil {
  352. return err
  353. }
  354. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  355. ServiceName: pointy.GetPointer("Wechat"),
  356. Path: pointy.GetPointer("/label_relationship"),
  357. Description: pointy.GetPointer("apiDesc.getLabelRelationshipById"),
  358. ApiGroup: pointy.GetPointer("label_relationship"),
  359. Method: pointy.GetPointer("POST"),
  360. })
  361. if err != nil {
  362. return err
  363. }
  364. // Label
  365. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  366. ServiceName: pointy.GetPointer("Wechat"),
  367. Path: pointy.GetPointer("/label/create"),
  368. Description: pointy.GetPointer("apiDesc.createLabel"),
  369. ApiGroup: pointy.GetPointer("label"),
  370. Method: pointy.GetPointer("POST"),
  371. })
  372. if err != nil {
  373. return err
  374. }
  375. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  376. ServiceName: pointy.GetPointer("Wechat"),
  377. Path: pointy.GetPointer("/label/update"),
  378. Description: pointy.GetPointer("apiDesc.updateLabel"),
  379. ApiGroup: pointy.GetPointer("label"),
  380. Method: pointy.GetPointer("POST"),
  381. })
  382. if err != nil {
  383. return err
  384. }
  385. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  386. ServiceName: pointy.GetPointer("Wechat"),
  387. Path: pointy.GetPointer("/label/delete"),
  388. Description: pointy.GetPointer("apiDesc.deleteLabel"),
  389. ApiGroup: pointy.GetPointer("label"),
  390. Method: pointy.GetPointer("POST"),
  391. })
  392. if err != nil {
  393. return err
  394. }
  395. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  396. ServiceName: pointy.GetPointer("Wechat"),
  397. Path: pointy.GetPointer("/label/list"),
  398. Description: pointy.GetPointer("apiDesc.getLabelList"),
  399. ApiGroup: pointy.GetPointer("label"),
  400. Method: pointy.GetPointer("POST"),
  401. })
  402. if err != nil {
  403. return err
  404. }
  405. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  406. ServiceName: pointy.GetPointer("Wechat"),
  407. Path: pointy.GetPointer("/label"),
  408. Description: pointy.GetPointer("apiDesc.getLabelById"),
  409. ApiGroup: pointy.GetPointer("label"),
  410. Method: pointy.GetPointer("POST"),
  411. })
  412. if err != nil {
  413. return err
  414. }
  415. // Contact
  416. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  417. ServiceName: pointy.GetPointer("Wechat"),
  418. Path: pointy.GetPointer("/contact/create"),
  419. Description: pointy.GetPointer("apiDesc.createContact"),
  420. ApiGroup: pointy.GetPointer("contact"),
  421. Method: pointy.GetPointer("POST"),
  422. })
  423. if err != nil {
  424. return err
  425. }
  426. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  427. ServiceName: pointy.GetPointer("Wechat"),
  428. Path: pointy.GetPointer("/contact/update"),
  429. Description: pointy.GetPointer("apiDesc.updateContact"),
  430. ApiGroup: pointy.GetPointer("contact"),
  431. Method: pointy.GetPointer("POST"),
  432. })
  433. if err != nil {
  434. return err
  435. }
  436. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  437. ServiceName: pointy.GetPointer("Wechat"),
  438. Path: pointy.GetPointer("/contact/delete"),
  439. Description: pointy.GetPointer("apiDesc.deleteContact"),
  440. ApiGroup: pointy.GetPointer("contact"),
  441. Method: pointy.GetPointer("POST"),
  442. })
  443. if err != nil {
  444. return err
  445. }
  446. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  447. ServiceName: pointy.GetPointer("Wechat"),
  448. Path: pointy.GetPointer("/contact/list"),
  449. Description: pointy.GetPointer("apiDesc.getContactList"),
  450. ApiGroup: pointy.GetPointer("contact"),
  451. Method: pointy.GetPointer("POST"),
  452. })
  453. if err != nil {
  454. return err
  455. }
  456. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  457. ServiceName: pointy.GetPointer("Wechat"),
  458. Path: pointy.GetPointer("/contact"),
  459. Description: pointy.GetPointer("apiDesc.getContactById"),
  460. ApiGroup: pointy.GetPointer("contact"),
  461. Method: pointy.GetPointer("POST"),
  462. })
  463. if err != nil {
  464. return err
  465. }
  466. // Wx
  467. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  468. ServiceName: pointy.GetPointer("Wechat"),
  469. Path: pointy.GetPointer("/wx/create"),
  470. Description: pointy.GetPointer("apiDesc.createWx"),
  471. ApiGroup: pointy.GetPointer("wx"),
  472. Method: pointy.GetPointer("POST"),
  473. })
  474. if err != nil {
  475. return err
  476. }
  477. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  478. ServiceName: pointy.GetPointer("Wechat"),
  479. Path: pointy.GetPointer("/wx/update"),
  480. Description: pointy.GetPointer("apiDesc.updateWx"),
  481. ApiGroup: pointy.GetPointer("wx"),
  482. Method: pointy.GetPointer("POST"),
  483. })
  484. if err != nil {
  485. return err
  486. }
  487. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  488. ServiceName: pointy.GetPointer("Wechat"),
  489. Path: pointy.GetPointer("/wx/delete"),
  490. Description: pointy.GetPointer("apiDesc.deleteWx"),
  491. ApiGroup: pointy.GetPointer("wx"),
  492. Method: pointy.GetPointer("POST"),
  493. })
  494. if err != nil {
  495. return err
  496. }
  497. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  498. ServiceName: pointy.GetPointer("Wechat"),
  499. Path: pointy.GetPointer("/wx/list"),
  500. Description: pointy.GetPointer("apiDesc.getWxList"),
  501. ApiGroup: pointy.GetPointer("wx"),
  502. Method: pointy.GetPointer("POST"),
  503. })
  504. if err != nil {
  505. return err
  506. }
  507. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  508. ServiceName: pointy.GetPointer("Wechat"),
  509. Path: pointy.GetPointer("/wx"),
  510. Description: pointy.GetPointer("apiDesc.getWxById"),
  511. ApiGroup: pointy.GetPointer("wx"),
  512. Method: pointy.GetPointer("POST"),
  513. })
  514. if err != nil {
  515. return err
  516. }
  517. // Server
  518. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  519. ServiceName: pointy.GetPointer("Wechat"),
  520. Path: pointy.GetPointer("/server/create"),
  521. Description: pointy.GetPointer("apiDesc.createServer"),
  522. ApiGroup: pointy.GetPointer("server"),
  523. Method: pointy.GetPointer("POST"),
  524. })
  525. if err != nil {
  526. return err
  527. }
  528. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  529. ServiceName: pointy.GetPointer("Wechat"),
  530. Path: pointy.GetPointer("/server/update"),
  531. Description: pointy.GetPointer("apiDesc.updateServer"),
  532. ApiGroup: pointy.GetPointer("server"),
  533. Method: pointy.GetPointer("POST"),
  534. })
  535. if err != nil {
  536. return err
  537. }
  538. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  539. ServiceName: pointy.GetPointer("Wechat"),
  540. Path: pointy.GetPointer("/server/delete"),
  541. Description: pointy.GetPointer("apiDesc.deleteServer"),
  542. ApiGroup: pointy.GetPointer("server"),
  543. Method: pointy.GetPointer("POST"),
  544. })
  545. if err != nil {
  546. return err
  547. }
  548. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  549. ServiceName: pointy.GetPointer("Wechat"),
  550. Path: pointy.GetPointer("/server/list"),
  551. Description: pointy.GetPointer("apiDesc.getServerList"),
  552. ApiGroup: pointy.GetPointer("server"),
  553. Method: pointy.GetPointer("POST"),
  554. })
  555. if err != nil {
  556. return err
  557. }
  558. _, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
  559. ServiceName: pointy.GetPointer("Wechat"),
  560. Path: pointy.GetPointer("/server"),
  561. Description: pointy.GetPointer("apiDesc.getServerById"),
  562. ApiGroup: pointy.GetPointer("server"),
  563. Method: pointy.GetPointer("POST"),
  564. })
  565. if err != nil {
  566. return err
  567. }
  568. return err
  569. }