openapi.json 104 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031
  1. {
  2. "openapi": "3.1.0",
  3. "info": {
  4. "title": "AI-Agent 财务审计系统",
  5. "description": "按课程设计:四节点审核、独立反馈、持久事件与人工审批。",
  6. "version": "1.0.0"
  7. },
  8. "paths": {
  9. "/api/v1/auth/login": {
  10. "post": {
  11. "tags": [
  12. "认证"
  13. ],
  14. "summary": "Login",
  15. "description": "功能:验证密码并创建会话。参数:登录名/密码。返回:双令牌与用户。异常:401凭据错误,422参数错误。",
  16. "operationId": "login_api_v1_auth_login_post",
  17. "requestBody": {
  18. "content": {
  19. "application/json": {
  20. "schema": {
  21. "$ref": "#/components/schemas/Login"
  22. }
  23. }
  24. },
  25. "required": true
  26. },
  27. "responses": {
  28. "200": {
  29. "description": "Successful Response",
  30. "content": {
  31. "application/json": {
  32. "schema": {}
  33. }
  34. }
  35. },
  36. "422": {
  37. "description": "Validation Error",
  38. "content": {
  39. "application/json": {
  40. "schema": {
  41. "$ref": "#/components/schemas/HTTPValidationError"
  42. }
  43. }
  44. }
  45. }
  46. }
  47. }
  48. },
  49. "/api/v1/auth/refresh": {
  50. "post": {
  51. "tags": [
  52. "认证"
  53. ],
  54. "summary": "Refresh",
  55. "description": "功能:刷新并撤销旧凭据。参数:refresh_token。返回:新双令牌。异常:401已撤销/过期/停用。",
  56. "operationId": "refresh_api_v1_auth_refresh_post",
  57. "requestBody": {
  58. "content": {
  59. "application/json": {
  60. "schema": {
  61. "$ref": "#/components/schemas/Refresh"
  62. }
  63. }
  64. },
  65. "required": true
  66. },
  67. "responses": {
  68. "200": {
  69. "description": "Successful Response",
  70. "content": {
  71. "application/json": {
  72. "schema": {}
  73. }
  74. }
  75. },
  76. "422": {
  77. "description": "Validation Error",
  78. "content": {
  79. "application/json": {
  80. "schema": {
  81. "$ref": "#/components/schemas/HTTPValidationError"
  82. }
  83. }
  84. }
  85. }
  86. }
  87. }
  88. },
  89. "/api/v1/auth/logout": {
  90. "post": {
  91. "tags": [
  92. "认证"
  93. ],
  94. "summary": "Logout",
  95. "description": "功能:撤销本人刷新会话。参数:refresh_token。返回:撤销状态。异常:401失效,403非本人。",
  96. "operationId": "logout_api_v1_auth_logout_post",
  97. "requestBody": {
  98. "content": {
  99. "application/json": {
  100. "schema": {
  101. "$ref": "#/components/schemas/Refresh"
  102. }
  103. }
  104. },
  105. "required": true
  106. },
  107. "responses": {
  108. "200": {
  109. "description": "Successful Response",
  110. "content": {
  111. "application/json": {
  112. "schema": {}
  113. }
  114. }
  115. },
  116. "422": {
  117. "description": "Validation Error",
  118. "content": {
  119. "application/json": {
  120. "schema": {
  121. "$ref": "#/components/schemas/HTTPValidationError"
  122. }
  123. }
  124. }
  125. }
  126. },
  127. "security": [
  128. {
  129. "HTTPBearer": []
  130. }
  131. ]
  132. }
  133. },
  134. "/api/v1/auth/me": {
  135. "get": {
  136. "tags": [
  137. "认证"
  138. ],
  139. "summary": "Me",
  140. "description": "功能:返回当前身份。参数:Bearer令牌。返回:无敏感字段的用户。异常:401失效或未登录。",
  141. "operationId": "me_api_v1_auth_me_get",
  142. "responses": {
  143. "200": {
  144. "description": "Successful Response",
  145. "content": {
  146. "application/json": {
  147. "schema": {}
  148. }
  149. }
  150. }
  151. },
  152. "security": [
  153. {
  154. "HTTPBearer": []
  155. }
  156. ]
  157. }
  158. },
  159. "/api/v1/users": {
  160. "get": {
  161. "tags": [
  162. "用户"
  163. ],
  164. "summary": "Users",
  165. "description": "功能:经理查看用户用于审批配置。参数:分页。返回:无密码用户列表。异常:403权限不足。",
  166. "operationId": "users_api_v1_users_get",
  167. "security": [
  168. {
  169. "HTTPBearer": []
  170. }
  171. ],
  172. "parameters": [
  173. {
  174. "name": "page",
  175. "in": "query",
  176. "required": false,
  177. "schema": {
  178. "type": "integer",
  179. "minimum": 1,
  180. "default": 1,
  181. "title": "Page"
  182. }
  183. },
  184. {
  185. "name": "page_size",
  186. "in": "query",
  187. "required": false,
  188. "schema": {
  189. "type": "integer",
  190. "maximum": 100,
  191. "minimum": 1,
  192. "default": 20,
  193. "title": "Page Size"
  194. }
  195. }
  196. ],
  197. "responses": {
  198. "200": {
  199. "description": "Successful Response",
  200. "content": {
  201. "application/json": {
  202. "schema": {}
  203. }
  204. }
  205. },
  206. "422": {
  207. "description": "Validation Error",
  208. "content": {
  209. "application/json": {
  210. "schema": {
  211. "$ref": "#/components/schemas/HTTPValidationError"
  212. }
  213. }
  214. }
  215. }
  216. }
  217. },
  218. "post": {
  219. "tags": [
  220. "用户"
  221. ],
  222. "summary": "Create User",
  223. "description": "功能:管理员创建有效用户。参数:用户/部门/角色/密码。返回:用户。异常:403权限,409重名,422弱密码。",
  224. "operationId": "create_user_api_v1_users_post",
  225. "security": [
  226. {
  227. "HTTPBearer": []
  228. }
  229. ],
  230. "requestBody": {
  231. "required": true,
  232. "content": {
  233. "application/json": {
  234. "schema": {
  235. "$ref": "#/components/schemas/UserCreate"
  236. }
  237. }
  238. }
  239. },
  240. "responses": {
  241. "201": {
  242. "description": "Successful Response",
  243. "content": {
  244. "application/json": {
  245. "schema": {}
  246. }
  247. }
  248. },
  249. "422": {
  250. "description": "Validation Error",
  251. "content": {
  252. "application/json": {
  253. "schema": {
  254. "$ref": "#/components/schemas/HTTPValidationError"
  255. }
  256. }
  257. }
  258. }
  259. }
  260. }
  261. },
  262. "/api/v1/users/{identifier}": {
  263. "patch": {
  264. "tags": [
  265. "用户"
  266. ],
  267. "summary": "Patch User",
  268. "description": "功能:修改身份/停用。参数:ID和允许字段。返回:更新用户。异常:403权限,404不存在,409停用自己。",
  269. "operationId": "patch_user_api_v1_users__identifier__patch",
  270. "security": [
  271. {
  272. "HTTPBearer": []
  273. }
  274. ],
  275. "parameters": [
  276. {
  277. "name": "identifier",
  278. "in": "path",
  279. "required": true,
  280. "schema": {
  281. "type": "integer",
  282. "title": "Identifier"
  283. }
  284. }
  285. ],
  286. "requestBody": {
  287. "required": true,
  288. "content": {
  289. "application/json": {
  290. "schema": {
  291. "$ref": "#/components/schemas/UserPatch"
  292. }
  293. }
  294. }
  295. },
  296. "responses": {
  297. "200": {
  298. "description": "Successful Response",
  299. "content": {
  300. "application/json": {
  301. "schema": {}
  302. }
  303. }
  304. },
  305. "422": {
  306. "description": "Validation Error",
  307. "content": {
  308. "application/json": {
  309. "schema": {
  310. "$ref": "#/components/schemas/HTTPValidationError"
  311. }
  312. }
  313. }
  314. }
  315. }
  316. }
  317. },
  318. "/api/v1/departments": {
  319. "get": {
  320. "tags": [
  321. "部门"
  322. ],
  323. "summary": "Departments",
  324. "description": "功能:提供部门选项。参数:当前身份。返回:部门列表。异常:401未登录。",
  325. "operationId": "departments_api_v1_departments_get",
  326. "responses": {
  327. "200": {
  328. "description": "Successful Response",
  329. "content": {
  330. "application/json": {
  331. "schema": {}
  332. }
  333. }
  334. }
  335. },
  336. "security": [
  337. {
  338. "HTTPBearer": []
  339. }
  340. ]
  341. },
  342. "post": {
  343. "tags": [
  344. "部门"
  345. ],
  346. "summary": "Create Department",
  347. "description": "功能:创建部门。参数:名称/启用。返回:部门。异常:403权限,409重名。",
  348. "operationId": "create_department_api_v1_departments_post",
  349. "requestBody": {
  350. "content": {
  351. "application/json": {
  352. "schema": {
  353. "$ref": "#/components/schemas/DepartmentBody"
  354. }
  355. }
  356. },
  357. "required": true
  358. },
  359. "responses": {
  360. "201": {
  361. "description": "Successful Response",
  362. "content": {
  363. "application/json": {
  364. "schema": {}
  365. }
  366. }
  367. },
  368. "422": {
  369. "description": "Validation Error",
  370. "content": {
  371. "application/json": {
  372. "schema": {
  373. "$ref": "#/components/schemas/HTTPValidationError"
  374. }
  375. }
  376. }
  377. }
  378. },
  379. "security": [
  380. {
  381. "HTTPBearer": []
  382. }
  383. ]
  384. }
  385. },
  386. "/api/v1/departments/{identifier}": {
  387. "patch": {
  388. "tags": [
  389. "部门"
  390. ],
  391. "summary": "Patch Department",
  392. "description": "功能:更名或停用。参数:ID/名称/active。返回:部门。异常:403权限,404不存在,409重名。",
  393. "operationId": "patch_department_api_v1_departments__identifier__patch",
  394. "security": [
  395. {
  396. "HTTPBearer": []
  397. }
  398. ],
  399. "parameters": [
  400. {
  401. "name": "identifier",
  402. "in": "path",
  403. "required": true,
  404. "schema": {
  405. "type": "integer",
  406. "title": "Identifier"
  407. }
  408. }
  409. ],
  410. "requestBody": {
  411. "required": true,
  412. "content": {
  413. "application/json": {
  414. "schema": {
  415. "$ref": "#/components/schemas/DepartmentBody"
  416. }
  417. }
  418. }
  419. },
  420. "responses": {
  421. "200": {
  422. "description": "Successful Response",
  423. "content": {
  424. "application/json": {
  425. "schema": {}
  426. }
  427. }
  428. },
  429. "422": {
  430. "description": "Validation Error",
  431. "content": {
  432. "application/json": {
  433. "schema": {
  434. "$ref": "#/components/schemas/HTTPValidationError"
  435. }
  436. }
  437. }
  438. }
  439. }
  440. }
  441. },
  442. "/api/v1/agents": {
  443. "get": {
  444. "tags": [
  445. "Agent"
  446. ],
  447. "summary": "Agents",
  448. "description": "功能:查看节点配置和实际统计。参数:当前身份。返回:五节点列表。异常:403权限不足。",
  449. "operationId": "agents_api_v1_agents_get",
  450. "responses": {
  451. "200": {
  452. "description": "Successful Response",
  453. "content": {
  454. "application/json": {
  455. "schema": {}
  456. }
  457. }
  458. }
  459. },
  460. "security": [
  461. {
  462. "HTTPBearer": []
  463. }
  464. ]
  465. }
  466. },
  467. "/api/v1/agents/{node_name}": {
  468. "get": {
  469. "tags": [
  470. "Agent"
  471. ],
  472. "summary": "Agent Detail",
  473. "description": "功能:查看节点全部版本。参数:固定节点名。返回:当前配置/历史。异常:403权限,404未知节点。",
  474. "operationId": "agent_detail_api_v1_agents__node_name__get",
  475. "security": [
  476. {
  477. "HTTPBearer": []
  478. }
  479. ],
  480. "parameters": [
  481. {
  482. "name": "node_name",
  483. "in": "path",
  484. "required": true,
  485. "schema": {
  486. "type": "string",
  487. "title": "Node Name"
  488. }
  489. }
  490. ],
  491. "responses": {
  492. "200": {
  493. "description": "Successful Response",
  494. "content": {
  495. "application/json": {
  496. "schema": {}
  497. }
  498. }
  499. },
  500. "422": {
  501. "description": "Validation Error",
  502. "content": {
  503. "application/json": {
  504. "schema": {
  505. "$ref": "#/components/schemas/HTTPValidationError"
  506. }
  507. }
  508. }
  509. }
  510. }
  511. },
  512. "patch": {
  513. "tags": [
  514. "Agent"
  515. ],
  516. "summary": "Patch Agent",
  517. "description": "功能:创建不可变配置版本。参数:节点/预期版本/参数。返回:新配置。异常:403权限,409版本冲突,422非法配置。",
  518. "operationId": "patch_agent_api_v1_agents__node_name__patch",
  519. "security": [
  520. {
  521. "HTTPBearer": []
  522. }
  523. ],
  524. "parameters": [
  525. {
  526. "name": "node_name",
  527. "in": "path",
  528. "required": true,
  529. "schema": {
  530. "type": "string",
  531. "title": "Node Name"
  532. }
  533. }
  534. ],
  535. "requestBody": {
  536. "required": true,
  537. "content": {
  538. "application/json": {
  539. "schema": {
  540. "$ref": "#/components/schemas/ConfigPatch"
  541. }
  542. }
  543. }
  544. },
  545. "responses": {
  546. "200": {
  547. "description": "Successful Response",
  548. "content": {
  549. "application/json": {
  550. "schema": {}
  551. }
  552. }
  553. },
  554. "422": {
  555. "description": "Validation Error",
  556. "content": {
  557. "application/json": {
  558. "schema": {
  559. "$ref": "#/components/schemas/HTTPValidationError"
  560. }
  561. }
  562. }
  563. }
  564. }
  565. }
  566. },
  567. "/api/v1/agents/{node_name}/test": {
  568. "post": {
  569. "tags": [
  570. "Agent"
  571. ],
  572. "summary": "Test Agent",
  573. "description": "功能:真实连接或确定性节点测试。参数:节点名。返回:可用/降级原因。异常:403权限,404未知节点。",
  574. "operationId": "test_agent_api_v1_agents__node_name__test_post",
  575. "security": [
  576. {
  577. "HTTPBearer": []
  578. }
  579. ],
  580. "parameters": [
  581. {
  582. "name": "node_name",
  583. "in": "path",
  584. "required": true,
  585. "schema": {
  586. "type": "string",
  587. "title": "Node Name"
  588. }
  589. }
  590. ],
  591. "responses": {
  592. "200": {
  593. "description": "Successful Response",
  594. "content": {
  595. "application/json": {
  596. "schema": {}
  597. }
  598. }
  599. },
  600. "422": {
  601. "description": "Validation Error",
  602. "content": {
  603. "application/json": {
  604. "schema": {
  605. "$ref": "#/components/schemas/HTTPValidationError"
  606. }
  607. }
  608. }
  609. }
  610. }
  611. }
  612. },
  613. "/api/v1/rules": {
  614. "get": {
  615. "tags": [
  616. "规则"
  617. ],
  618. "summary": "Rules",
  619. "description": "功能:查看生效规则。参数:分页/code/enabled。返回:最新版本列表。异常:403权限不足。",
  620. "operationId": "rules_api_v1_rules_get",
  621. "security": [
  622. {
  623. "HTTPBearer": []
  624. }
  625. ],
  626. "parameters": [
  627. {
  628. "name": "page",
  629. "in": "query",
  630. "required": false,
  631. "schema": {
  632. "type": "integer",
  633. "minimum": 1,
  634. "default": 1,
  635. "title": "Page"
  636. }
  637. },
  638. {
  639. "name": "page_size",
  640. "in": "query",
  641. "required": false,
  642. "schema": {
  643. "type": "integer",
  644. "maximum": 100,
  645. "minimum": 1,
  646. "default": 20,
  647. "title": "Page Size"
  648. }
  649. },
  650. {
  651. "name": "code",
  652. "in": "query",
  653. "required": false,
  654. "schema": {
  655. "anyOf": [
  656. {
  657. "type": "string"
  658. },
  659. {
  660. "type": "null"
  661. }
  662. ],
  663. "title": "Code"
  664. }
  665. },
  666. {
  667. "name": "enabled",
  668. "in": "query",
  669. "required": false,
  670. "schema": {
  671. "anyOf": [
  672. {
  673. "type": "boolean"
  674. },
  675. {
  676. "type": "null"
  677. }
  678. ],
  679. "title": "Enabled"
  680. }
  681. }
  682. ],
  683. "responses": {
  684. "200": {
  685. "description": "Successful Response",
  686. "content": {
  687. "application/json": {
  688. "schema": {}
  689. }
  690. }
  691. },
  692. "422": {
  693. "description": "Validation Error",
  694. "content": {
  695. "application/json": {
  696. "schema": {
  697. "$ref": "#/components/schemas/HTTPValidationError"
  698. }
  699. }
  700. }
  701. }
  702. }
  703. }
  704. },
  705. "/api/v1/rules/{code}": {
  706. "get": {
  707. "tags": [
  708. "规则"
  709. ],
  710. "summary": "Rule Detail",
  711. "description": "功能:追踪规则历史。参数:规则code。返回:当前及所有版本。异常:403权限,404未知规则。",
  712. "operationId": "rule_detail_api_v1_rules__code__get",
  713. "security": [
  714. {
  715. "HTTPBearer": []
  716. }
  717. ],
  718. "parameters": [
  719. {
  720. "name": "code",
  721. "in": "path",
  722. "required": true,
  723. "schema": {
  724. "type": "string",
  725. "title": "Code"
  726. }
  727. }
  728. ],
  729. "responses": {
  730. "200": {
  731. "description": "Successful Response",
  732. "content": {
  733. "application/json": {
  734. "schema": {}
  735. }
  736. }
  737. },
  738. "422": {
  739. "description": "Validation Error",
  740. "content": {
  741. "application/json": {
  742. "schema": {
  743. "$ref": "#/components/schemas/HTTPValidationError"
  744. }
  745. }
  746. }
  747. }
  748. }
  749. },
  750. "patch": {
  751. "tags": [
  752. "规则"
  753. ],
  754. "summary": "Patch Rule",
  755. "description": "功能:保存规则新版本。参数:预期版本/参数/范围/开关。返回:新版本。异常:403权限,409并发,422核心检查绕过。",
  756. "operationId": "patch_rule_api_v1_rules__code__patch",
  757. "security": [
  758. {
  759. "HTTPBearer": []
  760. }
  761. ],
  762. "parameters": [
  763. {
  764. "name": "code",
  765. "in": "path",
  766. "required": true,
  767. "schema": {
  768. "type": "string",
  769. "title": "Code"
  770. }
  771. }
  772. ],
  773. "requestBody": {
  774. "required": true,
  775. "content": {
  776. "application/json": {
  777. "schema": {
  778. "$ref": "#/components/schemas/RulePatch"
  779. }
  780. }
  781. }
  782. },
  783. "responses": {
  784. "200": {
  785. "description": "Successful Response",
  786. "content": {
  787. "application/json": {
  788. "schema": {}
  789. }
  790. }
  791. },
  792. "422": {
  793. "description": "Validation Error",
  794. "content": {
  795. "application/json": {
  796. "schema": {
  797. "$ref": "#/components/schemas/HTTPValidationError"
  798. }
  799. }
  800. }
  801. }
  802. }
  803. }
  804. },
  805. "/api/v1/rules/{code}/test": {
  806. "post": {
  807. "tags": [
  808. "规则"
  809. ],
  810. "summary": "Test Rule",
  811. "description": "功能:独立试算不改变正式结果。参数:invoice/context。返回:规则证据。异常:403权限,404规则,422上下文非法。",
  812. "operationId": "test_rule_api_v1_rules__code__test_post",
  813. "security": [
  814. {
  815. "HTTPBearer": []
  816. }
  817. ],
  818. "parameters": [
  819. {
  820. "name": "code",
  821. "in": "path",
  822. "required": true,
  823. "schema": {
  824. "type": "string",
  825. "title": "Code"
  826. }
  827. }
  828. ],
  829. "requestBody": {
  830. "required": true,
  831. "content": {
  832. "application/json": {
  833. "schema": {
  834. "$ref": "#/components/schemas/RuleTest"
  835. }
  836. }
  837. }
  838. },
  839. "responses": {
  840. "200": {
  841. "description": "Successful Response",
  842. "content": {
  843. "application/json": {
  844. "schema": {}
  845. }
  846. }
  847. },
  848. "422": {
  849. "description": "Validation Error",
  850. "content": {
  851. "application/json": {
  852. "schema": {
  853. "$ref": "#/components/schemas/HTTPValidationError"
  854. }
  855. }
  856. }
  857. }
  858. }
  859. }
  860. },
  861. "/api/v1/reimbursements": {
  862. "get": {
  863. "tags": [
  864. "报销"
  865. ],
  866. "summary": "Reimbursements",
  867. "description": "功能:按授权范围列单。参数:分页/状态/类型。返回:报销分页。异常:401未登录,422非法分页。",
  868. "operationId": "reimbursements_api_v1_reimbursements_get",
  869. "security": [
  870. {
  871. "HTTPBearer": []
  872. }
  873. ],
  874. "parameters": [
  875. {
  876. "name": "page",
  877. "in": "query",
  878. "required": false,
  879. "schema": {
  880. "type": "integer",
  881. "minimum": 1,
  882. "default": 1,
  883. "title": "Page"
  884. }
  885. },
  886. {
  887. "name": "page_size",
  888. "in": "query",
  889. "required": false,
  890. "schema": {
  891. "type": "integer",
  892. "maximum": 100,
  893. "minimum": 1,
  894. "default": 20,
  895. "title": "Page Size"
  896. }
  897. },
  898. {
  899. "name": "status",
  900. "in": "query",
  901. "required": false,
  902. "schema": {
  903. "anyOf": [
  904. {
  905. "type": "string"
  906. },
  907. {
  908. "type": "null"
  909. }
  910. ],
  911. "title": "Status"
  912. }
  913. },
  914. {
  915. "name": "type",
  916. "in": "query",
  917. "required": false,
  918. "schema": {
  919. "anyOf": [
  920. {
  921. "type": "integer"
  922. },
  923. {
  924. "type": "null"
  925. }
  926. ],
  927. "title": "Type"
  928. }
  929. }
  930. ],
  931. "responses": {
  932. "200": {
  933. "description": "Successful Response",
  934. "content": {
  935. "application/json": {
  936. "schema": {}
  937. }
  938. }
  939. },
  940. "422": {
  941. "description": "Validation Error",
  942. "content": {
  943. "application/json": {
  944. "schema": {
  945. "$ref": "#/components/schemas/HTTPValidationError"
  946. }
  947. }
  948. }
  949. }
  950. }
  951. },
  952. "post": {
  953. "tags": [
  954. "报销"
  955. ],
  956. "summary": "Create Reimbursement",
  957. "description": "功能:创建本人草稿。参数:标题/类型/含税额。返回:草稿。异常:422金额,409序号耗尽。",
  958. "operationId": "create_reimbursement_api_v1_reimbursements_post",
  959. "security": [
  960. {
  961. "HTTPBearer": []
  962. }
  963. ],
  964. "requestBody": {
  965. "required": true,
  966. "content": {
  967. "application/json": {
  968. "schema": {
  969. "$ref": "#/components/schemas/ReimbursementCreate"
  970. }
  971. }
  972. }
  973. },
  974. "responses": {
  975. "201": {
  976. "description": "Successful Response",
  977. "content": {
  978. "application/json": {
  979. "schema": {}
  980. }
  981. }
  982. },
  983. "422": {
  984. "description": "Validation Error",
  985. "content": {
  986. "application/json": {
  987. "schema": {
  988. "$ref": "#/components/schemas/HTTPValidationError"
  989. }
  990. }
  991. }
  992. }
  993. }
  994. }
  995. },
  996. "/api/v1/reimbursements/{identifier}": {
  997. "get": {
  998. "tags": [
  999. "报销"
  1000. ],
  1001. "summary": "Reimbursement Detail",
  1002. "description": "功能:查看单据全历史。参数:ID。返回:发票/审核/审批。异常:403无权,404不存在。",
  1003. "operationId": "reimbursement_detail_api_v1_reimbursements__identifier__get",
  1004. "security": [
  1005. {
  1006. "HTTPBearer": []
  1007. }
  1008. ],
  1009. "parameters": [
  1010. {
  1011. "name": "identifier",
  1012. "in": "path",
  1013. "required": true,
  1014. "schema": {
  1015. "type": "integer",
  1016. "title": "Identifier"
  1017. }
  1018. }
  1019. ],
  1020. "responses": {
  1021. "200": {
  1022. "description": "Successful Response",
  1023. "content": {
  1024. "application/json": {
  1025. "schema": {}
  1026. }
  1027. }
  1028. },
  1029. "422": {
  1030. "description": "Validation Error",
  1031. "content": {
  1032. "application/json": {
  1033. "schema": {
  1034. "$ref": "#/components/schemas/HTTPValidationError"
  1035. }
  1036. }
  1037. }
  1038. }
  1039. }
  1040. },
  1041. "patch": {
  1042. "tags": [
  1043. "报销"
  1044. ],
  1045. "summary": "Patch Reimbursement",
  1046. "description": "功能:修改本人可编辑单。参数:revision及业务字段。返回:新版本。异常:403所有权,409状态/版本,422金额。",
  1047. "operationId": "patch_reimbursement_api_v1_reimbursements__identifier__patch",
  1048. "security": [
  1049. {
  1050. "HTTPBearer": []
  1051. }
  1052. ],
  1053. "parameters": [
  1054. {
  1055. "name": "identifier",
  1056. "in": "path",
  1057. "required": true,
  1058. "schema": {
  1059. "type": "integer",
  1060. "title": "Identifier"
  1061. }
  1062. }
  1063. ],
  1064. "requestBody": {
  1065. "required": true,
  1066. "content": {
  1067. "application/json": {
  1068. "schema": {
  1069. "$ref": "#/components/schemas/ReimbursementPatch"
  1070. }
  1071. }
  1072. }
  1073. },
  1074. "responses": {
  1075. "200": {
  1076. "description": "Successful Response",
  1077. "content": {
  1078. "application/json": {
  1079. "schema": {}
  1080. }
  1081. }
  1082. },
  1083. "422": {
  1084. "description": "Validation Error",
  1085. "content": {
  1086. "application/json": {
  1087. "schema": {
  1088. "$ref": "#/components/schemas/HTTPValidationError"
  1089. }
  1090. }
  1091. }
  1092. }
  1093. }
  1094. }
  1095. },
  1096. "/api/v1/reimbursements/{identifier}/invoices": {
  1097. "post": {
  1098. "tags": [
  1099. "发票"
  1100. ],
  1101. "summary": "Upload Invoices",
  1102. "description": "功能:逐文件上传并流式留痕。参数:multipart files/revision/metadata数组。返回:SSE真实进度。异常:前置403/409/422;流内error含部分成功ID。",
  1103. "operationId": "upload_invoices_api_v1_reimbursements__identifier__invoices_post",
  1104. "security": [
  1105. {
  1106. "HTTPBearer": []
  1107. }
  1108. ],
  1109. "parameters": [
  1110. {
  1111. "name": "identifier",
  1112. "in": "path",
  1113. "required": true,
  1114. "schema": {
  1115. "type": "integer",
  1116. "title": "Identifier"
  1117. }
  1118. }
  1119. ],
  1120. "requestBody": {
  1121. "required": true,
  1122. "content": {
  1123. "multipart/form-data": {
  1124. "schema": {
  1125. "$ref": "#/components/schemas/Body_upload_invoices_api_v1_reimbursements__identifier__invoices_post"
  1126. }
  1127. }
  1128. }
  1129. },
  1130. "responses": {
  1131. "200": {
  1132. "description": "Successful Response",
  1133. "content": {
  1134. "application/json": {
  1135. "schema": {}
  1136. }
  1137. }
  1138. },
  1139. "422": {
  1140. "description": "Validation Error",
  1141. "content": {
  1142. "application/json": {
  1143. "schema": {
  1144. "$ref": "#/components/schemas/HTTPValidationError"
  1145. }
  1146. }
  1147. }
  1148. }
  1149. }
  1150. }
  1151. },
  1152. "/api/v1/invoices/{identifier}": {
  1153. "patch": {
  1154. "tags": [
  1155. "发票"
  1156. ],
  1157. "summary": "Patch Invoice",
  1158. "description": "功能:用户补录未知字段。参数:ID/单据revision/fields。返回:发票与新revision。异常:403非本人,409状态,422字段。",
  1159. "operationId": "patch_invoice_api_v1_invoices__identifier__patch",
  1160. "security": [
  1161. {
  1162. "HTTPBearer": []
  1163. }
  1164. ],
  1165. "parameters": [
  1166. {
  1167. "name": "identifier",
  1168. "in": "path",
  1169. "required": true,
  1170. "schema": {
  1171. "type": "integer",
  1172. "title": "Identifier"
  1173. }
  1174. }
  1175. ],
  1176. "requestBody": {
  1177. "required": true,
  1178. "content": {
  1179. "application/json": {
  1180. "schema": {
  1181. "$ref": "#/components/schemas/InvoicePatch"
  1182. }
  1183. }
  1184. }
  1185. },
  1186. "responses": {
  1187. "200": {
  1188. "description": "Successful Response",
  1189. "content": {
  1190. "application/json": {
  1191. "schema": {}
  1192. }
  1193. }
  1194. },
  1195. "422": {
  1196. "description": "Validation Error",
  1197. "content": {
  1198. "application/json": {
  1199. "schema": {
  1200. "$ref": "#/components/schemas/HTTPValidationError"
  1201. }
  1202. }
  1203. }
  1204. }
  1205. }
  1206. },
  1207. "delete": {
  1208. "tags": [
  1209. "发票"
  1210. ],
  1211. "summary": "Delete Invoice",
  1212. "description": "功能:从可编辑单移除发票并保留历史证据。参数:ID/revision。返回:新版本。异常:403/404/409。",
  1213. "operationId": "delete_invoice_api_v1_invoices__identifier__delete",
  1214. "security": [
  1215. {
  1216. "HTTPBearer": []
  1217. }
  1218. ],
  1219. "parameters": [
  1220. {
  1221. "name": "identifier",
  1222. "in": "path",
  1223. "required": true,
  1224. "schema": {
  1225. "type": "integer",
  1226. "title": "Identifier"
  1227. }
  1228. },
  1229. {
  1230. "name": "revision",
  1231. "in": "query",
  1232. "required": true,
  1233. "schema": {
  1234. "type": "integer",
  1235. "minimum": 1,
  1236. "title": "Revision"
  1237. }
  1238. }
  1239. ],
  1240. "responses": {
  1241. "200": {
  1242. "description": "Successful Response",
  1243. "content": {
  1244. "application/json": {
  1245. "schema": {}
  1246. }
  1247. }
  1248. },
  1249. "422": {
  1250. "description": "Validation Error",
  1251. "content": {
  1252. "application/json": {
  1253. "schema": {
  1254. "$ref": "#/components/schemas/HTTPValidationError"
  1255. }
  1256. }
  1257. }
  1258. }
  1259. }
  1260. }
  1261. },
  1262. "/api/v1/invoices/{identifier}/file": {
  1263. "get": {
  1264. "tags": [
  1265. "发票"
  1266. ],
  1267. "summary": "Download Invoice",
  1268. "description": "功能:按所有权读取原始文件。参数:ID。返回:文件流。异常:403权限,404文件不存在;不接受磁盘路径。",
  1269. "operationId": "download_invoice_api_v1_invoices__identifier__file_get",
  1270. "security": [
  1271. {
  1272. "HTTPBearer": []
  1273. }
  1274. ],
  1275. "parameters": [
  1276. {
  1277. "name": "identifier",
  1278. "in": "path",
  1279. "required": true,
  1280. "schema": {
  1281. "type": "integer",
  1282. "title": "Identifier"
  1283. }
  1284. }
  1285. ],
  1286. "responses": {
  1287. "200": {
  1288. "description": "Successful Response",
  1289. "content": {
  1290. "application/json": {
  1291. "schema": {}
  1292. }
  1293. }
  1294. },
  1295. "422": {
  1296. "description": "Validation Error",
  1297. "content": {
  1298. "application/json": {
  1299. "schema": {
  1300. "$ref": "#/components/schemas/HTTPValidationError"
  1301. }
  1302. }
  1303. }
  1304. }
  1305. }
  1306. }
  1307. },
  1308. "/api/v1/reimbursements/{identifier}/submit": {
  1309. "post": {
  1310. "tags": [
  1311. "报销"
  1312. ],
  1313. "summary": "Submit",
  1314. "description": "功能:异步提交。参数:revision/Idempotency-Key。返回:202审核ID。异常:403所有权,409版本/活动任务,422无发票。",
  1315. "operationId": "submit_api_v1_reimbursements__identifier__submit_post",
  1316. "security": [
  1317. {
  1318. "HTTPBearer": []
  1319. }
  1320. ],
  1321. "parameters": [
  1322. {
  1323. "name": "identifier",
  1324. "in": "path",
  1325. "required": true,
  1326. "schema": {
  1327. "type": "integer",
  1328. "title": "Identifier"
  1329. }
  1330. },
  1331. {
  1332. "name": "Idempotency-Key",
  1333. "in": "header",
  1334. "required": true,
  1335. "schema": {
  1336. "type": "string",
  1337. "minLength": 8,
  1338. "maxLength": 80,
  1339. "title": "Idempotency-Key"
  1340. }
  1341. }
  1342. ],
  1343. "requestBody": {
  1344. "required": true,
  1345. "content": {
  1346. "application/json": {
  1347. "schema": {
  1348. "$ref": "#/components/schemas/Revision"
  1349. }
  1350. }
  1351. }
  1352. },
  1353. "responses": {
  1354. "202": {
  1355. "description": "Successful Response",
  1356. "content": {
  1357. "application/json": {
  1358. "schema": {}
  1359. }
  1360. }
  1361. },
  1362. "422": {
  1363. "description": "Validation Error",
  1364. "content": {
  1365. "application/json": {
  1366. "schema": {
  1367. "$ref": "#/components/schemas/HTTPValidationError"
  1368. }
  1369. }
  1370. }
  1371. }
  1372. }
  1373. }
  1374. },
  1375. "/api/v1/reimbursements/{identifier}/withdraw": {
  1376. "post": {
  1377. "tags": [
  1378. "报销"
  1379. ],
  1380. "summary": "Withdraw",
  1381. "description": "功能:撤回待审单使旧任务失效。参数:ID/revision。返回:终态。异常:403非本人,409非待审核/过期版本。",
  1382. "operationId": "withdraw_api_v1_reimbursements__identifier__withdraw_post",
  1383. "security": [
  1384. {
  1385. "HTTPBearer": []
  1386. }
  1387. ],
  1388. "parameters": [
  1389. {
  1390. "name": "identifier",
  1391. "in": "path",
  1392. "required": true,
  1393. "schema": {
  1394. "type": "integer",
  1395. "title": "Identifier"
  1396. }
  1397. }
  1398. ],
  1399. "requestBody": {
  1400. "required": true,
  1401. "content": {
  1402. "application/json": {
  1403. "schema": {
  1404. "$ref": "#/components/schemas/Revision"
  1405. }
  1406. }
  1407. }
  1408. },
  1409. "responses": {
  1410. "200": {
  1411. "description": "Successful Response",
  1412. "content": {
  1413. "application/json": {
  1414. "schema": {}
  1415. }
  1416. }
  1417. },
  1418. "422": {
  1419. "description": "Validation Error",
  1420. "content": {
  1421. "application/json": {
  1422. "schema": {
  1423. "$ref": "#/components/schemas/HTTPValidationError"
  1424. }
  1425. }
  1426. }
  1427. }
  1428. }
  1429. }
  1430. },
  1431. "/api/v1/audit": {
  1432. "get": {
  1433. "tags": [
  1434. "审核"
  1435. ],
  1436. "summary": "Audits",
  1437. "description": "功能:列出有权查看的历史审核。参数:状态/风险/决策/单据/分页。返回:审核分页。异常:401身份。",
  1438. "operationId": "audits_api_v1_audit_get",
  1439. "security": [
  1440. {
  1441. "HTTPBearer": []
  1442. }
  1443. ],
  1444. "parameters": [
  1445. {
  1446. "name": "page",
  1447. "in": "query",
  1448. "required": false,
  1449. "schema": {
  1450. "type": "integer",
  1451. "minimum": 1,
  1452. "default": 1,
  1453. "title": "Page"
  1454. }
  1455. },
  1456. {
  1457. "name": "page_size",
  1458. "in": "query",
  1459. "required": false,
  1460. "schema": {
  1461. "type": "integer",
  1462. "maximum": 100,
  1463. "minimum": 1,
  1464. "default": 20,
  1465. "title": "Page Size"
  1466. }
  1467. },
  1468. {
  1469. "name": "status",
  1470. "in": "query",
  1471. "required": false,
  1472. "schema": {
  1473. "anyOf": [
  1474. {
  1475. "type": "string"
  1476. },
  1477. {
  1478. "type": "null"
  1479. }
  1480. ],
  1481. "title": "Status"
  1482. }
  1483. },
  1484. {
  1485. "name": "risk_level",
  1486. "in": "query",
  1487. "required": false,
  1488. "schema": {
  1489. "anyOf": [
  1490. {
  1491. "type": "integer"
  1492. },
  1493. {
  1494. "type": "null"
  1495. }
  1496. ],
  1497. "title": "Risk Level"
  1498. }
  1499. },
  1500. {
  1501. "name": "decision",
  1502. "in": "query",
  1503. "required": false,
  1504. "schema": {
  1505. "anyOf": [
  1506. {
  1507. "type": "string"
  1508. },
  1509. {
  1510. "type": "null"
  1511. }
  1512. ],
  1513. "title": "Decision"
  1514. }
  1515. },
  1516. {
  1517. "name": "reimbursement_id",
  1518. "in": "query",
  1519. "required": false,
  1520. "schema": {
  1521. "anyOf": [
  1522. {
  1523. "type": "integer"
  1524. },
  1525. {
  1526. "type": "null"
  1527. }
  1528. ],
  1529. "title": "Reimbursement Id"
  1530. }
  1531. }
  1532. ],
  1533. "responses": {
  1534. "200": {
  1535. "description": "Successful Response",
  1536. "content": {
  1537. "application/json": {
  1538. "schema": {}
  1539. }
  1540. }
  1541. },
  1542. "422": {
  1543. "description": "Validation Error",
  1544. "content": {
  1545. "application/json": {
  1546. "schema": {
  1547. "$ref": "#/components/schemas/HTTPValidationError"
  1548. }
  1549. }
  1550. }
  1551. }
  1552. }
  1553. }
  1554. },
  1555. "/api/v1/audit/{identifier}": {
  1556. "get": {
  1557. "tags": [
  1558. "审核"
  1559. ],
  1560. "summary": "Get Audit",
  1561. "description": "功能:完整证据与版本详情。参数:审核ID。返回:快照/节点/规则/反馈。异常:403无权,404不存在。",
  1562. "operationId": "get_audit_api_v1_audit__identifier__get",
  1563. "security": [
  1564. {
  1565. "HTTPBearer": []
  1566. }
  1567. ],
  1568. "parameters": [
  1569. {
  1570. "name": "identifier",
  1571. "in": "path",
  1572. "required": true,
  1573. "schema": {
  1574. "type": "integer",
  1575. "title": "Identifier"
  1576. }
  1577. }
  1578. ],
  1579. "responses": {
  1580. "200": {
  1581. "description": "Successful Response",
  1582. "content": {
  1583. "application/json": {
  1584. "schema": {}
  1585. }
  1586. }
  1587. },
  1588. "422": {
  1589. "description": "Validation Error",
  1590. "content": {
  1591. "application/json": {
  1592. "schema": {
  1593. "$ref": "#/components/schemas/HTTPValidationError"
  1594. }
  1595. }
  1596. }
  1597. }
  1598. }
  1599. }
  1600. },
  1601. "/api/v1/audit/{identifier}/events": {
  1602. "get": {
  1603. "tags": [
  1604. "审核"
  1605. ],
  1606. "summary": "Audit Events",
  1607. "description": "功能:实时审核进度。参数:ID/Last-Event-ID。返回:SSE节点/完成/失败/心跳。异常:前置403/404;断线用详情恢复。",
  1608. "operationId": "audit_events_api_v1_audit__identifier__events_get",
  1609. "security": [
  1610. {
  1611. "HTTPBearer": []
  1612. }
  1613. ],
  1614. "parameters": [
  1615. {
  1616. "name": "identifier",
  1617. "in": "path",
  1618. "required": true,
  1619. "schema": {
  1620. "type": "integer",
  1621. "title": "Identifier"
  1622. }
  1623. },
  1624. {
  1625. "name": "Last-Event-ID",
  1626. "in": "header",
  1627. "required": false,
  1628. "schema": {
  1629. "anyOf": [
  1630. {
  1631. "type": "string"
  1632. },
  1633. {
  1634. "type": "null"
  1635. }
  1636. ],
  1637. "title": "Last-Event-Id"
  1638. }
  1639. }
  1640. ],
  1641. "responses": {
  1642. "200": {
  1643. "description": "Successful Response",
  1644. "content": {
  1645. "application/json": {
  1646. "schema": {}
  1647. }
  1648. }
  1649. },
  1650. "422": {
  1651. "description": "Validation Error",
  1652. "content": {
  1653. "application/json": {
  1654. "schema": {
  1655. "$ref": "#/components/schemas/HTTPValidationError"
  1656. }
  1657. }
  1658. }
  1659. }
  1660. }
  1661. }
  1662. },
  1663. "/api/v1/audit/{identifier}/rerun": {
  1664. "post": {
  1665. "tags": [
  1666. "审核"
  1667. ],
  1668. "summary": "Rerun",
  1669. "description": "功能:授权重跑保留旧结果。参数:审核ID/理由/幂等键。返回:新审核ID。异常:403权限,409终态/在途审批。",
  1670. "operationId": "rerun_api_v1_audit__identifier__rerun_post",
  1671. "security": [
  1672. {
  1673. "HTTPBearer": []
  1674. }
  1675. ],
  1676. "parameters": [
  1677. {
  1678. "name": "identifier",
  1679. "in": "path",
  1680. "required": true,
  1681. "schema": {
  1682. "type": "integer",
  1683. "title": "Identifier"
  1684. }
  1685. },
  1686. {
  1687. "name": "Idempotency-Key",
  1688. "in": "header",
  1689. "required": true,
  1690. "schema": {
  1691. "type": "string",
  1692. "minLength": 8,
  1693. "maxLength": 80,
  1694. "title": "Idempotency-Key"
  1695. }
  1696. }
  1697. ],
  1698. "requestBody": {
  1699. "required": true,
  1700. "content": {
  1701. "application/json": {
  1702. "schema": {
  1703. "$ref": "#/components/schemas/Rerun"
  1704. }
  1705. }
  1706. }
  1707. },
  1708. "responses": {
  1709. "202": {
  1710. "description": "Successful Response",
  1711. "content": {
  1712. "application/json": {
  1713. "schema": {}
  1714. }
  1715. }
  1716. },
  1717. "422": {
  1718. "description": "Validation Error",
  1719. "content": {
  1720. "application/json": {
  1721. "schema": {
  1722. "$ref": "#/components/schemas/HTTPValidationError"
  1723. }
  1724. }
  1725. }
  1726. }
  1727. }
  1728. }
  1729. },
  1730. "/api/v1/audit/{identifier}/feedback": {
  1731. "post": {
  1732. "tags": [
  1733. "反馈"
  1734. ],
  1735. "summary": "Feedback",
  1736. "description": "功能:人工审批后独立反馈。参数:已处理审批ID/纠正/理由。返回:反馈及迭代建议。异常:403非签署人,409轮次不匹配。",
  1737. "operationId": "feedback_api_v1_audit__identifier__feedback_post",
  1738. "security": [
  1739. {
  1740. "HTTPBearer": []
  1741. }
  1742. ],
  1743. "parameters": [
  1744. {
  1745. "name": "identifier",
  1746. "in": "path",
  1747. "required": true,
  1748. "schema": {
  1749. "type": "integer",
  1750. "title": "Identifier"
  1751. }
  1752. }
  1753. ],
  1754. "requestBody": {
  1755. "required": true,
  1756. "content": {
  1757. "application/json": {
  1758. "schema": {
  1759. "$ref": "#/components/schemas/Feedback"
  1760. }
  1761. }
  1762. }
  1763. },
  1764. "responses": {
  1765. "200": {
  1766. "description": "Successful Response",
  1767. "content": {
  1768. "application/json": {
  1769. "schema": {}
  1770. }
  1771. }
  1772. },
  1773. "422": {
  1774. "description": "Validation Error",
  1775. "content": {
  1776. "application/json": {
  1777. "schema": {
  1778. "$ref": "#/components/schemas/HTTPValidationError"
  1779. }
  1780. }
  1781. }
  1782. }
  1783. }
  1784. }
  1785. },
  1786. "/api/v1/approvals/chains": {
  1787. "get": {
  1788. "tags": [
  1789. "审批链"
  1790. ],
  1791. "summary": "Chains",
  1792. "description": "功能:查看链配置。参数:分页。返回:审批链列表。异常:403经理权限不足。",
  1793. "operationId": "chains_api_v1_approvals_chains_get",
  1794. "security": [
  1795. {
  1796. "HTTPBearer": []
  1797. }
  1798. ],
  1799. "parameters": [
  1800. {
  1801. "name": "page",
  1802. "in": "query",
  1803. "required": false,
  1804. "schema": {
  1805. "type": "integer",
  1806. "minimum": 1,
  1807. "default": 1,
  1808. "title": "Page"
  1809. }
  1810. },
  1811. {
  1812. "name": "page_size",
  1813. "in": "query",
  1814. "required": false,
  1815. "schema": {
  1816. "type": "integer",
  1817. "maximum": 100,
  1818. "minimum": 1,
  1819. "default": 20,
  1820. "title": "Page Size"
  1821. }
  1822. }
  1823. ],
  1824. "responses": {
  1825. "200": {
  1826. "description": "Successful Response",
  1827. "content": {
  1828. "application/json": {
  1829. "schema": {}
  1830. }
  1831. }
  1832. },
  1833. "422": {
  1834. "description": "Validation Error",
  1835. "content": {
  1836. "application/json": {
  1837. "schema": {
  1838. "$ref": "#/components/schemas/HTTPValidationError"
  1839. }
  1840. }
  1841. }
  1842. }
  1843. }
  1844. },
  1845. "post": {
  1846. "tags": [
  1847. "审批链"
  1848. ],
  1849. "summary": "Create Chain",
  1850. "description": "功能:创建匹配条件与顺序链。参数:route/范围/nodes。返回:链配置。异常:403权限,422非法人员或金额范围。",
  1851. "operationId": "create_chain_api_v1_approvals_chains_post",
  1852. "security": [
  1853. {
  1854. "HTTPBearer": []
  1855. }
  1856. ],
  1857. "requestBody": {
  1858. "required": true,
  1859. "content": {
  1860. "application/json": {
  1861. "schema": {
  1862. "$ref": "#/components/schemas/ChainBody"
  1863. }
  1864. }
  1865. }
  1866. },
  1867. "responses": {
  1868. "201": {
  1869. "description": "Successful Response",
  1870. "content": {
  1871. "application/json": {
  1872. "schema": {}
  1873. }
  1874. }
  1875. },
  1876. "422": {
  1877. "description": "Validation Error",
  1878. "content": {
  1879. "application/json": {
  1880. "schema": {
  1881. "$ref": "#/components/schemas/HTTPValidationError"
  1882. }
  1883. }
  1884. }
  1885. }
  1886. }
  1887. }
  1888. },
  1889. "/api/v1/approvals/chains/{identifier}": {
  1890. "patch": {
  1891. "tags": [
  1892. "审批链"
  1893. ],
  1894. "summary": "Patch Chain",
  1895. "description": "功能:更新下一轮链配置。参数:ID/expected_version/完整链。返回:新版本。异常:403、404、409版本、422非法链。",
  1896. "operationId": "patch_chain_api_v1_approvals_chains__identifier__patch",
  1897. "security": [
  1898. {
  1899. "HTTPBearer": []
  1900. }
  1901. ],
  1902. "parameters": [
  1903. {
  1904. "name": "identifier",
  1905. "in": "path",
  1906. "required": true,
  1907. "schema": {
  1908. "type": "integer",
  1909. "title": "Identifier"
  1910. }
  1911. }
  1912. ],
  1913. "requestBody": {
  1914. "required": true,
  1915. "content": {
  1916. "application/json": {
  1917. "schema": {
  1918. "$ref": "#/components/schemas/ChainBody"
  1919. }
  1920. }
  1921. }
  1922. },
  1923. "responses": {
  1924. "200": {
  1925. "description": "Successful Response",
  1926. "content": {
  1927. "application/json": {
  1928. "schema": {}
  1929. }
  1930. }
  1931. },
  1932. "422": {
  1933. "description": "Validation Error",
  1934. "content": {
  1935. "application/json": {
  1936. "schema": {
  1937. "$ref": "#/components/schemas/HTTPValidationError"
  1938. }
  1939. }
  1940. }
  1941. }
  1942. }
  1943. }
  1944. },
  1945. "/api/v1/approvals": {
  1946. "get": {
  1947. "tags": [
  1948. "审批"
  1949. ],
  1950. "summary": "Approvals",
  1951. "description": "功能:查看本人待办与授权历史。参数:pending/单据/分页。返回:记录与关联信息。异常:401身份。",
  1952. "operationId": "approvals_api_v1_approvals_get",
  1953. "security": [
  1954. {
  1955. "HTTPBearer": []
  1956. }
  1957. ],
  1958. "parameters": [
  1959. {
  1960. "name": "page",
  1961. "in": "query",
  1962. "required": false,
  1963. "schema": {
  1964. "type": "integer",
  1965. "minimum": 1,
  1966. "default": 1,
  1967. "title": "Page"
  1968. }
  1969. },
  1970. {
  1971. "name": "page_size",
  1972. "in": "query",
  1973. "required": false,
  1974. "schema": {
  1975. "type": "integer",
  1976. "maximum": 100,
  1977. "minimum": 1,
  1978. "default": 20,
  1979. "title": "Page Size"
  1980. }
  1981. },
  1982. {
  1983. "name": "pending",
  1984. "in": "query",
  1985. "required": false,
  1986. "schema": {
  1987. "anyOf": [
  1988. {
  1989. "type": "boolean"
  1990. },
  1991. {
  1992. "type": "null"
  1993. }
  1994. ],
  1995. "title": "Pending"
  1996. }
  1997. },
  1998. {
  1999. "name": "reimbursement_id",
  2000. "in": "query",
  2001. "required": false,
  2002. "schema": {
  2003. "anyOf": [
  2004. {
  2005. "type": "integer"
  2006. },
  2007. {
  2008. "type": "null"
  2009. }
  2010. ],
  2011. "title": "Reimbursement Id"
  2012. }
  2013. }
  2014. ],
  2015. "responses": {
  2016. "200": {
  2017. "description": "Successful Response",
  2018. "content": {
  2019. "application/json": {
  2020. "schema": {}
  2021. }
  2022. }
  2023. },
  2024. "422": {
  2025. "description": "Validation Error",
  2026. "content": {
  2027. "application/json": {
  2028. "schema": {
  2029. "$ref": "#/components/schemas/HTTPValidationError"
  2030. }
  2031. }
  2032. }
  2033. }
  2034. }
  2035. }
  2036. },
  2037. "/api/v1/approvals/{identifier}/decide": {
  2038. "post": {
  2039. "tags": [
  2040. "审批"
  2041. ],
  2042. "summary": "Approval Decision",
  2043. "description": "功能:处理指定审批并原子推进下一棒。参数:ID/action/opinion。返回:记录/轮次/单据。异常:403自审/非指定人,409重签。",
  2044. "operationId": "approval_decision_api_v1_approvals__identifier__decide_post",
  2045. "security": [
  2046. {
  2047. "HTTPBearer": []
  2048. }
  2049. ],
  2050. "parameters": [
  2051. {
  2052. "name": "identifier",
  2053. "in": "path",
  2054. "required": true,
  2055. "schema": {
  2056. "type": "integer",
  2057. "title": "Identifier"
  2058. }
  2059. }
  2060. ],
  2061. "requestBody": {
  2062. "required": true,
  2063. "content": {
  2064. "application/json": {
  2065. "schema": {
  2066. "$ref": "#/components/schemas/Decide"
  2067. }
  2068. }
  2069. }
  2070. },
  2071. "responses": {
  2072. "200": {
  2073. "description": "Successful Response",
  2074. "content": {
  2075. "application/json": {
  2076. "schema": {}
  2077. }
  2078. }
  2079. },
  2080. "422": {
  2081. "description": "Validation Error",
  2082. "content": {
  2083. "application/json": {
  2084. "schema": {
  2085. "$ref": "#/components/schemas/HTTPValidationError"
  2086. }
  2087. }
  2088. }
  2089. }
  2090. }
  2091. }
  2092. },
  2093. "/api/v1/knowledge/documents/import": {
  2094. "post": {
  2095. "tags": [
  2096. "知识库"
  2097. ],
  2098. "summary": "Import Document",
  2099. "description": "功能:导入真实文本政策。参数:UTF-8 txt/md文件。返回:政策和索引状态。异常:403权限,422文件类型/大小/编码。",
  2100. "operationId": "import_document_api_v1_knowledge_documents_import_post",
  2101. "requestBody": {
  2102. "content": {
  2103. "multipart/form-data": {
  2104. "schema": {
  2105. "$ref": "#/components/schemas/Body_import_document_api_v1_knowledge_documents_import_post"
  2106. }
  2107. }
  2108. },
  2109. "required": true
  2110. },
  2111. "responses": {
  2112. "201": {
  2113. "description": "Successful Response",
  2114. "content": {
  2115. "application/json": {
  2116. "schema": {}
  2117. }
  2118. }
  2119. },
  2120. "422": {
  2121. "description": "Validation Error",
  2122. "content": {
  2123. "application/json": {
  2124. "schema": {
  2125. "$ref": "#/components/schemas/HTTPValidationError"
  2126. }
  2127. }
  2128. }
  2129. }
  2130. },
  2131. "security": [
  2132. {
  2133. "HTTPBearer": []
  2134. }
  2135. ]
  2136. }
  2137. },
  2138. "/api/v1/knowledge/documents": {
  2139. "get": {
  2140. "tags": [
  2141. "知识库"
  2142. ],
  2143. "summary": "Documents",
  2144. "description": "功能:阅读政策与索引状态。参数:分页。返回:含正文政策列表。异常:401未登录。",
  2145. "operationId": "documents_api_v1_knowledge_documents_get",
  2146. "security": [
  2147. {
  2148. "HTTPBearer": []
  2149. }
  2150. ],
  2151. "parameters": [
  2152. {
  2153. "name": "page",
  2154. "in": "query",
  2155. "required": false,
  2156. "schema": {
  2157. "type": "integer",
  2158. "minimum": 1,
  2159. "default": 1,
  2160. "title": "Page"
  2161. }
  2162. },
  2163. {
  2164. "name": "page_size",
  2165. "in": "query",
  2166. "required": false,
  2167. "schema": {
  2168. "type": "integer",
  2169. "maximum": 100,
  2170. "minimum": 1,
  2171. "default": 20,
  2172. "title": "Page Size"
  2173. }
  2174. }
  2175. ],
  2176. "responses": {
  2177. "200": {
  2178. "description": "Successful Response",
  2179. "content": {
  2180. "application/json": {
  2181. "schema": {}
  2182. }
  2183. }
  2184. },
  2185. "422": {
  2186. "description": "Validation Error",
  2187. "content": {
  2188. "application/json": {
  2189. "schema": {
  2190. "$ref": "#/components/schemas/HTTPValidationError"
  2191. }
  2192. }
  2193. }
  2194. }
  2195. }
  2196. },
  2197. "post": {
  2198. "tags": [
  2199. "知识库"
  2200. ],
  2201. "summary": "Create Document",
  2202. "description": "功能:保存用户制度原文并分块。参数:标题/分类/正文。返回:未索引文档。异常:403权限,422正文不合法。",
  2203. "operationId": "create_document_api_v1_knowledge_documents_post",
  2204. "security": [
  2205. {
  2206. "HTTPBearer": []
  2207. }
  2208. ],
  2209. "requestBody": {
  2210. "required": true,
  2211. "content": {
  2212. "application/json": {
  2213. "schema": {
  2214. "$ref": "#/components/schemas/KnowledgeBody"
  2215. }
  2216. }
  2217. }
  2218. },
  2219. "responses": {
  2220. "201": {
  2221. "description": "Successful Response",
  2222. "content": {
  2223. "application/json": {
  2224. "schema": {}
  2225. }
  2226. }
  2227. },
  2228. "422": {
  2229. "description": "Validation Error",
  2230. "content": {
  2231. "application/json": {
  2232. "schema": {
  2233. "$ref": "#/components/schemas/HTTPValidationError"
  2234. }
  2235. }
  2236. }
  2237. }
  2238. }
  2239. }
  2240. },
  2241. "/api/v1/knowledge/documents/{identifier}": {
  2242. "patch": {
  2243. "tags": [
  2244. "知识库"
  2245. ],
  2246. "summary": "Patch Document",
  2247. "description": "功能:修订正文使旧向量失效。参数:ID/预期版本/正文。返回:新版本。异常:403权限,404不存在,409并发。",
  2248. "operationId": "patch_document_api_v1_knowledge_documents__identifier__patch",
  2249. "security": [
  2250. {
  2251. "HTTPBearer": []
  2252. }
  2253. ],
  2254. "parameters": [
  2255. {
  2256. "name": "identifier",
  2257. "in": "path",
  2258. "required": true,
  2259. "schema": {
  2260. "type": "integer",
  2261. "title": "Identifier"
  2262. }
  2263. }
  2264. ],
  2265. "requestBody": {
  2266. "required": true,
  2267. "content": {
  2268. "application/json": {
  2269. "schema": {
  2270. "$ref": "#/components/schemas/KnowledgeBody"
  2271. }
  2272. }
  2273. }
  2274. },
  2275. "responses": {
  2276. "200": {
  2277. "description": "Successful Response",
  2278. "content": {
  2279. "application/json": {
  2280. "schema": {}
  2281. }
  2282. }
  2283. },
  2284. "422": {
  2285. "description": "Validation Error",
  2286. "content": {
  2287. "application/json": {
  2288. "schema": {
  2289. "$ref": "#/components/schemas/HTTPValidationError"
  2290. }
  2291. }
  2292. }
  2293. }
  2294. }
  2295. }
  2296. },
  2297. "/api/v1/knowledge/documents/{identifier}/reindex": {
  2298. "post": {
  2299. "tags": [
  2300. "知识库"
  2301. ],
  2302. "summary": "Reindex Document",
  2303. "description": "功能:排队真实向量化。参数:文档ID。返回:索引任务ID。异常:403权限,404不存在,409已有任务,503无模型。",
  2304. "operationId": "reindex_document_api_v1_knowledge_documents__identifier__reindex_post",
  2305. "security": [
  2306. {
  2307. "HTTPBearer": []
  2308. }
  2309. ],
  2310. "parameters": [
  2311. {
  2312. "name": "identifier",
  2313. "in": "path",
  2314. "required": true,
  2315. "schema": {
  2316. "type": "integer",
  2317. "title": "Identifier"
  2318. }
  2319. }
  2320. ],
  2321. "responses": {
  2322. "202": {
  2323. "description": "Successful Response",
  2324. "content": {
  2325. "application/json": {
  2326. "schema": {}
  2327. }
  2328. }
  2329. },
  2330. "422": {
  2331. "description": "Validation Error",
  2332. "content": {
  2333. "application/json": {
  2334. "schema": {
  2335. "$ref": "#/components/schemas/HTTPValidationError"
  2336. }
  2337. }
  2338. }
  2339. }
  2340. }
  2341. }
  2342. },
  2343. "/api/v1/knowledge/search": {
  2344. "post": {
  2345. "tags": [
  2346. "知识库"
  2347. ],
  2348. "summary": "Search",
  2349. "description": "功能:显式关键词/语义试验。参数:query/mode/top_k/category。返回:模式及原文出处。异常:503真实向量不可用。",
  2350. "operationId": "search_api_v1_knowledge_search_post",
  2351. "requestBody": {
  2352. "content": {
  2353. "application/json": {
  2354. "schema": {
  2355. "$ref": "#/components/schemas/SearchBody"
  2356. }
  2357. }
  2358. },
  2359. "required": true
  2360. },
  2361. "responses": {
  2362. "200": {
  2363. "description": "Successful Response",
  2364. "content": {
  2365. "application/json": {
  2366. "schema": {}
  2367. }
  2368. }
  2369. },
  2370. "422": {
  2371. "description": "Validation Error",
  2372. "content": {
  2373. "application/json": {
  2374. "schema": {
  2375. "$ref": "#/components/schemas/HTTPValidationError"
  2376. }
  2377. }
  2378. }
  2379. }
  2380. },
  2381. "security": [
  2382. {
  2383. "HTTPBearer": []
  2384. }
  2385. ]
  2386. }
  2387. },
  2388. "/api/v1/logs/export": {
  2389. "get": {
  2390. "tags": [
  2391. "日志"
  2392. ],
  2393. "summary": "Logs Export",
  2394. "description": "功能:导出授权日志。参数:与列表相同筛选。返回:UTF-8 BOM CSV。异常:403权限,422时间格式。",
  2395. "operationId": "logs_export_api_v1_logs_export_get",
  2396. "security": [
  2397. {
  2398. "HTTPBearer": []
  2399. }
  2400. ],
  2401. "parameters": [
  2402. {
  2403. "name": "action",
  2404. "in": "query",
  2405. "required": false,
  2406. "schema": {
  2407. "anyOf": [
  2408. {
  2409. "type": "string"
  2410. },
  2411. {
  2412. "type": "null"
  2413. }
  2414. ],
  2415. "title": "Action"
  2416. }
  2417. },
  2418. {
  2419. "name": "trace",
  2420. "in": "query",
  2421. "required": false,
  2422. "schema": {
  2423. "anyOf": [
  2424. {
  2425. "type": "string"
  2426. },
  2427. {
  2428. "type": "null"
  2429. }
  2430. ],
  2431. "title": "Trace"
  2432. }
  2433. },
  2434. {
  2435. "name": "actor_id",
  2436. "in": "query",
  2437. "required": false,
  2438. "schema": {
  2439. "anyOf": [
  2440. {
  2441. "type": "integer"
  2442. },
  2443. {
  2444. "type": "null"
  2445. }
  2446. ],
  2447. "title": "Actor Id"
  2448. }
  2449. },
  2450. {
  2451. "name": "resource",
  2452. "in": "query",
  2453. "required": false,
  2454. "schema": {
  2455. "anyOf": [
  2456. {
  2457. "type": "string"
  2458. },
  2459. {
  2460. "type": "null"
  2461. }
  2462. ],
  2463. "title": "Resource"
  2464. }
  2465. },
  2466. {
  2467. "name": "since",
  2468. "in": "query",
  2469. "required": false,
  2470. "schema": {
  2471. "anyOf": [
  2472. {
  2473. "type": "string"
  2474. },
  2475. {
  2476. "type": "null"
  2477. }
  2478. ],
  2479. "title": "Since"
  2480. }
  2481. },
  2482. {
  2483. "name": "until",
  2484. "in": "query",
  2485. "required": false,
  2486. "schema": {
  2487. "anyOf": [
  2488. {
  2489. "type": "string"
  2490. },
  2491. {
  2492. "type": "null"
  2493. }
  2494. ],
  2495. "title": "Until"
  2496. }
  2497. }
  2498. ],
  2499. "responses": {
  2500. "200": {
  2501. "description": "Successful Response",
  2502. "content": {
  2503. "application/json": {
  2504. "schema": {}
  2505. }
  2506. }
  2507. },
  2508. "422": {
  2509. "description": "Validation Error",
  2510. "content": {
  2511. "application/json": {
  2512. "schema": {
  2513. "$ref": "#/components/schemas/HTTPValidationError"
  2514. }
  2515. }
  2516. }
  2517. }
  2518. }
  2519. }
  2520. },
  2521. "/api/v1/logs": {
  2522. "get": {
  2523. "tags": [
  2524. "日志"
  2525. ],
  2526. "summary": "Logs",
  2527. "description": "功能:按人/动作/资源/追踪查证。参数:筛选和分页。返回:只读日志。异常:403权限,422时间格式。",
  2528. "operationId": "logs_api_v1_logs_get",
  2529. "security": [
  2530. {
  2531. "HTTPBearer": []
  2532. }
  2533. ],
  2534. "parameters": [
  2535. {
  2536. "name": "page",
  2537. "in": "query",
  2538. "required": false,
  2539. "schema": {
  2540. "type": "integer",
  2541. "minimum": 1,
  2542. "default": 1,
  2543. "title": "Page"
  2544. }
  2545. },
  2546. {
  2547. "name": "page_size",
  2548. "in": "query",
  2549. "required": false,
  2550. "schema": {
  2551. "type": "integer",
  2552. "maximum": 100,
  2553. "minimum": 1,
  2554. "default": 20,
  2555. "title": "Page Size"
  2556. }
  2557. },
  2558. {
  2559. "name": "action",
  2560. "in": "query",
  2561. "required": false,
  2562. "schema": {
  2563. "anyOf": [
  2564. {
  2565. "type": "string"
  2566. },
  2567. {
  2568. "type": "null"
  2569. }
  2570. ],
  2571. "title": "Action"
  2572. }
  2573. },
  2574. {
  2575. "name": "trace",
  2576. "in": "query",
  2577. "required": false,
  2578. "schema": {
  2579. "anyOf": [
  2580. {
  2581. "type": "string"
  2582. },
  2583. {
  2584. "type": "null"
  2585. }
  2586. ],
  2587. "title": "Trace"
  2588. }
  2589. },
  2590. {
  2591. "name": "actor_id",
  2592. "in": "query",
  2593. "required": false,
  2594. "schema": {
  2595. "anyOf": [
  2596. {
  2597. "type": "integer"
  2598. },
  2599. {
  2600. "type": "null"
  2601. }
  2602. ],
  2603. "title": "Actor Id"
  2604. }
  2605. },
  2606. {
  2607. "name": "resource",
  2608. "in": "query",
  2609. "required": false,
  2610. "schema": {
  2611. "anyOf": [
  2612. {
  2613. "type": "string"
  2614. },
  2615. {
  2616. "type": "null"
  2617. }
  2618. ],
  2619. "title": "Resource"
  2620. }
  2621. },
  2622. {
  2623. "name": "since",
  2624. "in": "query",
  2625. "required": false,
  2626. "schema": {
  2627. "anyOf": [
  2628. {
  2629. "type": "string"
  2630. },
  2631. {
  2632. "type": "null"
  2633. }
  2634. ],
  2635. "title": "Since"
  2636. }
  2637. },
  2638. {
  2639. "name": "until",
  2640. "in": "query",
  2641. "required": false,
  2642. "schema": {
  2643. "anyOf": [
  2644. {
  2645. "type": "string"
  2646. },
  2647. {
  2648. "type": "null"
  2649. }
  2650. ],
  2651. "title": "Until"
  2652. }
  2653. }
  2654. ],
  2655. "responses": {
  2656. "200": {
  2657. "description": "Successful Response",
  2658. "content": {
  2659. "application/json": {
  2660. "schema": {}
  2661. }
  2662. }
  2663. },
  2664. "422": {
  2665. "description": "Validation Error",
  2666. "content": {
  2667. "application/json": {
  2668. "schema": {
  2669. "$ref": "#/components/schemas/HTTPValidationError"
  2670. }
  2671. }
  2672. }
  2673. }
  2674. }
  2675. }
  2676. },
  2677. "/api/v1/alerts": {
  2678. "get": {
  2679. "tags": [
  2680. "告警"
  2681. ],
  2682. "summary": "Alerts",
  2683. "description": "功能:查询授权告警。参数:状态/严重度/类型/分页。返回:持久告警。异常:403权限不足。",
  2684. "operationId": "alerts_api_v1_alerts_get",
  2685. "security": [
  2686. {
  2687. "HTTPBearer": []
  2688. }
  2689. ],
  2690. "parameters": [
  2691. {
  2692. "name": "page",
  2693. "in": "query",
  2694. "required": false,
  2695. "schema": {
  2696. "type": "integer",
  2697. "minimum": 1,
  2698. "default": 1,
  2699. "title": "Page"
  2700. }
  2701. },
  2702. {
  2703. "name": "page_size",
  2704. "in": "query",
  2705. "required": false,
  2706. "schema": {
  2707. "type": "integer",
  2708. "maximum": 100,
  2709. "minimum": 1,
  2710. "default": 20,
  2711. "title": "Page Size"
  2712. }
  2713. },
  2714. {
  2715. "name": "status",
  2716. "in": "query",
  2717. "required": false,
  2718. "schema": {
  2719. "anyOf": [
  2720. {
  2721. "type": "string"
  2722. },
  2723. {
  2724. "type": "null"
  2725. }
  2726. ],
  2727. "title": "Status"
  2728. }
  2729. },
  2730. {
  2731. "name": "severity",
  2732. "in": "query",
  2733. "required": false,
  2734. "schema": {
  2735. "anyOf": [
  2736. {
  2737. "type": "string"
  2738. },
  2739. {
  2740. "type": "null"
  2741. }
  2742. ],
  2743. "title": "Severity"
  2744. }
  2745. },
  2746. {
  2747. "name": "type",
  2748. "in": "query",
  2749. "required": false,
  2750. "schema": {
  2751. "anyOf": [
  2752. {
  2753. "type": "string"
  2754. },
  2755. {
  2756. "type": "null"
  2757. }
  2758. ],
  2759. "title": "Type"
  2760. }
  2761. }
  2762. ],
  2763. "responses": {
  2764. "200": {
  2765. "description": "Successful Response",
  2766. "content": {
  2767. "application/json": {
  2768. "schema": {}
  2769. }
  2770. }
  2771. },
  2772. "422": {
  2773. "description": "Validation Error",
  2774. "content": {
  2775. "application/json": {
  2776. "schema": {
  2777. "$ref": "#/components/schemas/HTTPValidationError"
  2778. }
  2779. }
  2780. }
  2781. }
  2782. }
  2783. }
  2784. },
  2785. "/api/v1/alerts/{identifier}/acknowledge": {
  2786. "post": {
  2787. "tags": [
  2788. "告警"
  2789. ],
  2790. "summary": "Acknowledge",
  2791. "description": "功能:确认异常负责人。参数:ID/意见。返回:已确认告警。异常:403范围,404不存在,409已处理。",
  2792. "operationId": "acknowledge_api_v1_alerts__identifier__acknowledge_post",
  2793. "security": [
  2794. {
  2795. "HTTPBearer": []
  2796. }
  2797. ],
  2798. "parameters": [
  2799. {
  2800. "name": "identifier",
  2801. "in": "path",
  2802. "required": true,
  2803. "schema": {
  2804. "type": "integer",
  2805. "title": "Identifier"
  2806. }
  2807. }
  2808. ],
  2809. "requestBody": {
  2810. "required": true,
  2811. "content": {
  2812. "application/json": {
  2813. "schema": {
  2814. "$ref": "#/components/schemas/Opinion"
  2815. }
  2816. }
  2817. }
  2818. },
  2819. "responses": {
  2820. "200": {
  2821. "description": "Successful Response",
  2822. "content": {
  2823. "application/json": {
  2824. "schema": {}
  2825. }
  2826. }
  2827. },
  2828. "422": {
  2829. "description": "Validation Error",
  2830. "content": {
  2831. "application/json": {
  2832. "schema": {
  2833. "$ref": "#/components/schemas/HTTPValidationError"
  2834. }
  2835. }
  2836. }
  2837. }
  2838. }
  2839. }
  2840. },
  2841. "/api/v1/alerts/{identifier}/resolve": {
  2842. "post": {
  2843. "tags": [
  2844. "告警"
  2845. ],
  2846. "summary": "Resolve",
  2847. "description": "功能:记录告警处理完成。参数:ID/意见。返回:已解决告警,原风险不变。异常:403范围,409未确认。",
  2848. "operationId": "resolve_api_v1_alerts__identifier__resolve_post",
  2849. "security": [
  2850. {
  2851. "HTTPBearer": []
  2852. }
  2853. ],
  2854. "parameters": [
  2855. {
  2856. "name": "identifier",
  2857. "in": "path",
  2858. "required": true,
  2859. "schema": {
  2860. "type": "integer",
  2861. "title": "Identifier"
  2862. }
  2863. }
  2864. ],
  2865. "requestBody": {
  2866. "required": true,
  2867. "content": {
  2868. "application/json": {
  2869. "schema": {
  2870. "$ref": "#/components/schemas/Opinion"
  2871. }
  2872. }
  2873. }
  2874. },
  2875. "responses": {
  2876. "200": {
  2877. "description": "Successful Response",
  2878. "content": {
  2879. "application/json": {
  2880. "schema": {}
  2881. }
  2882. }
  2883. },
  2884. "422": {
  2885. "description": "Validation Error",
  2886. "content": {
  2887. "application/json": {
  2888. "schema": {
  2889. "$ref": "#/components/schemas/HTTPValidationError"
  2890. }
  2891. }
  2892. }
  2893. }
  2894. }
  2895. }
  2896. },
  2897. "/api/v1/stats/overview": {
  2898. "get": {
  2899. "tags": [
  2900. "统计"
  2901. ],
  2902. "summary": "Overview",
  2903. "description": "功能:实时授权统计。参数:时间/部门。返回:数量、金额、状态、风险、部门。异常:401身份,422时间。",
  2904. "operationId": "overview_api_v1_stats_overview_get",
  2905. "security": [
  2906. {
  2907. "HTTPBearer": []
  2908. }
  2909. ],
  2910. "parameters": [
  2911. {
  2912. "name": "since",
  2913. "in": "query",
  2914. "required": false,
  2915. "schema": {
  2916. "anyOf": [
  2917. {
  2918. "type": "string"
  2919. },
  2920. {
  2921. "type": "null"
  2922. }
  2923. ],
  2924. "title": "Since"
  2925. }
  2926. },
  2927. {
  2928. "name": "until",
  2929. "in": "query",
  2930. "required": false,
  2931. "schema": {
  2932. "anyOf": [
  2933. {
  2934. "type": "string"
  2935. },
  2936. {
  2937. "type": "null"
  2938. }
  2939. ],
  2940. "title": "Until"
  2941. }
  2942. },
  2943. {
  2944. "name": "department_id",
  2945. "in": "query",
  2946. "required": false,
  2947. "schema": {
  2948. "anyOf": [
  2949. {
  2950. "type": "integer"
  2951. },
  2952. {
  2953. "type": "null"
  2954. }
  2955. ],
  2956. "title": "Department Id"
  2957. }
  2958. }
  2959. ],
  2960. "responses": {
  2961. "200": {
  2962. "description": "Successful Response",
  2963. "content": {
  2964. "application/json": {
  2965. "schema": {}
  2966. }
  2967. }
  2968. },
  2969. "422": {
  2970. "description": "Validation Error",
  2971. "content": {
  2972. "application/json": {
  2973. "schema": {
  2974. "$ref": "#/components/schemas/HTTPValidationError"
  2975. }
  2976. }
  2977. }
  2978. }
  2979. }
  2980. }
  2981. },
  2982. "/api/v1/stats/export": {
  2983. "get": {
  2984. "tags": [
  2985. "统计"
  2986. ],
  2987. "summary": "Stats Export",
  2988. "description": "功能:导出授权财务明细。参数:format/时间/部门。返回:Excel或中文PDF。异常:403权限,422格式,503字体问题。",
  2989. "operationId": "stats_export_api_v1_stats_export_get",
  2990. "security": [
  2991. {
  2992. "HTTPBearer": []
  2993. }
  2994. ],
  2995. "parameters": [
  2996. {
  2997. "name": "format",
  2998. "in": "query",
  2999. "required": false,
  3000. "schema": {
  3001. "type": "string",
  3002. "pattern": "^(xlsx|pdf)$",
  3003. "default": "xlsx",
  3004. "title": "Format"
  3005. }
  3006. },
  3007. {
  3008. "name": "since",
  3009. "in": "query",
  3010. "required": false,
  3011. "schema": {
  3012. "anyOf": [
  3013. {
  3014. "type": "string"
  3015. },
  3016. {
  3017. "type": "null"
  3018. }
  3019. ],
  3020. "title": "Since"
  3021. }
  3022. },
  3023. {
  3024. "name": "until",
  3025. "in": "query",
  3026. "required": false,
  3027. "schema": {
  3028. "anyOf": [
  3029. {
  3030. "type": "string"
  3031. },
  3032. {
  3033. "type": "null"
  3034. }
  3035. ],
  3036. "title": "Until"
  3037. }
  3038. },
  3039. {
  3040. "name": "department_id",
  3041. "in": "query",
  3042. "required": false,
  3043. "schema": {
  3044. "anyOf": [
  3045. {
  3046. "type": "integer"
  3047. },
  3048. {
  3049. "type": "null"
  3050. }
  3051. ],
  3052. "title": "Department Id"
  3053. }
  3054. }
  3055. ],
  3056. "responses": {
  3057. "200": {
  3058. "description": "Successful Response",
  3059. "content": {
  3060. "application/json": {
  3061. "schema": {}
  3062. }
  3063. }
  3064. },
  3065. "422": {
  3066. "description": "Validation Error",
  3067. "content": {
  3068. "application/json": {
  3069. "schema": {
  3070. "$ref": "#/components/schemas/HTTPValidationError"
  3071. }
  3072. }
  3073. }
  3074. }
  3075. }
  3076. }
  3077. },
  3078. "/api/v1/health": {
  3079. "get": {
  3080. "tags": [
  3081. "健康"
  3082. ],
  3083. "summary": "Health",
  3084. "description": "功能:报告实际数据库和消费者状态。参数:无。返回:组件状态,无凭据。异常:503数据库不可用。",
  3085. "operationId": "health_api_v1_health_get",
  3086. "responses": {
  3087. "200": {
  3088. "description": "Successful Response",
  3089. "content": {
  3090. "application/json": {
  3091. "schema": {}
  3092. }
  3093. }
  3094. }
  3095. }
  3096. }
  3097. }
  3098. },
  3099. "components": {
  3100. "schemas": {
  3101. "Body_import_document_api_v1_knowledge_documents_import_post": {
  3102. "properties": {
  3103. "file": {
  3104. "type": "string",
  3105. "contentMediaType": "application/octet-stream",
  3106. "title": "File"
  3107. }
  3108. },
  3109. "type": "object",
  3110. "required": [
  3111. "file"
  3112. ],
  3113. "title": "Body_import_document_api_v1_knowledge_documents_import_post"
  3114. },
  3115. "Body_upload_invoices_api_v1_reimbursements__identifier__invoices_post": {
  3116. "properties": {
  3117. "revision": {
  3118. "type": "integer",
  3119. "title": "Revision"
  3120. },
  3121. "metadata": {
  3122. "type": "string",
  3123. "title": "Metadata",
  3124. "default": "[]"
  3125. },
  3126. "files": {
  3127. "items": {
  3128. "type": "string",
  3129. "contentMediaType": "application/octet-stream"
  3130. },
  3131. "type": "array",
  3132. "title": "Files"
  3133. }
  3134. },
  3135. "type": "object",
  3136. "required": [
  3137. "revision",
  3138. "files"
  3139. ],
  3140. "title": "Body_upload_invoices_api_v1_reimbursements__identifier__invoices_post"
  3141. },
  3142. "ChainBody": {
  3143. "properties": {
  3144. "name": {
  3145. "type": "string",
  3146. "maxLength": 100,
  3147. "minLength": 1,
  3148. "title": "Name",
  3149. "description": "审批链显示名"
  3150. },
  3151. "route": {
  3152. "type": "string",
  3153. "enum": [
  3154. "to_supervisor",
  3155. "to_finance",
  3156. "to_manual"
  3157. ],
  3158. "title": "Route",
  3159. "description": "对应确定性审核路由;系统批准不配置人工链"
  3160. },
  3161. "type": {
  3162. "anyOf": [
  3163. {
  3164. "type": "integer",
  3165. "enum": [
  3166. 1,
  3167. 2,
  3168. 3
  3169. ]
  3170. },
  3171. {
  3172. "type": "null"
  3173. }
  3174. ],
  3175. "title": "Type",
  3176. "description": "适用报销类型,空表示全部"
  3177. },
  3178. "department_id": {
  3179. "anyOf": [
  3180. {
  3181. "type": "integer",
  3182. "exclusiveMinimum": 0.0
  3183. },
  3184. {
  3185. "type": "null"
  3186. }
  3187. ],
  3188. "title": "Department Id",
  3189. "description": "匹配历史单据所属有效部门,空表示全部"
  3190. },
  3191. "amount_min": {
  3192. "anyOf": [
  3193. {
  3194. "type": "number"
  3195. },
  3196. {
  3197. "type": "string",
  3198. "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
  3199. },
  3200. {
  3201. "type": "null"
  3202. }
  3203. ],
  3204. "title": "Amount Min",
  3205. "description": "含税金额下限,空不限制"
  3206. },
  3207. "amount_max": {
  3208. "anyOf": [
  3209. {
  3210. "type": "number"
  3211. },
  3212. {
  3213. "type": "string",
  3214. "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
  3215. },
  3216. {
  3217. "type": "null"
  3218. }
  3219. ],
  3220. "title": "Amount Max",
  3221. "description": "含税金额上限,必须大于等于下限"
  3222. },
  3223. "priority": {
  3224. "type": "integer",
  3225. "maximum": 100.0,
  3226. "minimum": 0.0,
  3227. "title": "Priority",
  3228. "description": "同具体度链的选择优先级,越大越优先",
  3229. "default": 0
  3230. },
  3231. "nodes": {
  3232. "items": {
  3233. "$ref": "#/components/schemas/ChainNode"
  3234. },
  3235. "type": "array",
  3236. "maxItems": 10,
  3237. "minItems": 1,
  3238. "title": "Nodes",
  3239. "description": "有序且非空审批链"
  3240. },
  3241. "active": {
  3242. "type": "boolean",
  3243. "title": "Active",
  3244. "description": "仅影响新轮次,已有冻结链不替换",
  3245. "default": true
  3246. },
  3247. "expected_version": {
  3248. "anyOf": [
  3249. {
  3250. "type": "integer",
  3251. "exclusiveMinimum": 0.0
  3252. },
  3253. {
  3254. "type": "null"
  3255. }
  3256. ],
  3257. "title": "Expected Version",
  3258. "description": "更新时必填"
  3259. }
  3260. },
  3261. "additionalProperties": false,
  3262. "type": "object",
  3263. "required": [
  3264. "name",
  3265. "route",
  3266. "nodes"
  3267. ],
  3268. "title": "ChainBody"
  3269. },
  3270. "ChainNode": {
  3271. "properties": {
  3272. "approver_id": {
  3273. "type": "integer",
  3274. "exclusiveMinimum": 0.0,
  3275. "title": "Approver Id",
  3276. "description": "实际有效用户,而非角色占位符"
  3277. },
  3278. "role": {
  3279. "type": "string",
  3280. "enum": [
  3281. "supervisor",
  3282. "auditor",
  3283. "manager",
  3284. "admin"
  3285. ],
  3286. "title": "Role",
  3287. "description": "必须与指定人员当前真实身份一致"
  3288. }
  3289. },
  3290. "additionalProperties": false,
  3291. "type": "object",
  3292. "required": [
  3293. "approver_id",
  3294. "role"
  3295. ],
  3296. "title": "ChainNode"
  3297. },
  3298. "ConfigPatch": {
  3299. "properties": {
  3300. "expected_version": {
  3301. "type": "integer",
  3302. "exclusiveMinimum": 0.0,
  3303. "title": "Expected Version",
  3304. "description": "乐观并发版本,不覆盖他人的修改"
  3305. },
  3306. "enabled": {
  3307. "anyOf": [
  3308. {
  3309. "type": "boolean"
  3310. },
  3311. {
  3312. "type": "null"
  3313. }
  3314. ],
  3315. "title": "Enabled",
  3316. "description": "可选能力开关,核心规则和决策不能停用"
  3317. },
  3318. "config": {
  3319. "anyOf": [
  3320. {
  3321. "additionalProperties": true,
  3322. "type": "object"
  3323. },
  3324. {
  3325. "type": "null"
  3326. }
  3327. ],
  3328. "title": "Config",
  3329. "description": "节点白名单参数,禁止密钥或代码"
  3330. }
  3331. },
  3332. "additionalProperties": false,
  3333. "type": "object",
  3334. "required": [
  3335. "expected_version"
  3336. ],
  3337. "title": "ConfigPatch"
  3338. },
  3339. "Decide": {
  3340. "properties": {
  3341. "action": {
  3342. "type": "string",
  3343. "enum": [
  3344. "approve",
  3345. "reject",
  3346. "return"
  3347. ],
  3348. "title": "Action",
  3349. "description": "通过、驳回或退回草稿,不接受任意状态"
  3350. },
  3351. "opinion": {
  3352. "type": "string",
  3353. "maxLength": 2000,
  3354. "minLength": 2,
  3355. "title": "Opinion",
  3356. "description": "所有审批动作必须留可读意见"
  3357. }
  3358. },
  3359. "additionalProperties": false,
  3360. "type": "object",
  3361. "required": [
  3362. "action",
  3363. "opinion"
  3364. ],
  3365. "title": "Decide"
  3366. },
  3367. "DepartmentBody": {
  3368. "properties": {
  3369. "name": {
  3370. "type": "string",
  3371. "maxLength": 100,
  3372. "minLength": 1,
  3373. "title": "Name",
  3374. "description": "不重复的部门名称"
  3375. },
  3376. "active": {
  3377. "type": "boolean",
  3378. "title": "Active",
  3379. "description": "停用仅影响新业务",
  3380. "default": true
  3381. }
  3382. },
  3383. "additionalProperties": false,
  3384. "type": "object",
  3385. "required": [
  3386. "name"
  3387. ],
  3388. "title": "DepartmentBody"
  3389. },
  3390. "Feedback": {
  3391. "properties": {
  3392. "approval_record_id": {
  3393. "type": "integer",
  3394. "exclusiveMinimum": 0.0,
  3395. "title": "Approval Record Id",
  3396. "description": "本人已处理审批记录"
  3397. },
  3398. "corrected_fields": {
  3399. "additionalProperties": true,
  3400. "type": "object",
  3401. "title": "Corrected Fields",
  3402. "description": "纠正建议,不覆盖原证据"
  3403. },
  3404. "reason": {
  3405. "type": "string",
  3406. "maxLength": 2000,
  3407. "minLength": 2,
  3408. "title": "Reason",
  3409. "description": "判断依据"
  3410. }
  3411. },
  3412. "additionalProperties": false,
  3413. "type": "object",
  3414. "required": [
  3415. "approval_record_id",
  3416. "reason"
  3417. ],
  3418. "title": "Feedback"
  3419. },
  3420. "HTTPValidationError": {
  3421. "properties": {
  3422. "detail": {
  3423. "items": {
  3424. "$ref": "#/components/schemas/ValidationError"
  3425. },
  3426. "type": "array",
  3427. "title": "Detail"
  3428. }
  3429. },
  3430. "type": "object",
  3431. "title": "HTTPValidationError"
  3432. },
  3433. "InvoicePatch": {
  3434. "properties": {
  3435. "revision": {
  3436. "type": "integer",
  3437. "exclusiveMinimum": 0.0,
  3438. "title": "Revision",
  3439. "description": "所属单据当前版本"
  3440. },
  3441. "fields": {
  3442. "additionalProperties": true,
  3443. "type": "object",
  3444. "title": "Fields",
  3445. "description": "用户填报字段;缺失为未知,不伪造默认金额"
  3446. }
  3447. },
  3448. "additionalProperties": false,
  3449. "type": "object",
  3450. "required": [
  3451. "revision",
  3452. "fields"
  3453. ],
  3454. "title": "InvoicePatch"
  3455. },
  3456. "KnowledgeBody": {
  3457. "properties": {
  3458. "title": {
  3459. "type": "string",
  3460. "maxLength": 200,
  3461. "minLength": 1,
  3462. "title": "Title",
  3463. "description": "政策原文标题,用作引用出处"
  3464. },
  3465. "category": {
  3466. "type": "string",
  3467. "pattern": "^[a-zA-Z0-9_-]{1,40}$",
  3468. "title": "Category",
  3469. "description": "policy分类参与正式政策审核",
  3470. "default": "policy"
  3471. },
  3472. "content": {
  3473. "type": "string",
  3474. "maxLength": 200000,
  3475. "minLength": 1,
  3476. "title": "Content",
  3477. "description": "用户提供的政策原文"
  3478. },
  3479. "active": {
  3480. "type": "boolean",
  3481. "title": "Active",
  3482. "description": "停用原文不参与新审核检索",
  3483. "default": true
  3484. },
  3485. "expected_version": {
  3486. "anyOf": [
  3487. {
  3488. "type": "integer",
  3489. "exclusiveMinimum": 0.0
  3490. },
  3491. {
  3492. "type": "null"
  3493. }
  3494. ],
  3495. "title": "Expected Version",
  3496. "description": "修订时必须等于当前正文版本"
  3497. }
  3498. },
  3499. "additionalProperties": false,
  3500. "type": "object",
  3501. "required": [
  3502. "title",
  3503. "content"
  3504. ],
  3505. "title": "KnowledgeBody"
  3506. },
  3507. "Login": {
  3508. "properties": {
  3509. "username": {
  3510. "type": "string",
  3511. "maxLength": 50,
  3512. "minLength": 1,
  3513. "title": "Username",
  3514. "description": "已初始化登录名"
  3515. },
  3516. "password": {
  3517. "type": "string",
  3518. "maxLength": 200,
  3519. "minLength": 1,
  3520. "title": "Password",
  3521. "description": "仅传输用于校验,不写入日志"
  3522. }
  3523. },
  3524. "additionalProperties": false,
  3525. "type": "object",
  3526. "required": [
  3527. "username",
  3528. "password"
  3529. ],
  3530. "title": "Login"
  3531. },
  3532. "Opinion": {
  3533. "properties": {
  3534. "opinion": {
  3535. "type": "string",
  3536. "maxLength": 2000,
  3537. "minLength": 2,
  3538. "title": "Opinion",
  3539. "description": "处理意见,不得仅置状态无依据"
  3540. }
  3541. },
  3542. "additionalProperties": false,
  3543. "type": "object",
  3544. "required": [
  3545. "opinion"
  3546. ],
  3547. "title": "Opinion"
  3548. },
  3549. "Refresh": {
  3550. "properties": {
  3551. "refresh_token": {
  3552. "type": "string",
  3553. "maxLength": 500,
  3554. "minLength": 20,
  3555. "title": "Refresh Token",
  3556. "description": "轮换或撤销的刷新凭据"
  3557. }
  3558. },
  3559. "additionalProperties": false,
  3560. "type": "object",
  3561. "required": [
  3562. "refresh_token"
  3563. ],
  3564. "title": "Refresh"
  3565. },
  3566. "ReimbursementCreate": {
  3567. "properties": {
  3568. "title": {
  3569. "type": "string",
  3570. "maxLength": 200,
  3571. "minLength": 1,
  3572. "title": "Title",
  3573. "description": "报销目的"
  3574. },
  3575. "description": {
  3576. "type": "string",
  3577. "maxLength": 5000,
  3578. "title": "Description",
  3579. "description": "业务补充说明",
  3580. "default": ""
  3581. },
  3582. "type": {
  3583. "type": "integer",
  3584. "enum": [
  3585. 1,
  3586. 2,
  3587. 3
  3588. ],
  3589. "title": "Type",
  3590. "description": "1差旅/2招待/3办公",
  3591. "default": 1
  3592. },
  3593. "total_amount": {
  3594. "anyOf": [
  3595. {
  3596. "type": "number"
  3597. },
  3598. {
  3599. "type": "string",
  3600. "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
  3601. }
  3602. ],
  3603. "title": "Total Amount",
  3604. "description": "含税总额,以两位小数传输"
  3605. }
  3606. },
  3607. "additionalProperties": false,
  3608. "type": "object",
  3609. "required": [
  3610. "title",
  3611. "total_amount"
  3612. ],
  3613. "title": "ReimbursementCreate"
  3614. },
  3615. "ReimbursementPatch": {
  3616. "properties": {
  3617. "revision": {
  3618. "type": "integer",
  3619. "exclusiveMinimum": 0.0,
  3620. "title": "Revision",
  3621. "description": "必须等于当前可编辑版本"
  3622. },
  3623. "title": {
  3624. "anyOf": [
  3625. {
  3626. "type": "string",
  3627. "maxLength": 200,
  3628. "minLength": 1
  3629. },
  3630. {
  3631. "type": "null"
  3632. }
  3633. ],
  3634. "title": "Title",
  3635. "description": "修改业务目的,不能空字符串"
  3636. },
  3637. "description": {
  3638. "anyOf": [
  3639. {
  3640. "type": "string",
  3641. "maxLength": 5000
  3642. },
  3643. {
  3644. "type": "null"
  3645. }
  3646. ],
  3647. "title": "Description",
  3648. "description": "修订补充说明"
  3649. },
  3650. "type": {
  3651. "anyOf": [
  3652. {
  3653. "type": "integer",
  3654. "enum": [
  3655. 1,
  3656. 2,
  3657. 3
  3658. ]
  3659. },
  3660. {
  3661. "type": "null"
  3662. }
  3663. ],
  3664. "title": "Type",
  3665. "description": "修改1差旅/2招待/3办公类型,影响下一轮匹配"
  3666. },
  3667. "total_amount": {
  3668. "anyOf": [
  3669. {
  3670. "type": "number"
  3671. },
  3672. {
  3673. "type": "string",
  3674. "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
  3675. },
  3676. {
  3677. "type": "null"
  3678. }
  3679. ],
  3680. "title": "Total Amount",
  3681. "description": "修订含税额,服务层校验非负及两位精度"
  3682. }
  3683. },
  3684. "additionalProperties": false,
  3685. "type": "object",
  3686. "required": [
  3687. "revision"
  3688. ],
  3689. "title": "ReimbursementPatch"
  3690. },
  3691. "Rerun": {
  3692. "properties": {
  3693. "reason": {
  3694. "type": "string",
  3695. "maxLength": 1000,
  3696. "minLength": 2,
  3697. "title": "Reason",
  3698. "description": "重跑理由记录在审计日志"
  3699. }
  3700. },
  3701. "additionalProperties": false,
  3702. "type": "object",
  3703. "required": [
  3704. "reason"
  3705. ],
  3706. "title": "Rerun"
  3707. },
  3708. "Revision": {
  3709. "properties": {
  3710. "revision": {
  3711. "type": "integer",
  3712. "exclusiveMinimum": 0.0,
  3713. "title": "Revision",
  3714. "description": "预期单据版本,过期返回409"
  3715. }
  3716. },
  3717. "additionalProperties": false,
  3718. "type": "object",
  3719. "required": [
  3720. "revision"
  3721. ],
  3722. "title": "Revision"
  3723. },
  3724. "RulePatch": {
  3725. "properties": {
  3726. "expected_version": {
  3727. "type": "integer",
  3728. "exclusiveMinimum": 0.0,
  3729. "title": "Expected Version",
  3730. "description": "当前规则版本"
  3731. },
  3732. "enabled": {
  3733. "anyOf": [
  3734. {
  3735. "type": "boolean"
  3736. },
  3737. {
  3738. "type": "null"
  3739. }
  3740. ],
  3741. "title": "Enabled",
  3742. "description": "可选规则生效开关,核心检查不允许关闭"
  3743. },
  3744. "severity": {
  3745. "anyOf": [
  3746. {
  3747. "type": "string",
  3748. "enum": [
  3749. "warning",
  3750. "error",
  3751. "critical"
  3752. ]
  3753. },
  3754. {
  3755. "type": "null"
  3756. }
  3757. ],
  3758. "title": "Severity",
  3759. "description": "命中时的处理级别,核心严重程度有下限"
  3760. },
  3761. "params": {
  3762. "anyOf": [
  3763. {
  3764. "additionalProperties": true,
  3765. "type": "object"
  3766. },
  3767. {
  3768. "type": "null"
  3769. }
  3770. ],
  3771. "title": "Params",
  3772. "description": "白名单阈值,不接受表达式"
  3773. },
  3774. "scope": {
  3775. "anyOf": [
  3776. {
  3777. "additionalProperties": true,
  3778. "type": "object"
  3779. },
  3780. {
  3781. "type": "null"
  3782. }
  3783. ],
  3784. "title": "Scope",
  3785. "description": "可选规则的部门/类型范围"
  3786. }
  3787. },
  3788. "additionalProperties": false,
  3789. "type": "object",
  3790. "required": [
  3791. "expected_version"
  3792. ],
  3793. "title": "RulePatch"
  3794. },
  3795. "RuleTest": {
  3796. "properties": {
  3797. "invoice": {
  3798. "additionalProperties": true,
  3799. "type": "object",
  3800. "title": "Invoice",
  3801. "description": "待试算字段,不写正式审核"
  3802. },
  3803. "context": {
  3804. "additionalProperties": true,
  3805. "type": "object",
  3806. "title": "Context",
  3807. "description": "显式试算上下文,不冒充生产历史"
  3808. }
  3809. },
  3810. "additionalProperties": false,
  3811. "type": "object",
  3812. "required": [
  3813. "invoice"
  3814. ],
  3815. "title": "RuleTest"
  3816. },
  3817. "SearchBody": {
  3818. "properties": {
  3819. "query": {
  3820. "type": "string",
  3821. "maxLength": 2000,
  3822. "minLength": 1,
  3823. "title": "Query",
  3824. "description": "实际检索问题,不用作系统指令"
  3825. },
  3826. "mode": {
  3827. "type": "string",
  3828. "enum": [
  3829. "keyword",
  3830. "semantic"
  3831. ],
  3832. "title": "Mode",
  3833. "description": "显式本地词项或真实向量语义模式",
  3834. "default": "keyword"
  3835. },
  3836. "top_k": {
  3837. "type": "integer",
  3838. "maximum": 20.0,
  3839. "minimum": 1.0,
  3840. "title": "Top K",
  3841. "description": "最多返回的真实片段数量",
  3842. "default": 5
  3843. },
  3844. "category": {
  3845. "anyOf": [
  3846. {
  3847. "type": "string",
  3848. "maxLength": 40
  3849. },
  3850. {
  3851. "type": "null"
  3852. }
  3853. ],
  3854. "title": "Category",
  3855. "description": "可选分类过滤"
  3856. }
  3857. },
  3858. "additionalProperties": false,
  3859. "type": "object",
  3860. "required": [
  3861. "query"
  3862. ],
  3863. "title": "SearchBody"
  3864. },
  3865. "UserCreate": {
  3866. "properties": {
  3867. "username": {
  3868. "type": "string",
  3869. "pattern": "^[A-Za-z][A-Za-z0-9_]{2,49}$",
  3870. "title": "Username",
  3871. "description": "唯一登录名"
  3872. },
  3873. "real_name": {
  3874. "type": "string",
  3875. "maxLength": 80,
  3876. "minLength": 1,
  3877. "title": "Real Name",
  3878. "description": "真实显示名称"
  3879. },
  3880. "password": {
  3881. "type": "string",
  3882. "maxLength": 200,
  3883. "minLength": 10,
  3884. "title": "Password",
  3885. "description": "至少大小写、数字和符号"
  3886. },
  3887. "department_id": {
  3888. "type": "integer",
  3889. "exclusiveMinimum": 0.0,
  3890. "title": "Department Id",
  3891. "description": "有效部门主键"
  3892. },
  3893. "role": {
  3894. "type": "string",
  3895. "enum": [
  3896. "employee",
  3897. "supervisor",
  3898. "auditor",
  3899. "manager",
  3900. "admin"
  3901. ],
  3902. "title": "Role",
  3903. "description": "五种固定业务身份,不接受任意角色名"
  3904. }
  3905. },
  3906. "additionalProperties": false,
  3907. "type": "object",
  3908. "required": [
  3909. "username",
  3910. "real_name",
  3911. "password",
  3912. "department_id",
  3913. "role"
  3914. ],
  3915. "title": "UserCreate"
  3916. },
  3917. "UserPatch": {
  3918. "properties": {
  3919. "real_name": {
  3920. "anyOf": [
  3921. {
  3922. "type": "string",
  3923. "maxLength": 80,
  3924. "minLength": 1
  3925. },
  3926. {
  3927. "type": "null"
  3928. }
  3929. ],
  3930. "title": "Real Name",
  3931. "description": "新显示名称"
  3932. },
  3933. "department_id": {
  3934. "anyOf": [
  3935. {
  3936. "type": "integer",
  3937. "exclusiveMinimum": 0.0
  3938. },
  3939. {
  3940. "type": "null"
  3941. }
  3942. ],
  3943. "title": "Department Id",
  3944. "description": "新部门,历史单据部门不变"
  3945. },
  3946. "role": {
  3947. "anyOf": [
  3948. {
  3949. "type": "string",
  3950. "enum": [
  3951. "employee",
  3952. "supervisor",
  3953. "auditor",
  3954. "manager",
  3955. "admin"
  3956. ]
  3957. },
  3958. {
  3959. "type": "null"
  3960. }
  3961. ],
  3962. "title": "Role",
  3963. "description": "管理员授权的固定身份;禁止降级自己"
  3964. },
  3965. "active": {
  3966. "anyOf": [
  3967. {
  3968. "type": "boolean"
  3969. },
  3970. {
  3971. "type": "null"
  3972. }
  3973. ],
  3974. "title": "Active",
  3975. "description": "停用后立即拒绝现有访问令牌"
  3976. }
  3977. },
  3978. "additionalProperties": false,
  3979. "type": "object",
  3980. "title": "UserPatch"
  3981. },
  3982. "ValidationError": {
  3983. "properties": {
  3984. "loc": {
  3985. "items": {
  3986. "anyOf": [
  3987. {
  3988. "type": "string"
  3989. },
  3990. {
  3991. "type": "integer"
  3992. }
  3993. ]
  3994. },
  3995. "type": "array",
  3996. "title": "Location"
  3997. },
  3998. "msg": {
  3999. "type": "string",
  4000. "title": "Message"
  4001. },
  4002. "type": {
  4003. "type": "string",
  4004. "title": "Error Type"
  4005. },
  4006. "input": {
  4007. "title": "Input"
  4008. },
  4009. "ctx": {
  4010. "type": "object",
  4011. "title": "Context"
  4012. }
  4013. },
  4014. "type": "object",
  4015. "required": [
  4016. "loc",
  4017. "msg",
  4018. "type"
  4019. ],
  4020. "title": "ValidationError"
  4021. }
  4022. },
  4023. "securitySchemes": {
  4024. "HTTPBearer": {
  4025. "type": "http",
  4026. "description": "登录返回 access_token,Swagger Authorize 只填令牌值",
  4027. "scheme": "bearer"
  4028. }
  4029. }
  4030. }
  4031. }