docs.go 110 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418
  1. // Package docs GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
  2. // This file was generated by swaggo/swag
  3. package docs
  4. import (
  5. "bytes"
  6. "encoding/json"
  7. "strings"
  8. "text/template"
  9. "github.com/swaggo/swag"
  10. )
  11. var doc = `{
  12. "schemes": {{ marshal .Schemes }},
  13. "swagger": "2.0",
  14. "info": {
  15. "description": "{{escape .Description}}",
  16. "title": "{{.Title}}",
  17. "contact": {},
  18. "license": {
  19. "name": "MIT",
  20. "url": "https://github.com/xinliangnote/go-gin-api/blob/master/LICENSE"
  21. },
  22. "version": "{{.Version}}"
  23. },
  24. "host": "{{.Host}}",
  25. "basePath": "{{.BasePath}}",
  26. "paths": {
  27. "/api/admin": {
  28. "get": {
  29. "security": [
  30. {
  31. "LoginToken": []
  32. }
  33. ],
  34. "description": "管理员列表",
  35. "consumes": [
  36. "application/x-www-form-urlencoded"
  37. ],
  38. "produces": [
  39. "application/json"
  40. ],
  41. "tags": [
  42. "API.admin"
  43. ],
  44. "summary": "管理员列表",
  45. "parameters": [
  46. {
  47. "type": "integer",
  48. "default": 1,
  49. "description": "第几页",
  50. "name": "page",
  51. "in": "query",
  52. "required": true
  53. },
  54. {
  55. "type": "integer",
  56. "default": 10,
  57. "description": "每页显示条数",
  58. "name": "page_size",
  59. "in": "query",
  60. "required": true
  61. },
  62. {
  63. "type": "string",
  64. "description": "用户名",
  65. "name": "username",
  66. "in": "query"
  67. },
  68. {
  69. "type": "string",
  70. "description": "昵称",
  71. "name": "nickname",
  72. "in": "query"
  73. },
  74. {
  75. "type": "string",
  76. "description": "手机号",
  77. "name": "mobile",
  78. "in": "query"
  79. }
  80. ],
  81. "responses": {
  82. "200": {
  83. "description": "OK",
  84. "schema": {
  85. "$ref": "#/definitions/admin.listResponse"
  86. }
  87. },
  88. "400": {
  89. "description": "Bad Request",
  90. "schema": {
  91. "$ref": "#/definitions/code.Failure"
  92. }
  93. }
  94. }
  95. },
  96. "post": {
  97. "security": [
  98. {
  99. "LoginToken": []
  100. }
  101. ],
  102. "description": "新增管理员",
  103. "consumes": [
  104. "application/x-www-form-urlencoded"
  105. ],
  106. "produces": [
  107. "application/json"
  108. ],
  109. "tags": [
  110. "API.admin"
  111. ],
  112. "summary": "新增管理员",
  113. "parameters": [
  114. {
  115. "type": "string",
  116. "description": "用户名",
  117. "name": "username",
  118. "in": "formData",
  119. "required": true
  120. },
  121. {
  122. "type": "string",
  123. "description": "昵称",
  124. "name": "nickname",
  125. "in": "formData",
  126. "required": true
  127. },
  128. {
  129. "type": "string",
  130. "description": "手机号",
  131. "name": "mobile",
  132. "in": "formData",
  133. "required": true
  134. },
  135. {
  136. "type": "string",
  137. "description": "MD5后的密码",
  138. "name": "password",
  139. "in": "formData",
  140. "required": true
  141. }
  142. ],
  143. "responses": {
  144. "200": {
  145. "description": "OK",
  146. "schema": {
  147. "$ref": "#/definitions/admin.createResponse"
  148. }
  149. },
  150. "400": {
  151. "description": "Bad Request",
  152. "schema": {
  153. "$ref": "#/definitions/code.Failure"
  154. }
  155. }
  156. }
  157. }
  158. },
  159. "/api/admin/info": {
  160. "get": {
  161. "security": [
  162. {
  163. "LoginToken": []
  164. }
  165. ],
  166. "description": "管理员详情",
  167. "consumes": [
  168. "application/x-www-form-urlencoded"
  169. ],
  170. "produces": [
  171. "application/json"
  172. ],
  173. "tags": [
  174. "API.admin"
  175. ],
  176. "summary": "管理员详情",
  177. "responses": {
  178. "200": {
  179. "description": "OK",
  180. "schema": {
  181. "$ref": "#/definitions/admin.detailResponse"
  182. }
  183. },
  184. "400": {
  185. "description": "Bad Request",
  186. "schema": {
  187. "$ref": "#/definitions/code.Failure"
  188. }
  189. }
  190. }
  191. }
  192. },
  193. "/api/admin/logout": {
  194. "post": {
  195. "security": [
  196. {
  197. "LoginToken": []
  198. }
  199. ],
  200. "description": "管理员登出",
  201. "consumes": [
  202. "application/x-www-form-urlencoded"
  203. ],
  204. "produces": [
  205. "application/json"
  206. ],
  207. "tags": [
  208. "API.admin"
  209. ],
  210. "summary": "管理员登出",
  211. "responses": {
  212. "200": {
  213. "description": "OK",
  214. "schema": {
  215. "$ref": "#/definitions/admin.logoutResponse"
  216. }
  217. },
  218. "400": {
  219. "description": "Bad Request",
  220. "schema": {
  221. "$ref": "#/definitions/code.Failure"
  222. }
  223. }
  224. }
  225. }
  226. },
  227. "/api/admin/menu": {
  228. "post": {
  229. "security": [
  230. {
  231. "LoginToken": []
  232. }
  233. ],
  234. "description": "提交菜单授权",
  235. "consumes": [
  236. "application/x-www-form-urlencoded"
  237. ],
  238. "produces": [
  239. "application/json"
  240. ],
  241. "tags": [
  242. "API.admin"
  243. ],
  244. "summary": "提交菜单授权",
  245. "parameters": [
  246. {
  247. "type": "string",
  248. "description": "Hashid",
  249. "name": "id",
  250. "in": "formData",
  251. "required": true
  252. },
  253. {
  254. "type": "string",
  255. "description": "功能权限ID,多个用,分割",
  256. "name": "actions",
  257. "in": "formData",
  258. "required": true
  259. }
  260. ],
  261. "responses": {
  262. "200": {
  263. "description": "OK",
  264. "schema": {
  265. "$ref": "#/definitions/admin.createResponse"
  266. }
  267. },
  268. "400": {
  269. "description": "Bad Request",
  270. "schema": {
  271. "$ref": "#/definitions/code.Failure"
  272. }
  273. }
  274. }
  275. }
  276. },
  277. "/api/admin/menu/{id}": {
  278. "get": {
  279. "security": [
  280. {
  281. "LoginToken": []
  282. }
  283. ],
  284. "description": "菜单授权列表",
  285. "consumes": [
  286. "application/x-www-form-urlencoded"
  287. ],
  288. "produces": [
  289. "application/json"
  290. ],
  291. "tags": [
  292. "API.admin"
  293. ],
  294. "summary": "菜单授权列表",
  295. "parameters": [
  296. {
  297. "type": "string",
  298. "description": "hashId",
  299. "name": "id",
  300. "in": "path",
  301. "required": true
  302. }
  303. ],
  304. "responses": {
  305. "200": {
  306. "description": "OK",
  307. "schema": {
  308. "$ref": "#/definitions/admin.listAdminMenuResponse"
  309. }
  310. },
  311. "400": {
  312. "description": "Bad Request",
  313. "schema": {
  314. "$ref": "#/definitions/code.Failure"
  315. }
  316. }
  317. }
  318. }
  319. },
  320. "/api/admin/modify_password": {
  321. "patch": {
  322. "security": [
  323. {
  324. "LoginToken": []
  325. }
  326. ],
  327. "description": "修改密码",
  328. "consumes": [
  329. "application/x-www-form-urlencoded"
  330. ],
  331. "produces": [
  332. "application/json"
  333. ],
  334. "tags": [
  335. "API.admin"
  336. ],
  337. "summary": "修改密码",
  338. "parameters": [
  339. {
  340. "type": "string",
  341. "description": "旧密码",
  342. "name": "old_password",
  343. "in": "formData",
  344. "required": true
  345. },
  346. {
  347. "type": "string",
  348. "description": "新密码",
  349. "name": "new_password",
  350. "in": "formData",
  351. "required": true
  352. }
  353. ],
  354. "responses": {
  355. "200": {
  356. "description": "OK",
  357. "schema": {
  358. "$ref": "#/definitions/admin.modifyPasswordResponse"
  359. }
  360. },
  361. "400": {
  362. "description": "Bad Request",
  363. "schema": {
  364. "$ref": "#/definitions/code.Failure"
  365. }
  366. }
  367. }
  368. }
  369. },
  370. "/api/admin/modify_personal_info": {
  371. "patch": {
  372. "security": [
  373. {
  374. "LoginToken": []
  375. }
  376. ],
  377. "description": "修改个人信息",
  378. "consumes": [
  379. "application/x-www-form-urlencoded"
  380. ],
  381. "produces": [
  382. "application/json"
  383. ],
  384. "tags": [
  385. "API.admin"
  386. ],
  387. "summary": "修改个人信息",
  388. "parameters": [
  389. {
  390. "type": "string",
  391. "description": "昵称",
  392. "name": "nickname",
  393. "in": "formData",
  394. "required": true
  395. },
  396. {
  397. "type": "string",
  398. "description": "手机号",
  399. "name": "mobile",
  400. "in": "formData",
  401. "required": true
  402. }
  403. ],
  404. "responses": {
  405. "200": {
  406. "description": "OK",
  407. "schema": {
  408. "$ref": "#/definitions/admin.modifyPersonalInfoResponse"
  409. }
  410. },
  411. "400": {
  412. "description": "Bad Request",
  413. "schema": {
  414. "$ref": "#/definitions/code.Failure"
  415. }
  416. }
  417. }
  418. }
  419. },
  420. "/api/admin/offline": {
  421. "patch": {
  422. "security": [
  423. {
  424. "LoginToken": []
  425. }
  426. ],
  427. "description": "下线管理员",
  428. "consumes": [
  429. "application/x-www-form-urlencoded"
  430. ],
  431. "produces": [
  432. "application/json"
  433. ],
  434. "tags": [
  435. "API.admin"
  436. ],
  437. "summary": "下线管理员",
  438. "parameters": [
  439. {
  440. "type": "string",
  441. "description": "Hashid",
  442. "name": "id",
  443. "in": "formData",
  444. "required": true
  445. }
  446. ],
  447. "responses": {
  448. "200": {
  449. "description": "OK",
  450. "schema": {
  451. "$ref": "#/definitions/admin.offlineResponse"
  452. }
  453. },
  454. "400": {
  455. "description": "Bad Request",
  456. "schema": {
  457. "$ref": "#/definitions/code.Failure"
  458. }
  459. }
  460. }
  461. }
  462. },
  463. "/api/admin/reset_password/{id}": {
  464. "patch": {
  465. "security": [
  466. {
  467. "LoginToken": []
  468. }
  469. ],
  470. "description": "重置密码",
  471. "consumes": [
  472. "application/json"
  473. ],
  474. "produces": [
  475. "application/json"
  476. ],
  477. "tags": [
  478. "API.admin"
  479. ],
  480. "summary": "重置密码",
  481. "parameters": [
  482. {
  483. "type": "string",
  484. "description": "hashId",
  485. "name": "id",
  486. "in": "path",
  487. "required": true
  488. }
  489. ],
  490. "responses": {
  491. "200": {
  492. "description": "OK",
  493. "schema": {
  494. "$ref": "#/definitions/admin.resetPasswordResponse"
  495. }
  496. },
  497. "400": {
  498. "description": "Bad Request",
  499. "schema": {
  500. "$ref": "#/definitions/code.Failure"
  501. }
  502. }
  503. }
  504. }
  505. },
  506. "/api/admin/used": {
  507. "patch": {
  508. "security": [
  509. {
  510. "LoginToken": []
  511. }
  512. ],
  513. "description": "更新管理员为启用/禁用",
  514. "consumes": [
  515. "application/x-www-form-urlencoded"
  516. ],
  517. "produces": [
  518. "application/json"
  519. ],
  520. "tags": [
  521. "API.admin"
  522. ],
  523. "summary": "更新管理员为启用/禁用",
  524. "parameters": [
  525. {
  526. "type": "string",
  527. "description": "Hashid",
  528. "name": "id",
  529. "in": "formData",
  530. "required": true
  531. },
  532. {
  533. "type": "integer",
  534. "description": "是否启用 1:是 -1:否",
  535. "name": "used",
  536. "in": "formData",
  537. "required": true
  538. }
  539. ],
  540. "responses": {
  541. "200": {
  542. "description": "OK",
  543. "schema": {
  544. "$ref": "#/definitions/admin.updateUsedResponse"
  545. }
  546. },
  547. "400": {
  548. "description": "Bad Request",
  549. "schema": {
  550. "$ref": "#/definitions/code.Failure"
  551. }
  552. }
  553. }
  554. }
  555. },
  556. "/api/admin/{id}": {
  557. "delete": {
  558. "security": [
  559. {
  560. "LoginToken": []
  561. }
  562. ],
  563. "description": "删除管理员",
  564. "consumes": [
  565. "application/json"
  566. ],
  567. "produces": [
  568. "application/json"
  569. ],
  570. "tags": [
  571. "API.admin"
  572. ],
  573. "summary": "删除管理员",
  574. "parameters": [
  575. {
  576. "type": "string",
  577. "description": "hashId",
  578. "name": "id",
  579. "in": "path",
  580. "required": true
  581. }
  582. ],
  583. "responses": {
  584. "200": {
  585. "description": "OK",
  586. "schema": {
  587. "$ref": "#/definitions/admin.deleteResponse"
  588. }
  589. },
  590. "400": {
  591. "description": "Bad Request",
  592. "schema": {
  593. "$ref": "#/definitions/code.Failure"
  594. }
  595. }
  596. }
  597. }
  598. },
  599. "/api/authorized": {
  600. "get": {
  601. "security": [
  602. {
  603. "LoginToken": []
  604. }
  605. ],
  606. "description": "调用方列表",
  607. "consumes": [
  608. "application/x-www-form-urlencoded"
  609. ],
  610. "produces": [
  611. "application/json"
  612. ],
  613. "tags": [
  614. "API.authorized"
  615. ],
  616. "summary": "调用方列表",
  617. "parameters": [
  618. {
  619. "type": "integer",
  620. "default": 1,
  621. "description": "第几页",
  622. "name": "page",
  623. "in": "query",
  624. "required": true
  625. },
  626. {
  627. "type": "integer",
  628. "default": 10,
  629. "description": "每页显示条数",
  630. "name": "page_size",
  631. "in": "query",
  632. "required": true
  633. },
  634. {
  635. "type": "string",
  636. "description": "调用方key",
  637. "name": "business_key",
  638. "in": "query"
  639. },
  640. {
  641. "type": "string",
  642. "description": "调用方secret",
  643. "name": "business_secret",
  644. "in": "query"
  645. },
  646. {
  647. "type": "string",
  648. "description": "调用方对接人",
  649. "name": "business_developer",
  650. "in": "query"
  651. },
  652. {
  653. "type": "string",
  654. "description": "备注",
  655. "name": "remark",
  656. "in": "path"
  657. }
  658. ],
  659. "responses": {
  660. "200": {
  661. "description": "OK",
  662. "schema": {
  663. "$ref": "#/definitions/authorized.listResponse"
  664. }
  665. },
  666. "400": {
  667. "description": "Bad Request",
  668. "schema": {
  669. "$ref": "#/definitions/code.Failure"
  670. }
  671. }
  672. }
  673. },
  674. "post": {
  675. "security": [
  676. {
  677. "LoginToken": []
  678. }
  679. ],
  680. "description": "新增调用方",
  681. "consumes": [
  682. "application/x-www-form-urlencoded"
  683. ],
  684. "produces": [
  685. "application/json"
  686. ],
  687. "tags": [
  688. "API.authorized"
  689. ],
  690. "summary": "新增调用方",
  691. "parameters": [
  692. {
  693. "type": "string",
  694. "description": "调用方key",
  695. "name": "business_key",
  696. "in": "formData",
  697. "required": true
  698. },
  699. {
  700. "type": "string",
  701. "description": "调用方对接人",
  702. "name": "business_developer",
  703. "in": "formData",
  704. "required": true
  705. },
  706. {
  707. "type": "string",
  708. "description": "备注",
  709. "name": "remark",
  710. "in": "formData",
  711. "required": true
  712. }
  713. ],
  714. "responses": {
  715. "200": {
  716. "description": "OK",
  717. "schema": {
  718. "$ref": "#/definitions/authorized.createResponse"
  719. }
  720. },
  721. "400": {
  722. "description": "Bad Request",
  723. "schema": {
  724. "$ref": "#/definitions/code.Failure"
  725. }
  726. }
  727. }
  728. }
  729. },
  730. "/api/authorized/used": {
  731. "patch": {
  732. "security": [
  733. {
  734. "LoginToken": []
  735. }
  736. ],
  737. "description": "更新调用方为启用/禁用",
  738. "consumes": [
  739. "application/x-www-form-urlencoded"
  740. ],
  741. "produces": [
  742. "application/json"
  743. ],
  744. "tags": [
  745. "API.authorized"
  746. ],
  747. "summary": "更新调用方为启用/禁用",
  748. "parameters": [
  749. {
  750. "type": "string",
  751. "description": "hashID",
  752. "name": "id",
  753. "in": "formData",
  754. "required": true
  755. },
  756. {
  757. "type": "integer",
  758. "description": "是否启用 1:是 -1:否",
  759. "name": "used",
  760. "in": "formData",
  761. "required": true
  762. }
  763. ],
  764. "responses": {
  765. "200": {
  766. "description": "OK",
  767. "schema": {
  768. "$ref": "#/definitions/authorized.updateUsedResponse"
  769. }
  770. },
  771. "400": {
  772. "description": "Bad Request",
  773. "schema": {
  774. "$ref": "#/definitions/code.Failure"
  775. }
  776. }
  777. }
  778. }
  779. },
  780. "/api/authorized/{id}": {
  781. "delete": {
  782. "security": [
  783. {
  784. "LoginToken": []
  785. }
  786. ],
  787. "description": "删除调用方",
  788. "consumes": [
  789. "application/json"
  790. ],
  791. "produces": [
  792. "application/json"
  793. ],
  794. "tags": [
  795. "API.authorized"
  796. ],
  797. "summary": "删除调用方",
  798. "parameters": [
  799. {
  800. "type": "string",
  801. "description": "hashId",
  802. "name": "id",
  803. "in": "path",
  804. "required": true
  805. }
  806. ],
  807. "responses": {
  808. "200": {
  809. "description": "OK",
  810. "schema": {
  811. "$ref": "#/definitions/authorized.deleteResponse"
  812. }
  813. },
  814. "400": {
  815. "description": "Bad Request",
  816. "schema": {
  817. "$ref": "#/definitions/code.Failure"
  818. }
  819. }
  820. }
  821. }
  822. },
  823. "/api/authorized_api": {
  824. "get": {
  825. "security": [
  826. {
  827. "LoginToken": []
  828. }
  829. ],
  830. "description": "调用方接口地址列表",
  831. "consumes": [
  832. "application/x-www-form-urlencoded"
  833. ],
  834. "produces": [
  835. "application/json"
  836. ],
  837. "tags": [
  838. "API.authorized"
  839. ],
  840. "summary": "调用方接口地址列表",
  841. "parameters": [
  842. {
  843. "type": "string",
  844. "description": "hashID",
  845. "name": "id",
  846. "in": "query",
  847. "required": true
  848. }
  849. ],
  850. "responses": {
  851. "200": {
  852. "description": "OK",
  853. "schema": {
  854. "$ref": "#/definitions/authorized.listAPIResponse"
  855. }
  856. },
  857. "400": {
  858. "description": "Bad Request",
  859. "schema": {
  860. "$ref": "#/definitions/code.Failure"
  861. }
  862. }
  863. }
  864. },
  865. "post": {
  866. "security": [
  867. {
  868. "LoginToken": []
  869. }
  870. ],
  871. "description": "授权调用方接口地址",
  872. "consumes": [
  873. "application/x-www-form-urlencoded"
  874. ],
  875. "produces": [
  876. "application/json"
  877. ],
  878. "tags": [
  879. "API.authorized"
  880. ],
  881. "summary": "授权调用方接口地址",
  882. "parameters": [
  883. {
  884. "type": "string",
  885. "description": "HashID",
  886. "name": "id",
  887. "in": "formData",
  888. "required": true
  889. },
  890. {
  891. "type": "string",
  892. "description": "请求方法",
  893. "name": "method",
  894. "in": "formData",
  895. "required": true
  896. },
  897. {
  898. "type": "string",
  899. "description": "请求地址",
  900. "name": "api",
  901. "in": "formData",
  902. "required": true
  903. }
  904. ],
  905. "responses": {
  906. "200": {
  907. "description": "OK",
  908. "schema": {
  909. "$ref": "#/definitions/authorized.createAPIResponse"
  910. }
  911. },
  912. "400": {
  913. "description": "Bad Request",
  914. "schema": {
  915. "$ref": "#/definitions/code.Failure"
  916. }
  917. }
  918. }
  919. }
  920. },
  921. "/api/authorized_api/{id}": {
  922. "delete": {
  923. "security": [
  924. {
  925. "LoginToken": []
  926. }
  927. ],
  928. "description": "删除调用方接口地址",
  929. "consumes": [
  930. "application/json"
  931. ],
  932. "produces": [
  933. "application/json"
  934. ],
  935. "tags": [
  936. "API.authorized"
  937. ],
  938. "summary": "删除调用方接口地址",
  939. "parameters": [
  940. {
  941. "type": "string",
  942. "description": "主键ID",
  943. "name": "id",
  944. "in": "path",
  945. "required": true
  946. }
  947. ],
  948. "responses": {
  949. "200": {
  950. "description": "OK",
  951. "schema": {
  952. "$ref": "#/definitions/authorized.deleteAPIResponse"
  953. }
  954. },
  955. "400": {
  956. "description": "Bad Request",
  957. "schema": {
  958. "$ref": "#/definitions/code.Failure"
  959. }
  960. }
  961. }
  962. }
  963. },
  964. "/api/config/email": {
  965. "patch": {
  966. "security": [
  967. {
  968. "LoginToken": []
  969. }
  970. ],
  971. "description": "修改邮件配置",
  972. "consumes": [
  973. "application/x-www-form-urlencoded"
  974. ],
  975. "produces": [
  976. "application/json"
  977. ],
  978. "tags": [
  979. "API.config"
  980. ],
  981. "summary": "修改邮件配置",
  982. "parameters": [
  983. {
  984. "type": "string",
  985. "description": "邮箱服务器",
  986. "name": "host",
  987. "in": "formData",
  988. "required": true
  989. },
  990. {
  991. "type": "string",
  992. "description": "端口",
  993. "name": "port",
  994. "in": "formData",
  995. "required": true
  996. },
  997. {
  998. "type": "string",
  999. "description": "发件人邮箱",
  1000. "name": "user",
  1001. "in": "formData",
  1002. "required": true
  1003. },
  1004. {
  1005. "type": "string",
  1006. "description": "发件人密码",
  1007. "name": "pass",
  1008. "in": "formData",
  1009. "required": true
  1010. },
  1011. {
  1012. "type": "string",
  1013. "description": "收件人邮箱地址,多个用,分割",
  1014. "name": "to",
  1015. "in": "formData",
  1016. "required": true
  1017. }
  1018. ],
  1019. "responses": {
  1020. "200": {
  1021. "description": "OK",
  1022. "schema": {
  1023. "$ref": "#/definitions/config.emailResponse"
  1024. }
  1025. },
  1026. "400": {
  1027. "description": "Bad Request",
  1028. "schema": {
  1029. "$ref": "#/definitions/code.Failure"
  1030. }
  1031. }
  1032. }
  1033. }
  1034. },
  1035. "/api/cron": {
  1036. "get": {
  1037. "security": [
  1038. {
  1039. "LoginToken": []
  1040. }
  1041. ],
  1042. "description": "任务列表",
  1043. "consumes": [
  1044. "application/x-www-form-urlencoded"
  1045. ],
  1046. "produces": [
  1047. "application/json"
  1048. ],
  1049. "tags": [
  1050. "API.cron"
  1051. ],
  1052. "summary": "任务列表",
  1053. "parameters": [
  1054. {
  1055. "type": "integer",
  1056. "default": 1,
  1057. "description": "第几页",
  1058. "name": "page",
  1059. "in": "query",
  1060. "required": true
  1061. },
  1062. {
  1063. "type": "integer",
  1064. "default": 10,
  1065. "description": "每页显示条数",
  1066. "name": "page_size",
  1067. "in": "query",
  1068. "required": true
  1069. },
  1070. {
  1071. "type": "string",
  1072. "description": "任务名称",
  1073. "name": "name",
  1074. "in": "query"
  1075. },
  1076. {
  1077. "type": "integer",
  1078. "description": "执行方式 1:shell 2:http",
  1079. "name": "protocol",
  1080. "in": "query"
  1081. },
  1082. {
  1083. "type": "integer",
  1084. "description": "是否启用 1:是 -1:否",
  1085. "name": "is_used",
  1086. "in": "query"
  1087. }
  1088. ],
  1089. "responses": {
  1090. "200": {
  1091. "description": "OK",
  1092. "schema": {
  1093. "$ref": "#/definitions/cron.listResponse"
  1094. }
  1095. },
  1096. "400": {
  1097. "description": "Bad Request",
  1098. "schema": {
  1099. "$ref": "#/definitions/code.Failure"
  1100. }
  1101. }
  1102. }
  1103. },
  1104. "post": {
  1105. "security": [
  1106. {
  1107. "LoginToken": []
  1108. }
  1109. ],
  1110. "description": "创建任务",
  1111. "consumes": [
  1112. "application/x-www-form-urlencoded"
  1113. ],
  1114. "produces": [
  1115. "application/json"
  1116. ],
  1117. "tags": [
  1118. "API.cron"
  1119. ],
  1120. "summary": "创建任务",
  1121. "parameters": [
  1122. {
  1123. "type": "string",
  1124. "description": "任务名称",
  1125. "name": "name",
  1126. "in": "formData",
  1127. "required": true
  1128. },
  1129. {
  1130. "type": "string",
  1131. "description": "crontab 表达式",
  1132. "name": "spec",
  1133. "in": "formData",
  1134. "required": true
  1135. },
  1136. {
  1137. "type": "string",
  1138. "description": "执行命令",
  1139. "name": "command",
  1140. "in": "formData",
  1141. "required": true
  1142. },
  1143. {
  1144. "type": "integer",
  1145. "description": "执行方式 1:shell 2:http",
  1146. "name": "protocol",
  1147. "in": "formData",
  1148. "required": true
  1149. },
  1150. {
  1151. "type": "integer",
  1152. "description": "http 请求方式 1:get 2:post",
  1153. "name": "http_method",
  1154. "in": "formData"
  1155. },
  1156. {
  1157. "type": "integer",
  1158. "description": "超时时间(单位:秒)",
  1159. "name": "timeout",
  1160. "in": "formData",
  1161. "required": true
  1162. },
  1163. {
  1164. "type": "integer",
  1165. "description": "重试次数",
  1166. "name": "retry_times",
  1167. "in": "formData",
  1168. "required": true
  1169. },
  1170. {
  1171. "type": "integer",
  1172. "description": "重试间隔(单位:秒)",
  1173. "name": "retry_interval",
  1174. "in": "formData",
  1175. "required": true
  1176. },
  1177. {
  1178. "type": "integer",
  1179. "description": "执行结束是否通知 1:不通知 2:失败通知 3:结束通知 4:结果关键字匹配通知",
  1180. "name": "notify_status",
  1181. "in": "formData",
  1182. "required": true
  1183. },
  1184. {
  1185. "type": "integer",
  1186. "description": "通知类型 1:邮件 2:webhook",
  1187. "name": "notify_type",
  1188. "in": "formData"
  1189. },
  1190. {
  1191. "type": "string",
  1192. "description": "通知者邮箱地址(多个用,分割)",
  1193. "name": "notify_receiver_email",
  1194. "in": "formData"
  1195. },
  1196. {
  1197. "type": "string",
  1198. "description": "通知匹配关键字(多个用,分割)",
  1199. "name": "notify_keyword",
  1200. "in": "formData"
  1201. },
  1202. {
  1203. "type": "string",
  1204. "description": "备注",
  1205. "name": "remark",
  1206. "in": "formData"
  1207. },
  1208. {
  1209. "type": "integer",
  1210. "description": "是否启用 1:是 -1:否",
  1211. "name": "is_used",
  1212. "in": "formData",
  1213. "required": true
  1214. }
  1215. ],
  1216. "responses": {
  1217. "200": {
  1218. "description": "OK",
  1219. "schema": {
  1220. "$ref": "#/definitions/cron.createResponse"
  1221. }
  1222. },
  1223. "400": {
  1224. "description": "Bad Request",
  1225. "schema": {
  1226. "$ref": "#/definitions/code.Failure"
  1227. }
  1228. }
  1229. }
  1230. }
  1231. },
  1232. "/api/cron/used": {
  1233. "patch": {
  1234. "security": [
  1235. {
  1236. "LoginToken": []
  1237. }
  1238. ],
  1239. "description": "更新任务为启用/禁用",
  1240. "consumes": [
  1241. "application/x-www-form-urlencoded"
  1242. ],
  1243. "produces": [
  1244. "application/json"
  1245. ],
  1246. "tags": [
  1247. "API.cron"
  1248. ],
  1249. "summary": "更新任务为启用/禁用",
  1250. "parameters": [
  1251. {
  1252. "type": "string",
  1253. "description": "hashID",
  1254. "name": "id",
  1255. "in": "formData",
  1256. "required": true
  1257. },
  1258. {
  1259. "type": "integer",
  1260. "description": "是否启用 1:是 -1:否",
  1261. "name": "used",
  1262. "in": "formData",
  1263. "required": true
  1264. }
  1265. ],
  1266. "responses": {
  1267. "200": {
  1268. "description": "OK",
  1269. "schema": {
  1270. "$ref": "#/definitions/cron.updateUsedResponse"
  1271. }
  1272. },
  1273. "400": {
  1274. "description": "Bad Request",
  1275. "schema": {
  1276. "$ref": "#/definitions/code.Failure"
  1277. }
  1278. }
  1279. }
  1280. }
  1281. },
  1282. "/api/cron/{id}": {
  1283. "get": {
  1284. "security": [
  1285. {
  1286. "LoginToken": []
  1287. }
  1288. ],
  1289. "description": "获取单条任务详情",
  1290. "consumes": [
  1291. "application/json"
  1292. ],
  1293. "produces": [
  1294. "application/json"
  1295. ],
  1296. "tags": [
  1297. "API.cron"
  1298. ],
  1299. "summary": "获取单条任务详情",
  1300. "parameters": [
  1301. {
  1302. "type": "string",
  1303. "description": "hashId",
  1304. "name": "id",
  1305. "in": "path",
  1306. "required": true
  1307. }
  1308. ],
  1309. "responses": {
  1310. "200": {
  1311. "description": "OK",
  1312. "schema": {
  1313. "$ref": "#/definitions/cron.detailResponse"
  1314. }
  1315. },
  1316. "400": {
  1317. "description": "Bad Request",
  1318. "schema": {
  1319. "$ref": "#/definitions/code.Failure"
  1320. }
  1321. }
  1322. }
  1323. },
  1324. "post": {
  1325. "security": [
  1326. {
  1327. "LoginToken": []
  1328. }
  1329. ],
  1330. "description": "编辑任务",
  1331. "consumes": [
  1332. "application/x-www-form-urlencoded"
  1333. ],
  1334. "produces": [
  1335. "application/json"
  1336. ],
  1337. "tags": [
  1338. "API.cron"
  1339. ],
  1340. "summary": "编辑任务",
  1341. "parameters": [
  1342. {
  1343. "type": "string",
  1344. "description": "hashID",
  1345. "name": "id",
  1346. "in": "formData",
  1347. "required": true
  1348. },
  1349. {
  1350. "type": "string",
  1351. "description": "任务名称",
  1352. "name": "name",
  1353. "in": "formData",
  1354. "required": true
  1355. },
  1356. {
  1357. "type": "string",
  1358. "description": "crontab 表达式",
  1359. "name": "spec",
  1360. "in": "formData",
  1361. "required": true
  1362. },
  1363. {
  1364. "type": "string",
  1365. "description": "执行命令",
  1366. "name": "command",
  1367. "in": "formData",
  1368. "required": true
  1369. },
  1370. {
  1371. "type": "integer",
  1372. "description": "执行方式 1:shell 2:http",
  1373. "name": "protocol",
  1374. "in": "formData",
  1375. "required": true
  1376. },
  1377. {
  1378. "type": "integer",
  1379. "description": "http 请求方式 1:get 2:post",
  1380. "name": "http_method",
  1381. "in": "formData"
  1382. },
  1383. {
  1384. "type": "integer",
  1385. "description": "超时时间(单位:秒)",
  1386. "name": "timeout",
  1387. "in": "formData",
  1388. "required": true
  1389. },
  1390. {
  1391. "type": "integer",
  1392. "description": "重试次数",
  1393. "name": "retry_times",
  1394. "in": "formData",
  1395. "required": true
  1396. },
  1397. {
  1398. "type": "integer",
  1399. "description": "重试间隔(单位:秒)",
  1400. "name": "retry_interval",
  1401. "in": "formData",
  1402. "required": true
  1403. },
  1404. {
  1405. "type": "integer",
  1406. "description": "执行结束是否通知 1:不通知 2:失败通知 3:结束通知 4:结果关键字匹配通知",
  1407. "name": "notify_status",
  1408. "in": "formData",
  1409. "required": true
  1410. },
  1411. {
  1412. "type": "integer",
  1413. "description": "通知类型 1:邮件 2:webhook",
  1414. "name": "notify_type",
  1415. "in": "formData"
  1416. },
  1417. {
  1418. "type": "string",
  1419. "description": "通知者邮箱地址(多个用,分割)",
  1420. "name": "notify_receiver_email",
  1421. "in": "formData"
  1422. },
  1423. {
  1424. "type": "string",
  1425. "description": "通知匹配关键字(多个用,分割)",
  1426. "name": "notify_keyword",
  1427. "in": "formData"
  1428. },
  1429. {
  1430. "type": "string",
  1431. "description": "备注",
  1432. "name": "remark",
  1433. "in": "formData"
  1434. },
  1435. {
  1436. "type": "integer",
  1437. "description": "是否启用 1:是 -1:否",
  1438. "name": "is_used",
  1439. "in": "formData",
  1440. "required": true
  1441. }
  1442. ],
  1443. "responses": {
  1444. "200": {
  1445. "description": "OK",
  1446. "schema": {
  1447. "$ref": "#/definitions/cron.modifyResponse"
  1448. }
  1449. },
  1450. "400": {
  1451. "description": "Bad Request",
  1452. "schema": {
  1453. "$ref": "#/definitions/code.Failure"
  1454. }
  1455. }
  1456. }
  1457. },
  1458. "patch": {
  1459. "security": [
  1460. {
  1461. "LoginToken": []
  1462. }
  1463. ],
  1464. "description": "手动执行单条任务",
  1465. "consumes": [
  1466. "application/json"
  1467. ],
  1468. "produces": [
  1469. "application/json"
  1470. ],
  1471. "tags": [
  1472. "API.cron"
  1473. ],
  1474. "summary": "手动执行单条任务",
  1475. "parameters": [
  1476. {
  1477. "type": "string",
  1478. "description": "hashId",
  1479. "name": "id",
  1480. "in": "path",
  1481. "required": true
  1482. }
  1483. ],
  1484. "responses": {
  1485. "200": {
  1486. "description": "OK",
  1487. "schema": {
  1488. "$ref": "#/definitions/cron.detailResponse"
  1489. }
  1490. },
  1491. "400": {
  1492. "description": "Bad Request",
  1493. "schema": {
  1494. "$ref": "#/definitions/code.Failure"
  1495. }
  1496. }
  1497. }
  1498. }
  1499. },
  1500. "/api/login": {
  1501. "post": {
  1502. "security": [
  1503. {
  1504. "LoginToken": []
  1505. }
  1506. ],
  1507. "description": "管理员登录",
  1508. "consumes": [
  1509. "application/x-www-form-urlencoded"
  1510. ],
  1511. "produces": [
  1512. "application/json"
  1513. ],
  1514. "tags": [
  1515. "API.admin"
  1516. ],
  1517. "summary": "管理员登录",
  1518. "parameters": [
  1519. {
  1520. "type": "string",
  1521. "description": "用户名",
  1522. "name": "username",
  1523. "in": "formData",
  1524. "required": true
  1525. },
  1526. {
  1527. "type": "string",
  1528. "description": "MD5后的密码",
  1529. "name": "password",
  1530. "in": "formData",
  1531. "required": true
  1532. }
  1533. ],
  1534. "responses": {
  1535. "200": {
  1536. "description": "OK",
  1537. "schema": {
  1538. "$ref": "#/definitions/admin.loginResponse"
  1539. }
  1540. },
  1541. "400": {
  1542. "description": "Bad Request",
  1543. "schema": {
  1544. "$ref": "#/definitions/code.Failure"
  1545. }
  1546. }
  1547. }
  1548. }
  1549. },
  1550. "/api/menu": {
  1551. "get": {
  1552. "security": [
  1553. {
  1554. "LoginToken": []
  1555. }
  1556. ],
  1557. "description": "菜单列表",
  1558. "consumes": [
  1559. "application/x-www-form-urlencoded"
  1560. ],
  1561. "produces": [
  1562. "application/json"
  1563. ],
  1564. "tags": [
  1565. "API.menu"
  1566. ],
  1567. "summary": "菜单列表",
  1568. "responses": {
  1569. "200": {
  1570. "description": "OK",
  1571. "schema": {
  1572. "$ref": "#/definitions/menu.listResponse"
  1573. }
  1574. },
  1575. "400": {
  1576. "description": "Bad Request",
  1577. "schema": {
  1578. "$ref": "#/definitions/code.Failure"
  1579. }
  1580. }
  1581. }
  1582. },
  1583. "post": {
  1584. "security": [
  1585. {
  1586. "LoginToken": []
  1587. }
  1588. ],
  1589. "description": "创建/编辑菜单",
  1590. "consumes": [
  1591. "application/x-www-form-urlencoded"
  1592. ],
  1593. "produces": [
  1594. "application/json"
  1595. ],
  1596. "tags": [
  1597. "API.menu"
  1598. ],
  1599. "summary": "创建/编辑菜单",
  1600. "parameters": [
  1601. {
  1602. "description": "请求信息",
  1603. "name": "Request",
  1604. "in": "body",
  1605. "required": true,
  1606. "schema": {
  1607. "$ref": "#/definitions/menu.createRequest"
  1608. }
  1609. }
  1610. ],
  1611. "responses": {
  1612. "200": {
  1613. "description": "OK",
  1614. "schema": {
  1615. "$ref": "#/definitions/menu.createResponse"
  1616. }
  1617. },
  1618. "400": {
  1619. "description": "Bad Request",
  1620. "schema": {
  1621. "$ref": "#/definitions/code.Failure"
  1622. }
  1623. }
  1624. }
  1625. }
  1626. },
  1627. "/api/menu/sort": {
  1628. "patch": {
  1629. "security": [
  1630. {
  1631. "LoginToken": []
  1632. }
  1633. ],
  1634. "description": "更新菜单排序",
  1635. "consumes": [
  1636. "application/x-www-form-urlencoded"
  1637. ],
  1638. "produces": [
  1639. "application/json"
  1640. ],
  1641. "tags": [
  1642. "API.menu"
  1643. ],
  1644. "summary": "更新菜单排序",
  1645. "parameters": [
  1646. {
  1647. "type": "string",
  1648. "description": "hashId",
  1649. "name": "id",
  1650. "in": "formData",
  1651. "required": true
  1652. },
  1653. {
  1654. "type": "integer",
  1655. "description": "排序",
  1656. "name": "sort",
  1657. "in": "formData",
  1658. "required": true
  1659. }
  1660. ],
  1661. "responses": {
  1662. "200": {
  1663. "description": "OK",
  1664. "schema": {
  1665. "$ref": "#/definitions/menu.updateSortResponse"
  1666. }
  1667. },
  1668. "400": {
  1669. "description": "Bad Request",
  1670. "schema": {
  1671. "$ref": "#/definitions/code.Failure"
  1672. }
  1673. }
  1674. }
  1675. }
  1676. },
  1677. "/api/menu/used": {
  1678. "patch": {
  1679. "security": [
  1680. {
  1681. "LoginToken": []
  1682. }
  1683. ],
  1684. "description": "更新菜单为启用/禁用",
  1685. "consumes": [
  1686. "application/x-www-form-urlencoded"
  1687. ],
  1688. "produces": [
  1689. "application/json"
  1690. ],
  1691. "tags": [
  1692. "API.menu"
  1693. ],
  1694. "summary": "更新菜单为启用/禁用",
  1695. "parameters": [
  1696. {
  1697. "type": "string",
  1698. "description": "hashId",
  1699. "name": "id",
  1700. "in": "formData",
  1701. "required": true
  1702. },
  1703. {
  1704. "type": "integer",
  1705. "description": "是否启用 1:是 -1:否",
  1706. "name": "used",
  1707. "in": "formData",
  1708. "required": true
  1709. }
  1710. ],
  1711. "responses": {
  1712. "200": {
  1713. "description": "OK",
  1714. "schema": {
  1715. "$ref": "#/definitions/menu.updateUsedResponse"
  1716. }
  1717. },
  1718. "400": {
  1719. "description": "Bad Request",
  1720. "schema": {
  1721. "$ref": "#/definitions/code.Failure"
  1722. }
  1723. }
  1724. }
  1725. }
  1726. },
  1727. "/api/menu/{id}": {
  1728. "get": {
  1729. "security": [
  1730. {
  1731. "LoginToken": []
  1732. }
  1733. ],
  1734. "description": "菜单详情",
  1735. "consumes": [
  1736. "application/x-www-form-urlencoded"
  1737. ],
  1738. "produces": [
  1739. "application/json"
  1740. ],
  1741. "tags": [
  1742. "API.menu"
  1743. ],
  1744. "summary": "菜单详情",
  1745. "parameters": [
  1746. {
  1747. "type": "string",
  1748. "description": "hashId",
  1749. "name": "id",
  1750. "in": "path",
  1751. "required": true
  1752. }
  1753. ],
  1754. "responses": {
  1755. "200": {
  1756. "description": "OK",
  1757. "schema": {
  1758. "$ref": "#/definitions/menu.detailResponse"
  1759. }
  1760. },
  1761. "400": {
  1762. "description": "Bad Request",
  1763. "schema": {
  1764. "$ref": "#/definitions/code.Failure"
  1765. }
  1766. }
  1767. }
  1768. },
  1769. "delete": {
  1770. "security": [
  1771. {
  1772. "LoginToken": []
  1773. }
  1774. ],
  1775. "description": "删除菜单",
  1776. "consumes": [
  1777. "application/json"
  1778. ],
  1779. "produces": [
  1780. "application/json"
  1781. ],
  1782. "tags": [
  1783. "API.menu"
  1784. ],
  1785. "summary": "删除菜单",
  1786. "parameters": [
  1787. {
  1788. "type": "string",
  1789. "description": "hashId",
  1790. "name": "id",
  1791. "in": "path",
  1792. "required": true
  1793. }
  1794. ],
  1795. "responses": {
  1796. "200": {
  1797. "description": "OK",
  1798. "schema": {
  1799. "$ref": "#/definitions/menu.deleteResponse"
  1800. }
  1801. },
  1802. "400": {
  1803. "description": "Bad Request",
  1804. "schema": {
  1805. "$ref": "#/definitions/code.Failure"
  1806. }
  1807. }
  1808. }
  1809. }
  1810. },
  1811. "/api/menu_action": {
  1812. "get": {
  1813. "security": [
  1814. {
  1815. "LoginToken": []
  1816. }
  1817. ],
  1818. "description": "功能权限列表",
  1819. "consumes": [
  1820. "application/x-www-form-urlencoded"
  1821. ],
  1822. "produces": [
  1823. "application/json"
  1824. ],
  1825. "tags": [
  1826. "API.menu"
  1827. ],
  1828. "summary": "功能权限列表",
  1829. "parameters": [
  1830. {
  1831. "type": "string",
  1832. "description": "hashID",
  1833. "name": "id",
  1834. "in": "query",
  1835. "required": true
  1836. }
  1837. ],
  1838. "responses": {
  1839. "200": {
  1840. "description": "OK",
  1841. "schema": {
  1842. "$ref": "#/definitions/menu.listActionResponse"
  1843. }
  1844. },
  1845. "400": {
  1846. "description": "Bad Request",
  1847. "schema": {
  1848. "$ref": "#/definitions/code.Failure"
  1849. }
  1850. }
  1851. }
  1852. },
  1853. "post": {
  1854. "security": [
  1855. {
  1856. "LoginToken": []
  1857. }
  1858. ],
  1859. "description": "创建功能权限",
  1860. "consumes": [
  1861. "application/x-www-form-urlencoded"
  1862. ],
  1863. "produces": [
  1864. "application/json"
  1865. ],
  1866. "tags": [
  1867. "API.menu"
  1868. ],
  1869. "summary": "创建功能权限",
  1870. "parameters": [
  1871. {
  1872. "type": "string",
  1873. "description": "HashID",
  1874. "name": "id",
  1875. "in": "formData",
  1876. "required": true
  1877. },
  1878. {
  1879. "type": "string",
  1880. "description": "请求方法",
  1881. "name": "method",
  1882. "in": "formData",
  1883. "required": true
  1884. },
  1885. {
  1886. "type": "string",
  1887. "description": "请求地址",
  1888. "name": "api",
  1889. "in": "formData",
  1890. "required": true
  1891. }
  1892. ],
  1893. "responses": {
  1894. "200": {
  1895. "description": "OK",
  1896. "schema": {
  1897. "$ref": "#/definitions/menu.createActionResponse"
  1898. }
  1899. },
  1900. "400": {
  1901. "description": "Bad Request",
  1902. "schema": {
  1903. "$ref": "#/definitions/code.Failure"
  1904. }
  1905. }
  1906. }
  1907. }
  1908. },
  1909. "/api/menu_action/{id}": {
  1910. "delete": {
  1911. "security": [
  1912. {
  1913. "LoginToken": []
  1914. }
  1915. ],
  1916. "description": "删除功能权限",
  1917. "consumes": [
  1918. "application/json"
  1919. ],
  1920. "produces": [
  1921. "application/json"
  1922. ],
  1923. "tags": [
  1924. "API.menu"
  1925. ],
  1926. "summary": "删除功能权限",
  1927. "parameters": [
  1928. {
  1929. "type": "string",
  1930. "description": "hashId",
  1931. "name": "id",
  1932. "in": "path",
  1933. "required": true
  1934. }
  1935. ],
  1936. "responses": {
  1937. "200": {
  1938. "description": "OK",
  1939. "schema": {
  1940. "$ref": "#/definitions/menu.deleteActionResponse"
  1941. }
  1942. },
  1943. "400": {
  1944. "description": "Bad Request",
  1945. "schema": {
  1946. "$ref": "#/definitions/code.Failure"
  1947. }
  1948. }
  1949. }
  1950. }
  1951. },
  1952. "/api/tool/cache/clear": {
  1953. "patch": {
  1954. "security": [
  1955. {
  1956. "LoginToken": []
  1957. }
  1958. ],
  1959. "description": "清空缓存",
  1960. "consumes": [
  1961. "application/x-www-form-urlencoded"
  1962. ],
  1963. "produces": [
  1964. "application/json"
  1965. ],
  1966. "tags": [
  1967. "API.tool"
  1968. ],
  1969. "summary": "清空缓存",
  1970. "parameters": [
  1971. {
  1972. "type": "string",
  1973. "description": "Redis Key",
  1974. "name": "redis_key",
  1975. "in": "formData",
  1976. "required": true
  1977. }
  1978. ],
  1979. "responses": {
  1980. "200": {
  1981. "description": "OK",
  1982. "schema": {
  1983. "$ref": "#/definitions/tool.searchCacheResponse"
  1984. }
  1985. },
  1986. "400": {
  1987. "description": "Bad Request",
  1988. "schema": {
  1989. "$ref": "#/definitions/code.Failure"
  1990. }
  1991. }
  1992. }
  1993. }
  1994. },
  1995. "/api/tool/cache/search": {
  1996. "post": {
  1997. "security": [
  1998. {
  1999. "LoginToken": []
  2000. }
  2001. ],
  2002. "description": "查询缓存",
  2003. "consumes": [
  2004. "application/x-www-form-urlencoded"
  2005. ],
  2006. "produces": [
  2007. "application/json"
  2008. ],
  2009. "tags": [
  2010. "API.tool"
  2011. ],
  2012. "summary": "查询缓存",
  2013. "parameters": [
  2014. {
  2015. "type": "string",
  2016. "description": "Redis Key",
  2017. "name": "redis_key",
  2018. "in": "formData",
  2019. "required": true
  2020. }
  2021. ],
  2022. "responses": {
  2023. "200": {
  2024. "description": "OK",
  2025. "schema": {
  2026. "$ref": "#/definitions/tool.searchCacheResponse"
  2027. }
  2028. },
  2029. "400": {
  2030. "description": "Bad Request",
  2031. "schema": {
  2032. "$ref": "#/definitions/code.Failure"
  2033. }
  2034. }
  2035. }
  2036. }
  2037. },
  2038. "/api/tool/data/dbs": {
  2039. "get": {
  2040. "security": [
  2041. {
  2042. "LoginToken": []
  2043. }
  2044. ],
  2045. "description": "查询 DB",
  2046. "consumes": [
  2047. "application/x-www-form-urlencoded"
  2048. ],
  2049. "produces": [
  2050. "application/json"
  2051. ],
  2052. "tags": [
  2053. "API.tool"
  2054. ],
  2055. "summary": "查询 DB",
  2056. "responses": {
  2057. "200": {
  2058. "description": "OK",
  2059. "schema": {
  2060. "$ref": "#/definitions/tool.dbsResponse"
  2061. }
  2062. },
  2063. "400": {
  2064. "description": "Bad Request",
  2065. "schema": {
  2066. "$ref": "#/definitions/code.Failure"
  2067. }
  2068. }
  2069. }
  2070. }
  2071. },
  2072. "/api/tool/data/mysql": {
  2073. "post": {
  2074. "security": [
  2075. {
  2076. "LoginToken": []
  2077. }
  2078. ],
  2079. "description": "执行 SQL 语句",
  2080. "consumes": [
  2081. "application/x-www-form-urlencoded"
  2082. ],
  2083. "produces": [
  2084. "application/json"
  2085. ],
  2086. "tags": [
  2087. "API.tool"
  2088. ],
  2089. "summary": "执行 SQL 语句",
  2090. "parameters": [
  2091. {
  2092. "type": "string",
  2093. "description": "数据库名称",
  2094. "name": "db_name",
  2095. "in": "formData",
  2096. "required": true
  2097. },
  2098. {
  2099. "type": "string",
  2100. "description": "数据表名称",
  2101. "name": "table_name",
  2102. "in": "formData",
  2103. "required": true
  2104. },
  2105. {
  2106. "type": "string",
  2107. "description": "SQL 语句",
  2108. "name": "sql",
  2109. "in": "formData",
  2110. "required": true
  2111. }
  2112. ],
  2113. "responses": {
  2114. "200": {
  2115. "description": "OK",
  2116. "schema": {
  2117. "$ref": "#/definitions/tool.searchMySQLResponse"
  2118. }
  2119. },
  2120. "400": {
  2121. "description": "Bad Request",
  2122. "schema": {
  2123. "$ref": "#/definitions/code.Failure"
  2124. }
  2125. }
  2126. }
  2127. }
  2128. },
  2129. "/api/tool/data/tables": {
  2130. "post": {
  2131. "security": [
  2132. {
  2133. "LoginToken": []
  2134. }
  2135. ],
  2136. "description": "查询 Table",
  2137. "consumes": [
  2138. "application/x-www-form-urlencoded"
  2139. ],
  2140. "produces": [
  2141. "application/json"
  2142. ],
  2143. "tags": [
  2144. "API.tool"
  2145. ],
  2146. "summary": "查询 Table",
  2147. "parameters": [
  2148. {
  2149. "type": "string",
  2150. "description": "数据库名称",
  2151. "name": "db_name",
  2152. "in": "formData",
  2153. "required": true
  2154. }
  2155. ],
  2156. "responses": {
  2157. "200": {
  2158. "description": "OK",
  2159. "schema": {
  2160. "$ref": "#/definitions/tool.tablesResponse"
  2161. }
  2162. },
  2163. "400": {
  2164. "description": "Bad Request",
  2165. "schema": {
  2166. "$ref": "#/definitions/code.Failure"
  2167. }
  2168. }
  2169. }
  2170. }
  2171. },
  2172. "/api/tool/hashids/decode/{id}": {
  2173. "get": {
  2174. "security": [
  2175. {
  2176. "LoginToken": []
  2177. }
  2178. ],
  2179. "description": "HashIds 解密",
  2180. "consumes": [
  2181. "application/x-www-form-urlencoded"
  2182. ],
  2183. "produces": [
  2184. "application/json"
  2185. ],
  2186. "tags": [
  2187. "API.tool"
  2188. ],
  2189. "summary": "HashIds 解密",
  2190. "parameters": [
  2191. {
  2192. "type": "string",
  2193. "description": "需解密的密文",
  2194. "name": "id",
  2195. "in": "path",
  2196. "required": true
  2197. }
  2198. ],
  2199. "responses": {
  2200. "200": {
  2201. "description": "OK",
  2202. "schema": {
  2203. "$ref": "#/definitions/tool.hashIdsDecodeResponse"
  2204. }
  2205. },
  2206. "400": {
  2207. "description": "Bad Request",
  2208. "schema": {
  2209. "$ref": "#/definitions/code.Failure"
  2210. }
  2211. }
  2212. }
  2213. }
  2214. },
  2215. "/api/tool/hashids/encode/{id}": {
  2216. "get": {
  2217. "security": [
  2218. {
  2219. "LoginToken": []
  2220. }
  2221. ],
  2222. "description": "HashIds 加密",
  2223. "consumes": [
  2224. "application/x-www-form-urlencoded"
  2225. ],
  2226. "produces": [
  2227. "application/json"
  2228. ],
  2229. "tags": [
  2230. "API.tool"
  2231. ],
  2232. "summary": "HashIds 加密",
  2233. "parameters": [
  2234. {
  2235. "type": "string",
  2236. "description": "需加密的数字",
  2237. "name": "id",
  2238. "in": "path",
  2239. "required": true
  2240. }
  2241. ],
  2242. "responses": {
  2243. "200": {
  2244. "description": "OK",
  2245. "schema": {
  2246. "$ref": "#/definitions/tool.hashIdsEncodeResponse"
  2247. }
  2248. },
  2249. "400": {
  2250. "description": "Bad Request",
  2251. "schema": {
  2252. "$ref": "#/definitions/code.Failure"
  2253. }
  2254. }
  2255. }
  2256. }
  2257. },
  2258. "/api/tool/send_message": {
  2259. "post": {
  2260. "security": [
  2261. {
  2262. "LoginToken": []
  2263. }
  2264. ],
  2265. "description": "发送消息",
  2266. "consumes": [
  2267. "application/x-www-form-urlencoded"
  2268. ],
  2269. "produces": [
  2270. "application/json"
  2271. ],
  2272. "tags": [
  2273. "API.tool"
  2274. ],
  2275. "summary": "发送消息",
  2276. "parameters": [
  2277. {
  2278. "type": "string",
  2279. "description": "消息内容",
  2280. "name": "message",
  2281. "in": "formData",
  2282. "required": true
  2283. }
  2284. ],
  2285. "responses": {
  2286. "200": {
  2287. "description": "OK",
  2288. "schema": {
  2289. "$ref": "#/definitions/tool.sendMessageResponse"
  2290. }
  2291. },
  2292. "400": {
  2293. "description": "Bad Request",
  2294. "schema": {
  2295. "$ref": "#/definitions/code.Failure"
  2296. }
  2297. }
  2298. }
  2299. }
  2300. },
  2301. "/helper/md5/{str}": {
  2302. "get": {
  2303. "description": "加密",
  2304. "consumes": [
  2305. "application/x-www-form-urlencoded"
  2306. ],
  2307. "produces": [
  2308. "application/json"
  2309. ],
  2310. "tags": [
  2311. "Helper"
  2312. ],
  2313. "summary": "加密",
  2314. "parameters": [
  2315. {
  2316. "type": "string",
  2317. "description": "需要加密的字符串",
  2318. "name": "str",
  2319. "in": "path",
  2320. "required": true
  2321. }
  2322. ],
  2323. "responses": {
  2324. "200": {
  2325. "description": "OK",
  2326. "schema": {
  2327. "$ref": "#/definitions/helper.md5Response"
  2328. }
  2329. },
  2330. "400": {
  2331. "description": "Bad Request",
  2332. "schema": {
  2333. "$ref": "#/definitions/code.Failure"
  2334. }
  2335. }
  2336. }
  2337. }
  2338. },
  2339. "/helper/sign": {
  2340. "post": {
  2341. "description": "签名",
  2342. "consumes": [
  2343. "application/x-www-form-urlencoded"
  2344. ],
  2345. "produces": [
  2346. "application/json"
  2347. ],
  2348. "tags": [
  2349. "Helper"
  2350. ],
  2351. "summary": "签名",
  2352. "parameters": [
  2353. {
  2354. "type": "string",
  2355. "description": "调用方 KEY",
  2356. "name": "key",
  2357. "in": "formData",
  2358. "required": true
  2359. },
  2360. {
  2361. "type": "string",
  2362. "description": "请求路径 (不附带 querystring),例如:/api/login",
  2363. "name": "path",
  2364. "in": "formData",
  2365. "required": true
  2366. },
  2367. {
  2368. "type": "string",
  2369. "description": "请求方式,例如:POST",
  2370. "name": "method",
  2371. "in": "formData",
  2372. "required": true
  2373. },
  2374. {
  2375. "type": "string",
  2376. "description": "请求参数,例如:username=tom\u0026password=123456",
  2377. "name": "params",
  2378. "in": "formData",
  2379. "required": true
  2380. }
  2381. ],
  2382. "responses": {
  2383. "200": {
  2384. "description": "OK",
  2385. "schema": {
  2386. "$ref": "#/definitions/helper.signResponse"
  2387. }
  2388. },
  2389. "400": {
  2390. "description": "Bad Request",
  2391. "schema": {
  2392. "$ref": "#/definitions/code.Failure"
  2393. }
  2394. }
  2395. }
  2396. }
  2397. }
  2398. },
  2399. "definitions": {
  2400. "admin.ListMenuData": {
  2401. "type": "object",
  2402. "properties": {
  2403. "id": {
  2404. "description": "ID",
  2405. "type": "integer"
  2406. },
  2407. "is_have": {
  2408. "description": "是否已拥有权限",
  2409. "type": "integer"
  2410. },
  2411. "name": {
  2412. "description": "菜单名称",
  2413. "type": "string"
  2414. },
  2415. "pid": {
  2416. "description": "父类ID",
  2417. "type": "integer"
  2418. }
  2419. }
  2420. },
  2421. "admin.ListMyMenuData": {
  2422. "type": "object",
  2423. "properties": {
  2424. "icon": {
  2425. "description": "图标",
  2426. "type": "string"
  2427. },
  2428. "id": {
  2429. "description": "ID",
  2430. "type": "integer"
  2431. },
  2432. "link": {
  2433. "description": "链接地址",
  2434. "type": "string"
  2435. },
  2436. "name": {
  2437. "description": "菜单名称",
  2438. "type": "string"
  2439. },
  2440. "pid": {
  2441. "description": "父类ID",
  2442. "type": "integer"
  2443. }
  2444. }
  2445. },
  2446. "admin.createResponse": {
  2447. "type": "object",
  2448. "properties": {
  2449. "id": {
  2450. "description": "主键ID",
  2451. "type": "integer"
  2452. }
  2453. }
  2454. },
  2455. "admin.deleteResponse": {
  2456. "type": "object",
  2457. "properties": {
  2458. "id": {
  2459. "description": "主键ID",
  2460. "type": "integer"
  2461. }
  2462. }
  2463. },
  2464. "admin.detailResponse": {
  2465. "type": "object",
  2466. "properties": {
  2467. "menu": {
  2468. "description": "菜单栏",
  2469. "type": "array",
  2470. "items": {
  2471. "$ref": "#/definitions/admin.ListMyMenuData"
  2472. }
  2473. },
  2474. "mobile": {
  2475. "description": "手机号",
  2476. "type": "string"
  2477. },
  2478. "nickname": {
  2479. "description": "昵称",
  2480. "type": "string"
  2481. },
  2482. "username": {
  2483. "description": "用户名",
  2484. "type": "string"
  2485. }
  2486. }
  2487. },
  2488. "admin.listAdminMenuResponse": {
  2489. "type": "object",
  2490. "properties": {
  2491. "list": {
  2492. "type": "array",
  2493. "items": {
  2494. "$ref": "#/definitions/admin.ListMenuData"
  2495. }
  2496. },
  2497. "username": {
  2498. "type": "string"
  2499. }
  2500. }
  2501. },
  2502. "admin.listData": {
  2503. "type": "object",
  2504. "properties": {
  2505. "created_at": {
  2506. "description": "创建时间",
  2507. "type": "string"
  2508. },
  2509. "created_user": {
  2510. "description": "创建人",
  2511. "type": "string"
  2512. },
  2513. "hashid": {
  2514. "description": "hashid",
  2515. "type": "string"
  2516. },
  2517. "id": {
  2518. "description": "ID",
  2519. "type": "integer"
  2520. },
  2521. "is_online": {
  2522. "description": "是否在线 1:是 -1:否",
  2523. "type": "integer"
  2524. },
  2525. "is_used": {
  2526. "description": "是否启用 1:是 -1:否",
  2527. "type": "integer"
  2528. },
  2529. "mobile": {
  2530. "description": "手机号",
  2531. "type": "string"
  2532. },
  2533. "nickname": {
  2534. "description": "昵称",
  2535. "type": "string"
  2536. },
  2537. "updated_at": {
  2538. "description": "更新时间",
  2539. "type": "string"
  2540. },
  2541. "updated_user": {
  2542. "description": "更新人",
  2543. "type": "string"
  2544. },
  2545. "username": {
  2546. "description": "用户名",
  2547. "type": "string"
  2548. }
  2549. }
  2550. },
  2551. "admin.listResponse": {
  2552. "type": "object",
  2553. "properties": {
  2554. "list": {
  2555. "type": "array",
  2556. "items": {
  2557. "$ref": "#/definitions/admin.listData"
  2558. }
  2559. },
  2560. "pagination": {
  2561. "type": "object",
  2562. "properties": {
  2563. "current_page": {
  2564. "type": "integer"
  2565. },
  2566. "per_page_count": {
  2567. "type": "integer"
  2568. },
  2569. "total": {
  2570. "type": "integer"
  2571. }
  2572. }
  2573. }
  2574. }
  2575. },
  2576. "admin.loginResponse": {
  2577. "type": "object",
  2578. "properties": {
  2579. "token": {
  2580. "description": "用户身份标识",
  2581. "type": "string"
  2582. }
  2583. }
  2584. },
  2585. "admin.logoutResponse": {
  2586. "type": "object",
  2587. "properties": {
  2588. "username": {
  2589. "description": "用户账号",
  2590. "type": "string"
  2591. }
  2592. }
  2593. },
  2594. "admin.modifyPasswordResponse": {
  2595. "type": "object",
  2596. "properties": {
  2597. "username": {
  2598. "description": "用户账号",
  2599. "type": "string"
  2600. }
  2601. }
  2602. },
  2603. "admin.modifyPersonalInfoResponse": {
  2604. "type": "object",
  2605. "properties": {
  2606. "username": {
  2607. "description": "用户账号",
  2608. "type": "string"
  2609. }
  2610. }
  2611. },
  2612. "admin.offlineResponse": {
  2613. "type": "object",
  2614. "properties": {
  2615. "id": {
  2616. "description": "主键ID",
  2617. "type": "integer"
  2618. }
  2619. }
  2620. },
  2621. "admin.resetPasswordResponse": {
  2622. "type": "object",
  2623. "properties": {
  2624. "id": {
  2625. "description": "主键ID",
  2626. "type": "integer"
  2627. }
  2628. }
  2629. },
  2630. "admin.updateUsedResponse": {
  2631. "type": "object",
  2632. "properties": {
  2633. "id": {
  2634. "description": "主键ID",
  2635. "type": "integer"
  2636. }
  2637. }
  2638. },
  2639. "authorized.createAPIResponse": {
  2640. "type": "object",
  2641. "properties": {
  2642. "id": {
  2643. "description": "主键ID",
  2644. "type": "integer"
  2645. }
  2646. }
  2647. },
  2648. "authorized.createResponse": {
  2649. "type": "object",
  2650. "properties": {
  2651. "id": {
  2652. "description": "主键ID",
  2653. "type": "integer"
  2654. }
  2655. }
  2656. },
  2657. "authorized.deleteAPIResponse": {
  2658. "type": "object",
  2659. "properties": {
  2660. "id": {
  2661. "description": "主键ID",
  2662. "type": "integer"
  2663. }
  2664. }
  2665. },
  2666. "authorized.deleteResponse": {
  2667. "type": "object",
  2668. "properties": {
  2669. "id": {
  2670. "description": "主键ID",
  2671. "type": "integer"
  2672. }
  2673. }
  2674. },
  2675. "authorized.listAPIData": {
  2676. "type": "object",
  2677. "properties": {
  2678. "api": {
  2679. "description": "调用方对接人",
  2680. "type": "string"
  2681. },
  2682. "business_key": {
  2683. "description": "调用方key",
  2684. "type": "string"
  2685. },
  2686. "hash_id": {
  2687. "description": "hashID",
  2688. "type": "string"
  2689. },
  2690. "method": {
  2691. "description": "调用方secret",
  2692. "type": "string"
  2693. }
  2694. }
  2695. },
  2696. "authorized.listAPIResponse": {
  2697. "type": "object",
  2698. "properties": {
  2699. "business_key": {
  2700. "description": "调用方key",
  2701. "type": "string"
  2702. },
  2703. "list": {
  2704. "type": "array",
  2705. "items": {
  2706. "$ref": "#/definitions/authorized.listAPIData"
  2707. }
  2708. }
  2709. }
  2710. },
  2711. "authorized.listData": {
  2712. "type": "object",
  2713. "properties": {
  2714. "business_developer": {
  2715. "description": "调用方对接人",
  2716. "type": "string"
  2717. },
  2718. "business_key": {
  2719. "description": "调用方key",
  2720. "type": "string"
  2721. },
  2722. "business_secret": {
  2723. "description": "调用方secret",
  2724. "type": "string"
  2725. },
  2726. "created_at": {
  2727. "description": "创建时间",
  2728. "type": "string"
  2729. },
  2730. "created_user": {
  2731. "description": "创建人",
  2732. "type": "string"
  2733. },
  2734. "hashid": {
  2735. "description": "hashid",
  2736. "type": "string"
  2737. },
  2738. "id": {
  2739. "description": "ID",
  2740. "type": "integer"
  2741. },
  2742. "is_used": {
  2743. "description": "是否启用 1:是 -1:否",
  2744. "type": "integer"
  2745. },
  2746. "remark": {
  2747. "description": "备注",
  2748. "type": "string"
  2749. },
  2750. "updated_at": {
  2751. "description": "更新时间",
  2752. "type": "string"
  2753. },
  2754. "updated_user": {
  2755. "description": "更新人",
  2756. "type": "string"
  2757. }
  2758. }
  2759. },
  2760. "authorized.listResponse": {
  2761. "type": "object",
  2762. "properties": {
  2763. "list": {
  2764. "type": "array",
  2765. "items": {
  2766. "$ref": "#/definitions/authorized.listData"
  2767. }
  2768. },
  2769. "pagination": {
  2770. "type": "object",
  2771. "properties": {
  2772. "current_page": {
  2773. "type": "integer"
  2774. },
  2775. "per_page_count": {
  2776. "type": "integer"
  2777. },
  2778. "total": {
  2779. "type": "integer"
  2780. }
  2781. }
  2782. }
  2783. }
  2784. },
  2785. "authorized.updateUsedResponse": {
  2786. "type": "object",
  2787. "properties": {
  2788. "id": {
  2789. "description": "主键ID",
  2790. "type": "integer"
  2791. }
  2792. }
  2793. },
  2794. "code.Failure": {
  2795. "type": "object",
  2796. "properties": {
  2797. "code": {
  2798. "description": "业务码",
  2799. "type": "integer"
  2800. },
  2801. "message": {
  2802. "description": "描述信息",
  2803. "type": "string"
  2804. }
  2805. }
  2806. },
  2807. "config.emailResponse": {
  2808. "type": "object",
  2809. "properties": {
  2810. "email": {
  2811. "description": "邮箱地址",
  2812. "type": "string"
  2813. }
  2814. }
  2815. },
  2816. "cron.createResponse": {
  2817. "type": "object",
  2818. "properties": {
  2819. "id": {
  2820. "description": "主键ID",
  2821. "type": "integer"
  2822. }
  2823. }
  2824. },
  2825. "cron.detailResponse": {
  2826. "type": "object",
  2827. "properties": {
  2828. "command": {
  2829. "description": "执行命令",
  2830. "type": "string"
  2831. },
  2832. "http_method": {
  2833. "description": "http 请求方式 1:get 2:post",
  2834. "type": "integer"
  2835. },
  2836. "is_used": {
  2837. "description": "是否启用 1:是 -1:否",
  2838. "type": "integer"
  2839. },
  2840. "name": {
  2841. "description": "任务名称",
  2842. "type": "string"
  2843. },
  2844. "notify_keyword": {
  2845. "description": "通知匹配关键字(多个用,分割)",
  2846. "type": "string"
  2847. },
  2848. "notify_receiver_email": {
  2849. "description": "通知者邮箱地址(多个用,分割)",
  2850. "type": "string"
  2851. },
  2852. "notify_status": {
  2853. "description": "执行结束是否通知 1:不通知 2:失败通知 3:结束通知 4:结果关键字匹配通知",
  2854. "type": "integer"
  2855. },
  2856. "notify_type": {
  2857. "description": "通知类型 1:邮件 2:webhook",
  2858. "type": "integer"
  2859. },
  2860. "protocol": {
  2861. "description": "执行方式 1:shell 2:http",
  2862. "type": "integer"
  2863. },
  2864. "remark": {
  2865. "description": "备注",
  2866. "type": "string"
  2867. },
  2868. "retry_interval": {
  2869. "description": "重试间隔(单位:秒)",
  2870. "type": "integer"
  2871. },
  2872. "retry_times": {
  2873. "description": "重试次数",
  2874. "type": "integer"
  2875. },
  2876. "spec": {
  2877. "description": "crontab 表达式",
  2878. "type": "string"
  2879. },
  2880. "timeout": {
  2881. "description": "超时时间(单位:秒)",
  2882. "type": "integer"
  2883. }
  2884. }
  2885. },
  2886. "cron.listData": {
  2887. "type": "object",
  2888. "properties": {
  2889. "command": {
  2890. "description": "执行命令",
  2891. "type": "string"
  2892. },
  2893. "created_at": {
  2894. "description": "创建时间",
  2895. "type": "string"
  2896. },
  2897. "created_user": {
  2898. "description": "创建人",
  2899. "type": "string"
  2900. },
  2901. "hashid": {
  2902. "description": "hashid",
  2903. "type": "string"
  2904. },
  2905. "http_method": {
  2906. "description": "http 请求方式 1:get 2:post",
  2907. "type": "integer"
  2908. },
  2909. "http_method_text": {
  2910. "description": "http 请求方式",
  2911. "type": "string"
  2912. },
  2913. "id": {
  2914. "description": "ID",
  2915. "type": "integer"
  2916. },
  2917. "is_used": {
  2918. "description": "是否启用 1=启用 2=禁用",
  2919. "type": "integer"
  2920. },
  2921. "is_used_text": {
  2922. "description": "是否启用",
  2923. "type": "string"
  2924. },
  2925. "name": {
  2926. "description": "任务名称",
  2927. "type": "string"
  2928. },
  2929. "notify_status": {
  2930. "description": "执行结束是否通知 1:不通知 2:失败通知 3:结束通知 4:结果关键字匹配通知",
  2931. "type": "integer"
  2932. },
  2933. "notify_status_text": {
  2934. "description": "执行结束是否通知",
  2935. "type": "string"
  2936. },
  2937. "protocol": {
  2938. "description": "执行方式 1:shell 2:http",
  2939. "type": "integer"
  2940. },
  2941. "protocol_text": {
  2942. "description": "执行方式",
  2943. "type": "string"
  2944. },
  2945. "retry_interval": {
  2946. "description": "重试间隔(单位:秒)",
  2947. "type": "integer"
  2948. },
  2949. "retry_times": {
  2950. "description": "重试次数",
  2951. "type": "integer"
  2952. },
  2953. "spec": {
  2954. "description": "crontab 表达式",
  2955. "type": "string"
  2956. },
  2957. "timeout": {
  2958. "description": "超时时间(单位:秒)",
  2959. "type": "integer"
  2960. },
  2961. "updated_at": {
  2962. "description": "更新时间",
  2963. "type": "string"
  2964. },
  2965. "updated_user": {
  2966. "description": "更新人",
  2967. "type": "string"
  2968. }
  2969. }
  2970. },
  2971. "cron.listResponse": {
  2972. "type": "object",
  2973. "properties": {
  2974. "list": {
  2975. "type": "array",
  2976. "items": {
  2977. "$ref": "#/definitions/cron.listData"
  2978. }
  2979. },
  2980. "pagination": {
  2981. "type": "object",
  2982. "properties": {
  2983. "current_page": {
  2984. "type": "integer"
  2985. },
  2986. "per_page_count": {
  2987. "type": "integer"
  2988. },
  2989. "total": {
  2990. "type": "integer"
  2991. }
  2992. }
  2993. }
  2994. }
  2995. },
  2996. "cron.modifyResponse": {
  2997. "type": "object",
  2998. "properties": {
  2999. "id": {
  3000. "description": "主键ID",
  3001. "type": "integer"
  3002. }
  3003. }
  3004. },
  3005. "cron.updateUsedResponse": {
  3006. "type": "object",
  3007. "properties": {
  3008. "id": {
  3009. "description": "主键ID",
  3010. "type": "integer"
  3011. }
  3012. }
  3013. },
  3014. "helper.md5Response": {
  3015. "type": "object",
  3016. "properties": {
  3017. "md5_str": {
  3018. "description": "MD5后的字符串",
  3019. "type": "string"
  3020. }
  3021. }
  3022. },
  3023. "helper.signResponse": {
  3024. "type": "object",
  3025. "properties": {
  3026. "authorization": {
  3027. "description": "签名信息-Authorization",
  3028. "type": "string"
  3029. },
  3030. "authorization_date": {
  3031. "description": "签名信息-Authorization-Date",
  3032. "type": "string"
  3033. }
  3034. }
  3035. },
  3036. "menu.createActionResponse": {
  3037. "type": "object",
  3038. "properties": {
  3039. "id": {
  3040. "description": "主键ID",
  3041. "type": "integer"
  3042. }
  3043. }
  3044. },
  3045. "menu.createRequest": {
  3046. "type": "object",
  3047. "properties": {
  3048. "icon": {
  3049. "description": "图标",
  3050. "type": "string"
  3051. },
  3052. "id": {
  3053. "description": "ID",
  3054. "type": "string"
  3055. },
  3056. "level": {
  3057. "description": "菜单类型 1:一级菜单 2:二级菜单",
  3058. "type": "integer"
  3059. },
  3060. "link": {
  3061. "description": "链接地址",
  3062. "type": "string"
  3063. },
  3064. "name": {
  3065. "description": "菜单名称",
  3066. "type": "string"
  3067. },
  3068. "pid": {
  3069. "description": "父类ID",
  3070. "type": "integer"
  3071. }
  3072. }
  3073. },
  3074. "menu.createResponse": {
  3075. "type": "object",
  3076. "properties": {
  3077. "id": {
  3078. "description": "主键ID",
  3079. "type": "integer"
  3080. }
  3081. }
  3082. },
  3083. "menu.deleteActionResponse": {
  3084. "type": "object",
  3085. "properties": {
  3086. "id": {
  3087. "description": "主键ID",
  3088. "type": "integer"
  3089. }
  3090. }
  3091. },
  3092. "menu.deleteResponse": {
  3093. "type": "object",
  3094. "properties": {
  3095. "id": {
  3096. "description": "主键ID",
  3097. "type": "integer"
  3098. }
  3099. }
  3100. },
  3101. "menu.detailResponse": {
  3102. "type": "object",
  3103. "properties": {
  3104. "icon": {
  3105. "description": "图标",
  3106. "type": "string"
  3107. },
  3108. "id": {
  3109. "description": "主键ID",
  3110. "type": "integer"
  3111. },
  3112. "link": {
  3113. "description": "链接地址",
  3114. "type": "string"
  3115. },
  3116. "name": {
  3117. "description": "菜单名称",
  3118. "type": "string"
  3119. },
  3120. "pid": {
  3121. "description": "父类ID",
  3122. "type": "integer"
  3123. }
  3124. }
  3125. },
  3126. "menu.listActionData": {
  3127. "type": "object",
  3128. "properties": {
  3129. "api": {
  3130. "description": "调用方对接人",
  3131. "type": "string"
  3132. },
  3133. "hash_id": {
  3134. "description": "hashID",
  3135. "type": "string"
  3136. },
  3137. "menu_id": {
  3138. "description": "菜单栏ID",
  3139. "type": "integer"
  3140. },
  3141. "method": {
  3142. "description": "调用方secret",
  3143. "type": "string"
  3144. }
  3145. }
  3146. },
  3147. "menu.listActionResponse": {
  3148. "type": "object",
  3149. "properties": {
  3150. "list": {
  3151. "type": "array",
  3152. "items": {
  3153. "$ref": "#/definitions/menu.listActionData"
  3154. }
  3155. },
  3156. "menu_name": {
  3157. "type": "string"
  3158. }
  3159. }
  3160. },
  3161. "menu.listData": {
  3162. "type": "object",
  3163. "properties": {
  3164. "hashid": {
  3165. "description": "hashid",
  3166. "type": "string"
  3167. },
  3168. "icon": {
  3169. "description": "图标",
  3170. "type": "string"
  3171. },
  3172. "id": {
  3173. "description": "ID",
  3174. "type": "integer"
  3175. },
  3176. "is_used": {
  3177. "description": "是否启用 1=启用 -1=禁用",
  3178. "type": "integer"
  3179. },
  3180. "link": {
  3181. "description": "链接地址",
  3182. "type": "string"
  3183. },
  3184. "name": {
  3185. "description": "菜单名称",
  3186. "type": "string"
  3187. },
  3188. "pid": {
  3189. "description": "父类ID",
  3190. "type": "integer"
  3191. },
  3192. "sort": {
  3193. "description": "排序",
  3194. "type": "integer"
  3195. }
  3196. }
  3197. },
  3198. "menu.listResponse": {
  3199. "type": "object",
  3200. "properties": {
  3201. "list": {
  3202. "type": "array",
  3203. "items": {
  3204. "$ref": "#/definitions/menu.listData"
  3205. }
  3206. }
  3207. }
  3208. },
  3209. "menu.updateSortResponse": {
  3210. "type": "object",
  3211. "properties": {
  3212. "id": {
  3213. "description": "主键ID",
  3214. "type": "integer"
  3215. }
  3216. }
  3217. },
  3218. "menu.updateUsedResponse": {
  3219. "type": "object",
  3220. "properties": {
  3221. "id": {
  3222. "description": "主键ID",
  3223. "type": "integer"
  3224. }
  3225. }
  3226. },
  3227. "tool.dbData": {
  3228. "type": "object",
  3229. "properties": {
  3230. "db_name": {
  3231. "description": "数据库名称",
  3232. "type": "string"
  3233. }
  3234. }
  3235. },
  3236. "tool.dbsResponse": {
  3237. "type": "object",
  3238. "properties": {
  3239. "list": {
  3240. "description": "数据库列表",
  3241. "type": "array",
  3242. "items": {
  3243. "$ref": "#/definitions/tool.dbData"
  3244. }
  3245. }
  3246. }
  3247. },
  3248. "tool.hashIdsDecodeResponse": {
  3249. "type": "object",
  3250. "properties": {
  3251. "val": {
  3252. "description": "解密后的值",
  3253. "type": "integer"
  3254. }
  3255. }
  3256. },
  3257. "tool.hashIdsEncodeResponse": {
  3258. "type": "object",
  3259. "properties": {
  3260. "val": {
  3261. "description": "加密后的值",
  3262. "type": "string"
  3263. }
  3264. }
  3265. },
  3266. "tool.searchCacheResponse": {
  3267. "type": "object",
  3268. "properties": {
  3269. "ttl": {
  3270. "description": "过期时间",
  3271. "type": "string"
  3272. },
  3273. "val": {
  3274. "description": "查询后的值",
  3275. "type": "string"
  3276. }
  3277. }
  3278. },
  3279. "tool.searchMySQLResponse": {
  3280. "type": "object",
  3281. "properties": {
  3282. "cols": {
  3283. "description": "查询后的行",
  3284. "type": "array",
  3285. "items": {
  3286. "type": "string"
  3287. }
  3288. },
  3289. "cols_info": {
  3290. "description": "行信息",
  3291. "type": "array",
  3292. "items": {
  3293. "$ref": "#/definitions/tool.tableColumn"
  3294. }
  3295. },
  3296. "list": {
  3297. "description": "查询后的数据",
  3298. "type": "array",
  3299. "items": {
  3300. "type": "object",
  3301. "additionalProperties": true
  3302. }
  3303. }
  3304. }
  3305. },
  3306. "tool.sendMessageResponse": {
  3307. "type": "object",
  3308. "properties": {
  3309. "status": {
  3310. "description": "状态",
  3311. "type": "string"
  3312. }
  3313. }
  3314. },
  3315. "tool.tableColumn": {
  3316. "type": "object",
  3317. "properties": {
  3318. "column_comment": {
  3319. "description": "字段注释",
  3320. "type": "string"
  3321. },
  3322. "column_name": {
  3323. "description": "字段名称",
  3324. "type": "string"
  3325. }
  3326. }
  3327. },
  3328. "tool.tableData": {
  3329. "type": "object",
  3330. "properties": {
  3331. "table_comment": {
  3332. "description": "数据表备注",
  3333. "type": "string"
  3334. },
  3335. "table_name": {
  3336. "description": "数据表名称",
  3337. "type": "string"
  3338. }
  3339. }
  3340. },
  3341. "tool.tablesResponse": {
  3342. "type": "object",
  3343. "properties": {
  3344. "list": {
  3345. "description": "数据表列表",
  3346. "type": "array",
  3347. "items": {
  3348. "$ref": "#/definitions/tool.tableData"
  3349. }
  3350. }
  3351. }
  3352. }
  3353. },
  3354. "securityDefinitions": {
  3355. "LoginToken": {
  3356. "type": "apiKey",
  3357. "name": "token",
  3358. "in": "header"
  3359. }
  3360. }
  3361. }`
  3362. type swaggerInfo struct {
  3363. Version string
  3364. Host string
  3365. BasePath string
  3366. Schemes []string
  3367. Title string
  3368. Description string
  3369. }
  3370. // SwaggerInfo holds exported Swagger Info so clients can modify it
  3371. var SwaggerInfo = swaggerInfo{
  3372. Version: "2.0",
  3373. Host: "",
  3374. BasePath: "/",
  3375. Schemes: []string{},
  3376. Title: "swagger 接口文档",
  3377. Description: "",
  3378. }
  3379. type s struct{}
  3380. func (s *s) ReadDoc() string {
  3381. sInfo := SwaggerInfo
  3382. sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1)
  3383. t, err := template.New("swagger_info").Funcs(template.FuncMap{
  3384. "marshal": func(v interface{}) string {
  3385. a, _ := json.Marshal(v)
  3386. return string(a)
  3387. },
  3388. "escape": func(v interface{}) string {
  3389. // escape tabs
  3390. str := strings.Replace(v.(string), "\t", "\\t", -1)
  3391. // replace " with \", and if that results in \\", replace that with \\\"
  3392. str = strings.Replace(str, "\"", "\\\"", -1)
  3393. return strings.Replace(str, "\\\\\"", "\\\\\\\"", -1)
  3394. },
  3395. }).Parse(doc)
  3396. if err != nil {
  3397. return doc
  3398. }
  3399. var tpl bytes.Buffer
  3400. if err := t.Execute(&tpl, sInfo); err != nil {
  3401. return doc
  3402. }
  3403. return tpl.String()
  3404. }
  3405. func init() {
  3406. swag.Register("swagger", &s{})
  3407. }