| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031 |
- {
- "openapi": "3.1.0",
- "info": {
- "title": "AI-Agent 财务审计系统",
- "description": "按课程设计:四节点审核、独立反馈、持久事件与人工审批。",
- "version": "1.0.0"
- },
- "paths": {
- "/api/v1/auth/login": {
- "post": {
- "tags": [
- "认证"
- ],
- "summary": "Login",
- "description": "功能:验证密码并创建会话。参数:登录名/密码。返回:双令牌与用户。异常:401凭据错误,422参数错误。",
- "operationId": "login_api_v1_auth_login_post",
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Login"
- }
- }
- },
- "required": true
- },
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/auth/refresh": {
- "post": {
- "tags": [
- "认证"
- ],
- "summary": "Refresh",
- "description": "功能:刷新并撤销旧凭据。参数:refresh_token。返回:新双令牌。异常:401已撤销/过期/停用。",
- "operationId": "refresh_api_v1_auth_refresh_post",
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Refresh"
- }
- }
- },
- "required": true
- },
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/auth/logout": {
- "post": {
- "tags": [
- "认证"
- ],
- "summary": "Logout",
- "description": "功能:撤销本人刷新会话。参数:refresh_token。返回:撤销状态。异常:401失效,403非本人。",
- "operationId": "logout_api_v1_auth_logout_post",
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Refresh"
- }
- }
- },
- "required": true
- },
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- },
- "security": [
- {
- "HTTPBearer": []
- }
- ]
- }
- },
- "/api/v1/auth/me": {
- "get": {
- "tags": [
- "认证"
- ],
- "summary": "Me",
- "description": "功能:返回当前身份。参数:Bearer令牌。返回:无敏感字段的用户。异常:401失效或未登录。",
- "operationId": "me_api_v1_auth_me_get",
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- }
- },
- "security": [
- {
- "HTTPBearer": []
- }
- ]
- }
- },
- "/api/v1/users": {
- "get": {
- "tags": [
- "用户"
- ],
- "summary": "Users",
- "description": "功能:经理查看用户用于审批配置。参数:分页。返回:无密码用户列表。异常:403权限不足。",
- "operationId": "users_api_v1_users_get",
- "security": [
- {
- "HTTPBearer": []
- }
- ],
- "parameters": [
- {
- "name": "page",
- "in": "query",
- "required": false,
- "schema": {
- "type": "integer",
- "minimum": 1,
- "default": 1,
- "title": "Page"
- }
- },
- {
- "name": "page_size",
- "in": "query",
- "required": false,
- "schema": {
- "type": "integer",
- "maximum": 100,
- "minimum": 1,
- "default": 20,
- "title": "Page Size"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- }
- },
- "post": {
- "tags": [
- "用户"
- ],
- "summary": "Create User",
- "description": "功能:管理员创建有效用户。参数:用户/部门/角色/密码。返回:用户。异常:403权限,409重名,422弱密码。",
- "operationId": "create_user_api_v1_users_post",
- "security": [
- {
- "HTTPBearer": []
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/UserCreate"
- }
- }
- }
- },
- "responses": {
- "201": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/users/{identifier}": {
- "patch": {
- "tags": [
- "用户"
- ],
- "summary": "Patch User",
- "description": "功能:修改身份/停用。参数:ID和允许字段。返回:更新用户。异常:403权限,404不存在,409停用自己。",
- "operationId": "patch_user_api_v1_users__identifier__patch",
- "security": [
- {
- "HTTPBearer": []
- }
- ],
- "parameters": [
- {
- "name": "identifier",
- "in": "path",
- "required": true,
- "schema": {
- "type": "integer",
- "title": "Identifier"
- }
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/UserPatch"
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/departments": {
- "get": {
- "tags": [
- "部门"
- ],
- "summary": "Departments",
- "description": "功能:提供部门选项。参数:当前身份。返回:部门列表。异常:401未登录。",
- "operationId": "departments_api_v1_departments_get",
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- }
- },
- "security": [
- {
- "HTTPBearer": []
- }
- ]
- },
- "post": {
- "tags": [
- "部门"
- ],
- "summary": "Create Department",
- "description": "功能:创建部门。参数:名称/启用。返回:部门。异常:403权限,409重名。",
- "operationId": "create_department_api_v1_departments_post",
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/DepartmentBody"
- }
- }
- },
- "required": true
- },
- "responses": {
- "201": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- },
- "security": [
- {
- "HTTPBearer": []
- }
- ]
- }
- },
- "/api/v1/departments/{identifier}": {
- "patch": {
- "tags": [
- "部门"
- ],
- "summary": "Patch Department",
- "description": "功能:更名或停用。参数:ID/名称/active。返回:部门。异常:403权限,404不存在,409重名。",
- "operationId": "patch_department_api_v1_departments__identifier__patch",
- "security": [
- {
- "HTTPBearer": []
- }
- ],
- "parameters": [
- {
- "name": "identifier",
- "in": "path",
- "required": true,
- "schema": {
- "type": "integer",
- "title": "Identifier"
- }
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/DepartmentBody"
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/agents": {
- "get": {
- "tags": [
- "Agent"
- ],
- "summary": "Agents",
- "description": "功能:查看节点配置和实际统计。参数:当前身份。返回:五节点列表。异常:403权限不足。",
- "operationId": "agents_api_v1_agents_get",
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- }
- },
- "security": [
- {
- "HTTPBearer": []
- }
- ]
- }
- },
- "/api/v1/agents/{node_name}": {
- "get": {
- "tags": [
- "Agent"
- ],
- "summary": "Agent Detail",
- "description": "功能:查看节点全部版本。参数:固定节点名。返回:当前配置/历史。异常:403权限,404未知节点。",
- "operationId": "agent_detail_api_v1_agents__node_name__get",
- "security": [
- {
- "HTTPBearer": []
- }
- ],
- "parameters": [
- {
- "name": "node_name",
- "in": "path",
- "required": true,
- "schema": {
- "type": "string",
- "title": "Node Name"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- }
- },
- "patch": {
- "tags": [
- "Agent"
- ],
- "summary": "Patch Agent",
- "description": "功能:创建不可变配置版本。参数:节点/预期版本/参数。返回:新配置。异常:403权限,409版本冲突,422非法配置。",
- "operationId": "patch_agent_api_v1_agents__node_name__patch",
- "security": [
- {
- "HTTPBearer": []
- }
- ],
- "parameters": [
- {
- "name": "node_name",
- "in": "path",
- "required": true,
- "schema": {
- "type": "string",
- "title": "Node Name"
- }
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ConfigPatch"
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/agents/{node_name}/test": {
- "post": {
- "tags": [
- "Agent"
- ],
- "summary": "Test Agent",
- "description": "功能:真实连接或确定性节点测试。参数:节点名。返回:可用/降级原因。异常:403权限,404未知节点。",
- "operationId": "test_agent_api_v1_agents__node_name__test_post",
- "security": [
- {
- "HTTPBearer": []
- }
- ],
- "parameters": [
- {
- "name": "node_name",
- "in": "path",
- "required": true,
- "schema": {
- "type": "string",
- "title": "Node Name"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/rules": {
- "get": {
- "tags": [
- "规则"
- ],
- "summary": "Rules",
- "description": "功能:查看生效规则。参数:分页/code/enabled。返回:最新版本列表。异常:403权限不足。",
- "operationId": "rules_api_v1_rules_get",
- "security": [
- {
- "HTTPBearer": []
- }
- ],
- "parameters": [
- {
- "name": "page",
- "in": "query",
- "required": false,
- "schema": {
- "type": "integer",
- "minimum": 1,
- "default": 1,
- "title": "Page"
- }
- },
- {
- "name": "page_size",
- "in": "query",
- "required": false,
- "schema": {
- "type": "integer",
- "maximum": 100,
- "minimum": 1,
- "default": 20,
- "title": "Page Size"
- }
- },
- {
- "name": "code",
- "in": "query",
- "required": false,
- "schema": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Code"
- }
- },
- {
- "name": "enabled",
- "in": "query",
- "required": false,
- "schema": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ],
- "title": "Enabled"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/rules/{code}": {
- "get": {
- "tags": [
- "规则"
- ],
- "summary": "Rule Detail",
- "description": "功能:追踪规则历史。参数:规则code。返回:当前及所有版本。异常:403权限,404未知规则。",
- "operationId": "rule_detail_api_v1_rules__code__get",
- "security": [
- {
- "HTTPBearer": []
- }
- ],
- "parameters": [
- {
- "name": "code",
- "in": "path",
- "required": true,
- "schema": {
- "type": "string",
- "title": "Code"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- }
- },
- "patch": {
- "tags": [
- "规则"
- ],
- "summary": "Patch Rule",
- "description": "功能:保存规则新版本。参数:预期版本/参数/范围/开关。返回:新版本。异常:403权限,409并发,422核心检查绕过。",
- "operationId": "patch_rule_api_v1_rules__code__patch",
- "security": [
- {
- "HTTPBearer": []
- }
- ],
- "parameters": [
- {
- "name": "code",
- "in": "path",
- "required": true,
- "schema": {
- "type": "string",
- "title": "Code"
- }
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/RulePatch"
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/rules/{code}/test": {
- "post": {
- "tags": [
- "规则"
- ],
- "summary": "Test Rule",
- "description": "功能:独立试算不改变正式结果。参数:invoice/context。返回:规则证据。异常:403权限,404规则,422上下文非法。",
- "operationId": "test_rule_api_v1_rules__code__test_post",
- "security": [
- {
- "HTTPBearer": []
- }
- ],
- "parameters": [
- {
- "name": "code",
- "in": "path",
- "required": true,
- "schema": {
- "type": "string",
- "title": "Code"
- }
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/RuleTest"
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/reimbursements": {
- "get": {
- "tags": [
- "报销"
- ],
- "summary": "Reimbursements",
- "description": "功能:按授权范围列单。参数:分页/状态/类型。返回:报销分页。异常:401未登录,422非法分页。",
- "operationId": "reimbursements_api_v1_reimbursements_get",
- "security": [
- {
- "HTTPBearer": []
- }
- ],
- "parameters": [
- {
- "name": "page",
- "in": "query",
- "required": false,
- "schema": {
- "type": "integer",
- "minimum": 1,
- "default": 1,
- "title": "Page"
- }
- },
- {
- "name": "page_size",
- "in": "query",
- "required": false,
- "schema": {
- "type": "integer",
- "maximum": 100,
- "minimum": 1,
- "default": 20,
- "title": "Page Size"
- }
- },
- {
- "name": "status",
- "in": "query",
- "required": false,
- "schema": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Status"
- }
- },
- {
- "name": "type",
- "in": "query",
- "required": false,
- "schema": {
- "anyOf": [
- {
- "type": "integer"
- },
- {
- "type": "null"
- }
- ],
- "title": "Type"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- }
- },
- "post": {
- "tags": [
- "报销"
- ],
- "summary": "Create Reimbursement",
- "description": "功能:创建本人草稿。参数:标题/类型/含税额。返回:草稿。异常:422金额,409序号耗尽。",
- "operationId": "create_reimbursement_api_v1_reimbursements_post",
- "security": [
- {
- "HTTPBearer": []
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ReimbursementCreate"
- }
- }
- }
- },
- "responses": {
- "201": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/reimbursements/{identifier}": {
- "get": {
- "tags": [
- "报销"
- ],
- "summary": "Reimbursement Detail",
- "description": "功能:查看单据全历史。参数:ID。返回:发票/审核/审批。异常:403无权,404不存在。",
- "operationId": "reimbursement_detail_api_v1_reimbursements__identifier__get",
- "security": [
- {
- "HTTPBearer": []
- }
- ],
- "parameters": [
- {
- "name": "identifier",
- "in": "path",
- "required": true,
- "schema": {
- "type": "integer",
- "title": "Identifier"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- }
- },
- "patch": {
- "tags": [
- "报销"
- ],
- "summary": "Patch Reimbursement",
- "description": "功能:修改本人可编辑单。参数:revision及业务字段。返回:新版本。异常:403所有权,409状态/版本,422金额。",
- "operationId": "patch_reimbursement_api_v1_reimbursements__identifier__patch",
- "security": [
- {
- "HTTPBearer": []
- }
- ],
- "parameters": [
- {
- "name": "identifier",
- "in": "path",
- "required": true,
- "schema": {
- "type": "integer",
- "title": "Identifier"
- }
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ReimbursementPatch"
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/reimbursements/{identifier}/invoices": {
- "post": {
- "tags": [
- "发票"
- ],
- "summary": "Upload Invoices",
- "description": "功能:逐文件上传并流式留痕。参数:multipart files/revision/metadata数组。返回:SSE真实进度。异常:前置403/409/422;流内error含部分成功ID。",
- "operationId": "upload_invoices_api_v1_reimbursements__identifier__invoices_post",
- "security": [
- {
- "HTTPBearer": []
- }
- ],
- "parameters": [
- {
- "name": "identifier",
- "in": "path",
- "required": true,
- "schema": {
- "type": "integer",
- "title": "Identifier"
- }
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "multipart/form-data": {
- "schema": {
- "$ref": "#/components/schemas/Body_upload_invoices_api_v1_reimbursements__identifier__invoices_post"
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/invoices/{identifier}": {
- "patch": {
- "tags": [
- "发票"
- ],
- "summary": "Patch Invoice",
- "description": "功能:用户补录未知字段。参数:ID/单据revision/fields。返回:发票与新revision。异常:403非本人,409状态,422字段。",
- "operationId": "patch_invoice_api_v1_invoices__identifier__patch",
- "security": [
- {
- "HTTPBearer": []
- }
- ],
- "parameters": [
- {
- "name": "identifier",
- "in": "path",
- "required": true,
- "schema": {
- "type": "integer",
- "title": "Identifier"
- }
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/InvoicePatch"
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- }
- },
- "delete": {
- "tags": [
- "发票"
- ],
- "summary": "Delete Invoice",
- "description": "功能:从可编辑单移除发票并保留历史证据。参数:ID/revision。返回:新版本。异常:403/404/409。",
- "operationId": "delete_invoice_api_v1_invoices__identifier__delete",
- "security": [
- {
- "HTTPBearer": []
- }
- ],
- "parameters": [
- {
- "name": "identifier",
- "in": "path",
- "required": true,
- "schema": {
- "type": "integer",
- "title": "Identifier"
- }
- },
- {
- "name": "revision",
- "in": "query",
- "required": true,
- "schema": {
- "type": "integer",
- "minimum": 1,
- "title": "Revision"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/invoices/{identifier}/file": {
- "get": {
- "tags": [
- "发票"
- ],
- "summary": "Download Invoice",
- "description": "功能:按所有权读取原始文件。参数:ID。返回:文件流。异常:403权限,404文件不存在;不接受磁盘路径。",
- "operationId": "download_invoice_api_v1_invoices__identifier__file_get",
- "security": [
- {
- "HTTPBearer": []
- }
- ],
- "parameters": [
- {
- "name": "identifier",
- "in": "path",
- "required": true,
- "schema": {
- "type": "integer",
- "title": "Identifier"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/reimbursements/{identifier}/submit": {
- "post": {
- "tags": [
- "报销"
- ],
- "summary": "Submit",
- "description": "功能:异步提交。参数:revision/Idempotency-Key。返回:202审核ID。异常:403所有权,409版本/活动任务,422无发票。",
- "operationId": "submit_api_v1_reimbursements__identifier__submit_post",
- "security": [
- {
- "HTTPBearer": []
- }
- ],
- "parameters": [
- {
- "name": "identifier",
- "in": "path",
- "required": true,
- "schema": {
- "type": "integer",
- "title": "Identifier"
- }
- },
- {
- "name": "Idempotency-Key",
- "in": "header",
- "required": true,
- "schema": {
- "type": "string",
- "minLength": 8,
- "maxLength": 80,
- "title": "Idempotency-Key"
- }
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Revision"
- }
- }
- }
- },
- "responses": {
- "202": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/reimbursements/{identifier}/withdraw": {
- "post": {
- "tags": [
- "报销"
- ],
- "summary": "Withdraw",
- "description": "功能:撤回待审单使旧任务失效。参数:ID/revision。返回:终态。异常:403非本人,409非待审核/过期版本。",
- "operationId": "withdraw_api_v1_reimbursements__identifier__withdraw_post",
- "security": [
- {
- "HTTPBearer": []
- }
- ],
- "parameters": [
- {
- "name": "identifier",
- "in": "path",
- "required": true,
- "schema": {
- "type": "integer",
- "title": "Identifier"
- }
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Revision"
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/audit": {
- "get": {
- "tags": [
- "审核"
- ],
- "summary": "Audits",
- "description": "功能:列出有权查看的历史审核。参数:状态/风险/决策/单据/分页。返回:审核分页。异常:401身份。",
- "operationId": "audits_api_v1_audit_get",
- "security": [
- {
- "HTTPBearer": []
- }
- ],
- "parameters": [
- {
- "name": "page",
- "in": "query",
- "required": false,
- "schema": {
- "type": "integer",
- "minimum": 1,
- "default": 1,
- "title": "Page"
- }
- },
- {
- "name": "page_size",
- "in": "query",
- "required": false,
- "schema": {
- "type": "integer",
- "maximum": 100,
- "minimum": 1,
- "default": 20,
- "title": "Page Size"
- }
- },
- {
- "name": "status",
- "in": "query",
- "required": false,
- "schema": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Status"
- }
- },
- {
- "name": "risk_level",
- "in": "query",
- "required": false,
- "schema": {
- "anyOf": [
- {
- "type": "integer"
- },
- {
- "type": "null"
- }
- ],
- "title": "Risk Level"
- }
- },
- {
- "name": "decision",
- "in": "query",
- "required": false,
- "schema": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Decision"
- }
- },
- {
- "name": "reimbursement_id",
- "in": "query",
- "required": false,
- "schema": {
- "anyOf": [
- {
- "type": "integer"
- },
- {
- "type": "null"
- }
- ],
- "title": "Reimbursement Id"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/audit/{identifier}": {
- "get": {
- "tags": [
- "审核"
- ],
- "summary": "Get Audit",
- "description": "功能:完整证据与版本详情。参数:审核ID。返回:快照/节点/规则/反馈。异常:403无权,404不存在。",
- "operationId": "get_audit_api_v1_audit__identifier__get",
- "security": [
- {
- "HTTPBearer": []
- }
- ],
- "parameters": [
- {
- "name": "identifier",
- "in": "path",
- "required": true,
- "schema": {
- "type": "integer",
- "title": "Identifier"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/audit/{identifier}/events": {
- "get": {
- "tags": [
- "审核"
- ],
- "summary": "Audit Events",
- "description": "功能:实时审核进度。参数:ID/Last-Event-ID。返回:SSE节点/完成/失败/心跳。异常:前置403/404;断线用详情恢复。",
- "operationId": "audit_events_api_v1_audit__identifier__events_get",
- "security": [
- {
- "HTTPBearer": []
- }
- ],
- "parameters": [
- {
- "name": "identifier",
- "in": "path",
- "required": true,
- "schema": {
- "type": "integer",
- "title": "Identifier"
- }
- },
- {
- "name": "Last-Event-ID",
- "in": "header",
- "required": false,
- "schema": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Last-Event-Id"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/audit/{identifier}/rerun": {
- "post": {
- "tags": [
- "审核"
- ],
- "summary": "Rerun",
- "description": "功能:授权重跑保留旧结果。参数:审核ID/理由/幂等键。返回:新审核ID。异常:403权限,409终态/在途审批。",
- "operationId": "rerun_api_v1_audit__identifier__rerun_post",
- "security": [
- {
- "HTTPBearer": []
- }
- ],
- "parameters": [
- {
- "name": "identifier",
- "in": "path",
- "required": true,
- "schema": {
- "type": "integer",
- "title": "Identifier"
- }
- },
- {
- "name": "Idempotency-Key",
- "in": "header",
- "required": true,
- "schema": {
- "type": "string",
- "minLength": 8,
- "maxLength": 80,
- "title": "Idempotency-Key"
- }
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Rerun"
- }
- }
- }
- },
- "responses": {
- "202": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/audit/{identifier}/feedback": {
- "post": {
- "tags": [
- "反馈"
- ],
- "summary": "Feedback",
- "description": "功能:人工审批后独立反馈。参数:已处理审批ID/纠正/理由。返回:反馈及迭代建议。异常:403非签署人,409轮次不匹配。",
- "operationId": "feedback_api_v1_audit__identifier__feedback_post",
- "security": [
- {
- "HTTPBearer": []
- }
- ],
- "parameters": [
- {
- "name": "identifier",
- "in": "path",
- "required": true,
- "schema": {
- "type": "integer",
- "title": "Identifier"
- }
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Feedback"
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/approvals/chains": {
- "get": {
- "tags": [
- "审批链"
- ],
- "summary": "Chains",
- "description": "功能:查看链配置。参数:分页。返回:审批链列表。异常:403经理权限不足。",
- "operationId": "chains_api_v1_approvals_chains_get",
- "security": [
- {
- "HTTPBearer": []
- }
- ],
- "parameters": [
- {
- "name": "page",
- "in": "query",
- "required": false,
- "schema": {
- "type": "integer",
- "minimum": 1,
- "default": 1,
- "title": "Page"
- }
- },
- {
- "name": "page_size",
- "in": "query",
- "required": false,
- "schema": {
- "type": "integer",
- "maximum": 100,
- "minimum": 1,
- "default": 20,
- "title": "Page Size"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- }
- },
- "post": {
- "tags": [
- "审批链"
- ],
- "summary": "Create Chain",
- "description": "功能:创建匹配条件与顺序链。参数:route/范围/nodes。返回:链配置。异常:403权限,422非法人员或金额范围。",
- "operationId": "create_chain_api_v1_approvals_chains_post",
- "security": [
- {
- "HTTPBearer": []
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ChainBody"
- }
- }
- }
- },
- "responses": {
- "201": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/approvals/chains/{identifier}": {
- "patch": {
- "tags": [
- "审批链"
- ],
- "summary": "Patch Chain",
- "description": "功能:更新下一轮链配置。参数:ID/expected_version/完整链。返回:新版本。异常:403、404、409版本、422非法链。",
- "operationId": "patch_chain_api_v1_approvals_chains__identifier__patch",
- "security": [
- {
- "HTTPBearer": []
- }
- ],
- "parameters": [
- {
- "name": "identifier",
- "in": "path",
- "required": true,
- "schema": {
- "type": "integer",
- "title": "Identifier"
- }
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ChainBody"
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/approvals": {
- "get": {
- "tags": [
- "审批"
- ],
- "summary": "Approvals",
- "description": "功能:查看本人待办与授权历史。参数:pending/单据/分页。返回:记录与关联信息。异常:401身份。",
- "operationId": "approvals_api_v1_approvals_get",
- "security": [
- {
- "HTTPBearer": []
- }
- ],
- "parameters": [
- {
- "name": "page",
- "in": "query",
- "required": false,
- "schema": {
- "type": "integer",
- "minimum": 1,
- "default": 1,
- "title": "Page"
- }
- },
- {
- "name": "page_size",
- "in": "query",
- "required": false,
- "schema": {
- "type": "integer",
- "maximum": 100,
- "minimum": 1,
- "default": 20,
- "title": "Page Size"
- }
- },
- {
- "name": "pending",
- "in": "query",
- "required": false,
- "schema": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ],
- "title": "Pending"
- }
- },
- {
- "name": "reimbursement_id",
- "in": "query",
- "required": false,
- "schema": {
- "anyOf": [
- {
- "type": "integer"
- },
- {
- "type": "null"
- }
- ],
- "title": "Reimbursement Id"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/approvals/{identifier}/decide": {
- "post": {
- "tags": [
- "审批"
- ],
- "summary": "Approval Decision",
- "description": "功能:处理指定审批并原子推进下一棒。参数:ID/action/opinion。返回:记录/轮次/单据。异常:403自审/非指定人,409重签。",
- "operationId": "approval_decision_api_v1_approvals__identifier__decide_post",
- "security": [
- {
- "HTTPBearer": []
- }
- ],
- "parameters": [
- {
- "name": "identifier",
- "in": "path",
- "required": true,
- "schema": {
- "type": "integer",
- "title": "Identifier"
- }
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Decide"
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/knowledge/documents/import": {
- "post": {
- "tags": [
- "知识库"
- ],
- "summary": "Import Document",
- "description": "功能:导入真实文本政策。参数:UTF-8 txt/md文件。返回:政策和索引状态。异常:403权限,422文件类型/大小/编码。",
- "operationId": "import_document_api_v1_knowledge_documents_import_post",
- "requestBody": {
- "content": {
- "multipart/form-data": {
- "schema": {
- "$ref": "#/components/schemas/Body_import_document_api_v1_knowledge_documents_import_post"
- }
- }
- },
- "required": true
- },
- "responses": {
- "201": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- },
- "security": [
- {
- "HTTPBearer": []
- }
- ]
- }
- },
- "/api/v1/knowledge/documents": {
- "get": {
- "tags": [
- "知识库"
- ],
- "summary": "Documents",
- "description": "功能:阅读政策与索引状态。参数:分页。返回:含正文政策列表。异常:401未登录。",
- "operationId": "documents_api_v1_knowledge_documents_get",
- "security": [
- {
- "HTTPBearer": []
- }
- ],
- "parameters": [
- {
- "name": "page",
- "in": "query",
- "required": false,
- "schema": {
- "type": "integer",
- "minimum": 1,
- "default": 1,
- "title": "Page"
- }
- },
- {
- "name": "page_size",
- "in": "query",
- "required": false,
- "schema": {
- "type": "integer",
- "maximum": 100,
- "minimum": 1,
- "default": 20,
- "title": "Page Size"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- }
- },
- "post": {
- "tags": [
- "知识库"
- ],
- "summary": "Create Document",
- "description": "功能:保存用户制度原文并分块。参数:标题/分类/正文。返回:未索引文档。异常:403权限,422正文不合法。",
- "operationId": "create_document_api_v1_knowledge_documents_post",
- "security": [
- {
- "HTTPBearer": []
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/KnowledgeBody"
- }
- }
- }
- },
- "responses": {
- "201": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/knowledge/documents/{identifier}": {
- "patch": {
- "tags": [
- "知识库"
- ],
- "summary": "Patch Document",
- "description": "功能:修订正文使旧向量失效。参数:ID/预期版本/正文。返回:新版本。异常:403权限,404不存在,409并发。",
- "operationId": "patch_document_api_v1_knowledge_documents__identifier__patch",
- "security": [
- {
- "HTTPBearer": []
- }
- ],
- "parameters": [
- {
- "name": "identifier",
- "in": "path",
- "required": true,
- "schema": {
- "type": "integer",
- "title": "Identifier"
- }
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/KnowledgeBody"
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/knowledge/documents/{identifier}/reindex": {
- "post": {
- "tags": [
- "知识库"
- ],
- "summary": "Reindex Document",
- "description": "功能:排队真实向量化。参数:文档ID。返回:索引任务ID。异常:403权限,404不存在,409已有任务,503无模型。",
- "operationId": "reindex_document_api_v1_knowledge_documents__identifier__reindex_post",
- "security": [
- {
- "HTTPBearer": []
- }
- ],
- "parameters": [
- {
- "name": "identifier",
- "in": "path",
- "required": true,
- "schema": {
- "type": "integer",
- "title": "Identifier"
- }
- }
- ],
- "responses": {
- "202": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/knowledge/search": {
- "post": {
- "tags": [
- "知识库"
- ],
- "summary": "Search",
- "description": "功能:显式关键词/语义试验。参数:query/mode/top_k/category。返回:模式及原文出处。异常:503真实向量不可用。",
- "operationId": "search_api_v1_knowledge_search_post",
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/SearchBody"
- }
- }
- },
- "required": true
- },
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- },
- "security": [
- {
- "HTTPBearer": []
- }
- ]
- }
- },
- "/api/v1/logs/export": {
- "get": {
- "tags": [
- "日志"
- ],
- "summary": "Logs Export",
- "description": "功能:导出授权日志。参数:与列表相同筛选。返回:UTF-8 BOM CSV。异常:403权限,422时间格式。",
- "operationId": "logs_export_api_v1_logs_export_get",
- "security": [
- {
- "HTTPBearer": []
- }
- ],
- "parameters": [
- {
- "name": "action",
- "in": "query",
- "required": false,
- "schema": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Action"
- }
- },
- {
- "name": "trace",
- "in": "query",
- "required": false,
- "schema": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Trace"
- }
- },
- {
- "name": "actor_id",
- "in": "query",
- "required": false,
- "schema": {
- "anyOf": [
- {
- "type": "integer"
- },
- {
- "type": "null"
- }
- ],
- "title": "Actor Id"
- }
- },
- {
- "name": "resource",
- "in": "query",
- "required": false,
- "schema": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Resource"
- }
- },
- {
- "name": "since",
- "in": "query",
- "required": false,
- "schema": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Since"
- }
- },
- {
- "name": "until",
- "in": "query",
- "required": false,
- "schema": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Until"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/logs": {
- "get": {
- "tags": [
- "日志"
- ],
- "summary": "Logs",
- "description": "功能:按人/动作/资源/追踪查证。参数:筛选和分页。返回:只读日志。异常:403权限,422时间格式。",
- "operationId": "logs_api_v1_logs_get",
- "security": [
- {
- "HTTPBearer": []
- }
- ],
- "parameters": [
- {
- "name": "page",
- "in": "query",
- "required": false,
- "schema": {
- "type": "integer",
- "minimum": 1,
- "default": 1,
- "title": "Page"
- }
- },
- {
- "name": "page_size",
- "in": "query",
- "required": false,
- "schema": {
- "type": "integer",
- "maximum": 100,
- "minimum": 1,
- "default": 20,
- "title": "Page Size"
- }
- },
- {
- "name": "action",
- "in": "query",
- "required": false,
- "schema": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Action"
- }
- },
- {
- "name": "trace",
- "in": "query",
- "required": false,
- "schema": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Trace"
- }
- },
- {
- "name": "actor_id",
- "in": "query",
- "required": false,
- "schema": {
- "anyOf": [
- {
- "type": "integer"
- },
- {
- "type": "null"
- }
- ],
- "title": "Actor Id"
- }
- },
- {
- "name": "resource",
- "in": "query",
- "required": false,
- "schema": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Resource"
- }
- },
- {
- "name": "since",
- "in": "query",
- "required": false,
- "schema": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Since"
- }
- },
- {
- "name": "until",
- "in": "query",
- "required": false,
- "schema": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Until"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/alerts": {
- "get": {
- "tags": [
- "告警"
- ],
- "summary": "Alerts",
- "description": "功能:查询授权告警。参数:状态/严重度/类型/分页。返回:持久告警。异常:403权限不足。",
- "operationId": "alerts_api_v1_alerts_get",
- "security": [
- {
- "HTTPBearer": []
- }
- ],
- "parameters": [
- {
- "name": "page",
- "in": "query",
- "required": false,
- "schema": {
- "type": "integer",
- "minimum": 1,
- "default": 1,
- "title": "Page"
- }
- },
- {
- "name": "page_size",
- "in": "query",
- "required": false,
- "schema": {
- "type": "integer",
- "maximum": 100,
- "minimum": 1,
- "default": 20,
- "title": "Page Size"
- }
- },
- {
- "name": "status",
- "in": "query",
- "required": false,
- "schema": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Status"
- }
- },
- {
- "name": "severity",
- "in": "query",
- "required": false,
- "schema": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Severity"
- }
- },
- {
- "name": "type",
- "in": "query",
- "required": false,
- "schema": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Type"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/alerts/{identifier}/acknowledge": {
- "post": {
- "tags": [
- "告警"
- ],
- "summary": "Acknowledge",
- "description": "功能:确认异常负责人。参数:ID/意见。返回:已确认告警。异常:403范围,404不存在,409已处理。",
- "operationId": "acknowledge_api_v1_alerts__identifier__acknowledge_post",
- "security": [
- {
- "HTTPBearer": []
- }
- ],
- "parameters": [
- {
- "name": "identifier",
- "in": "path",
- "required": true,
- "schema": {
- "type": "integer",
- "title": "Identifier"
- }
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Opinion"
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/alerts/{identifier}/resolve": {
- "post": {
- "tags": [
- "告警"
- ],
- "summary": "Resolve",
- "description": "功能:记录告警处理完成。参数:ID/意见。返回:已解决告警,原风险不变。异常:403范围,409未确认。",
- "operationId": "resolve_api_v1_alerts__identifier__resolve_post",
- "security": [
- {
- "HTTPBearer": []
- }
- ],
- "parameters": [
- {
- "name": "identifier",
- "in": "path",
- "required": true,
- "schema": {
- "type": "integer",
- "title": "Identifier"
- }
- }
- ],
- "requestBody": {
- "required": true,
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/Opinion"
- }
- }
- }
- },
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/stats/overview": {
- "get": {
- "tags": [
- "统计"
- ],
- "summary": "Overview",
- "description": "功能:实时授权统计。参数:时间/部门。返回:数量、金额、状态、风险、部门。异常:401身份,422时间。",
- "operationId": "overview_api_v1_stats_overview_get",
- "security": [
- {
- "HTTPBearer": []
- }
- ],
- "parameters": [
- {
- "name": "since",
- "in": "query",
- "required": false,
- "schema": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Since"
- }
- },
- {
- "name": "until",
- "in": "query",
- "required": false,
- "schema": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Until"
- }
- },
- {
- "name": "department_id",
- "in": "query",
- "required": false,
- "schema": {
- "anyOf": [
- {
- "type": "integer"
- },
- {
- "type": "null"
- }
- ],
- "title": "Department Id"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/stats/export": {
- "get": {
- "tags": [
- "统计"
- ],
- "summary": "Stats Export",
- "description": "功能:导出授权财务明细。参数:format/时间/部门。返回:Excel或中文PDF。异常:403权限,422格式,503字体问题。",
- "operationId": "stats_export_api_v1_stats_export_get",
- "security": [
- {
- "HTTPBearer": []
- }
- ],
- "parameters": [
- {
- "name": "format",
- "in": "query",
- "required": false,
- "schema": {
- "type": "string",
- "pattern": "^(xlsx|pdf)$",
- "default": "xlsx",
- "title": "Format"
- }
- },
- {
- "name": "since",
- "in": "query",
- "required": false,
- "schema": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Since"
- }
- },
- {
- "name": "until",
- "in": "query",
- "required": false,
- "schema": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Until"
- }
- },
- {
- "name": "department_id",
- "in": "query",
- "required": false,
- "schema": {
- "anyOf": [
- {
- "type": "integer"
- },
- {
- "type": "null"
- }
- ],
- "title": "Department Id"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "422": {
- "description": "Validation Error",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- }
- }
- }
- }
- },
- "/api/v1/health": {
- "get": {
- "tags": [
- "健康"
- ],
- "summary": "Health",
- "description": "功能:报告实际数据库和消费者状态。参数:无。返回:组件状态,无凭据。异常:503数据库不可用。",
- "operationId": "health_api_v1_health_get",
- "responses": {
- "200": {
- "description": "Successful Response",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- }
- }
- }
- }
- },
- "components": {
- "schemas": {
- "Body_import_document_api_v1_knowledge_documents_import_post": {
- "properties": {
- "file": {
- "type": "string",
- "contentMediaType": "application/octet-stream",
- "title": "File"
- }
- },
- "type": "object",
- "required": [
- "file"
- ],
- "title": "Body_import_document_api_v1_knowledge_documents_import_post"
- },
- "Body_upload_invoices_api_v1_reimbursements__identifier__invoices_post": {
- "properties": {
- "revision": {
- "type": "integer",
- "title": "Revision"
- },
- "metadata": {
- "type": "string",
- "title": "Metadata",
- "default": "[]"
- },
- "files": {
- "items": {
- "type": "string",
- "contentMediaType": "application/octet-stream"
- },
- "type": "array",
- "title": "Files"
- }
- },
- "type": "object",
- "required": [
- "revision",
- "files"
- ],
- "title": "Body_upload_invoices_api_v1_reimbursements__identifier__invoices_post"
- },
- "ChainBody": {
- "properties": {
- "name": {
- "type": "string",
- "maxLength": 100,
- "minLength": 1,
- "title": "Name",
- "description": "审批链显示名"
- },
- "route": {
- "type": "string",
- "enum": [
- "to_supervisor",
- "to_finance",
- "to_manual"
- ],
- "title": "Route",
- "description": "对应确定性审核路由;系统批准不配置人工链"
- },
- "type": {
- "anyOf": [
- {
- "type": "integer",
- "enum": [
- 1,
- 2,
- 3
- ]
- },
- {
- "type": "null"
- }
- ],
- "title": "Type",
- "description": "适用报销类型,空表示全部"
- },
- "department_id": {
- "anyOf": [
- {
- "type": "integer",
- "exclusiveMinimum": 0.0
- },
- {
- "type": "null"
- }
- ],
- "title": "Department Id",
- "description": "匹配历史单据所属有效部门,空表示全部"
- },
- "amount_min": {
- "anyOf": [
- {
- "type": "number"
- },
- {
- "type": "string",
- "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
- },
- {
- "type": "null"
- }
- ],
- "title": "Amount Min",
- "description": "含税金额下限,空不限制"
- },
- "amount_max": {
- "anyOf": [
- {
- "type": "number"
- },
- {
- "type": "string",
- "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
- },
- {
- "type": "null"
- }
- ],
- "title": "Amount Max",
- "description": "含税金额上限,必须大于等于下限"
- },
- "priority": {
- "type": "integer",
- "maximum": 100.0,
- "minimum": 0.0,
- "title": "Priority",
- "description": "同具体度链的选择优先级,越大越优先",
- "default": 0
- },
- "nodes": {
- "items": {
- "$ref": "#/components/schemas/ChainNode"
- },
- "type": "array",
- "maxItems": 10,
- "minItems": 1,
- "title": "Nodes",
- "description": "有序且非空审批链"
- },
- "active": {
- "type": "boolean",
- "title": "Active",
- "description": "仅影响新轮次,已有冻结链不替换",
- "default": true
- },
- "expected_version": {
- "anyOf": [
- {
- "type": "integer",
- "exclusiveMinimum": 0.0
- },
- {
- "type": "null"
- }
- ],
- "title": "Expected Version",
- "description": "更新时必填"
- }
- },
- "additionalProperties": false,
- "type": "object",
- "required": [
- "name",
- "route",
- "nodes"
- ],
- "title": "ChainBody"
- },
- "ChainNode": {
- "properties": {
- "approver_id": {
- "type": "integer",
- "exclusiveMinimum": 0.0,
- "title": "Approver Id",
- "description": "实际有效用户,而非角色占位符"
- },
- "role": {
- "type": "string",
- "enum": [
- "supervisor",
- "auditor",
- "manager",
- "admin"
- ],
- "title": "Role",
- "description": "必须与指定人员当前真实身份一致"
- }
- },
- "additionalProperties": false,
- "type": "object",
- "required": [
- "approver_id",
- "role"
- ],
- "title": "ChainNode"
- },
- "ConfigPatch": {
- "properties": {
- "expected_version": {
- "type": "integer",
- "exclusiveMinimum": 0.0,
- "title": "Expected Version",
- "description": "乐观并发版本,不覆盖他人的修改"
- },
- "enabled": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ],
- "title": "Enabled",
- "description": "可选能力开关,核心规则和决策不能停用"
- },
- "config": {
- "anyOf": [
- {
- "additionalProperties": true,
- "type": "object"
- },
- {
- "type": "null"
- }
- ],
- "title": "Config",
- "description": "节点白名单参数,禁止密钥或代码"
- }
- },
- "additionalProperties": false,
- "type": "object",
- "required": [
- "expected_version"
- ],
- "title": "ConfigPatch"
- },
- "Decide": {
- "properties": {
- "action": {
- "type": "string",
- "enum": [
- "approve",
- "reject",
- "return"
- ],
- "title": "Action",
- "description": "通过、驳回或退回草稿,不接受任意状态"
- },
- "opinion": {
- "type": "string",
- "maxLength": 2000,
- "minLength": 2,
- "title": "Opinion",
- "description": "所有审批动作必须留可读意见"
- }
- },
- "additionalProperties": false,
- "type": "object",
- "required": [
- "action",
- "opinion"
- ],
- "title": "Decide"
- },
- "DepartmentBody": {
- "properties": {
- "name": {
- "type": "string",
- "maxLength": 100,
- "minLength": 1,
- "title": "Name",
- "description": "不重复的部门名称"
- },
- "active": {
- "type": "boolean",
- "title": "Active",
- "description": "停用仅影响新业务",
- "default": true
- }
- },
- "additionalProperties": false,
- "type": "object",
- "required": [
- "name"
- ],
- "title": "DepartmentBody"
- },
- "Feedback": {
- "properties": {
- "approval_record_id": {
- "type": "integer",
- "exclusiveMinimum": 0.0,
- "title": "Approval Record Id",
- "description": "本人已处理审批记录"
- },
- "corrected_fields": {
- "additionalProperties": true,
- "type": "object",
- "title": "Corrected Fields",
- "description": "纠正建议,不覆盖原证据"
- },
- "reason": {
- "type": "string",
- "maxLength": 2000,
- "minLength": 2,
- "title": "Reason",
- "description": "判断依据"
- }
- },
- "additionalProperties": false,
- "type": "object",
- "required": [
- "approval_record_id",
- "reason"
- ],
- "title": "Feedback"
- },
- "HTTPValidationError": {
- "properties": {
- "detail": {
- "items": {
- "$ref": "#/components/schemas/ValidationError"
- },
- "type": "array",
- "title": "Detail"
- }
- },
- "type": "object",
- "title": "HTTPValidationError"
- },
- "InvoicePatch": {
- "properties": {
- "revision": {
- "type": "integer",
- "exclusiveMinimum": 0.0,
- "title": "Revision",
- "description": "所属单据当前版本"
- },
- "fields": {
- "additionalProperties": true,
- "type": "object",
- "title": "Fields",
- "description": "用户填报字段;缺失为未知,不伪造默认金额"
- }
- },
- "additionalProperties": false,
- "type": "object",
- "required": [
- "revision",
- "fields"
- ],
- "title": "InvoicePatch"
- },
- "KnowledgeBody": {
- "properties": {
- "title": {
- "type": "string",
- "maxLength": 200,
- "minLength": 1,
- "title": "Title",
- "description": "政策原文标题,用作引用出处"
- },
- "category": {
- "type": "string",
- "pattern": "^[a-zA-Z0-9_-]{1,40}$",
- "title": "Category",
- "description": "policy分类参与正式政策审核",
- "default": "policy"
- },
- "content": {
- "type": "string",
- "maxLength": 200000,
- "minLength": 1,
- "title": "Content",
- "description": "用户提供的政策原文"
- },
- "active": {
- "type": "boolean",
- "title": "Active",
- "description": "停用原文不参与新审核检索",
- "default": true
- },
- "expected_version": {
- "anyOf": [
- {
- "type": "integer",
- "exclusiveMinimum": 0.0
- },
- {
- "type": "null"
- }
- ],
- "title": "Expected Version",
- "description": "修订时必须等于当前正文版本"
- }
- },
- "additionalProperties": false,
- "type": "object",
- "required": [
- "title",
- "content"
- ],
- "title": "KnowledgeBody"
- },
- "Login": {
- "properties": {
- "username": {
- "type": "string",
- "maxLength": 50,
- "minLength": 1,
- "title": "Username",
- "description": "已初始化登录名"
- },
- "password": {
- "type": "string",
- "maxLength": 200,
- "minLength": 1,
- "title": "Password",
- "description": "仅传输用于校验,不写入日志"
- }
- },
- "additionalProperties": false,
- "type": "object",
- "required": [
- "username",
- "password"
- ],
- "title": "Login"
- },
- "Opinion": {
- "properties": {
- "opinion": {
- "type": "string",
- "maxLength": 2000,
- "minLength": 2,
- "title": "Opinion",
- "description": "处理意见,不得仅置状态无依据"
- }
- },
- "additionalProperties": false,
- "type": "object",
- "required": [
- "opinion"
- ],
- "title": "Opinion"
- },
- "Refresh": {
- "properties": {
- "refresh_token": {
- "type": "string",
- "maxLength": 500,
- "minLength": 20,
- "title": "Refresh Token",
- "description": "轮换或撤销的刷新凭据"
- }
- },
- "additionalProperties": false,
- "type": "object",
- "required": [
- "refresh_token"
- ],
- "title": "Refresh"
- },
- "ReimbursementCreate": {
- "properties": {
- "title": {
- "type": "string",
- "maxLength": 200,
- "minLength": 1,
- "title": "Title",
- "description": "报销目的"
- },
- "description": {
- "type": "string",
- "maxLength": 5000,
- "title": "Description",
- "description": "业务补充说明",
- "default": ""
- },
- "type": {
- "type": "integer",
- "enum": [
- 1,
- 2,
- 3
- ],
- "title": "Type",
- "description": "1差旅/2招待/3办公",
- "default": 1
- },
- "total_amount": {
- "anyOf": [
- {
- "type": "number"
- },
- {
- "type": "string",
- "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
- }
- ],
- "title": "Total Amount",
- "description": "含税总额,以两位小数传输"
- }
- },
- "additionalProperties": false,
- "type": "object",
- "required": [
- "title",
- "total_amount"
- ],
- "title": "ReimbursementCreate"
- },
- "ReimbursementPatch": {
- "properties": {
- "revision": {
- "type": "integer",
- "exclusiveMinimum": 0.0,
- "title": "Revision",
- "description": "必须等于当前可编辑版本"
- },
- "title": {
- "anyOf": [
- {
- "type": "string",
- "maxLength": 200,
- "minLength": 1
- },
- {
- "type": "null"
- }
- ],
- "title": "Title",
- "description": "修改业务目的,不能空字符串"
- },
- "description": {
- "anyOf": [
- {
- "type": "string",
- "maxLength": 5000
- },
- {
- "type": "null"
- }
- ],
- "title": "Description",
- "description": "修订补充说明"
- },
- "type": {
- "anyOf": [
- {
- "type": "integer",
- "enum": [
- 1,
- 2,
- 3
- ]
- },
- {
- "type": "null"
- }
- ],
- "title": "Type",
- "description": "修改1差旅/2招待/3办公类型,影响下一轮匹配"
- },
- "total_amount": {
- "anyOf": [
- {
- "type": "number"
- },
- {
- "type": "string",
- "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
- },
- {
- "type": "null"
- }
- ],
- "title": "Total Amount",
- "description": "修订含税额,服务层校验非负及两位精度"
- }
- },
- "additionalProperties": false,
- "type": "object",
- "required": [
- "revision"
- ],
- "title": "ReimbursementPatch"
- },
- "Rerun": {
- "properties": {
- "reason": {
- "type": "string",
- "maxLength": 1000,
- "minLength": 2,
- "title": "Reason",
- "description": "重跑理由记录在审计日志"
- }
- },
- "additionalProperties": false,
- "type": "object",
- "required": [
- "reason"
- ],
- "title": "Rerun"
- },
- "Revision": {
- "properties": {
- "revision": {
- "type": "integer",
- "exclusiveMinimum": 0.0,
- "title": "Revision",
- "description": "预期单据版本,过期返回409"
- }
- },
- "additionalProperties": false,
- "type": "object",
- "required": [
- "revision"
- ],
- "title": "Revision"
- },
- "RulePatch": {
- "properties": {
- "expected_version": {
- "type": "integer",
- "exclusiveMinimum": 0.0,
- "title": "Expected Version",
- "description": "当前规则版本"
- },
- "enabled": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ],
- "title": "Enabled",
- "description": "可选规则生效开关,核心检查不允许关闭"
- },
- "severity": {
- "anyOf": [
- {
- "type": "string",
- "enum": [
- "warning",
- "error",
- "critical"
- ]
- },
- {
- "type": "null"
- }
- ],
- "title": "Severity",
- "description": "命中时的处理级别,核心严重程度有下限"
- },
- "params": {
- "anyOf": [
- {
- "additionalProperties": true,
- "type": "object"
- },
- {
- "type": "null"
- }
- ],
- "title": "Params",
- "description": "白名单阈值,不接受表达式"
- },
- "scope": {
- "anyOf": [
- {
- "additionalProperties": true,
- "type": "object"
- },
- {
- "type": "null"
- }
- ],
- "title": "Scope",
- "description": "可选规则的部门/类型范围"
- }
- },
- "additionalProperties": false,
- "type": "object",
- "required": [
- "expected_version"
- ],
- "title": "RulePatch"
- },
- "RuleTest": {
- "properties": {
- "invoice": {
- "additionalProperties": true,
- "type": "object",
- "title": "Invoice",
- "description": "待试算字段,不写正式审核"
- },
- "context": {
- "additionalProperties": true,
- "type": "object",
- "title": "Context",
- "description": "显式试算上下文,不冒充生产历史"
- }
- },
- "additionalProperties": false,
- "type": "object",
- "required": [
- "invoice"
- ],
- "title": "RuleTest"
- },
- "SearchBody": {
- "properties": {
- "query": {
- "type": "string",
- "maxLength": 2000,
- "minLength": 1,
- "title": "Query",
- "description": "实际检索问题,不用作系统指令"
- },
- "mode": {
- "type": "string",
- "enum": [
- "keyword",
- "semantic"
- ],
- "title": "Mode",
- "description": "显式本地词项或真实向量语义模式",
- "default": "keyword"
- },
- "top_k": {
- "type": "integer",
- "maximum": 20.0,
- "minimum": 1.0,
- "title": "Top K",
- "description": "最多返回的真实片段数量",
- "default": 5
- },
- "category": {
- "anyOf": [
- {
- "type": "string",
- "maxLength": 40
- },
- {
- "type": "null"
- }
- ],
- "title": "Category",
- "description": "可选分类过滤"
- }
- },
- "additionalProperties": false,
- "type": "object",
- "required": [
- "query"
- ],
- "title": "SearchBody"
- },
- "UserCreate": {
- "properties": {
- "username": {
- "type": "string",
- "pattern": "^[A-Za-z][A-Za-z0-9_]{2,49}$",
- "title": "Username",
- "description": "唯一登录名"
- },
- "real_name": {
- "type": "string",
- "maxLength": 80,
- "minLength": 1,
- "title": "Real Name",
- "description": "真实显示名称"
- },
- "password": {
- "type": "string",
- "maxLength": 200,
- "minLength": 10,
- "title": "Password",
- "description": "至少大小写、数字和符号"
- },
- "department_id": {
- "type": "integer",
- "exclusiveMinimum": 0.0,
- "title": "Department Id",
- "description": "有效部门主键"
- },
- "role": {
- "type": "string",
- "enum": [
- "employee",
- "supervisor",
- "auditor",
- "manager",
- "admin"
- ],
- "title": "Role",
- "description": "五种固定业务身份,不接受任意角色名"
- }
- },
- "additionalProperties": false,
- "type": "object",
- "required": [
- "username",
- "real_name",
- "password",
- "department_id",
- "role"
- ],
- "title": "UserCreate"
- },
- "UserPatch": {
- "properties": {
- "real_name": {
- "anyOf": [
- {
- "type": "string",
- "maxLength": 80,
- "minLength": 1
- },
- {
- "type": "null"
- }
- ],
- "title": "Real Name",
- "description": "新显示名称"
- },
- "department_id": {
- "anyOf": [
- {
- "type": "integer",
- "exclusiveMinimum": 0.0
- },
- {
- "type": "null"
- }
- ],
- "title": "Department Id",
- "description": "新部门,历史单据部门不变"
- },
- "role": {
- "anyOf": [
- {
- "type": "string",
- "enum": [
- "employee",
- "supervisor",
- "auditor",
- "manager",
- "admin"
- ]
- },
- {
- "type": "null"
- }
- ],
- "title": "Role",
- "description": "管理员授权的固定身份;禁止降级自己"
- },
- "active": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ],
- "title": "Active",
- "description": "停用后立即拒绝现有访问令牌"
- }
- },
- "additionalProperties": false,
- "type": "object",
- "title": "UserPatch"
- },
- "ValidationError": {
- "properties": {
- "loc": {
- "items": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "integer"
- }
- ]
- },
- "type": "array",
- "title": "Location"
- },
- "msg": {
- "type": "string",
- "title": "Message"
- },
- "type": {
- "type": "string",
- "title": "Error Type"
- },
- "input": {
- "title": "Input"
- },
- "ctx": {
- "type": "object",
- "title": "Context"
- }
- },
- "type": "object",
- "required": [
- "loc",
- "msg",
- "type"
- ],
- "title": "ValidationError"
- }
- },
- "securitySchemes": {
- "HTTPBearer": {
- "type": "http",
- "description": "登录返回 access_token,Swagger Authorize 只填令牌值",
- "scheme": "bearer"
- }
- }
- }
- }
|