openapi.yaml 366 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099
  1. openapi: 3.1.0
  2. info:
  3. title: klt-bos
  4. version: 0.1.0
  5. description: |
  6. 恪澜通运营支撑扩展微服务(klt-bos)。
  7. 统一请求信封:`{ "data": { … } }`;统一响应信封:`{ code, message, error_code?, data }`。
  8. 业务错误码段 60000–60999(注意:2026-11-07 平台新口径:`60000` 以前平台已保留 ⇒
  9. 原 20000–20999 **整体 +40000 平移**,块结构与段内顺位不变;这是第二次对外契约破坏性平移)。
  10. 本服务**产出**的数字码落在该段内;唯一在册例外=**鉴权失败类透传平台原码**:
  11. 未认证 `11000`、无权限 `11001`(业主 2026-11-07 裁定=不收段,含平台 SDK 鉴权闸门
  12. 在本进程内产出的响应,业务侧不得改写)。其余平台通用码(11100/11103/11104/10110)
  13. 仍由 `S` 段自造码承接,平台原码在 `message` 原文保留。
  14. 通用块 60000–60049(`S` 段):`KLT-S407`/60001 通用冲突、`KLT-S20002`/11000 未认证(透传)、
  15. `KLT-S20003`/11001 无权限(透传)、`KLT-S20004`/60004 参数缺失或格式错误、`KLT-S20005`/60005 对象不存在、
  16. `KLT-S20006`/60006 下游依赖失败、`KLT-S20007`/60007 内部错误、`KLT-S20008`/60008 功能未实现;
  17. 角色档拒绝 `KLT-P301`/60058(路由级 AC 已放行、但本服务 `require_roles` 细粒度角色档拦下,
  18. ⛔ 与网关授权层 `11001` 混用:`11001`=路由 catalog 未绑键/授权层拦下,`60058`=本服务角色档拒下);
  19. 设计口径码 `KLT-T2xx`(发号=第 1 册 07-业务错误码;`error_code`=代码,`code`=数字,与通用族 `KLT-S2xxxx` 并行且⛔ 混用):
  20. `KLT-T201`/60068 名称已存在(运营商/运营团队/运维团队名称在同一区域范围内重复,忽略大小写与首尾空白)、
  21. `KLT-T216`/60095 负责范围与**同类**其他主体交叉(报文带对方名称+冲突区域/客户清单;异类可并存;内置「总部·不限区域」豁免)、
  22. `KLT-T222`/60076 操作过于频繁(激活预校验与激活限流,⛔ 锁定账号)、
  23. `KLT-T223`/60077 新密码不能与原密码相同、
  24. `KLT-T224`/60089 同省份下已存在同品牌运营商档案(省份 × 品牌唯一)、
  25. `KLT-T225`/60090 运营商档案的所属区域必须是省级节点(本码⛔ 挂其他档案,业主 D-OR-15 定案)、
  26. `KLT-T226`/60091 合伙人名称全站唯一(⚠️ 数字 `60091` 在设计册 07 册登记给**未实现**的 `KLT-T215`「所挂运维团队不存在」⇒ 设计册数字归属待同步)、
  27. `KLT-T227`/60096 负责范围同请求内祖先+子孙混选(整单⛔ 落库)。
  28. ⚠️ 设计册在册但本服务**无抛点**(⇒ ⛔ 进上表、⛔ 挂 `x-error-codes`,否则契约谎称会下发):`KLT-T202`/60069、`KLT-T203`/60070、`KLT-T211`/60071、`KLT-T212`/60072、`KLT-T213`/60073、`KLT-T214`/60074、`KLT-T215`/60091(`error.rs` 无该变体);`KLT-T221`/60075(`error.rs` 只声明变体,业务链路⛔ 抛出)。
  29. 注意:`KLT-*` 字符串不随段位改名(对外稳定契约)⇒ 字符串内嵌数字与 `code` 已脱钩。
  30. 成功码沿用平台统一值 10000。调用方断言**只绑** `error_code`(`KLT-*`),不绑数字顺位。
  31. 判权/判成功口径(RG-12 裁定):本服务经网关**一律以 HTTP 200 返回、结果只体现在信封 `code`**,
  32. 调用方⛔ 据 HTTP 状态判成败/判权限;权限拒绝按层取码——授权/认证层 `11001`、本服务角色档 `60058`。
  33. 经网关对外前缀:`/api/klt/klt-bos/{resource}/{action}@v1`(本文件路径不含 namespace 前缀;
  34. 前缀口径=注册中心 `services/registry.rs:707` `format!("/api/{namespace}/{service_name}{path}")`,
  35. ⇒ namespace=`klt` + service_name=`klt-bos`。注意:此前写成的 `/api/klt/bos/` 系**前缀漂移**,
  36. 若本服务以 `prefix_mode=strip_prefix` 注册会被剥掉一段而全链路 404(平台 v1.5 件 §2.4)。)
  37. 分页约定:请求页码 0 基;呈现时再转为 1 基。
  38. x-error-code-range:
  39. start: 60000
  40. end: 60999
  41. servers:
  42. - url: /
  43. tags:
  44. - name: 系统健康
  45. description: 服务存活与状态探测,不含业务写操作。
  46. - name: 认证与激活
  47. description: 当前登录上下文查询;免登录的激活码校验与密码设置。
  48. - name: 区域管理
  49. description: 区域树节点新建、改名、删除与可见范围查询。
  50. - name: 账号管理
  51. description: 账号开通、状态、激活码、改密与客户分账号。
  52. - name: 运营商
  53. description: 运营商建档与对账账号。
  54. - name: 合伙人
  55. description: 合伙人建档、负责范围读写。
  56. - name: 运营团队
  57. description: 运营团队(ent_team)档案、成员与负责范围。
  58. - name: 运维团队与成员
  59. description: 运维团队建档、成员、分派方式、覆盖客户与成员范围。
  60. - name: 客户管理
  61. description: 客户建档、改挂区域、归属变更与变更历史。
  62. - name: 批量导入
  63. description: 客户批量导入模板、提交、批次、续传与导出。
  64. - name: 交付现状
  65. description: 在册资源一览与导出(讨论稿§7.7:客户详情页签、订阅详情当前资源、门户摘要三处共用台账取数)
  66. - name: 套餐档位
  67. description: 固定/自定义套餐档位维护。
  68. - name: 合同
  69. description: 合同新建、编辑与查询(含服务条目与 IP 条件)。
  70. - name: 订阅
  71. description: 订阅开通、升降配、叠加与查询。
  72. - name: 成本与分成
  73. description: 成本项定义、成本金额与分成规则。
  74. - name: 运维视图
  75. description: 运维侧只读首页概览。
  76. - name: 定时作业
  77. description: 已注册作业清单、启停、执行记录与补跑。
  78. - name: 工单与开停交付
  79. description: 工单列表/详情/分派/回填/终态/材料与闭环配置(第5册§6)
  80. - name: 竣工与回执
  81. description: 竣工回传文件生成与运营商回执确认(第5册§6.5)
  82. - name: 报文人工处置
  83. description: 运营商报文待处置队列、挂接并生效、作废、冲突确认与改挂(第5册§6.6)
  84. paths:
  85. /health:
  86. get:
  87. summary: 健康检查
  88. description: 服务存活探测,无需登录。
  89. operationId: health
  90. tags:
  91. - 系统健康
  92. x-require-auth: false
  93. x-resource-type:
  94. $ref: '#/components/x-resource-types/health/code'
  95. x-action:
  96. $ref: '#/components/x-actions/view/code'
  97. x-version: v1
  98. x-permission-visibility: catalog
  99. x-error-codes: []
  100. responses:
  101. "200":
  102. description: 成功。统一信封 code/message/data
  103. /health@v1:
  104. get:
  105. summary: 健康检查(v1)
  106. description: 服务存活探测,无需登录。
  107. operationId: health_v1
  108. tags:
  109. - 系统健康
  110. x-require-auth: false
  111. x-resource-type:
  112. $ref: '#/components/x-resource-types/health/code'
  113. x-action:
  114. $ref: '#/components/x-actions/view/code'
  115. x-version: v1
  116. x-permission-visibility: catalog
  117. x-error-codes: []
  118. responses:
  119. "200":
  120. description: 成功。统一信封 code/message/data
  121. /ping@v1:
  122. get:
  123. summary: 存活探测
  124. description: 需登录的轻量探测,返回服务状态与绑定信息。
  125. operationId: ping
  126. tags:
  127. - 系统健康
  128. x-require-auth: true
  129. x-resource-type:
  130. $ref: '#/components/x-resource-types/ping/code'
  131. x-action:
  132. $ref: '#/components/x-actions/view/code'
  133. x-version: v1
  134. x-permission-visibility: catalog
  135. x-error-codes: []
  136. responses:
  137. "200":
  138. description: 成功。统一信封 code/message/data
  139. /auth/context@v1:
  140. get:
  141. summary: 当前登录上下文
  142. description: 返回当前登录身份、业务角色、主体类型/ID、可见形态等;首次业务请求在此完成未激活/已过期拦截。
  143. operationId: auth_context
  144. tags:
  145. - 认证与激活
  146. x-require-auth: true
  147. x-resource-type:
  148. $ref: '#/components/x-resource-types/auth/code'
  149. x-action:
  150. $ref: '#/components/x-actions/view/code'
  151. x-version: v1
  152. x-permission-visibility: catalog
  153. x-error-codes: []
  154. responses:
  155. "200":
  156. description: 成功。统一信封 code/message/data
  157. /region/create@v1:
  158. post:
  159. summary: 新建区域节点
  160. description: 在区域树下新建省/市/区县节点。admin 任意层级;区域运营主/子账号仅限本团队负责范围内已有省份下建市/区县。
  161. operationId: region_create
  162. tags:
  163. - 区域管理
  164. x-require-auth: true
  165. x-resource-type:
  166. $ref: '#/components/x-resource-types/region/code'
  167. x-action:
  168. $ref: '#/components/x-actions/create/code'
  169. x-version: v1
  170. x-permission-visibility: catalog
  171. requestBody:
  172. required: true
  173. description: JSON 请求体,业务字段置于 data
  174. content:
  175. application/json:
  176. schema:
  177. type: object
  178. description: 统一信封请求体,业务字段放在 data 内
  179. properties:
  180. data:
  181. type: object
  182. description: 新建区域参数
  183. properties:
  184. parent_node_id:
  185. type: string
  186. description: 父节点 ID,必填;区域树根由平台建立,业务侧不自行挂根
  187. node_name:
  188. type: string
  189. description: 本级区域名称,同父唯一
  190. level:
  191. type: string
  192. enum: [省, 市, 区县]
  193. description: 业务侧自持层级,必填且不得按平台 depth 推导
  194. required:
  195. - parent_node_id
  196. - node_name
  197. - level
  198. required:
  199. - data
  200. x-error-codes: [60058, 60059, 60060, 60063, 60087]
  201. responses:
  202. "200":
  203. description: 成功。统一信封 code/message/data
  204. /region/rename@v1:
  205. post:
  206. summary: 重命名区域节点
  207. description: 仅修改节点名称 node_name,不改层级与父子关系。
  208. operationId: region_rename
  209. tags:
  210. - 区域管理
  211. x-require-auth: true
  212. x-resource-type:
  213. $ref: '#/components/x-resource-types/region/code'
  214. x-action:
  215. $ref: '#/components/x-actions/update/code'
  216. x-version: v1
  217. x-permission-visibility: catalog
  218. requestBody:
  219. required: true
  220. description: JSON 请求体,业务字段置于 data
  221. content:
  222. application/json:
  223. schema:
  224. type: object
  225. description: 统一信封请求体,业务字段放在 data 内
  226. properties:
  227. data:
  228. type: object
  229. description: 业务参数
  230. properties:
  231. node_id:
  232. type: string
  233. description: 区域节点 ID
  234. node_name:
  235. type: string
  236. description: 新名称
  237. required:
  238. - node_id
  239. - node_name
  240. required:
  241. - data
  242. x-error-codes: [60058, 60060, 60063]
  243. responses:
  244. "200":
  245. description: 成功。统一信封 code/message/data
  246. /region/delete@v1:
  247. post:
  248. summary: 删除区域节点
  249. description: 仅 admin。须提交 confirm_name(与当前区域名逐字一致)并通过三重守卫(无下级/无挂载客户/无引用)。
  250. operationId: region_delete
  251. tags:
  252. - 区域管理
  253. x-require-auth: true
  254. x-resource-type:
  255. $ref: '#/components/x-resource-types/region/code'
  256. x-action:
  257. $ref: '#/components/x-actions/delete/code'
  258. x-version: v1
  259. x-permission-visibility: catalog
  260. requestBody:
  261. required: true
  262. description: JSON 请求体,业务字段置于 data
  263. content:
  264. application/json:
  265. schema:
  266. type: object
  267. description: 统一信封请求体,业务字段放在 data 内
  268. properties:
  269. data:
  270. type: object
  271. description: 业务参数
  272. properties:
  273. node_id:
  274. type: string
  275. description: 待删除区域节点 ID
  276. confirm_name:
  277. type: string
  278. description: 确认名称,须与当前区域名逐字一致
  279. required:
  280. - node_id
  281. - confirm_name
  282. required:
  283. - data
  284. x-error-codes: [60058, 60063]
  285. responses:
  286. "200":
  287. description: 成功。统一信封 code/message/data
  288. /region/tree@v1:
  289. post:
  290. summary: 查询可见区域树
  291. description: 按操作人可见范围返回区域节点集合/树;运营主/子账号只见本范围及下级。注意:2026-11-08 由 GET 改 POST(R-5:GET 无请求体,网关无法注入授权上界)。
  292. operationId: region_tree
  293. tags:
  294. - 区域管理
  295. x-require-auth: true
  296. x-resource-type:
  297. $ref: '#/components/x-resource-types/region/code'
  298. x-action:
  299. $ref: '#/components/x-actions/view/code'
  300. x-version: v1
  301. x-permission-visibility: catalog
  302. x-enumeration-kind: tree
  303. requestBody:
  304. required: true
  305. description: 统一信封请求体(无业务参数,data 传空对象以使网关注入授权上界)
  306. content:
  307. application/json:
  308. schema:
  309. type: object
  310. properties:
  311. data:
  312. type: object
  313. description: 无业务参数
  314. required:
  315. - data
  316. x-error-codes: [60063]
  317. responses:
  318. "200":
  319. description: 成功。统一信封 code/message/data
  320. /region/subtree@v1:
  321. post:
  322. summary: 查询区域子树
  323. description: 挂载弹窗左树、区域钻取共用;按可见范围裁剪。
  324. operationId: region_subtree
  325. tags:
  326. - 区域管理
  327. x-require-auth: true
  328. x-resource-type:
  329. $ref: '#/components/x-resource-types/region/code'
  330. x-action:
  331. $ref: '#/components/x-actions/view/code'
  332. x-version: v1
  333. x-permission-visibility: catalog
  334. # 工单回件 §5.2 B1(2026-11-08):operation 级 x-enumeration-kind 是作者侧唯一的真源列举标记,
  335. # 注册中心折叠为 scope_config.POST.source_enumeration 后 AC 才回传授权上界、网关才注入
  336. # (手写 x-scope.source_enumeration 会被注册中心拒,registry.rs:510-528)。
  337. # 标 tree 的依据:本路由可见集=区域资源树授权子集——handler 已消费通道②
  338. # (region.rs tree_inner → ScopedSelect::visible_region_node_ids,scoped_select.rs:120 优先取
  339. # 网关注入实例)。注意:2026-11-08 R-5 裁决:同源 /region/tree@v1 已由 GET 改 POST 并同样标
  340. # tree(GET 无请求体,网关无法注入授权上界;改 POST 后 data 传空对象即可触发注入)。
  341. x-enumeration-kind: tree
  342. requestBody:
  343. required: true
  344. description: JSON 请求体,业务字段置于 data
  345. content:
  346. application/json:
  347. schema:
  348. type: object
  349. description: 统一信封请求体,业务字段放在 data 内
  350. properties:
  351. data:
  352. type: object
  353. description: 子树查询参数
  354. properties:
  355. node_id:
  356. type: string
  357. description: 根节点 ID(可选;空则按可见根展开)
  358. required:
  359. - data
  360. x-error-codes: [60063]
  361. responses:
  362. "200":
  363. description: 成功。统一信封 code/message/data
  364. /region/change_log@v1:
  365. get:
  366. summary: 区域变更流水
  367. description: 仅 admin 可见;运营子账号可见节点但不可见变更流水。
  368. operationId: region_change_log
  369. tags:
  370. - 区域管理
  371. x-require-auth: true
  372. x-resource-type:
  373. $ref: '#/components/x-resource-types/region/code'
  374. x-action:
  375. $ref: '#/components/x-actions/view/code'
  376. x-version: v1
  377. x-permission-visibility: catalog
  378. x-error-codes: [60058, 60063]
  379. responses:
  380. "200":
  381. description: 成功。统一信封 code/message/data
  382. /region/orphans@v1:
  383. post:
  384. summary: 悬空区域节点
  385. description: 查询悬空/孤儿节点;按节点所在区域分派可见性,admin 全量。注意:2026-11-08 由 GET 改 POST(R-5)。
  386. operationId: region_orphans
  387. tags:
  388. - 区域管理
  389. x-require-auth: true
  390. x-resource-type:
  391. $ref: '#/components/x-resource-types/region/code'
  392. x-action:
  393. $ref: '#/components/x-actions/view/code'
  394. x-version: v1
  395. x-permission-visibility: catalog
  396. x-enumeration-kind: tree
  397. requestBody:
  398. required: true
  399. description: 统一信封请求体(无业务参数,data 传空对象以使网关注入授权上界)
  400. content:
  401. application/json:
  402. schema:
  403. type: object
  404. properties:
  405. data:
  406. type: object
  407. description: 无业务参数
  408. required:
  409. - data
  410. x-error-codes: [60063]
  411. responses:
  412. "200":
  413. description: 成功。统一信封 code/message/data
  414. /account/get_list@v1:
  415. post:
  416. summary: 成员账号列表
  417. description: 列登录名/手机号(掩码)/角色/主体/主-子账号标记/启停状态,并下发激活码生命周期(交付、激活、设密时间与有效截止日)。`status`=账号启停(`bos_user_binding.status`),`activation_status`=激活态(`bos_account_ext.status`),两者正交。运维侧全量,团队侧限本团队成员。注意:「姓名」列无数据源(`bos_user_binding` 无该列),见总则§18.3。
  418. operationId: account_get_list
  419. tags:
  420. - 账号管理
  421. x-require-auth: true
  422. x-resource-type:
  423. $ref: '#/components/x-resource-types/account/code'
  424. x-action:
  425. $ref: '#/components/x-actions/list/code'
  426. x-version: v1
  427. x-permission-visibility: catalog
  428. requestBody:
  429. required: false
  430. description: 分页与过滤(page/page_size/keyword/role_code/subject_type/subject_id/status/activation_status),业务字段置于 data
  431. content:
  432. application/json:
  433. schema:
  434. type: object
  435. x-error-codes: [60001, 60053, 60054, 60077, 60082]
  436. responses:
  437. "200":
  438. description: 成功。统一信封 code/message/data
  439. /ent_team/get_list@v1:
  440. post:
  441. summary: 运营团队列表
  442. description: 一条团队带负责人登录名、成员数与成员明细(`members[]`,含 `name`/`display_name`/`username`、账号启停 `binding_status` 与可承接工单类型 `ticket_types`,主/子账号一并下发);仅 admin/opsMain/opsSub。
  443. operationId: ent_team_get_list
  444. tags:
  445. - 运营团队
  446. x-require-auth: true
  447. x-resource-type:
  448. $ref: '#/components/x-resource-types/ent_team/code'
  449. x-action:
  450. $ref: '#/components/x-actions/list/code'
  451. x-version: v1
  452. x-permission-visibility: catalog
  453. requestBody:
  454. required: false
  455. description: 分页与过滤(page/page_size/keyword),业务字段置于 data
  456. content:
  457. application/json:
  458. schema:
  459. type: object
  460. x-error-codes: [60053, 60054, 60068]
  461. responses:
  462. "200":
  463. description: 成功。统一信封 code/message/data
  464. /ops_team/get_list@v1:
  465. post:
  466. summary: 运维团队列表
  467. description: 一页列出全部团队,带可分配工单类型、成员数与派单/结算口径。两列负载(未完成工单/超期未完成)与成员级 open_tickets 均已内联真值(批量一次算全部团队);取数失败才回 null+顶层 load_pending/member_load_pending,不回落 0。
  468. operationId: ops_team_get_list
  469. tags:
  470. - 运维团队
  471. x-require-auth: true
  472. x-resource-type:
  473. $ref: '#/components/x-resource-types/ops_team/code'
  474. x-action:
  475. $ref: '#/components/x-actions/list/code'
  476. x-version: v1
  477. x-permission-visibility: catalog
  478. requestBody:
  479. required: false
  480. description: 分页与过滤(page/page_size/keyword/region_node_id),业务字段置于 data
  481. content:
  482. application/json:
  483. schema:
  484. type: object
  485. x-error-codes: [60053, 60054, 60068, 60082]
  486. responses:
  487. "200":
  488. description: 成功。统一信封 code/message/data
  489. /audit/get_list@v1:
  490. post:
  491. summary: 审计日志检索
  492. description: SC-04 六列(时间/操作人/操作类型/对象/变更前/变更后);时间倒序+(occurred_at,id) 游标,不用 OFFSET。数据取自 bos_audit_log,各业务写口(含 /audit/export@v1)均写留痕;响应附 audit_read_ready/audit_write_ready/cursor_usable 三个诚实标记。
  493. operationId: audit_get_list
  494. tags:
  495. - 审计日志
  496. x-require-auth: true
  497. x-resource-type:
  498. $ref: '#/components/x-resource-types/audit/code'
  499. x-action:
  500. $ref: '#/components/x-actions/list/code'
  501. x-version: v1
  502. x-permission-visibility: catalog
  503. requestBody:
  504. required: false
  505. description: 游标与检索条件(cursor/page_size/object_type/object_ref/actor_user_id/occurred_from/occurred_to/keyword),业务字段置于 data
  506. content:
  507. application/json:
  508. schema:
  509. type: object
  510. x-error-codes: [60053]
  511. responses:
  512. "200":
  513. description: 成功。统一信封 code/message/data
  514. /audit/export@v1:
  515. post:
  516. summary: 审计日志导出
  517. description: 'SC-04 导出(第10册§6.3):入参与 /audit/get_list@v1 逐字同构(同一份 DTO、同一段可见范围谓词),不接受 row_ids[];CSV(UTF-8 带 BOM)首行为 `#` 说明行(导出时刻+筛选条件逐项回显+文件行数/同一谓词命中总数+范围裁剪声明);行数上限 20000,超限 KLT-R20903(detail.row_count/detail.limit)且不产文件、不写审计、不落 OSS;产出成功写 object_type=audit_export 留痕,留痕失败 KLT-S405。仅运营侧(admin/opsMain/opsSub)。'
  518. operationId: audit_export
  519. tags:
  520. - 审计日志
  521. x-require-auth: true
  522. x-resource-type:
  523. $ref: '#/components/x-resource-types/audit/code'
  524. x-action:
  525. $ref: '#/components/x-actions/export/code'
  526. x-version: v1
  527. x-permission-visibility: catalog
  528. requestBody:
  529. required: false
  530. description: 与 /audit/get_list@v1 同构的筛选条件(cursor/page_size 不参与导出)
  531. content:
  532. application/json:
  533. schema:
  534. type: object
  535. x-error-codes: [60903, 60905]
  536. responses:
  537. "200":
  538. description: 成功。统一信封 code/message/data;data={file_name, oss_key, row_count, limit, truncated:false}
  539. /account/provision@v1:
  540. post:
  541. summary: 开通账号
  542. description: 四入口共用开通管线。唯一性守卫(登录名/手机号)先于平台调用;角色与主体须一致。
  543. operationId: account_provision
  544. tags:
  545. - 账号管理
  546. x-require-auth: true
  547. x-resource-type:
  548. $ref: '#/components/x-resource-types/account/code'
  549. x-action:
  550. $ref: '#/components/x-actions/create/code'
  551. x-version: v1
  552. x-permission-visibility: catalog
  553. requestBody:
  554. required: true
  555. description: JSON 请求体,业务字段置于 data
  556. content:
  557. application/json:
  558. schema:
  559. type: object
  560. description: 统一信封请求体,业务字段放在 data 内
  561. properties:
  562. data:
  563. type: object
  564. description: 业务参数
  565. properties:
  566. username:
  567. type: string
  568. description: 登录名(归一化后全站唯一)
  569. role_code:
  570. type: string
  571. description: 业务角色码
  572. subject_type:
  573. type: string
  574. description: 主体类型(operator/partner/ent_team/ops_team/customer 等)
  575. subject_id:
  576. type: string
  577. description: 主体 ID
  578. mobile:
  579. type: string
  580. description: 手机号(可选,唯一)
  581. required:
  582. - username
  583. - role_code
  584. - subject_type
  585. - subject_id
  586. required:
  587. - data
  588. x-error-codes: [60001, 60053, 60054, 60077, 60082]
  589. responses:
  590. "200":
  591. description: 成功。统一信封 code/message/data
  592. /account/update_status@v1:
  593. post:
  594. summary: 停用或恢复账号
  595. description: 停用/恢复账号状态;不可操作当前登录账号。
  596. operationId: account_update_status
  597. tags:
  598. - 账号管理
  599. x-require-auth: true
  600. x-resource-type:
  601. $ref: '#/components/x-resource-types/account/code'
  602. x-action:
  603. $ref: '#/components/x-actions/manage/code'
  604. x-version: v1
  605. x-permission-visibility: catalog
  606. requestBody:
  607. required: true
  608. description: JSON 请求体,业务字段置于 data
  609. content:
  610. application/json:
  611. schema:
  612. type: object
  613. description: 统一信封请求体,业务字段放在 data 内
  614. properties:
  615. data:
  616. type: object
  617. description: 业务参数
  618. properties:
  619. user_id:
  620. type: string
  621. description: 目标用户 ID
  622. status:
  623. type: string
  624. description: 目标状态(如 disabled/active)
  625. required:
  626. - user_id
  627. - status
  628. required:
  629. - data
  630. x-error-codes: [60001, 60053, 60054, 60077, 60082]
  631. responses:
  632. "200":
  633. description: 成功。统一信封 code/message/data
  634. /account/unbind@v1:
  635. post:
  636. summary: 注销/解绑账号
  637. description: |
  638. 本地处置 `bos_user_binding`+`bos_account_ext`(与运营商删除级联同口径)。
  639. 平台 iam-user 删除类接口仅认 Bearer 用户令牌 ⇒ `platform_sync.applied=false` 诚实标记。
  640. 不可注销当前登录账号。档案删除/成员移出亦走同一级联。
  641. operationId: account_unbind
  642. tags:
  643. - 账号管理
  644. x-require-auth: true
  645. x-resource-type:
  646. $ref: '#/components/x-resource-types/account/code'
  647. x-action:
  648. $ref: '#/components/x-actions/manage/code'
  649. x-version: v1
  650. x-permission-visibility: catalog
  651. requestBody:
  652. required: true
  653. description: JSON 请求体,业务字段置于 data
  654. content:
  655. application/json:
  656. schema:
  657. type: object
  658. description: 统一信封请求体,业务字段放在 data 内
  659. properties:
  660. data:
  661. type: object
  662. description: 业务参数
  663. properties:
  664. user_id:
  665. type: string
  666. description: 目标用户 ID
  667. required:
  668. - user_id
  669. required:
  670. - data
  671. responses:
  672. "200":
  673. description: 成功。统一信封 code/message/data
  674. /account/reset_code@v1:
  675. post:
  676. summary: 重置激活码
  677. description: 仅未激活账号可重置;已激活拒绝。新码仅当次返回。
  678. operationId: account_reset_code
  679. tags:
  680. - 账号管理
  681. x-require-auth: true
  682. x-resource-type:
  683. $ref: '#/components/x-resource-types/account/code'
  684. x-action:
  685. $ref: '#/components/x-actions/manage/code'
  686. x-version: v1
  687. x-permission-visibility: catalog
  688. requestBody:
  689. required: true
  690. description: JSON 请求体,业务字段置于 data
  691. content:
  692. application/json:
  693. schema:
  694. type: object
  695. description: 统一信封请求体,业务字段放在 data 内
  696. properties:
  697. data:
  698. type: object
  699. description: 业务参数
  700. properties:
  701. user_id:
  702. type: string
  703. description: 目标用户 ID
  704. required:
  705. - user_id
  706. required:
  707. - data
  708. x-error-codes: [60001, 60053, 60054, 60077, 60082]
  709. responses:
  710. "200":
  711. description: 成功。统一信封 code/message/data
  712. /account/export_codes@v1:
  713. post:
  714. summary: 导出激活码
  715. description: |
  716. 导出未设密账号激活码明文。必传按本人可见范围收窄后的 user_ids(不得传空列表——平台侧空值=项目内全量);
  717. scope 一律服务端派生(`scope_type=end_user` +项目空间 ID),不收客户端的 scope_type/scope_id;
  718. validity 默认 `valid`(只读),`expired`/`all` 为写操作(对已过期行换新),不接受 `active`。
  719. 明文=调平台 `bootstrap_credential/export@v1`(项目服务授权主体 keypair),>200 人自动分片翻页。
  720. **错误码(D-14/D-17)**:空/非法入参 `60004`;账号均未登记 `60005`;有登记但均不可见 `60108`/`KLT-C007`;角色无权 `60058`。
  721. ⛔ 再用分成册 `60503`、⛔ 再借树节点 `S403`/`60066`。**读/写出参同一信封**:`export_mode`/`write_capability`/`reissued`/`kept`/`revoked`/
  722. `audit_written`+`audit_note`;`items[].plaintext` 只随本次应答回显一次。
  723. operationId: account_export_codes
  724. tags:
  725. - 账号管理
  726. x-require-auth: true
  727. x-resource-type:
  728. $ref: '#/components/x-resource-types/account/code'
  729. x-action:
  730. $ref: '#/components/x-actions/export/code'
  731. x-version: v1
  732. x-permission-visibility: catalog
  733. requestBody:
  734. required: true
  735. description: JSON 请求体,业务字段置于 data
  736. content:
  737. application/json:
  738. schema:
  739. type: object
  740. description: 统一信封请求体,业务字段放在 data 内
  741. properties:
  742. data:
  743. type: object
  744. description: 业务参数
  745. properties:
  746. user_ids:
  747. type: array
  748. description: 按本人可见范围收窄后的用户 ID 列表(不可传空列表:平台侧空值=项目内全量导出)
  749. minItems: 1
  750. items:
  751. type: string
  752. description: 用户 ID
  753. validity:
  754. type: string
  755. description: 导出口径(平台取值域):valid=仍有效(只读,缺省);expired=已过期(写);all=全部(写)。不接受 active——平台合法值是 valid,传 active 会被 60004 拒收(⛔ 透传平台 11103)
  756. default: valid
  757. enum:
  758. - valid
  759. - expired
  760. - all
  761. required:
  762. - user_ids
  763. required:
  764. - data
  765. x-error-codes: [60004, 60005, 60058, 60108]
  766. responses:
  767. "200":
  768. description: 成功。统一信封 code/message/data
  769. /account/change_password@v1:
  770. post:
  771. summary: 自助修改密码
  772. description: 已登录用户修改本人密码;新旧相同不保存。
  773. operationId: account_change_password
  774. tags:
  775. - 账号管理
  776. x-require-auth: true
  777. # AC-05 明定「任何已登录角色」:不挂业务权限键(`bos.account.manage` 只授给运营侧)。
  778. # 登录即可=复用所有人都在的 `bos.auth.view@v1`;「只改本人」由 handler 保证。
  779. x-resource-type:
  780. $ref: '#/components/x-resource-types/auth/code'
  781. x-action:
  782. $ref: '#/components/x-actions/view/code'
  783. x-version: v1
  784. x-permission-visibility: catalog
  785. requestBody:
  786. required: true
  787. description: JSON 请求体,业务字段置于 data
  788. content:
  789. application/json:
  790. schema:
  791. type: object
  792. description: 统一信封请求体,业务字段放在 data 内
  793. properties:
  794. data:
  795. type: object
  796. description: 业务参数
  797. properties:
  798. old_password:
  799. type: string
  800. description: 原密码
  801. new_password:
  802. type: string
  803. description: 新密码
  804. required:
  805. - old_password
  806. - new_password
  807. required:
  808. - data
  809. x-error-codes: [60001, 60053, 60054, 60055, 60077, 60082]
  810. responses:
  811. "200":
  812. description: 成功。统一信封 code/message/data
  813. /account/profile/update@v1:
  814. post:
  815. summary: 本人维护姓名
  816. description: AC-05 个人资料;仅限本人。只写账号级自填姓名(bos_account_ext.display_name),不用于主体档案(客户联系人/运营商名/团队名归运营侧维护)。空串或 null=清除自填、回落到档案派生名;超 64 字符或含控制字符 ⇒ 60004。
  817. operationId: account_profile_update
  818. tags:
  819. - 账号管理
  820. x-require-auth: true
  821. # AC-05:任何已登录角色且仅限本人 ⇒ 登录即可,不挂业务权限键(`bos.account.manage` 会把客户等角色挡在网关)。
  822. x-resource-type:
  823. $ref: '#/components/x-resource-types/auth/code'
  824. x-action:
  825. $ref: '#/components/x-actions/view/code'
  826. x-version: v1
  827. x-permission-visibility: catalog
  828. requestBody:
  829. required: true
  830. description: JSON 请求体,业务字段置于 data
  831. content:
  832. application/json:
  833. schema:
  834. type: object
  835. description: 统一信封请求体,业务字段放在 data 内
  836. properties:
  837. data:
  838. type: object
  839. description: 业务参数
  840. properties:
  841. display_name:
  842. type: string
  843. maxLength: 64
  844. description: 本人姓名;空串或 null=清除自填(回落到档案派生名)
  845. required:
  846. - data
  847. x-error-codes: [60004]
  848. responses:
  849. "200":
  850. description: 成功。统一信封 code/message/data
  851. /account/notify_pref@v1:
  852. get:
  853. summary: 读通知投递偏好
  854. description: AC-06;只读本人三通道(站内/邮箱/短信)的 enabled/available/address_hint。站内恒开不可关;地址摘要一律脱敏。任何已登录角色。
  855. operationId: account_notify_pref
  856. tags:
  857. - 账号管理
  858. x-require-auth: true
  859. # AC-06:任何已登录角色只读本人;不挂业务权限键(06-接口清单「登录即可」)。
  860. x-resource-type:
  861. $ref: '#/components/x-resource-types/auth/code'
  862. x-action:
  863. $ref: '#/components/x-actions/view/code'
  864. x-version: v1
  865. x-permission-visibility: catalog
  866. x-error-codes: []
  867. responses:
  868. "200":
  869. description: 成功。统一信封 code/message/data
  870. /account/notify_pref/save@v1:
  871. post:
  872. summary: 保存通知投递开关
  873. description: AC-06;仅限本人(user_id 取登录上下文)。站内投递不可关闭(KLT-A004/60092);未绑定手机号不能开启短信(KLT-A005/60093)。关闭是合法动作、不发码。
  874. operationId: account_notify_pref_save
  875. tags:
  876. - 账号管理
  877. x-require-auth: true
  878. # AC-06:任何已登录角色且仅限本人 ⇒ 登录即可,不挂业务权限键。
  879. x-resource-type:
  880. $ref: '#/components/x-resource-types/auth/code'
  881. x-action:
  882. $ref: '#/components/x-actions/view/code'
  883. x-version: v1
  884. x-permission-visibility: catalog
  885. requestBody:
  886. required: true
  887. description: JSON 请求体,业务字段置于 data
  888. content:
  889. application/json:
  890. schema:
  891. type: object
  892. description: 统一信封请求体,业务字段放在 data 内
  893. properties:
  894. data:
  895. type: object
  896. description: 业务参数
  897. properties:
  898. inapp_enabled:
  899. type: boolean
  900. description: 站内投递开关;只接受 true/缺省,false ⇒ KLT-A004
  901. mail_enabled:
  902. type: boolean
  903. description: 邮箱投递开关
  904. sms_enabled:
  905. type: boolean
  906. description: 短信投递开关;无绑定手机号时 true ⇒ KLT-A005
  907. required:
  908. - mail_enabled
  909. - sms_enabled
  910. required:
  911. - data
  912. x-error-codes: [60092, 60093]
  913. responses:
  914. "200":
  915. description: 成功。统一信封 code/message/data
  916. /account/notify_email@v1:
  917. post:
  918. summary: 本人维护通知投递邮箱
  919. description: AC-06;仅限本人。空串=清空登记(合法动作);格式或长度不符 ⇒ KLT-A006/60094。不要求全站唯一。
  920. operationId: account_notify_email
  921. tags:
  922. - 账号管理
  923. x-require-auth: true
  924. # AC-06:任何已登录角色且仅限本人 ⇒ 登录即可,不挂业务权限键。
  925. x-resource-type:
  926. $ref: '#/components/x-resource-types/auth/code'
  927. x-action:
  928. $ref: '#/components/x-actions/view/code'
  929. x-version: v1
  930. x-permission-visibility: catalog
  931. requestBody:
  932. required: true
  933. description: JSON 请求体,业务字段置于 data
  934. content:
  935. application/json:
  936. schema:
  937. type: object
  938. description: 统一信封请求体,业务字段放在 data 内
  939. properties:
  940. data:
  941. type: object
  942. description: 业务参数
  943. properties:
  944. email:
  945. type: string
  946. maxLength: 254
  947. description: 通知投递邮箱;空串或 null=清空登记
  948. required:
  949. - data
  950. x-error-codes: [60094]
  951. responses:
  952. "200":
  953. description: 成功。统一信封 code/message/data
  954. /account/notify_email/set@v1:
  955. post:
  956. summary: 运营代办维护通知投递邮箱
  957. description: AC-06;admin 全域、opsMain 负责范围内(opsSub 只读)。与本人自助口同一套格式校验(KLT-A006/60094),范围外按 11104 语义拒绝。
  958. operationId: account_notify_email_set
  959. tags:
  960. - 账号管理
  961. x-require-auth: true
  962. x-resource-type:
  963. $ref: '#/components/x-resource-types/account/code'
  964. x-action:
  965. $ref: '#/components/x-actions/manage/code'
  966. x-version: v1
  967. x-permission-visibility: catalog
  968. requestBody:
  969. required: true
  970. description: JSON 请求体,业务字段置于 data
  971. content:
  972. application/json:
  973. schema:
  974. type: object
  975. description: 统一信封请求体,业务字段放在 data 内
  976. properties:
  977. data:
  978. type: object
  979. description: 业务参数
  980. properties:
  981. user_id:
  982. type: string
  983. description: 目标账号 ID
  984. email:
  985. type: string
  986. maxLength: 254
  987. description: 通知投递邮箱;空串或 null=清空登记
  988. required:
  989. - user_id
  990. required:
  991. - data
  992. x-error-codes: [60094]
  993. responses:
  994. "200":
  995. description: 成功。统一信封 code/message/data
  996. /activation/verify@v1:
  997. post:
  998. summary: 激活并设置密码
  999. description: 免登录豁免接口。校验激活码后设置新密码;按来源 IP+码窗口限流,不设失败计数锁死。
  1000. operationId: activation_verify
  1001. tags:
  1002. - 认证与激活
  1003. x-require-auth: false
  1004. x-resource-type:
  1005. $ref: '#/components/x-resource-types/activation/code'
  1006. x-action:
  1007. $ref: '#/components/x-actions/manage/code'
  1008. x-version: v1
  1009. x-permission-visibility: catalog
  1010. requestBody:
  1011. required: true
  1012. description: JSON 请求体,业务字段置于 data
  1013. content:
  1014. application/json:
  1015. schema:
  1016. type: object
  1017. description: 统一信封请求体,业务字段放在 data 内
  1018. properties:
  1019. data:
  1020. type: object
  1021. description: 业务参数
  1022. properties:
  1023. code:
  1024. type: string
  1025. description: 激活码
  1026. new_password:
  1027. type: string
  1028. description: 新密码(建议不少于 8 位)
  1029. minLength: 8
  1030. required:
  1031. - code
  1032. - new_password
  1033. required:
  1034. - data
  1035. x-error-codes: [60006, 60076]
  1036. responses:
  1037. "200":
  1038. description: 成功。统一信封 code/message/data
  1039. /activation/precheck@v1:
  1040. post:
  1041. summary: 激活第 1 步预校验(登录名与激活状态)
  1042. description: 免登录豁免接口。在设密步之前按登录名校验账号侧前置:已激活/已停用/未发码/已过期四类在第 1 步拦下;激活码明文仍由平台 bootstrap/consume 核销。
  1043. operationId: activation_precheck
  1044. tags:
  1045. - 认证与激活
  1046. x-require-auth: false
  1047. x-resource-type:
  1048. $ref: '#/components/x-resource-types/activation/code'
  1049. x-action:
  1050. $ref: '#/components/x-actions/manage/code'
  1051. x-version: v1
  1052. x-permission-visibility: catalog
  1053. requestBody:
  1054. required: true
  1055. description: JSON 请求体,业务字段置于 data
  1056. content:
  1057. application/json:
  1058. schema:
  1059. type: object
  1060. description: 统一信封请求体,业务字段放在 data 内
  1061. properties:
  1062. data:
  1063. type: object
  1064. description: 业务参数
  1065. properties:
  1066. login_name:
  1067. type: string
  1068. description: 登录名(平台定位账号的必填参数)
  1069. code:
  1070. type: string
  1071. description: 激活码(仅作限流隔离键;码值由平台核销)
  1072. required:
  1073. - login_name
  1074. required:
  1075. - data
  1076. x-error-codes: [60006, 60052, 60076, 60088]
  1077. responses:
  1078. "200":
  1079. description: 成功。统一信封 code/message/data
  1080. /operator/create@v1:
  1081. post:
  1082. summary: 新建运营商
  1083. description: 运营商建档。所属区域必须是省级节点;同省份×品牌唯一;可写结算口径。
  1084. operationId: operator_create
  1085. tags:
  1086. - 运营商
  1087. x-require-auth: true
  1088. x-resource-type:
  1089. $ref: '#/components/x-resource-types/operator/code'
  1090. x-action:
  1091. $ref: '#/components/x-actions/create/code'
  1092. x-version: v1
  1093. x-permission-visibility: catalog
  1094. requestBody:
  1095. required: true
  1096. description: JSON 请求体,业务字段置于 data
  1097. content:
  1098. application/json:
  1099. schema:
  1100. type: object
  1101. description: 统一信封请求体,业务字段放在 data 内
  1102. properties:
  1103. data:
  1104. type: object
  1105. description: 业务参数
  1106. properties:
  1107. name:
  1108. type: string
  1109. description: 运营商名称
  1110. brand:
  1111. type: string
  1112. description: 品牌:移动/联通/电信
  1113. region_node_id:
  1114. type: string
  1115. description: 建档区域节点 ID(必须省级)
  1116. is_province_node:
  1117. type: boolean
  1118. description: 是否省级节点标记(服务端校验用,可选)
  1119. settle_mode:
  1120. type: string
  1121. description: 结算方式:ratio=比例;amount=固定金额;per_account=每账号
  1122. enum:
  1123. - ratio
  1124. - amount
  1125. - per_account
  1126. settle_value:
  1127. type: number
  1128. description: 结算值:比例时 0<x≤100;金额/每账号时为分且 >0
  1129. required:
  1130. - name
  1131. - brand
  1132. - region_node_id
  1133. required:
  1134. - data
  1135. x-error-codes: [60053, 60054, 60066, 60068, 60089, 60090]
  1136. responses:
  1137. "200":
  1138. description: 成功。统一信封 code/message/data
  1139. /operator/update@v1:
  1140. post:
  1141. summary: 编辑运营商
  1142. description: 编辑运营商档案;改品牌/省份不得绕过省份×品牌唯一与省级节点校验。
  1143. operationId: operator_update
  1144. tags:
  1145. - 运营商
  1146. x-require-auth: true
  1147. x-resource-type:
  1148. $ref: '#/components/x-resource-types/operator/code'
  1149. x-action:
  1150. $ref: '#/components/x-actions/update/code'
  1151. x-version: v1
  1152. x-permission-visibility: catalog
  1153. requestBody:
  1154. required: true
  1155. description: JSON 请求体,业务字段置于 data
  1156. content:
  1157. application/json:
  1158. schema:
  1159. type: object
  1160. description: 统一信封请求体,业务字段放在 data 内
  1161. properties:
  1162. data:
  1163. type: object
  1164. description: 业务参数
  1165. properties:
  1166. operator_id:
  1167. type: string
  1168. description: 运营商 ID
  1169. name:
  1170. type: string
  1171. description: 运营商名称
  1172. brand:
  1173. type: string
  1174. description: 品牌:移动/联通/电信
  1175. region_node_id:
  1176. type: string
  1177. description: 建档区域节点 ID(必须省级)
  1178. is_province_node:
  1179. type: boolean
  1180. description: 是否省级节点标记(可选)
  1181. settle_mode:
  1182. type: string
  1183. description: 结算方式:ratio/amount/per_account
  1184. settle_value:
  1185. type: number
  1186. description: 结算值
  1187. row_version:
  1188. type: integer
  1189. description: 乐观锁版本(若启用)
  1190. required:
  1191. - operator_id
  1192. - name
  1193. - brand
  1194. - region_node_id
  1195. required:
  1196. - data
  1197. x-error-codes: [60053, 60054, 60066, 60068, 60089, 60090]
  1198. responses:
  1199. "200":
  1200. description: 成功。统一信封 code/message/data
  1201. /operator/delete@v1:
  1202. post:
  1203. summary: 删除运营商
  1204. description: 删除前六项检查并级联注销对账账号。
  1205. operationId: operator_delete
  1206. tags:
  1207. - 运营商
  1208. x-require-auth: true
  1209. x-resource-type:
  1210. $ref: '#/components/x-resource-types/operator/code'
  1211. x-action:
  1212. $ref: '#/components/x-actions/delete/code'
  1213. x-version: v1
  1214. x-permission-visibility: catalog
  1215. requestBody:
  1216. required: true
  1217. description: JSON 请求体,业务字段置于 data
  1218. content:
  1219. application/json:
  1220. schema:
  1221. type: object
  1222. description: 统一信封请求体,业务字段放在 data 内
  1223. properties:
  1224. data:
  1225. type: object
  1226. description: 业务参数
  1227. properties:
  1228. operator_id:
  1229. type: string
  1230. description: 运营商 ID
  1231. required:
  1232. - operator_id
  1233. required:
  1234. - data
  1235. x-error-codes: [60053, 60054, 60066, 60068, 60089, 60090]
  1236. responses:
  1237. "200":
  1238. description: 成功。统一信封 code/message/data
  1239. /operator/get_list@v1:
  1240. post:
  1241. summary: 运营商列表
  1242. description: 卡片口径:建档区域或下挂客户落在本可见范围。
  1243. operationId: operator_get_list
  1244. tags:
  1245. - 运营商
  1246. x-require-auth: true
  1247. x-resource-type:
  1248. $ref: '#/components/x-resource-types/operator/code'
  1249. x-action:
  1250. $ref: '#/components/x-actions/list/code'
  1251. x-version: v1
  1252. x-permission-visibility: catalog
  1253. requestBody:
  1254. required: true
  1255. description: JSON 请求体,业务字段置于 data
  1256. content:
  1257. application/json:
  1258. schema:
  1259. type: object
  1260. description: 统一信封请求体,业务字段放在 data 内
  1261. properties:
  1262. data:
  1263. type: object
  1264. description: 列表筛选参数
  1265. properties:
  1266. page:
  1267. type: integer
  1268. description: 页码(0 基索引,默认 0)
  1269. minimum: 0
  1270. default: 0
  1271. page_size:
  1272. type: integer
  1273. description: 每页条数(默认 20,上限 200)
  1274. minimum: 1
  1275. maximum: 200
  1276. default: 20
  1277. keyword:
  1278. type: string
  1279. description: 关键字筛选(可选)
  1280. brand:
  1281. type: string
  1282. description: 品牌筛选(可选)
  1283. required:
  1284. - data
  1285. x-error-codes: [60053, 60054, 60066, 60068, 60089, 60090]
  1286. responses:
  1287. "200":
  1288. description: 成功。统一信封 code/message/data
  1289. /operator/recon_account/create@v1:
  1290. post:
  1291. summary: 创建对账账号
  1292. description: 一家运营商至多一个对账账号;初始密码仅当次显示。
  1293. operationId: operator_recon_account_create
  1294. tags:
  1295. - 运营商
  1296. x-require-auth: true
  1297. x-resource-type:
  1298. $ref: '#/components/x-resource-types/operator_recon_account/code'
  1299. x-action:
  1300. $ref: '#/components/x-actions/create/code'
  1301. x-version: v1
  1302. x-permission-visibility: catalog
  1303. requestBody:
  1304. required: true
  1305. description: JSON 请求体,业务字段置于 data
  1306. content:
  1307. application/json:
  1308. schema:
  1309. type: object
  1310. description: 统一信封请求体,业务字段放在 data 内
  1311. properties:
  1312. data:
  1313. type: object
  1314. description: 业务参数
  1315. properties:
  1316. operator_id:
  1317. type: string
  1318. description: 运营商 ID
  1319. username:
  1320. type: string
  1321. description: 对账账号登录名
  1322. mobile:
  1323. type: string
  1324. description: 手机号(可选)
  1325. required:
  1326. - operator_id
  1327. - username
  1328. required:
  1329. - data
  1330. x-error-codes: [60053, 60054, 60066, 60068, 60089, 60090]
  1331. responses:
  1332. "200":
  1333. description: 成功。统一信封 code/message/data
  1334. /operator/recon_account/get@v1:
  1335. post:
  1336. summary: 查询对账账号
  1337. description: 只回状态提示(如「未发送,线下告知本人」),不回密码。
  1338. operationId: operator_recon_account_get
  1339. tags:
  1340. - 运营商
  1341. x-require-auth: true
  1342. x-resource-type:
  1343. $ref: '#/components/x-resource-types/operator_recon_account/code'
  1344. x-action:
  1345. $ref: '#/components/x-actions/view/code'
  1346. x-version: v1
  1347. x-permission-visibility: catalog
  1348. requestBody:
  1349. required: true
  1350. description: JSON 请求体,业务字段置于 data
  1351. content:
  1352. application/json:
  1353. schema:
  1354. type: object
  1355. description: 统一信封请求体,业务字段放在 data 内
  1356. properties:
  1357. data:
  1358. type: object
  1359. description: 业务参数
  1360. properties:
  1361. operator_id:
  1362. type: string
  1363. description: 运营商 ID
  1364. required:
  1365. - operator_id
  1366. required:
  1367. - data
  1368. x-error-codes: [60053, 60054, 60066, 60068, 60089, 60090]
  1369. responses:
  1370. "200":
  1371. description: 成功。统一信封 code/message/data
  1372. /partner/create@v1:
  1373. post:
  1374. summary: 新建合伙人
  1375. description: 合伙人建档并同步开通账号;名称全站唯一;结算字段仅 admin 可写。
  1376. operationId: partner_create
  1377. tags:
  1378. - 合伙人
  1379. x-require-auth: true
  1380. x-resource-type:
  1381. $ref: '#/components/x-resource-types/partner/code'
  1382. x-action:
  1383. $ref: '#/components/x-actions/create/code'
  1384. x-version: v1
  1385. x-permission-visibility: catalog
  1386. requestBody:
  1387. required: true
  1388. description: JSON 请求体,业务字段置于 data
  1389. content:
  1390. application/json:
  1391. schema:
  1392. type: object
  1393. description: 统一信封请求体,业务字段放在 data 内
  1394. properties:
  1395. data:
  1396. type: object
  1397. description: 业务参数
  1398. properties:
  1399. name:
  1400. type: string
  1401. description: 合伙人名称(全站唯一)
  1402. duty_desc:
  1403. type: string
  1404. description: 职务说明(可选)
  1405. region_node_id:
  1406. type: string
  1407. description: 建档区域节点 ID
  1408. mobile:
  1409. type: string
  1410. description: 手机号(可选)
  1411. username:
  1412. type: string
  1413. description: 登录名(开通账号用)
  1414. settle_mode:
  1415. type: string
  1416. description: 结算方式(仅 admin 可写,可选)
  1417. settle_value:
  1418. type: number
  1419. description: 结算值(仅 admin 可写,可选)
  1420. required:
  1421. - name
  1422. - region_node_id
  1423. - username
  1424. required:
  1425. - data
  1426. x-error-codes: [60053, 60054, 60091]
  1427. responses:
  1428. "200":
  1429. description: 成功。统一信封 code/message/data
  1430. /partner/update@v1:
  1431. post:
  1432. summary: 编辑合伙人
  1433. description: 编辑合伙人资料;登录名不可改。
  1434. operationId: partner_update
  1435. tags:
  1436. - 合伙人
  1437. x-require-auth: true
  1438. x-resource-type:
  1439. $ref: '#/components/x-resource-types/partner/code'
  1440. x-action:
  1441. $ref: '#/components/x-actions/update/code'
  1442. x-version: v1
  1443. x-permission-visibility: catalog
  1444. requestBody:
  1445. required: true
  1446. description: JSON 请求体,业务字段置于 data
  1447. content:
  1448. application/json:
  1449. schema:
  1450. type: object
  1451. description: 统一信封请求体,业务字段放在 data 内
  1452. properties:
  1453. data:
  1454. type: object
  1455. description: 业务参数
  1456. properties:
  1457. partner_id:
  1458. type: string
  1459. description: 合伙人 ID
  1460. name:
  1461. type: string
  1462. description: 合伙人名称(全站唯一)
  1463. duty_desc:
  1464. type: string
  1465. description: 职务说明(可选)
  1466. region_node_id:
  1467. type: string
  1468. description: 建档区域节点 ID
  1469. mobile:
  1470. type: string
  1471. description: 手机号(可选)
  1472. settle_mode:
  1473. type: string
  1474. description: 结算方式(仅 admin 可写,可选)
  1475. settle_value:
  1476. type: number
  1477. description: 结算值(仅 admin 可写,可选)
  1478. row_version:
  1479. type: integer
  1480. description: 乐观锁版本(若启用)
  1481. required:
  1482. - partner_id
  1483. - name
  1484. - region_node_id
  1485. required:
  1486. - data
  1487. x-error-codes: [60053, 60054, 60091]
  1488. responses:
  1489. "200":
  1490. description: 成功。统一信封 code/message/data
  1491. /partner/delete@v1:
  1492. post:
  1493. summary: 删除合伙人
  1494. description: 删除合伙人档案及相关授权。
  1495. operationId: partner_delete
  1496. tags:
  1497. - 合伙人
  1498. x-require-auth: true
  1499. x-resource-type:
  1500. $ref: '#/components/x-resource-types/partner/code'
  1501. x-action:
  1502. $ref: '#/components/x-actions/delete/code'
  1503. x-version: v1
  1504. x-permission-visibility: catalog
  1505. requestBody:
  1506. required: true
  1507. description: JSON 请求体,业务字段置于 data
  1508. content:
  1509. application/json:
  1510. schema:
  1511. type: object
  1512. description: 统一信封请求体,业务字段放在 data 内
  1513. properties:
  1514. data:
  1515. type: object
  1516. description: 业务参数
  1517. properties:
  1518. partner_id:
  1519. type: string
  1520. description: 合伙人 ID
  1521. required:
  1522. - partner_id
  1523. required:
  1524. - data
  1525. x-error-codes: [60053, 60054]
  1526. responses:
  1527. "200":
  1528. description: 成功。统一信封 code/message/data
  1529. /partner/get_list@v1:
  1530. post:
  1531. summary: 合伙人列表
  1532. description: 卡片口径:建档区域落在本范围(含下级)。
  1533. operationId: partner_get_list
  1534. tags:
  1535. - 合伙人
  1536. x-require-auth: true
  1537. x-resource-type:
  1538. $ref: '#/components/x-resource-types/partner/code'
  1539. x-action:
  1540. $ref: '#/components/x-actions/list/code'
  1541. x-version: v1
  1542. x-permission-visibility: catalog
  1543. requestBody:
  1544. required: true
  1545. description: JSON 请求体,业务字段置于 data
  1546. content:
  1547. application/json:
  1548. schema:
  1549. type: object
  1550. description: 统一信封请求体,业务字段放在 data 内
  1551. properties:
  1552. data:
  1553. type: object
  1554. description: 列表筛选参数
  1555. properties:
  1556. page:
  1557. type: integer
  1558. description: 页码(0 基索引,默认 0)
  1559. minimum: 0
  1560. default: 0
  1561. page_size:
  1562. type: integer
  1563. description: 每页条数(默认 20,上限 200)
  1564. minimum: 1
  1565. maximum: 200
  1566. default: 20
  1567. keyword:
  1568. type: string
  1569. description: 关键字筛选(可选)
  1570. required:
  1571. - data
  1572. x-error-codes: [60053, 60054]
  1573. responses:
  1574. "200":
  1575. description: 成功。统一信封 code/message/data
  1576. /partner/scope/get@v1:
  1577. post:
  1578. summary: 读取合伙人负责范围
  1579. description: 返回该合伙人的 region/customer 两类 bos_data_scope。注意:2026-11-08 由 GET 改 POST(R-5,统一方法;本接口读 scope 表本身,不消费授权上界,故不标 x-enumeration-kind)。
  1580. operationId: partner_scope_get
  1581. tags:
  1582. - 合伙人
  1583. x-require-auth: true
  1584. x-resource-type:
  1585. $ref: '#/components/x-resource-types/partner_scope/code'
  1586. x-action:
  1587. $ref: '#/components/x-actions/view/code'
  1588. x-version: v1
  1589. x-permission-visibility: catalog
  1590. requestBody:
  1591. required: true
  1592. description: 统一信封请求体(无业务参数)
  1593. content:
  1594. application/json:
  1595. schema:
  1596. type: object
  1597. properties:
  1598. data:
  1599. type: object
  1600. description: 无业务参数
  1601. required:
  1602. - data
  1603. x-error-codes: [60053, 60054]
  1604. responses:
  1605. "200":
  1606. description: 成功。统一信封 code/message/data
  1607. /partner/scope/save@v1:
  1608. post:
  1609. summary: 保存合伙人负责范围
  1610. description: 写入 bos_data_scope(holder_type=partner);允许保存为空;保存即 bump epoch。同类合伙人区域子树/点客户不得交叉(KLT-T216);异类可并存。
  1611. operationId: partner_scope_save
  1612. tags:
  1613. - 合伙人
  1614. x-require-auth: true
  1615. x-resource-type:
  1616. $ref: '#/components/x-resource-types/partner_scope/code'
  1617. x-action:
  1618. $ref: '#/components/x-actions/manage/code'
  1619. x-version: v1
  1620. x-permission-visibility: catalog
  1621. requestBody:
  1622. required: true
  1623. description: JSON 请求体,业务字段置于 data
  1624. content:
  1625. application/json:
  1626. schema:
  1627. type: object
  1628. description: 统一信封请求体,业务字段放在 data 内
  1629. properties:
  1630. data:
  1631. type: object
  1632. description: 业务参数
  1633. properties:
  1634. partner_id:
  1635. type: string
  1636. description: 合伙人 ID
  1637. region_node_ids:
  1638. type: array
  1639. description: 负责区域节点 ID 列表(可空)
  1640. items:
  1641. type: string
  1642. description: 区域节点 ID
  1643. customer_ids:
  1644. type: array
  1645. description: 负责客户 ID 列表(可空)
  1646. items:
  1647. type: string
  1648. description: 客户 ID
  1649. required:
  1650. - partner_id
  1651. required:
  1652. - data
  1653. x-error-codes: [60053, 60054, 60095, 60096]
  1654. responses:
  1655. "200":
  1656. description: 成功。统一信封 code/message/data
  1657. /ent_team/create@v1:
  1658. post:
  1659. summary: 新建运营团队
  1660. description: 仅 admin。新建运营团队,负责范围初始为空。
  1661. operationId: ent_team_create
  1662. tags:
  1663. - 运营团队
  1664. x-require-auth: true
  1665. x-resource-type:
  1666. $ref: '#/components/x-resource-types/ent_team/code'
  1667. x-action:
  1668. $ref: '#/components/x-actions/create/code'
  1669. x-version: v1
  1670. x-permission-visibility: catalog
  1671. requestBody:
  1672. required: true
  1673. description: JSON 请求体,业务字段置于 data
  1674. content:
  1675. application/json:
  1676. schema:
  1677. type: object
  1678. description: 统一信封请求体,业务字段放在 data 内
  1679. properties:
  1680. data:
  1681. type: object
  1682. description: 业务参数
  1683. properties:
  1684. team_name:
  1685. type: string
  1686. description: 团队名称
  1687. primary_username:
  1688. type: string
  1689. description: 主账号登录名(可选)
  1690. primary_mobile:
  1691. type: string
  1692. description: 主账号手机号(可选)
  1693. primary_name:
  1694. type: string
  1695. maxLength: 64
  1696. description: 主账号姓名(可选,落 `bos_account_ext.display_name`;下拉框按姓名选人,前端必填,未带=回落登录名)
  1697. required:
  1698. - team_name
  1699. required:
  1700. - data
  1701. x-error-codes: [60053, 60054, 60068]
  1702. responses:
  1703. "200":
  1704. description: 成功。统一信封 code/message/data
  1705. /ent_team/update@v1:
  1706. post:
  1707. summary: 编辑运营团队
  1708. description: 仅 admin。编辑团队资料。
  1709. operationId: ent_team_update
  1710. tags:
  1711. - 运营团队
  1712. x-require-auth: true
  1713. x-resource-type:
  1714. $ref: '#/components/x-resource-types/ent_team/code'
  1715. x-action:
  1716. $ref: '#/components/x-actions/update/code'
  1717. x-version: v1
  1718. x-permission-visibility: catalog
  1719. requestBody:
  1720. required: true
  1721. description: JSON 请求体,业务字段置于 data
  1722. content:
  1723. application/json:
  1724. schema:
  1725. type: object
  1726. description: 统一信封请求体,业务字段放在 data 内
  1727. properties:
  1728. data:
  1729. type: object
  1730. description: 业务参数
  1731. properties:
  1732. team_id:
  1733. type: string
  1734. description: 团队 ID
  1735. team_name:
  1736. type: string
  1737. description: 团队名称
  1738. row_version:
  1739. type: integer
  1740. description: 乐观锁版本(若启用)
  1741. required:
  1742. - team_id
  1743. - team_name
  1744. required:
  1745. - data
  1746. x-error-codes: [60053, 60054, 60068]
  1747. responses:
  1748. "200":
  1749. description: 成功。统一信封 code/message/data
  1750. /ent_team/delete@v1:
  1751. post:
  1752. summary: 删除运营团队
  1753. description: 仅 admin。内置「总部·不限区域」团队不可删。
  1754. operationId: ent_team_delete
  1755. tags:
  1756. - 运营团队
  1757. x-require-auth: true
  1758. x-resource-type:
  1759. $ref: '#/components/x-resource-types/ent_team/code'
  1760. x-action:
  1761. $ref: '#/components/x-actions/delete/code'
  1762. x-version: v1
  1763. x-permission-visibility: catalog
  1764. requestBody:
  1765. required: true
  1766. description: JSON 请求体,业务字段置于 data
  1767. content:
  1768. application/json:
  1769. schema:
  1770. type: object
  1771. description: 统一信封请求体,业务字段放在 data 内
  1772. properties:
  1773. data:
  1774. type: object
  1775. description: 业务参数
  1776. properties:
  1777. team_id:
  1778. type: string
  1779. description: 团队 ID
  1780. required:
  1781. - team_id
  1782. required:
  1783. - data
  1784. x-error-codes: [60053, 60054, 60068]
  1785. responses:
  1786. "200":
  1787. description: 成功。统一信封 code/message/data
  1788. /ent_team/member_add@v1:
  1789. post:
  1790. summary: 添加运营团队成员
  1791. description: 每团队有且仅有一个主账号;首个成员即主账号;成员姓名(`name`)落 `bos_account_ext.display_name`(未带=回落登录名)。不可删除当前登录账号。
  1792. operationId: ent_team_member_add
  1793. tags:
  1794. - 运营团队
  1795. x-require-auth: true
  1796. x-resource-type:
  1797. $ref: '#/components/x-resource-types/ent_team/code'
  1798. x-action:
  1799. $ref: '#/components/x-actions/manage/code'
  1800. x-version: v1
  1801. x-permission-visibility: catalog
  1802. requestBody:
  1803. required: true
  1804. description: JSON 请求体,业务字段置于 data
  1805. content:
  1806. application/json:
  1807. schema:
  1808. type: object
  1809. description: 统一信封请求体,业务字段放在 data 内
  1810. properties:
  1811. data:
  1812. type: object
  1813. description: 业务参数
  1814. properties:
  1815. team_id:
  1816. type: string
  1817. description: 团队 ID
  1818. username:
  1819. type: string
  1820. description: 成员登录名
  1821. name:
  1822. type: string
  1823. maxLength: 64
  1824. description: 成员姓名(落 `bos_account_ext.display_name`;前端必填,未带=回落登录名)
  1825. mobile:
  1826. type: string
  1827. description: 手机号(可选)
  1828. is_primary:
  1829. type: boolean
  1830. description: 是否设为主账号(可选)
  1831. required:
  1832. - team_id
  1833. - username
  1834. required:
  1835. - data
  1836. x-error-codes: [60053, 60054, 60068]
  1837. responses:
  1838. "200":
  1839. description: 成功。统一信封 code/message/data
  1840. /ent_team/member_update@v1:
  1841. post:
  1842. summary: 编辑运营团队成员资料
  1843. description: 仅 admin。改姓名(`bos_account_ext.display_name`)、手机号与运营账号可承接工单类型清单(`ticket_types`);登录名与本/子身份不变(改名办 `ent_team/transfer_primary@v1`)。
  1844. operationId: ent_team_member_update
  1845. tags:
  1846. - 运营团队
  1847. x-require-auth: true
  1848. x-resource-type:
  1849. $ref: '#/components/x-resource-types/ent_team/code'
  1850. x-action:
  1851. $ref: '#/components/x-actions/manage/code'
  1852. x-version: v1
  1853. x-permission-visibility: catalog
  1854. requestBody:
  1855. required: true
  1856. description: JSON 请求体,业务字段置于 data
  1857. content:
  1858. application/json:
  1859. schema:
  1860. type: object
  1861. description: 统一信封请求体,业务字段放在 data 内
  1862. properties:
  1863. data:
  1864. type: object
  1865. description: 业务参数
  1866. properties:
  1867. team_id:
  1868. type: string
  1869. description: 团队 ID
  1870. user_id:
  1871. type: string
  1872. description: 成员用户 ID
  1873. name:
  1874. type: string
  1875. maxLength: 64
  1876. description: 姓名(可选;缺省=不改;空白串=拒绝,姓名是下拉框选人的展示值)
  1877. mobile:
  1878. type: string
  1879. description: 手机号(可选;缺省/空串=不改;全站唯一)
  1880. ticket_types:
  1881. type: array
  1882. items:
  1883. type: string
  1884. description: 可承接工单类型清单(`ops_account_ticket_type`,工单§3.4.2 判据二,2026-11-17 新增):缺省=不改;非空=整体替换,且**必须含 `renewal`**(续签单只由运营账号受理,清单不可清空;`[]` 或漏掉续签一律拒绝)。取值限八类型码(`open`/`service_open`/`updown`/`expiry_stop`/`service_stop`/`fault`/`after_sale`/`renewal`),只对 `role_code ∈ opsMain/opsSub` 的账号生效。新建与存量账号默认只播种 `renewal`
  1885. required:
  1886. - team_id
  1887. - user_id
  1888. required:
  1889. - data
  1890. x-error-codes: [60053, 60054, 60068]
  1891. responses:
  1892. "200":
  1893. description: 成功。统一信封 code/message/data
  1894. /ent_team/member_remove@v1:
  1895. post:
  1896. summary: 移除运营团队成员
  1897. description: 内置主账号不可删不可转交;不可删除当前登录账号。
  1898. operationId: ent_team_member_remove
  1899. tags:
  1900. - 运营团队
  1901. x-require-auth: true
  1902. x-resource-type:
  1903. $ref: '#/components/x-resource-types/ent_team/code'
  1904. x-action:
  1905. $ref: '#/components/x-actions/manage/code'
  1906. x-version: v1
  1907. x-permission-visibility: catalog
  1908. requestBody:
  1909. required: true
  1910. description: JSON 请求体,业务字段置于 data
  1911. content:
  1912. application/json:
  1913. schema:
  1914. type: object
  1915. description: 统一信封请求体,业务字段放在 data 内
  1916. properties:
  1917. data:
  1918. type: object
  1919. description: 业务参数
  1920. properties:
  1921. team_id:
  1922. type: string
  1923. description: 团队 ID
  1924. user_id:
  1925. type: string
  1926. description: 成员用户 ID
  1927. required:
  1928. - team_id
  1929. - user_id
  1930. required:
  1931. - data
  1932. x-error-codes: [60053, 60054, 60068]
  1933. responses:
  1934. "200":
  1935. description: 成功。统一信封 code/message/data
  1936. /ent_team/transfer_primary@v1:
  1937. post:
  1938. summary: 转交运营团队主账号
  1939. description: 总运营可办理任意团队;运营主账号(opsMain)只能转交本团队(限本人所属团队)。同事务切换两人的 is_primary 标记并同步 role_code(opsMain↔opsSub),登录名与负责范围不变;内置总运营团队不可转交,跨团队接收方直接拒。审计记转出与转入账号名。
  1940. operationId: ent_team_transfer_primary
  1941. tags:
  1942. - 运营团队
  1943. x-require-auth: true
  1944. x-resource-type:
  1945. $ref: '#/components/x-resource-types/ent_team/code'
  1946. x-action:
  1947. $ref: '#/components/x-actions/manage/code'
  1948. x-version: v1
  1949. x-permission-visibility: catalog
  1950. requestBody:
  1951. required: true
  1952. description: JSON 请求体,业务字段置于 data
  1953. content:
  1954. application/json:
  1955. schema:
  1956. type: object
  1957. description: 统一信封请求体,业务字段放在 data 内
  1958. properties:
  1959. data:
  1960. type: object
  1961. description: 业务参数
  1962. properties:
  1963. team_id:
  1964. type: string
  1965. description: 团队 ID
  1966. from_user_id:
  1967. type: string
  1968. description: 原主账号用户 ID
  1969. to_user_id:
  1970. type: string
  1971. description: 新主账号用户 ID
  1972. required:
  1973. - team_id
  1974. - from_user_id
  1975. - to_user_id
  1976. required:
  1977. - data
  1978. x-error-codes: [60053, 60054, 60068]
  1979. responses:
  1980. "200":
  1981. description: 成功。统一信封 code/message/data
  1982. /ent_team/scope/get@v1:
  1983. post:
  1984. summary: 读取运营团队负责范围
  1985. description: 仅 admin。返回团队区域负责范围。注意:2026-11-08 由 GET 改 POST(R-5,统一方法;本接口读 scope 表本身,不消费授权上界,故不标 x-enumeration-kind)。
  1986. operationId: ent_team_scope_get
  1987. tags:
  1988. - 运营团队
  1989. x-require-auth: true
  1990. x-resource-type:
  1991. $ref: '#/components/x-resource-types/ent_team_scope/code'
  1992. x-action:
  1993. $ref: '#/components/x-actions/view/code'
  1994. x-version: v1
  1995. x-permission-visibility: catalog
  1996. requestBody:
  1997. required: true
  1998. description: 统一信封请求体(无业务参数)
  1999. content:
  2000. application/json:
  2001. schema:
  2002. type: object
  2003. properties:
  2004. data:
  2005. type: object
  2006. description: 无业务参数
  2007. required:
  2008. - data
  2009. x-error-codes: [60053, 60054, 60068]
  2010. responses:
  2011. "200":
  2012. description: 成功。统一信封 code/message/data
  2013. /ent_team/scope/save@v1:
  2014. post:
  2015. summary: 保存运营团队负责范围
  2016. description: 仅 admin。勾选区域写入 bos_data_scope(holder=ent_team),成为区域删除的引用来源。与其它非内置运营团队区域子树互斥(KLT-T216);内置总部豁免。
  2017. operationId: ent_team_scope_save
  2018. tags:
  2019. - 运营团队
  2020. x-require-auth: true
  2021. x-resource-type:
  2022. $ref: '#/components/x-resource-types/ent_team_scope/code'
  2023. x-action:
  2024. $ref: '#/components/x-actions/manage/code'
  2025. x-version: v1
  2026. x-permission-visibility: catalog
  2027. requestBody:
  2028. required: true
  2029. description: JSON 请求体,业务字段置于 data
  2030. content:
  2031. application/json:
  2032. schema:
  2033. type: object
  2034. description: 统一信封请求体,业务字段放在 data 内
  2035. properties:
  2036. data:
  2037. type: object
  2038. description: 业务参数
  2039. properties:
  2040. team_id:
  2041. type: string
  2042. description: 团队 ID
  2043. region_node_ids:
  2044. type: array
  2045. description: 负责区域节点 ID 列表
  2046. items:
  2047. type: string
  2048. description: 区域节点 ID
  2049. required:
  2050. - team_id
  2051. - region_node_ids
  2052. required:
  2053. - data
  2054. x-error-codes: [60053, 60054, 60068, 60095, 60096]
  2055. responses:
  2056. "200":
  2057. description: 成功。统一信封 code/message/data
  2058. /ops_team/create@v1:
  2059. post:
  2060. summary: 新建运维团队
  2061. description: 须指定所属区域、可派工单类型≥1、分派方式与结算口径。注意:2026-11-05 起团队不分类型(无 team_type 键)。
  2062. operationId: ops_team_create
  2063. tags:
  2064. - 运维团队与成员
  2065. x-require-auth: true
  2066. x-resource-type:
  2067. $ref: '#/components/x-resource-types/ops_team/code'
  2068. x-action:
  2069. $ref: '#/components/x-actions/create/code'
  2070. x-version: v1
  2071. x-permission-visibility: catalog
  2072. requestBody:
  2073. required: true
  2074. description: JSON 请求体,业务字段置于 data
  2075. content:
  2076. application/json:
  2077. schema:
  2078. type: object
  2079. description: 统一信封请求体,业务字段放在 data 内
  2080. properties:
  2081. data:
  2082. type: object
  2083. description: 业务参数
  2084. properties:
  2085. team_name:
  2086. type: string
  2087. description: 团队名称
  2088. region_node_id:
  2089. type: string
  2090. description: 所属区域节点 ID
  2091. ticket_types:
  2092. type: array
  2093. description: 可派工单类型列表(至少 1 项;⛔ 含 `renewal`——续签单只由运营账号受理,业主 2026-11-17)
  2094. items:
  2095. type: string
  2096. description: 工单类型码
  2097. dispatch_mode:
  2098. type: string
  2099. description: 分派方式:manual=手工;auto_avg=自动均分
  2100. enum:
  2101. - manual
  2102. - auto_avg
  2103. settle_mode:
  2104. type: string
  2105. description: 结算方式
  2106. settle_value:
  2107. type: number
  2108. description: 结算值
  2109. primary_username:
  2110. type: string
  2111. description: 主账号登录名(空则默认「{团队名}主账号」)
  2112. primary_name:
  2113. type: string
  2114. description: 主账号姓名(档案名,1~64 字符;空=未填,列表回落显示登录名)
  2115. primary_mobile:
  2116. type: string
  2117. description: 主账号手机号(可选)
  2118. required:
  2119. - team_name
  2120. - region_node_id
  2121. - ticket_types
  2122. - dispatch_mode
  2123. required:
  2124. - data
  2125. x-error-codes: [60053, 60054, 60068, 60082]
  2126. responses:
  2127. "200":
  2128. description: 成功。统一信封 code/message/data
  2129. /ops_team/update@v1:
  2130. post:
  2131. summary: 编辑运维团队
  2132. description: 编辑团队资料。注意:2026-11-05 起团队不分类型,请求体无 team_type 键。
  2133. operationId: ops_team_update
  2134. tags:
  2135. - 运维团队与成员
  2136. x-require-auth: true
  2137. x-resource-type:
  2138. $ref: '#/components/x-resource-types/ops_team/code'
  2139. x-action:
  2140. $ref: '#/components/x-actions/update/code'
  2141. x-version: v1
  2142. x-permission-visibility: catalog
  2143. requestBody:
  2144. required: true
  2145. description: JSON 请求体,业务字段置于 data
  2146. content:
  2147. application/json:
  2148. schema:
  2149. type: object
  2150. description: 统一信封请求体,业务字段放在 data 内
  2151. properties:
  2152. data:
  2153. type: object
  2154. description: 业务参数
  2155. properties:
  2156. team_id:
  2157. type: string
  2158. description: 团队 ID
  2159. team_name:
  2160. type: string
  2161. description: 团队名称
  2162. region_node_id:
  2163. type: string
  2164. description: 所属区域节点 ID
  2165. ticket_types:
  2166. type: array
  2167. description: 可派工单类型列表(整体替换,至少 1 项;⛔ 含 `renewal`——续签单只由运营账号受理)
  2168. items:
  2169. type: string
  2170. description: 工单类型码
  2171. settle_mode:
  2172. type: string
  2173. description: 结算方式
  2174. settle_value:
  2175. type: number
  2176. description: 结算值
  2177. row_version:
  2178. type: integer
  2179. description: 乐观锁版本(若启用)
  2180. required:
  2181. - team_id
  2182. required:
  2183. - data
  2184. x-error-codes: [60053, 60054, 60068, 60082]
  2185. responses:
  2186. "200":
  2187. description: 成功。统一信封 code/message/data
  2188. /ops_team/delete@v1:
  2189. post:
  2190. summary: 删除运维团队
  2191. description: 删除前校验引用与未办完工单等守卫。
  2192. operationId: ops_team_delete
  2193. tags:
  2194. - 运维团队与成员
  2195. x-require-auth: true
  2196. x-resource-type:
  2197. $ref: '#/components/x-resource-types/ops_team/code'
  2198. x-action:
  2199. $ref: '#/components/x-actions/delete/code'
  2200. x-version: v1
  2201. x-permission-visibility: catalog
  2202. requestBody:
  2203. required: true
  2204. description: JSON 请求体,业务字段置于 data
  2205. content:
  2206. application/json:
  2207. schema:
  2208. type: object
  2209. description: 统一信封请求体,业务字段放在 data 内
  2210. properties:
  2211. data:
  2212. type: object
  2213. description: 业务参数
  2214. properties:
  2215. team_id:
  2216. type: string
  2217. description: 团队 ID
  2218. required:
  2219. - team_id
  2220. required:
  2221. - data
  2222. x-error-codes: [60053, 60054, 60068, 60082]
  2223. responses:
  2224. "200":
  2225. description: 成功。统一信封 code/message/data
  2226. /ops_team/scope/save@v1:
  2227. post:
  2228. summary: 保存运维团队负责范围
  2229. description: 三个范围写入口之一。同事务校验范围包含关系与未办完工单守卫;失败两侧都不落库。与其它运维团队区域子树/点客户互斥(KLT-T216);异类可并存。
  2230. operationId: ops_team_scope_save
  2231. tags:
  2232. - 运维团队与成员
  2233. x-require-auth: true
  2234. x-resource-type:
  2235. $ref: '#/components/x-resource-types/ops_team_scope/code'
  2236. x-action:
  2237. $ref: '#/components/x-actions/manage/code'
  2238. x-version: v1
  2239. x-permission-visibility: catalog
  2240. requestBody:
  2241. required: true
  2242. description: JSON 请求体,业务字段置于 data
  2243. content:
  2244. application/json:
  2245. schema:
  2246. type: object
  2247. description: 统一信封请求体,业务字段放在 data 内
  2248. properties:
  2249. data:
  2250. type: object
  2251. description: 业务参数
  2252. properties:
  2253. team_id:
  2254. type: string
  2255. description: 团队 ID
  2256. region_node_ids:
  2257. type: array
  2258. description: 负责区域节点 ID 列表
  2259. items:
  2260. type: string
  2261. description: 区域节点 ID
  2262. customer_ids:
  2263. type: array
  2264. description: 负责客户 ID 列表(可空)
  2265. items:
  2266. type: string
  2267. description: 客户 ID
  2268. required:
  2269. - team_id
  2270. required:
  2271. - data
  2272. x-error-codes: [60053, 60054, 60068, 60082, 60095, 60096]
  2273. responses:
  2274. "200":
  2275. description: 成功。统一信封 code/message/data
  2276. /ops_team/member_add@v1:
  2277. post:
  2278. summary: 添加运维成员
  2279. description: 新建成员档案(含成员姓名)并开通运维子账号(`role_code=ops`)。注意:2026-11-05 起成员不分类型,服务侧只校验 `ticket_types` 是团队可分配类型的子集(`KLT-I105`,可为空=不接单)。注意:2026-11-16 起 `ticket_mode` 与负责范围同构:`follow_team`=随团队(成员级零行),`custom`=勾选子集。注意:`renewal` 不属于运维可承接类型(续签单只由运营账号受理,业主 2026-11-17),传入即拒。
  2280. operationId: ops_team_member_add
  2281. tags:
  2282. - 运维团队与成员
  2283. x-require-auth: true
  2284. x-resource-type:
  2285. $ref: '#/components/x-resource-types/ops_team/code'
  2286. x-action:
  2287. $ref: '#/components/x-actions/manage/code'
  2288. x-version: v1
  2289. x-permission-visibility: catalog
  2290. requestBody:
  2291. required: true
  2292. description: JSON 请求体,业务字段置于 data
  2293. content:
  2294. application/json:
  2295. schema:
  2296. type: object
  2297. description: 统一信封请求体,业务字段放在 data 内
  2298. properties:
  2299. data:
  2300. type: object
  2301. description: 业务参数
  2302. properties:
  2303. team_id:
  2304. type: string
  2305. description: 团队 ID
  2306. ticket_types:
  2307. type: array
  2308. description: 该成员可处理的工单类型(须为团队可分配类型的子集;空数组=不接单,如录入人员;⛔ 含 `renewal`——续签单只由运营账号受理)。`ticket_mode=follow_team` 时不得传本键
  2309. items:
  2310. type: string
  2311. description: 工单类型码
  2312. ticket_mode:
  2313. type: string
  2314. description: 可处理类型形态:follow_team=随团队可分配类型(成员级零行,团队改类型自动跟随);custom=勾选子集。缺省=follow_team(D-04/OR-14:与负责范围默认同构;显式 custom 且不带 ticket_types=不接单)
  2315. enum:
  2316. - follow_team
  2317. - custom
  2318. username:
  2319. type: string
  2320. description: 登录名
  2321. name:
  2322. type: string
  2323. description: 成员姓名(必填;1~64 字符、不含控制字符;契约字段=`name`,兼容旧键 `display_name`)。与登录名分列,列表「成员」列显示该值
  2324. display_name:
  2325. type: string
  2326. description: 成员姓名别名(兼容旧调用方;与 `name` 同义,优先用 `name`)
  2327. mobile:
  2328. type: string
  2329. description: 手机号(可选)
  2330. required:
  2331. - team_id
  2332. - username
  2333. - name
  2334. required:
  2335. - data
  2336. x-error-codes: [60053, 60054, 60068, 60082]
  2337. responses:
  2338. "200":
  2339. description: 成功。统一信封 code/message/data
  2340. /ops_team/member_update@v1:
  2341. post:
  2342. summary: 更新运维成员
  2343. description: 可改成员姓名、手机号与可处理工单类型(形态+子集,各字段缺省=不改)。注意:2026-11-05 起成员不分类型,不因类型变更改写 role_code;`custom` 时子集落 ops_member_ticket_type,`follow_team` 时清空该成员行并随团队类型。
  2344. operationId: ops_team_member_update
  2345. tags:
  2346. - 运维团队与成员
  2347. x-require-auth: true
  2348. x-resource-type:
  2349. $ref: '#/components/x-resource-types/ops_team/code'
  2350. x-action:
  2351. $ref: '#/components/x-actions/manage/code'
  2352. x-version: v1
  2353. x-permission-visibility: catalog
  2354. requestBody:
  2355. required: true
  2356. description: JSON 请求体,业务字段置于 data
  2357. content:
  2358. application/json:
  2359. schema:
  2360. type: object
  2361. description: 统一信封请求体,业务字段放在 data 内
  2362. properties:
  2363. data:
  2364. type: object
  2365. description: 业务参数
  2366. properties:
  2367. team_id:
  2368. type: string
  2369. description: 团队 ID
  2370. ticket_types:
  2371. type: array
  2372. description: 该成员可处理的工单类型(整体替换;须为团队可分配类型的子集;空数组=不接单;⛔ 含 `renewal`——续签单只由运营账号受理)。`ticket_mode=follow_team` 时不得传本键
  2373. items:
  2374. type: string
  2375. description: 工单类型码
  2376. ticket_mode:
  2377. type: string
  2378. description: 可处理类型形态:follow_team=随团队(清空该成员的类型行);custom=按 ticket_types 整体替换。缺省且带 ticket_types ⇒ 按 custom;都不带 ⇒ 不动类型
  2379. enum:
  2380. - follow_team
  2381. - custom
  2382. member_id:
  2383. type: string
  2384. description: 成员 ID
  2385. name:
  2386. type: string
  2387. description: 成员姓名新值(契约字段=`name`,兼容旧键 `display_name`);1~64 字符、不含控制字符;缺省=不改,空串非法
  2388. display_name:
  2389. type: string
  2390. description: 成员姓名别名(兼容旧调用方;与 `name` 同义)
  2391. mobile:
  2392. type: string
  2393. description: 手机号(可选)
  2394. required:
  2395. - team_id
  2396. - member_id
  2397. required:
  2398. - data
  2399. x-error-codes: [60053, 60054, 60068, 60082]
  2400. responses:
  2401. "200":
  2402. description: 成功。统一信封 code/message/data
  2403. /ops_team/transfer_primary@v1:
  2404. post:
  2405. summary: 转交运维团队主账号
  2406. description: 总运营/运维主账号可办;同事务切换两人的 is_primary 并同步 role_code(teamLead↔ops),新主账号可处理类型强制随团队;登录名与负责范围不变。
  2407. operationId: ops_team_transfer_primary
  2408. tags:
  2409. - 运维团队与成员
  2410. x-require-auth: true
  2411. x-resource-type:
  2412. $ref: '#/components/x-resource-types/ops_team/code'
  2413. x-action:
  2414. $ref: '#/components/x-actions/manage/code'
  2415. x-version: v1
  2416. x-permission-visibility: catalog
  2417. requestBody:
  2418. required: true
  2419. description: JSON 请求体,业务字段置于 data
  2420. content:
  2421. application/json:
  2422. schema:
  2423. type: object
  2424. description: 统一信封请求体,业务字段放在 data 内
  2425. properties:
  2426. data:
  2427. type: object
  2428. description: 业务参数
  2429. properties:
  2430. team_id:
  2431. type: string
  2432. description: 团队 ID
  2433. from_member_id:
  2434. type: string
  2435. description: 原主账号成员 ID
  2436. to_member_id:
  2437. type: string
  2438. description: 新主账号成员 ID(须同团队)
  2439. required:
  2440. - team_id
  2441. - from_member_id
  2442. - to_member_id
  2443. required:
  2444. - data
  2445. x-error-codes: [60053, 60054, 60068]
  2446. responses:
  2447. "200":
  2448. description: 成功。统一信封 code/message/data
  2449. /ops_team/member_remove@v1:
  2450. post:
  2451. summary: 移除运维成员
  2452. description: 删除前五项检查并注销账号。
  2453. operationId: ops_team_member_remove
  2454. tags:
  2455. - 运维团队与成员
  2456. x-require-auth: true
  2457. x-resource-type:
  2458. $ref: '#/components/x-resource-types/ops_team/code'
  2459. x-action:
  2460. $ref: '#/components/x-actions/manage/code'
  2461. x-version: v1
  2462. x-permission-visibility: catalog
  2463. requestBody:
  2464. required: true
  2465. description: JSON 请求体,业务字段置于 data
  2466. content:
  2467. application/json:
  2468. schema:
  2469. type: object
  2470. description: 统一信封请求体,业务字段放在 data 内
  2471. properties:
  2472. data:
  2473. type: object
  2474. description: 业务参数
  2475. properties:
  2476. team_id:
  2477. type: string
  2478. description: 团队 ID
  2479. member_id:
  2480. type: string
  2481. description: 成员 ID
  2482. required:
  2483. - team_id
  2484. - member_id
  2485. required:
  2486. - data
  2487. x-error-codes: [60053, 60054, 60068, 60082]
  2488. responses:
  2489. "200":
  2490. description: 成功。统一信封 code/message/data
  2491. /ops_member/scope/save@v1:
  2492. post:
  2493. summary: 保存运维成员负责范围
  2494. description: 三个范围写入口之二。scope_mode∈follow_team/region/customer;越界报错不保存。
  2495. operationId: ops_member_scope_save
  2496. tags:
  2497. - 运维团队与成员
  2498. x-require-auth: true
  2499. x-resource-type:
  2500. $ref: '#/components/x-resource-types/ops_member_scope/code'
  2501. x-action:
  2502. $ref: '#/components/x-actions/manage/code'
  2503. x-version: v1
  2504. x-permission-visibility: catalog
  2505. requestBody:
  2506. required: true
  2507. description: JSON 请求体,业务字段置于 data
  2508. content:
  2509. application/json:
  2510. schema:
  2511. type: object
  2512. description: 统一信封请求体,业务字段放在 data 内
  2513. properties:
  2514. data:
  2515. type: object
  2516. description: 业务参数
  2517. properties:
  2518. member_id:
  2519. type: string
  2520. description: 成员 ID
  2521. scope_mode:
  2522. type: string
  2523. description: 范围模式:follow_team=跟随团队;region=按区域;customer=按客户
  2524. enum:
  2525. - follow_team
  2526. - region
  2527. - customer
  2528. targets:
  2529. type: array
  2530. description: region/customer 模式下的目标 ID 列表
  2531. items:
  2532. type: string
  2533. description: 目标 ID
  2534. required:
  2535. - member_id
  2536. - scope_mode
  2537. required:
  2538. - data
  2539. x-error-codes: [60053, 60054, 60068, 60082]
  2540. responses:
  2541. "200":
  2542. description: 成功。统一信封 code/message/data
  2543. /ops_team/dispatch_mode/update@v1:
  2544. post:
  2545. summary: 更新分派方式
  2546. description: 与运营侧改同一字段,后写入者生效;默认补记审计。
  2547. operationId: ops_team_dispatch_mode_update
  2548. tags:
  2549. - 运维团队与成员
  2550. x-require-auth: true
  2551. x-resource-type:
  2552. $ref: '#/components/x-resource-types/ops_team_dispatch_mode/code'
  2553. x-action:
  2554. $ref: '#/components/x-actions/update/code'
  2555. x-version: v1
  2556. x-permission-visibility: catalog
  2557. requestBody:
  2558. required: true
  2559. description: JSON 请求体,业务字段置于 data
  2560. content:
  2561. application/json:
  2562. schema:
  2563. type: object
  2564. description: 统一信封请求体,业务字段放在 data 内
  2565. properties:
  2566. data:
  2567. type: object
  2568. description: 业务参数
  2569. properties:
  2570. team_id:
  2571. type: string
  2572. description: 团队 ID
  2573. dispatch_mode:
  2574. type: string
  2575. description: 分派方式:manual=手工;auto_avg=自动均分
  2576. enum:
  2577. - manual
  2578. - auto_avg
  2579. required:
  2580. - team_id
  2581. - dispatch_mode
  2582. required:
  2583. - data
  2584. x-error-codes: [60053, 60054, 60068, 60082]
  2585. responses:
  2586. "200":
  2587. description: 成功。统一信封 code/message/data
  2588. /ops_team/coverage/get@v1:
  2589. post:
  2590. summary: 运维团队覆盖客户
  2591. description: 覆盖客户=团队区域范围(Tree) ∩ 本类型归属(Owner),与列表分页同源。注意:2026-11-08 由 GET 改 POST(R-5)。
  2592. operationId: ops_team_coverage_get
  2593. tags:
  2594. - 运维团队与成员
  2595. x-require-auth: true
  2596. x-resource-type:
  2597. $ref: '#/components/x-resource-types/ops_team_coverage/code'
  2598. x-action:
  2599. $ref: '#/components/x-actions/view/code'
  2600. x-version: v1
  2601. x-permission-visibility: catalog
  2602. x-enumeration-kind: list
  2603. requestBody:
  2604. required: true
  2605. description: 统一信封请求体(无业务参数,data 传空对象以使网关注入授权上界)
  2606. content:
  2607. application/json:
  2608. schema:
  2609. type: object
  2610. properties:
  2611. data:
  2612. type: object
  2613. description: 无业务参数
  2614. required:
  2615. - data
  2616. x-error-codes: [60053, 60054, 60068, 60082]
  2617. responses:
  2618. "200":
  2619. description: 成功。统一信封 code/message/data
  2620. /customer/create@v1:
  2621. post:
  2622. summary: 新建客户
  2623. description: 客户建档(Opt-11 先挂树后建档)。`mount_request_id` 与 `parent_node_id` 至少给一个:给 `parent_node_id` 时由本接口完成「发号 → 平台资源树注册客户实例 → 回填挂载事实」;给 `mount_request_id` 时就近认领已存在的挂载申请。同时按 组织§4.5 为客户开通主账号(`primary_username` 留空=按主体号自动派生)。完整弹窗字段还可含识别号、联系人、地址、运维团队等。
  2624. operationId: customer_create
  2625. tags:
  2626. - 客户管理
  2627. x-require-auth: true
  2628. x-resource-type:
  2629. $ref: '#/components/x-resource-types/customer/code'
  2630. x-action:
  2631. $ref: '#/components/x-actions/create/code'
  2632. x-version: v1
  2633. x-permission-visibility: catalog
  2634. requestBody:
  2635. required: true
  2636. description: JSON 请求体,业务字段置于 data
  2637. content:
  2638. application/json:
  2639. schema:
  2640. type: object
  2641. description: 统一信封请求体,业务字段放在 data 内
  2642. properties:
  2643. data:
  2644. type: object
  2645. description: 业务参数
  2646. properties:
  2647. customer_name:
  2648. type: string
  2649. description: 客户名称
  2650. subject_type:
  2651. type: string
  2652. description: 主体类型
  2653. operator_id:
  2654. type: string
  2655. description: 归属运营商 ID
  2656. partner_id:
  2657. type: string
  2658. description: 归属合伙人 ID(可选)
  2659. mount_request_id:
  2660. type: string
  2661. description: 挂载申请 ID(与 parent_node_id 二选一;有值=认领已有的挂载事实)
  2662. parent_node_id:
  2663. type: string
  2664. description: 所挂区域父节点 ID(与 mount_request_id 二选一;有值=由本接口完成平台挂树并回填挂载事实)
  2665. id_code:
  2666. type: string
  2667. description: 识别号(可选)
  2668. contact_name:
  2669. type: string
  2670. description: 联系人(可选)
  2671. contact_mobile:
  2672. type: string
  2673. description: 联系电话(可选)
  2674. tech_contact_name:
  2675. type: string
  2676. description: 技术联系人姓名(可选)
  2677. tech_contact_mobile:
  2678. type: string
  2679. description: 技术联系人电话(可选)
  2680. finance_contact_name:
  2681. type: string
  2682. description: 财务联系人姓名(可选)
  2683. finance_contact_mobile:
  2684. type: string
  2685. description: 财务联系人电话(可选)
  2686. remark:
  2687. type: string
  2688. description: 客户备注(可选,≤512 字)
  2689. address:
  2690. type: string
  2691. description: 地址(可选)
  2692. ops_team_ids:
  2693. type: array
  2694. description: 所挂运维团队 ID(**单支定案** 2026-11-12:建档必填**恰好 1 支**,数组形态仅兼容调用方;缺支/空数组/>1 支一律拒绝,且须在操作人负责范围内)
  2695. items:
  2696. type: string
  2697. description: 运维团队 ID
  2698. primary_username:
  2699. type: string
  2700. description: 客户主账号登录名(可选;留空=按主体号自动派生)。本接口自行调平台 iam-user/user/create@v1 建号
  2701. primary_mobile:
  2702. type: string
  2703. description: 客户主账号手机号(可选)
  2704. license:
  2705. type: object
  2706. description: 登记材料(营业执照影像,客户§2.1/§3.5;`U-97` 2026-11-03 定案)。**选填**(业主 2026-11-19 定案,⛔ 强制登记)。影像本体由浏览器持自身账号票直传平台 `unified-oss`(本服务不收字节流、不开上传接口),建档只回报落库用的对象键+原始文件名。`object_key` 必须落在 `klt/customer/license/` 前缀下
  2707. properties:
  2708. object_key:
  2709. type: string
  2710. description: 平台 unified-oss 逻辑键(1–512 字符,须以 klt/customer/license/ 开头;不得是 URL/签名链接)
  2711. file_name:
  2712. type: string
  2713. description: 原始文件名(1–128 字符,不含路径分隔符;仅供页面展示)
  2714. required:
  2715. - object_key
  2716. - file_name
  2717. required:
  2718. - customer_name
  2719. - subject_type
  2720. - operator_id
  2721. required:
  2722. - data
  2723. x-error-codes: [60056, 60064, 60108, 60117]
  2724. responses:
  2725. "200":
  2726. description: 成功。统一信封 code/message/data
  2727. /customer/get_list@v1:
  2728. post:
  2729. summary: 客户列表
  2730. description: 按可见范围返回客户列表,支持筛选与分页。
  2731. operationId: customer_get_list
  2732. tags:
  2733. - 客户管理
  2734. x-require-auth: true
  2735. x-resource-type:
  2736. $ref: '#/components/x-resource-types/customer/code'
  2737. x-action:
  2738. $ref: '#/components/x-actions/list/code'
  2739. x-version: v1
  2740. x-permission-visibility: catalog
  2741. # 工单回件 §5.2 B1 点名的「客户列表」:本路由列出的行=klt.customer 维度的资源实例
  2742. # (PG-3 的可见集口径即「授权上界 ∩ 资源树挂载」),故按 list 声明真源列举。
  2743. # 注意:声明本身不改变本轮可见范围:handler 现按 customer_scope_pred 收窄
  2744. # (customer.rs:556 → partner.rs:1146),运维分支仍走本地 bos_data_scope,
  2745. # 通道②在运维分支的接入待业主确认口径(见影响清单 L-2)。
  2746. x-enumeration-kind: list
  2747. requestBody:
  2748. required: true
  2749. description: JSON 请求体,业务字段置于 data
  2750. content:
  2751. application/json:
  2752. schema:
  2753. type: object
  2754. description: 统一信封请求体,业务字段放在 data 内
  2755. properties:
  2756. data:
  2757. type: object
  2758. description: 列表筛选参数
  2759. properties:
  2760. page:
  2761. type: integer
  2762. description: 页码(0 基索引,默认 0)
  2763. minimum: 0
  2764. default: 0
  2765. page_size:
  2766. type: integer
  2767. description: 每页条数(默认 20,上限 200)
  2768. minimum: 1
  2769. maximum: 200
  2770. default: 20
  2771. keyword:
  2772. type: string
  2773. description: 关键字筛选(可选)
  2774. region_node_id:
  2775. type: string
  2776. description: 区域筛选(可选)
  2777. operator_id:
  2778. type: string
  2779. description: 运营商筛选(可选)
  2780. partner_id:
  2781. type: string
  2782. description: 合伙人筛选(可选)
  2783. status:
  2784. type: string
  2785. description: 状态筛选(可选)
  2786. required:
  2787. - data
  2788. x-error-codes: [60056, 60064, 60108, 60117]
  2789. responses:
  2790. "200":
  2791. description: 成功。统一信封 code/message/data
  2792. /customer/get@v1:
  2793. post:
  2794. summary: 客户详情
  2795. description: |
  2796. 按客户 ID 查询档案详情;回显主体资料(含经办联系人/联系电话/地址,脱敏识别号)与当期团队、区域挂载、分账号数,以及登记材料摘要 `license{…}`(客户§3.5)。
  2797. **读侧越权(N-2/客户§3.7)**:不存在与不可见**同码同文**=信封 `60005`+文案含 `11104`(⛔ 分档回 `60108` 枚举存在性);写侧越权仍用 `60108`/`KLT-C007`。
  2798. operationId: customer_get
  2799. tags:
  2800. - 客户管理
  2801. x-require-auth: true
  2802. x-resource-type:
  2803. $ref: '#/components/x-resource-types/customer/code'
  2804. x-action:
  2805. $ref: '#/components/x-actions/view/code'
  2806. x-version: v1
  2807. x-permission-visibility: catalog
  2808. requestBody:
  2809. required: true
  2810. description: JSON 请求体,业务字段置于 data
  2811. content:
  2812. application/json:
  2813. schema:
  2814. type: object
  2815. description: 统一信封请求体,业务字段放在 data 内
  2816. properties:
  2817. data:
  2818. type: object
  2819. description: 业务参数
  2820. properties:
  2821. customer_id:
  2822. type: string
  2823. description: 客户 ID
  2824. required:
  2825. - customer_id
  2826. required:
  2827. - data
  2828. x-error-codes: [60005, 60056, 60064, 60117]
  2829. responses:
  2830. "200":
  2831. description: 成功。统一信封 code/message/data
  2832. /customer/update@v1:
  2833. post:
  2834. summary: 编辑客户
  2835. description: >-
  2836. 编辑客户资料。拒收改写 customer_id/region_node_id/operator_id/partner_id;改识别号时 change_basis 选填(留空按 NULL 留痕,⛔ 因缺依据拒写)。
  2837. **`row_version` 必填**(N-7):缺省 ⇒ `60004`;与库内不符 ⇒ `KLT-S407`/`60001`,⛔ 不带版本静默覆盖。
  2838. 登记材料换图或随主体变更撤销时,**旧对象即时删除**(平台 `unified-oss/object/delete@v1`,KB-2 §2.6;
  2839. 生命周期回收只兜「到期」,不替代即时删除)。删除为 best-effort:主表此刻已指向新对象,
  2840. 删除失败不回退整笔,只告警并由运维补删。响应新增 `license_object_delete{status,reason,deleted?,failed_codes?,error?}`:
  2841. `not_applicable`(未动影像/键未变)/`deleted`/`partial`/`failed`。注意:对象键不上响应体。
  2842. operationId: customer_update
  2843. tags:
  2844. - 客户管理
  2845. x-require-auth: true
  2846. x-resource-type:
  2847. $ref: '#/components/x-resource-types/customer/code'
  2848. x-action:
  2849. $ref: '#/components/x-actions/update/code'
  2850. x-version: v1
  2851. x-permission-visibility: catalog
  2852. requestBody:
  2853. required: true
  2854. description: JSON 请求体,业务字段置于 data
  2855. content:
  2856. application/json:
  2857. schema:
  2858. type: object
  2859. description: 统一信封请求体,业务字段放在 data 内
  2860. properties:
  2861. data:
  2862. type: object
  2863. description: 业务参数
  2864. properties:
  2865. customer_id:
  2866. type: string
  2867. description: 客户 ID
  2868. customer_name:
  2869. type: string
  2870. description: 客户名称
  2871. subject_type:
  2872. type: string
  2873. description: 主体类型
  2874. id_code:
  2875. type: string
  2876. description: 识别号
  2877. change_basis:
  2878. type: string
  2879. description: 改识别号时的变更依据
  2880. contact_name:
  2881. type: string
  2882. description: 联系人
  2883. contact_mobile:
  2884. type: string
  2885. description: 联系电话
  2886. tech_contact_name:
  2887. type: string
  2888. description: 技术联系人姓名(给了才改)
  2889. tech_contact_mobile:
  2890. type: string
  2891. description: 技术联系人电话(给了才改)
  2892. finance_contact_name:
  2893. type: string
  2894. description: 财务联系人姓名(给了才改)
  2895. finance_contact_mobile:
  2896. type: string
  2897. description: 财务联系人电话(给了才改)
  2898. remark:
  2899. type: string
  2900. description: 客户备注(给了才改;空串=清空;≤512 字)
  2901. address:
  2902. type: string
  2903. description: 地址
  2904. ops_team_ids:
  2905. type: array
  2906. description: 改派运维团队(整体替换当前归属;**单支定案**:最多 1 支——空数组=清空归属⇒拒绝,>1 支⇒拒绝;不提交=不改动)
  2907. items:
  2908. type: string
  2909. description: 运维团队 ID
  2910. row_version:
  2911. type: integer
  2912. description: 乐观锁版本(必填;缺省=60004,不符=KLT-S407/60001)
  2913. license:
  2914. type: object
  2915. description: 登记材料(营业执照影像)**整对替换**(客户§3.5 补传/替换,写入口只在本分区)。**选填**(业主 2026-11-19 定案,⛔ 强制登记)。不提交=本次不动影像(不清空);**唯一例外**:本次把 `subject_type` 改为非企业(`individual`/`sole_proprietor`)且库内有影像 ⇒ 影像随本笔**同批撤销**(两列置 `NULL`+`license_file_name` 变更留痕,见 2026-11-15 死锁修复);企业→企业不带 `license` 一律不动影像;库内无影像且本次也不提交时**照常保存其余字段**。`object_key` 须落在 `klt/customer/license/` 下
  2916. properties:
  2917. object_key:
  2918. type: string
  2919. description: 平台 unified-oss 逻辑键(1–512 字符,须以 klt/customer/license/ 开头)
  2920. file_name:
  2921. type: string
  2922. description: 原始文件名(1–128 字符,不含路径分隔符)
  2923. required:
  2924. - object_key
  2925. - file_name
  2926. required:
  2927. - customer_id
  2928. - row_version
  2929. required:
  2930. - data
  2931. x-error-codes: [60001, 60004, 60056, 60064, 60108, 60117]
  2932. responses:
  2933. "200":
  2934. description: 成功。统一信封 code/message/data
  2935. /customer/delete_precheck@v1:
  2936. post:
  2937. summary: 客户删除前置检查
  2938. description: 返回 can_delete 与 reasons,供删除确认弹窗使用。
  2939. operationId: customer_delete_precheck
  2940. tags:
  2941. - 客户管理
  2942. x-require-auth: true
  2943. x-resource-type:
  2944. $ref: '#/components/x-resource-types/customer/code'
  2945. x-action:
  2946. $ref: '#/components/x-actions/view/code'
  2947. x-version: v1
  2948. x-permission-visibility: catalog
  2949. requestBody:
  2950. required: true
  2951. description: JSON 请求体,业务字段置于 data
  2952. content:
  2953. application/json:
  2954. schema:
  2955. type: object
  2956. description: 统一信封请求体,业务字段放在 data 内
  2957. properties:
  2958. data:
  2959. type: object
  2960. description: 业务参数
  2961. properties:
  2962. customer_id:
  2963. type: string
  2964. description: 客户 ID
  2965. required:
  2966. - customer_id
  2967. required:
  2968. - data
  2969. x-error-codes: [60056, 60064, 60108, 60117]
  2970. responses:
  2971. "200":
  2972. description: 成功。统一信封 code/message/data
  2973. /customer/delete@v1:
  2974. post:
  2975. summary: 删除客户
  2976. description: 删除客户;须携带删除前置检查时的阻塞快照版本。
  2977. operationId: customer_delete
  2978. tags:
  2979. - 客户管理
  2980. x-require-auth: true
  2981. x-resource-type:
  2982. $ref: '#/components/x-resource-types/customer/code'
  2983. x-action:
  2984. $ref: '#/components/x-actions/delete/code'
  2985. x-version: v1
  2986. x-permission-visibility: catalog
  2987. requestBody:
  2988. required: true
  2989. description: JSON 请求体,业务字段置于 data
  2990. content:
  2991. application/json:
  2992. schema:
  2993. type: object
  2994. description: 统一信封请求体,业务字段放在 data 内
  2995. properties:
  2996. data:
  2997. type: object
  2998. description: 业务参数
  2999. properties:
  3000. customer_id:
  3001. type: string
  3002. description: 客户 ID
  3003. precheck_version:
  3004. type: string
  3005. description: 删除前置检查快照版本
  3006. required:
  3007. - customer_id
  3008. required:
  3009. - data
  3010. x-error-codes: [60056, 60064, 60108, 60117]
  3011. responses:
  3012. "200":
  3013. description: 成功。统一信封 code/message/data
  3014. /customer/history@v1:
  3015. post:
  3016. summary: 客户变更历史
  3017. description: 查询客户档案变更流水。
  3018. operationId: customer_history
  3019. tags:
  3020. - 客户管理
  3021. x-require-auth: true
  3022. x-resource-type:
  3023. $ref: '#/components/x-resource-types/customer/code'
  3024. x-action:
  3025. $ref: '#/components/x-actions/view/code'
  3026. x-version: v1
  3027. x-permission-visibility: catalog
  3028. requestBody:
  3029. required: true
  3030. description: JSON 请求体,业务字段置于 data
  3031. content:
  3032. application/json:
  3033. schema:
  3034. type: object
  3035. description: 统一信封请求体,业务字段放在 data 内
  3036. properties:
  3037. data:
  3038. type: object
  3039. description: 业务参数
  3040. properties:
  3041. customer_id:
  3042. type: string
  3043. description: 客户 ID
  3044. page:
  3045. type: integer
  3046. description: 页码(0 基索引,默认 0)
  3047. minimum: 0
  3048. default: 0
  3049. page_size:
  3050. type: integer
  3051. description: 每页条数(默认 20,上限 200)
  3052. minimum: 1
  3053. maximum: 200
  3054. default: 20
  3055. keyword:
  3056. type: string
  3057. description: 关键字筛选(可选)
  3058. required:
  3059. - customer_id
  3060. required:
  3061. - data
  3062. x-error-codes: [60056, 60064, 60108, 60117]
  3063. responses:
  3064. "200":
  3065. description: 成功。统一信封 code/message/data
  3066. /customer/mount_candidates@v1:
  3067. post:
  3068. summary: 改挂候选客户
  3069. description: 返回操作人可见范围内可作为改挂目标的候选客户列表。注意:2026-11-08 由 GET 改 POST(R-5)。
  3070. operationId: customer_mount_candidates
  3071. tags:
  3072. - 客户管理
  3073. x-require-auth: true
  3074. x-resource-type:
  3075. $ref: '#/components/x-resource-types/customer/code'
  3076. x-action:
  3077. $ref: '#/components/x-actions/view/code'
  3078. x-version: v1
  3079. x-permission-visibility: catalog
  3080. x-enumeration-kind: list
  3081. requestBody:
  3082. required: true
  3083. description: 统一信封请求体(无业务参数,data 传空对象以使网关注入授权上界)
  3084. content:
  3085. application/json:
  3086. schema:
  3087. type: object
  3088. properties:
  3089. data:
  3090. type: object
  3091. description: 无业务参数
  3092. required:
  3093. - data
  3094. x-error-codes: [60056, 60064, 60108, 60117]
  3095. responses:
  3096. "200":
  3097. description: 成功。统一信封 code/message/data
  3098. /customer/influence@v1:
  3099. post:
  3100. summary: 改挂影响面
  3101. description: 改挂前必做前置:未办完工单数、当前责任人与团队、当期是否已出账等。
  3102. operationId: customer_influence
  3103. tags:
  3104. - 客户管理
  3105. x-require-auth: true
  3106. x-resource-type:
  3107. $ref: '#/components/x-resource-types/customer/code'
  3108. x-action:
  3109. $ref: '#/components/x-actions/view/code'
  3110. x-version: v1
  3111. x-permission-visibility: catalog
  3112. requestBody:
  3113. required: true
  3114. description: JSON 请求体,业务字段置于 data
  3115. content:
  3116. application/json:
  3117. schema:
  3118. type: object
  3119. description: 统一信封请求体,业务字段放在 data 内
  3120. properties:
  3121. data:
  3122. type: object
  3123. description: 业务参数
  3124. properties:
  3125. customer_id:
  3126. type: string
  3127. description: 客户 ID
  3128. required:
  3129. - customer_id
  3130. required:
  3131. - data
  3132. x-error-codes: [60056, 60064, 60108, 60117]
  3133. responses:
  3134. "200":
  3135. description: 成功。统一信封 code/message/data
  3136. /customer/move_region@v1:
  3137. post:
  3138. summary: 客户改挂区域
  3139. description: 复合事务改挂区域;新区域省份须等于归属运营商档案省份。
  3140. operationId: customer_move_region
  3141. tags:
  3142. - 客户管理
  3143. x-require-auth: true
  3144. x-resource-type:
  3145. $ref: '#/components/x-resource-types/customer/code'
  3146. x-action:
  3147. $ref: '#/components/x-actions/update/code'
  3148. x-version: v1
  3149. x-permission-visibility: catalog
  3150. requestBody:
  3151. required: true
  3152. description: JSON 请求体,业务字段置于 data
  3153. content:
  3154. application/json:
  3155. schema:
  3156. type: object
  3157. description: 统一信封请求体,业务字段放在 data 内
  3158. properties:
  3159. data:
  3160. type: object
  3161. description: 业务参数
  3162. properties:
  3163. customer_id:
  3164. type: string
  3165. description: 客户 ID
  3166. new_region_node_id:
  3167. type: string
  3168. description: 新挂载区域节点 ID
  3169. ops_team_ids:
  3170. type: array
  3171. description: 随改挂重绑的运维团队(**单支定案**:最多 1 支;不提交=不改动)
  3172. items:
  3173. type: string
  3174. description: 运维团队 ID
  3175. required:
  3176. - customer_id
  3177. - new_region_node_id
  3178. required:
  3179. - data
  3180. x-error-codes: [60056, 60064, 60108, 60117]
  3181. responses:
  3182. "200":
  3183. description: 成功。统一信封 code/message/data
  3184. /customer/attribution/update@v1:
  3185. post:
  3186. summary: 更新客户归属
  3187. description: 改归属运营商/合伙人;改运营商时档案省份须等于客户所挂区域省份。
  3188. operationId: customer_attribution_update
  3189. tags:
  3190. - 客户管理
  3191. x-require-auth: true
  3192. x-resource-type:
  3193. $ref: '#/components/x-resource-types/customer_attribution/code'
  3194. x-action:
  3195. $ref: '#/components/x-actions/update/code'
  3196. x-version: v1
  3197. x-permission-visibility: catalog
  3198. requestBody:
  3199. required: true
  3200. description: JSON 请求体,业务字段置于 data
  3201. content:
  3202. application/json:
  3203. schema:
  3204. type: object
  3205. description: 统一信封请求体,业务字段放在 data 内
  3206. properties:
  3207. data:
  3208. type: object
  3209. description: 业务参数
  3210. properties:
  3211. customer_id:
  3212. type: string
  3213. description: 客户 ID
  3214. operator_id:
  3215. type: string
  3216. description: 新归属运营商 ID(可选)
  3217. partner_id:
  3218. type: string
  3219. description: 新归属合伙人 ID(可选,可清空)
  3220. required:
  3221. - customer_id
  3222. required:
  3223. - data
  3224. x-error-codes: [60056, 60064, 60108, 60117]
  3225. responses:
  3226. "200":
  3227. description: 成功。统一信封 code/message/data
  3228. /import_batch/template_download@v1:
  3229. get:
  3230. summary: 下载导入模板
  3231. description: 返回 14 列 xlsx 模板说明(format/columns/max_rows)。
  3232. operationId: import_batch_template_download
  3233. tags:
  3234. - 批量导入
  3235. x-require-auth: true
  3236. x-resource-type:
  3237. $ref: '#/components/x-resource-types/import_batch/code'
  3238. x-action:
  3239. $ref: '#/components/x-actions/export/code'
  3240. x-version: v1
  3241. x-permission-visibility: catalog
  3242. x-error-codes: [60111, 60112, 60113, 60114]
  3243. responses:
  3244. "200":
  3245. description: 成功。统一信封 code/message/data
  3246. /import_batch/submit@v1:
  3247. post:
  3248. summary: 提交客户批量导入
  3249. description: 提交导入行对象列表,单批上限 500 行。列含客户名称、识别号、主体类型、联系人、电话、地址、区域、运营商、合伙人、运维团队、主账号等。
  3250. operationId: import_batch_submit
  3251. tags:
  3252. - 批量导入
  3253. x-require-auth: true
  3254. x-resource-type:
  3255. $ref: '#/components/x-resource-types/import_batch/code'
  3256. x-action:
  3257. $ref: '#/components/x-actions/create/code'
  3258. x-version: v1
  3259. x-permission-visibility: catalog
  3260. requestBody:
  3261. required: true
  3262. description: JSON 请求体,业务字段置于 data
  3263. content:
  3264. application/json:
  3265. schema:
  3266. type: object
  3267. description: 统一信封请求体,业务字段放在 data 内
  3268. properties:
  3269. data:
  3270. type: object
  3271. description: 业务参数
  3272. properties:
  3273. rows:
  3274. type: array
  3275. description: 导入行对象列表(≤500)
  3276. maxItems: 500
  3277. items:
  3278. type: object
  3279. description: 单行导入字段(14 列)
  3280. properties:
  3281. row_no:
  3282. type: integer
  3283. description: 行编号
  3284. customer_name:
  3285. type: string
  3286. description: 客户名称
  3287. id_code:
  3288. type: string
  3289. description: 识别号
  3290. subject_type:
  3291. type: string
  3292. description: 主体类型
  3293. contact_name:
  3294. type: string
  3295. description: 联系人
  3296. contact_mobile:
  3297. type: string
  3298. description: 联系电话
  3299. address:
  3300. type: string
  3301. description: 地址
  3302. region_name:
  3303. type: string
  3304. description: 所挂区域
  3305. operator_name:
  3306. type: string
  3307. description: 运营商
  3308. partner_name:
  3309. type: string
  3310. description: 合伙人
  3311. ops_team_names:
  3312. type: array
  3313. description: 所挂运维团队名称(**单支定案** 2026-11-12:建档必填**恰好 1 支**——一格只填一支名称,不得用「;」分隔多支;留空或多支=该行校验失败)
  3314. items:
  3315. type: string
  3316. description: 运维团队名称
  3317. primary_username:
  3318. type: string
  3319. description: 主账号登录名
  3320. primary_mobile:
  3321. type: string
  3322. description: 主账号手机号
  3323. required:
  3324. - rows
  3325. required:
  3326. - data
  3327. x-error-codes: [60111, 60112, 60113, 60114]
  3328. responses:
  3329. "200":
  3330. description: 成功。统一信封 code/message/data
  3331. /import_batch/get_list@v1:
  3332. post:
  3333. summary: 导入批次列表
  3334. description: 查询本人可见范围内的导入批次。
  3335. operationId: import_batch_get_list
  3336. tags:
  3337. - 批量导入
  3338. x-require-auth: true
  3339. x-resource-type:
  3340. $ref: '#/components/x-resource-types/import_batch/code'
  3341. x-action:
  3342. $ref: '#/components/x-actions/list/code'
  3343. x-version: v1
  3344. x-permission-visibility: catalog
  3345. requestBody:
  3346. required: true
  3347. description: JSON 请求体,业务字段置于 data
  3348. content:
  3349. application/json:
  3350. schema:
  3351. type: object
  3352. description: 统一信封请求体,业务字段放在 data 内
  3353. properties:
  3354. data:
  3355. type: object
  3356. description: 列表筛选参数
  3357. properties:
  3358. page:
  3359. type: integer
  3360. description: 页码(0 基索引,默认 0)
  3361. minimum: 0
  3362. default: 0
  3363. page_size:
  3364. type: integer
  3365. description: 每页条数(默认 20,上限 200)
  3366. minimum: 1
  3367. maximum: 200
  3368. default: 20
  3369. keyword:
  3370. type: string
  3371. description: 关键字筛选(可选)
  3372. required:
  3373. - data
  3374. x-error-codes: [60111, 60112, 60113, 60114]
  3375. responses:
  3376. "200":
  3377. description: 成功。统一信封 code/message/data
  3378. /import_batch/get@v1:
  3379. post:
  3380. summary: 导入批次详情
  3381. description: 按批次 ID/编号查询详情与行状态。
  3382. operationId: import_batch_get
  3383. tags:
  3384. - 批量导入
  3385. x-require-auth: true
  3386. x-resource-type:
  3387. $ref: '#/components/x-resource-types/import_batch/code'
  3388. x-action:
  3389. $ref: '#/components/x-actions/view/code'
  3390. x-version: v1
  3391. x-permission-visibility: catalog
  3392. requestBody:
  3393. required: true
  3394. description: JSON 请求体,业务字段置于 data
  3395. content:
  3396. application/json:
  3397. schema:
  3398. type: object
  3399. description: 统一信封请求体,业务字段放在 data 内
  3400. properties:
  3401. data:
  3402. type: object
  3403. description: 业务参数
  3404. properties:
  3405. batch_id:
  3406. type: string
  3407. description: 批次 ID(与 batch_no 二选一)
  3408. batch_no:
  3409. type: string
  3410. description: 批次编号(与 batch_id 二选一)
  3411. required:
  3412. - data
  3413. x-error-codes: [60111, 60112, 60113, 60114]
  3414. responses:
  3415. "200":
  3416. description: 成功。统一信封 code/message/data
  3417. /import_batch/resume@v1:
  3418. post:
  3419. summary: 失败行续传
  3420. description: 针对失败行提交续传数据,行号对应原 row_no。
  3421. operationId: import_batch_resume
  3422. tags:
  3423. - 批量导入
  3424. x-require-auth: true
  3425. x-resource-type:
  3426. $ref: '#/components/x-resource-types/import_batch/code'
  3427. x-action:
  3428. $ref: '#/components/x-actions/update/code'
  3429. x-version: v1
  3430. x-permission-visibility: catalog
  3431. requestBody:
  3432. required: true
  3433. description: JSON 请求体,业务字段置于 data
  3434. content:
  3435. application/json:
  3436. schema:
  3437. type: object
  3438. description: 统一信封请求体,业务字段放在 data 内
  3439. properties:
  3440. data:
  3441. type: object
  3442. description: 业务参数
  3443. properties:
  3444. batch_id:
  3445. type: string
  3446. description: 批次 ID
  3447. rows:
  3448. type: array
  3449. description: 续传行列表(含原 row_no)
  3450. items:
  3451. type: object
  3452. required:
  3453. - batch_id
  3454. - rows
  3455. required:
  3456. - data
  3457. x-error-codes: [60111, 60112, 60113, 60114]
  3458. responses:
  3459. "200":
  3460. description: 成功。统一信封 code/message/data
  3461. /import_batch/export_codes@v1:
  3462. post:
  3463. summary: 按批次导出激活码
  3464. description: |
  3465. 语义同账号导出(与 `/account/export_codes@v1` 共用分片/翻页/审计/出参信封,D-14);
  3466. 须传批次与按本人可见范围收窄后的 user_ids(不可传空列表:空值=项目内全量);
  3467. scope 服务端派生,不收 scope_type/scope_id;validity 默认 `valid`,不接受 `active`。
  3468. 错误码:批次收窄 `60111`–`60114`;账号门禁同账号口 `60004`/`60005`/`60058`/`60108`(⛔ `60503`/`60066`);
  3469. 出参另含 `batch_id`/`batch_no` 与读/写同一信封字段。
  3470. operationId: import_batch_export_codes
  3471. tags:
  3472. - 批量导入
  3473. x-require-auth: true
  3474. x-resource-type:
  3475. $ref: '#/components/x-resource-types/import_batch/code'
  3476. x-action:
  3477. $ref: '#/components/x-actions/export/code'
  3478. x-version: v1
  3479. x-permission-visibility: catalog
  3480. requestBody:
  3481. required: true
  3482. description: JSON 请求体,业务字段置于 data
  3483. content:
  3484. application/json:
  3485. schema:
  3486. type: object
  3487. description: 统一信封请求体,业务字段放在 data 内
  3488. properties:
  3489. data:
  3490. type: object
  3491. description: 业务参数
  3492. properties:
  3493. batch_id:
  3494. type: string
  3495. description: 批次 ID
  3496. user_ids:
  3497. type: array
  3498. description: 按本人可见范围收窄后的用户 ID 列表(不可传空列表:平台侧空值=项目内全量导出)
  3499. minItems: 1
  3500. items:
  3501. type: string
  3502. description: 用户 ID
  3503. validity:
  3504. type: string
  3505. description: 导出口径(平台取值域):valid=仍有效(只读,缺省);expired=已过期(写);all=全部(写)。不接受 active
  3506. default: valid
  3507. enum:
  3508. - valid
  3509. - expired
  3510. - all
  3511. required:
  3512. - batch_id
  3513. - user_ids
  3514. required:
  3515. - data
  3516. x-error-codes: [60004, 60005, 60058, 60108, 60111, 60112, 60113, 60114]
  3517. responses:
  3518. "200":
  3519. description: 成功。统一信封 code/message/data
  3520. /import_batch/export_customers@v1:
  3521. post:
  3522. summary: 按批次导出客户
  3523. description: 按导入批次导出客户 15 列结果。
  3524. operationId: import_batch_export_customers
  3525. tags:
  3526. - 批量导入
  3527. x-require-auth: true
  3528. x-resource-type:
  3529. $ref: '#/components/x-resource-types/import_batch/code'
  3530. x-action:
  3531. $ref: '#/components/x-actions/export/code'
  3532. x-version: v1
  3533. x-permission-visibility: catalog
  3534. requestBody:
  3535. required: true
  3536. description: JSON 请求体,业务字段置于 data
  3537. content:
  3538. application/json:
  3539. schema:
  3540. type: object
  3541. description: 统一信封请求体,业务字段放在 data 内
  3542. properties:
  3543. data:
  3544. type: object
  3545. description: 业务参数
  3546. properties:
  3547. batch_id:
  3548. type: string
  3549. description: 批次 ID
  3550. required:
  3551. - batch_id
  3552. required:
  3553. - data
  3554. x-error-codes: [60111, 60112, 60113, 60114]
  3555. responses:
  3556. "200":
  3557. description: 成功。统一信封 code/message/data
  3558. /sub_account/get_list@v1:
  3559. post:
  3560. summary: 分账号列表
  3561. description: 查询客户下属分账号列表。
  3562. operationId: sub_account_get_list
  3563. tags:
  3564. - 账号管理
  3565. x-require-auth: true
  3566. x-resource-type:
  3567. $ref: '#/components/x-resource-types/sub_account/code'
  3568. x-action:
  3569. $ref: '#/components/x-actions/list/code'
  3570. x-version: v1
  3571. x-permission-visibility: catalog
  3572. # 工单回件 §5.2 B1 点名的「分账号列表」:列表按所属客户的可见集收窄
  3573. # (sub_account.rs:50 get_list → :57 customer_scope_pred),客户维度受授权上界约束
  3574. # ⇒ 按 list 声明真源列举。同 L-2:本轮仅打通声明,运维分支仍走本地口径。
  3575. x-enumeration-kind: list
  3576. requestBody:
  3577. required: true
  3578. description: JSON 请求体,业务字段置于 data
  3579. content:
  3580. application/json:
  3581. schema:
  3582. type: object
  3583. description: 统一信封请求体,业务字段放在 data 内
  3584. properties:
  3585. data:
  3586. type: object
  3587. description: 业务参数
  3588. properties:
  3589. customer_id:
  3590. type: string
  3591. description: 客户 ID
  3592. page:
  3593. type: integer
  3594. description: 页码(0 基索引,默认 0)
  3595. minimum: 0
  3596. default: 0
  3597. page_size:
  3598. type: integer
  3599. description: 每页条数(默认 20,上限 200)
  3600. minimum: 1
  3601. maximum: 200
  3602. default: 20
  3603. keyword:
  3604. type: string
  3605. description: 关键字筛选(可选)
  3606. required:
  3607. - customer_id
  3608. required:
  3609. - data
  3610. x-error-codes: []
  3611. responses:
  3612. "200":
  3613. description: 成功。统一信封 code/message/data
  3614. /sub_account/update@v1:
  3615. post:
  3616. summary: 更新分账号
  3617. description: 运营可改 display_name 与 network_account_name;客户主账号只许改 display_name。
  3618. operationId: sub_account_update
  3619. tags:
  3620. - 账号管理
  3621. x-require-auth: true
  3622. x-resource-type:
  3623. $ref: '#/components/x-resource-types/sub_account/code'
  3624. x-action:
  3625. $ref: '#/components/x-actions/update/code'
  3626. x-version: v1
  3627. x-permission-visibility: catalog
  3628. requestBody:
  3629. required: true
  3630. description: JSON 请求体,业务字段置于 data
  3631. content:
  3632. application/json:
  3633. schema:
  3634. type: object
  3635. description: 统一信封请求体,业务字段放在 data 内
  3636. properties:
  3637. data:
  3638. type: object
  3639. description: 业务参数
  3640. properties:
  3641. sub_account_id:
  3642. type: string
  3643. description: 分账号 ID
  3644. display_name:
  3645. type: string
  3646. description: 显示名称/用途说明
  3647. network_account_name:
  3648. type: string
  3649. description: 网络侧账号名(运营可改)
  3650. required:
  3651. - sub_account_id
  3652. required:
  3653. - data
  3654. x-error-codes: []
  3655. responses:
  3656. "200":
  3657. description: 成功。统一信封 code/message/data
  3658. /delivery/list@v1:
  3659. post:
  3660. summary: 交付现状(在册资源一览)
  3661. description: '讨论稿§7.7:客户详情「交付现状」页签与订阅详情「当前资源」区块共用。数据源锁定台账 subscription_ip_assignment(released_at IS NULL 的行=当前在册),⛔ 不用“最新一单”(并单后一单只含部分账号、service_open 又是增量交付);实测参数(内网 IP/实测上下行/实测出口)只取该账号“最近一次成功开通回填”(ticket_backfill.exec_conclusion=success)并随行下发 measured_at(列头日期)。三态:在用/已到期待回收(台账未释放且订阅 end_date 已过)/已回收(默认只显示前两态,勾选 include_released 才含第三态)。合同出口与实测出口两列并排、不一致时 exit_mismatch=true(两值都返回,⛔ 互相覆盖)。输出不含 port_start/port_end(D-6 端口本轮不启用、无“端口段”列)。可见范围复用 customer_scope_pred,未另立判据。'
  3662. operationId: delivery_list
  3663. tags:
  3664. - 交付现状
  3665. x-require-auth: true
  3666. x-resource-type:
  3667. $ref: '#/components/x-resource-types/delivery/code'
  3668. x-action:
  3669. $ref: '#/components/x-actions/list/code'
  3670. x-version: v1
  3671. x-permission-visibility: catalog
  3672. requestBody:
  3673. required: false
  3674. description: 分页与筛选(page/page_size/customer_id/subscription_id/sub_account_id/keyword/state/include_released),业务字段置于 data
  3675. content:
  3676. application/json:
  3677. schema:
  3678. type: object
  3679. x-error-codes: [60004, 60053]
  3680. responses:
  3681. "200":
  3682. description: 成功。统一信封 code/message/data
  3683. /delivery/export@v1:
  3684. post:
  3685. summary: 交付现状导出
  3686. description: '讨论稿§7.7/§6.3 第 7 条:入参与 /delivery/list@v1 逐字同构(同一份 DTO、同一段谓词),导出不另立判据;CSV(UTF-8 带 BOM)首行为 `#` 说明行(导出时刻+筛选条件逐项回显+文件行数/同一谓词命中总数+范围裁剪声明);行数上限 20000,超限 KLT-R20903(detail.row_count/detail.limit)且不产文件、不写审计、不落 OSS;产出成功写 object_type=delivery_export 留痕,留痕失败 KLT-S405。角色 admin/opsMain/opsSub/teamLead。'
  3687. operationId: delivery_export
  3688. tags:
  3689. - 交付现状
  3690. x-require-auth: true
  3691. x-resource-type:
  3692. $ref: '#/components/x-resource-types/delivery/code'
  3693. x-action:
  3694. $ref: '#/components/x-actions/export/code'
  3695. x-version: v1
  3696. x-permission-visibility: catalog
  3697. requestBody:
  3698. required: false
  3699. description: 与 /delivery/list@v1 同构的筛选条件(page/page_size 不参与导出)
  3700. content:
  3701. application/json:
  3702. schema:
  3703. type: object
  3704. x-error-codes: [60903, 60905]
  3705. responses:
  3706. "200":
  3707. description: 成功。统一信封 code/message/data
  3708. /line_exit/get_list@v1:
  3709. post:
  3710. summary: 线路出口目录列表
  3711. description: 套餐配置统一维护的线路出口(去空白+小写去重)。合同条目等页面只从这里选择;任何登录角色可读。每条带 ref_count/ref_summary(被合同条目、存量 IP 备案、派生档、订阅引用的合计与构成;IP 备案表自 2026-11-17 起停写,只计入历史行,防历史悬空),>0 即目录侧不允许删除。⚠️ 工单回填不读本目录、也不与订阅核定集合比对(2026-11-17 业主口径「工单连出口都不校」,KLT-G20406 已退役)。
  3712. operationId: line_exit_get_list
  3713. tags:
  3714. - 套餐档位
  3715. x-require-auth: true
  3716. x-resource-type:
  3717. $ref: '#/components/x-resource-types/catalog/code'
  3718. x-action:
  3719. $ref: '#/components/x-actions/list/code'
  3720. x-version: v1
  3721. x-permission-visibility: catalog
  3722. responses:
  3723. "200":
  3724. description: 成功。统一信封 code/message/data(data.items[]=exit_name/exit_key/sort_no/ref_count/ref_summary)
  3725. /line_exit/save@v1:
  3726. post:
  3727. summary: 线路出口目录整段全量替换
  3728. description: 总运营/运营主账号可写;数组顺序即展示顺序。被合同条目、存量 IP 备案(该表自 2026-11-17 起停写,只计历史行)、派生档或订阅引用的出口不可删除(整单拒绝并点名引用数)。
  3729. operationId: line_exit_save
  3730. tags:
  3731. - 套餐档位
  3732. x-require-auth: true
  3733. x-resource-type:
  3734. $ref: '#/components/x-resource-types/catalog/code'
  3735. x-action:
  3736. $ref: '#/components/x-actions/update/code'
  3737. x-version: v1
  3738. x-permission-visibility: catalog
  3739. requestBody:
  3740. required: true
  3741. description: JSON 请求体,业务字段置于 data
  3742. content:
  3743. application/json:
  3744. schema:
  3745. type: object
  3746. description: 统一信封请求体,业务字段放在 data 内
  3747. properties:
  3748. data:
  3749. type: object
  3750. description: 业务参数
  3751. properties:
  3752. items:
  3753. type: array
  3754. description: 线路出口整段(全量替换,上限 200 条)
  3755. maxItems: 200
  3756. items:
  3757. type: object
  3758. description: 单个出口
  3759. properties:
  3760. exit_name:
  3761. type: string
  3762. description: 国家/地区名称原文(1~64 字;去空白+小写后不可重复)
  3763. required:
  3764. - exit_name
  3765. required:
  3766. - items
  3767. required:
  3768. - data
  3769. x-error-codes: []
  3770. responses:
  3771. "200":
  3772. description: 成功。统一信封 code/message/data
  3773. /ip_bandwidth_tier/get_list@v1:
  3774. post:
  3775. summary: 带宽档位目录列表
  3776. description: 套餐配置「线路出口」tab 内统一维护的带宽档位(2026-11-16 业主裁定:档位不再写死 5/10/30 兆)。✅ 2026-11-17 改用途:主要作为**固定套餐/自定义套餐配置中带宽权益录入的快捷预设**(档位编辑器「03 带宽与权益」点一条即带出上/下行同值),另兼存量 IP 备案的历史引用;⛔ 与工单回填的 5/10/30 封闭三值互不约束。任何登录角色可读。每条带 ref_count/ref_summary(被存量 IP 备案引用的条数;该表自 2026-11-17 起停写),>0 即目录侧不允许删除。
  3777. operationId: ip_bandwidth_tier_get_list
  3778. tags:
  3779. - 套餐档位
  3780. x-require-auth: true
  3781. x-resource-type:
  3782. $ref: '#/components/x-resource-types/catalog/code'
  3783. x-action:
  3784. $ref: '#/components/x-actions/list/code'
  3785. x-version: v1
  3786. x-permission-visibility: catalog
  3787. x-error-codes: []
  3788. responses:
  3789. "200":
  3790. description: 成功。统一信封 code/message/data(data.items[]=tier_key/tier_name/bandwidth_tier_mbps/bandwidth_committed/sort_no/ref_count/ref_summary)
  3791. /ip_bandwidth_tier/save@v1:
  3792. post:
  3793. summary: 带宽档位目录整段全量替换
  3794. description: |
  3795. 总运营/运营主账号可写;数组顺序即展示顺序(也是套餐编辑器里预设胶囊的顺序);同一兆数只允许一条,「不承诺带宽」(bandwidth_tier_mbps 缺省或 null)全表唯一。被存量 IP 备案引用的档位不可删除(整单拒绝并点名引用条数)。⚠️ 本清单是套餐带宽权益的**快捷预设**,⛔ 反向约束套餐上手填的兆数。
  3796. ⚠️ **读写不对称(既定契约)**:`get_list` 回 `tier_key`/`bandwidth_committed`/`sort_no`(系统派生);本接口 `items[]` **只收** `tier_name`+`bandwidth_tier_mbps`。⛔ 把读侧 JSON 原样写回(会因未声明字段/系统带出字段被拒)。
  3797. operationId: ip_bandwidth_tier_save
  3798. tags:
  3799. - 套餐档位
  3800. x-require-auth: true
  3801. x-resource-type:
  3802. $ref: '#/components/x-resource-types/catalog/code'
  3803. x-action:
  3804. $ref: '#/components/x-actions/update/code'
  3805. x-version: v1
  3806. x-permission-visibility: catalog
  3807. requestBody:
  3808. required: true
  3809. description: JSON 请求体,业务字段置于 data
  3810. content:
  3811. application/json:
  3812. schema:
  3813. type: object
  3814. description: 统一信封请求体,业务字段放在 data 内
  3815. properties:
  3816. data:
  3817. type: object
  3818. description: 业务参数
  3819. properties:
  3820. items:
  3821. type: array
  3822. description: 带宽档位整段(全量替换,上限 50 条)
  3823. maxItems: 50
  3824. items:
  3825. type: object
  3826. description: 单个档位
  3827. properties:
  3828. tier_name:
  3829. type: string
  3830. description: 展示名称(1~64 字,如「10 兆」「不承诺带宽」)
  3831. bandwidth_tier_mbps:
  3832. type: integer
  3833. nullable: true
  3834. description: 带宽兆数(1~10000);缺省或 null=「不承诺带宽」
  3835. required:
  3836. - tier_name
  3837. required:
  3838. - items
  3839. required:
  3840. - data
  3841. x-error-codes: []
  3842. responses:
  3843. "200":
  3844. description: 成功。统一信封 code/message/data
  3845. /portal/plan_board@v1:
  3846. post:
  3847. summary: 客户侧「我的套餐」两表
  3848. description: |
  3849. 第 9 册门户 4 的唯一自有读口(§4)。主体号一律由会话派生:载荷出现
  3850. `customer_id`/`sub_account_id` ⇒ 硬拒(甲类);出现 `status`/`scope`/
  3851. `region_id` ⇒ `11103`(乙类)。`view=board`(与 `view=list` 同义)一次返回
  3852. 「当前套餐」「往期套餐」两表;`view=detail` 本轮未接线 ⇒ `60008`。
  3853. operationId: portal_plan_board
  3854. tags:
  3855. - 客户门户
  3856. x-require-auth: true
  3857. x-resource-type:
  3858. $ref: '#/components/x-resource-types/portal/code'
  3859. x-action:
  3860. $ref: '#/components/x-actions/plan_board/code'
  3861. x-version: v1
  3862. x-permission-visibility: catalog
  3863. requestBody:
  3864. required: true
  3865. description: JSON 请求体,业务字段置于 data
  3866. content:
  3867. application/json:
  3868. schema:
  3869. type: object
  3870. description: 统一信封请求体,业务字段放在 data 内
  3871. properties:
  3872. data:
  3873. type: object
  3874. description: 业务参数(白名单只有 view;主体与状态类键一律拒收)
  3875. properties:
  3876. view:
  3877. type: string
  3878. enum:
  3879. - board
  3880. - list
  3881. - detail
  3882. description: board(同义 list)=两表;detail=详情三段(本轮未接线 ⇒ 60008)
  3883. required:
  3884. - data
  3885. # ⚠️ 只能是**整数**数组:注册中心 `error_code_range` 对字符串条目判
  3886. # 「x-error-codes 含有非整数」⇒ 整条路由 validation_status=abnormal/callable=false,
  3887. # 网关不导流(实测 50000 未找到匹配路由)。字符串别名(KLT-P301→60058、
  3888. # KLT-M221→60214)只写在本 description 里,⛔ 再写回数组。
  3889. x-error-codes: [11103, 60004, 60005, 60008, 60058]
  3890. responses:
  3891. "200":
  3892. description: 成功。统一信封 code/message/data
  3893. content:
  3894. application/json:
  3895. schema:
  3896. type: object
  3897. properties:
  3898. code:
  3899. type: integer
  3900. message:
  3901. type: string
  3902. data:
  3903. type: object
  3904. properties:
  3905. view:
  3906. type: string
  3907. party:
  3908. type: object
  3909. description: 页头主体:customer_id/customer_name/operator_name(签订方)/region_path
  3910. current_rows:
  3911. type: array
  3912. description: 当前套餐(status.key ∈ active/pending),服务端排序
  3913. items:
  3914. $ref: '#/components/schemas/PortalPlanBoardRow'
  3915. history_rows:
  3916. type: array
  3917. description: 往期套餐(含 expired 与 cancelled/replaced 终态)
  3918. items:
  3919. $ref: '#/components/schemas/PortalPlanBoardRow'
  3920. amount_note:
  3921. type: string
  3922. description: 合同总额与每期结算口径的说明行(逐字,前端⛔ 改写)
  3923. notes:
  3924. type: array
  3925. items:
  3926. type: string
  3927. /catalog/create@v1:
  3928. post:
  3929. summary: 新建套餐档位
  3930. description: 新建固定/自定义档位。拒收 sub_mode、first_referred_at。自定义档必填 customer_id。Ops 角色只能建自定义档(D-16);created_by=鉴权账号、created_team_id=建档团队快照(D-17)。
  3931. operationId: catalog_create
  3932. tags:
  3933. - 套餐档位
  3934. x-require-auth: true
  3935. x-resource-type:
  3936. $ref: '#/components/x-resource-types/catalog/code'
  3937. x-action:
  3938. $ref: '#/components/x-actions/create/code'
  3939. x-version: v1
  3940. x-permission-visibility: catalog
  3941. requestBody:
  3942. required: true
  3943. description: JSON 请求体,业务字段置于 data
  3944. content:
  3945. application/json:
  3946. schema:
  3947. type: object
  3948. description: 统一信封请求体,业务字段放在 data 内
  3949. properties:
  3950. data:
  3951. type: object
  3952. description: 业务参数
  3953. properties:
  3954. plan_kind:
  3955. type: string
  3956. description: 档位类型:fixed=固定;custom=自定义
  3957. enum:
  3958. - fixed
  3959. - custom
  3960. plan_name:
  3961. type: string
  3962. description: 档位名称
  3963. plan_desc:
  3964. type: string
  3965. description: 套餐说明(报价单权益口径,可空;去首尾空白后 ≤512 字符,超长报 11103)。引用冻结后仍可改(与名称、随附成本项同档)
  3966. plan_family:
  3967. type: string
  3968. description: 交付形态:link=跨境链路(份数恒 1);addon=叠加服务(份数≥1,不设带宽列)
  3969. enum:
  3970. - link
  3971. - addon
  3972. annual_price_cents:
  3973. type: integer
  3974. description: 年价(分)
  3975. monthly_settle_cents:
  3976. type: integer
  3977. description: 月结算标准(分,可选,1~上限);可录入(2026-11-19 起由只读列改为可写)
  3978. sub_account_quota:
  3979. type: integer
  3980. description: 分账号额度(非负,上限 9999):link 档必须 > 0;addon 档必须为 0(D-15)。可缺省——link=1、addon=0(2026-11-22)
  3981. bandwidth_committed:
  3982. type: boolean
  3983. description: 是否承诺带宽:仅 link 档可传(缺省 true);addon 档一律不传(D-18)
  3984. bandwidth_up_mbps:
  3985. type: integer
  3986. description: 上行带宽(Mbps,整数 1~1000);bandwidth_committed=true 时必填。不再有单值 total_bandwidth_mbps(2026-11-05 D8 关闭=该列退役,「总带宽」只是显示列名)
  3987. bandwidth_down_mbps:
  3988. type: integer
  3989. description: 下行带宽(Mbps,整数 1~1000);bandwidth_committed=true 时必填;与上行同值时界面并显「上下行 N 兆」,不等显「下行 X 兆 / 上行 Y 兆」
  3990. customer_id:
  3991. type: string
  3992. description: 自定义档所属客户 ID(custom 必填)
  3993. required:
  3994. - plan_kind
  3995. - plan_name
  3996. - plan_family
  3997. - annual_price_cents
  3998. required:
  3999. - data
  4000. x-error-codes: [60001, 60202, 60203, 60204, 60205, 60206, 60227]
  4001. responses:
  4002. "200":
  4003. description: 成功。统一信封 code/message/data
  4004. /catalog/update@v1:
  4005. post:
  4006. summary: 编辑套餐档位
  4007. description: 编辑档位;plan_kind/plan_family 建后不可改(K204);被订阅引用冻结后多数字段只读。
  4008. operationId: catalog_update
  4009. tags:
  4010. - 套餐档位
  4011. x-require-auth: true
  4012. x-resource-type:
  4013. $ref: '#/components/x-resource-types/catalog/code'
  4014. x-action:
  4015. $ref: '#/components/x-actions/update/code'
  4016. x-version: v1
  4017. x-permission-visibility: catalog
  4018. requestBody:
  4019. required: true
  4020. description: JSON 请求体,业务字段置于 data
  4021. content:
  4022. application/json:
  4023. schema:
  4024. type: object
  4025. description: 统一信封请求体,业务字段放在 data 内
  4026. properties:
  4027. data:
  4028. type: object
  4029. description: 业务参数
  4030. properties:
  4031. plan_id:
  4032. type: string
  4033. description: 档位 ID
  4034. plan_name:
  4035. type: string
  4036. description: 档位名称
  4037. plan_desc:
  4038. type: string
  4039. nullable: true
  4040. description: 套餐说明(可空;缺键=不动;null/空串=清空成库内 null;≤512 字符)。引用冻结后仍可改(2026-11-22)
  4041. annual_price_cents:
  4042. type: integer
  4043. description: 年价(分)
  4044. monthly_settle_cents:
  4045. type: integer
  4046. description: 月结算标准(分,可选,1~上限);可录入(2026-11-19 起由只读列改为可写)
  4047. sub_account_quota:
  4048. type: integer
  4049. description: 分账号额度(非负,上限 9999):link 档必须 > 0;addon 档必须为 0(D-15)
  4050. bandwidth_committed:
  4051. type: boolean
  4052. description: 是否承诺带宽:true=承诺(缺省);false=该档「不承诺带宽」,上下行两字段一律不传
  4053. bandwidth_up_mbps:
  4054. type: integer
  4055. description: 上行带宽(Mbps,整数 1~1000);bandwidth_committed=true 时必填,关闭「是否承诺带宽」时必不传(档位被订阅引用后随整单只读,K204)
  4056. bandwidth_down_mbps:
  4057. type: integer
  4058. description: 下行带宽(Mbps,整数 1~1000);必填规则同上,两值不折算为单值
  4059. row_version:
  4060. type: integer
  4061. description: 乐观锁版本(若启用)
  4062. required:
  4063. - plan_id
  4064. required:
  4065. - data
  4066. x-error-codes: [60001, 60202, 60203, 60204, 60205, 60206, 60227]
  4067. responses:
  4068. "200":
  4069. description: 成功。统一信封 code/message/data
  4070. /catalog/get_list@v1:
  4071. post:
  4072. summary: 套餐档位列表
  4073. description: 按 plan_kind/plan_family/created_by/created_team_id 等条件筛选档位列表。每行回 plan_family、use_purpose、created_by/created_team_id 及读侧名称 created_by_name/created_team_name(D-17);data.facets 回建档团队/建档人下拉项(服务端在 base 谓词 ∧ plan_kind=custom 上聚合,⛔ 用当前页行凑)。
  4074. operationId: catalog_get_list
  4075. tags:
  4076. - 套餐档位
  4077. x-require-auth: true
  4078. x-resource-type:
  4079. $ref: '#/components/x-resource-types/catalog/code'
  4080. x-action:
  4081. $ref: '#/components/x-actions/list/code'
  4082. x-version: v1
  4083. x-permission-visibility: catalog
  4084. requestBody:
  4085. required: true
  4086. description: JSON 请求体,业务字段置于 data
  4087. content:
  4088. application/json:
  4089. schema:
  4090. type: object
  4091. description: 统一信封请求体,业务字段放在 data 内
  4092. properties:
  4093. data:
  4094. type: object
  4095. description: 列表筛选参数
  4096. properties:
  4097. page:
  4098. type: integer
  4099. description: 页码(0 基索引,默认 0)
  4100. minimum: 0
  4101. default: 0
  4102. page_size:
  4103. type: integer
  4104. description: 每页条数(默认 20,上限 200)
  4105. minimum: 1
  4106. maximum: 200
  4107. default: 20
  4108. keyword:
  4109. type: string
  4110. description: 关键字筛选(可选)
  4111. plan_kind:
  4112. type: string
  4113. description: 档位类型筛选:fixed/custom
  4114. plan_family:
  4115. type: string
  4116. description: 交付形态筛选:link/addon(仅自定义档可筛,固定档带此参报错)
  4117. enum:
  4118. - link
  4119. - addon
  4120. customer_id:
  4121. type: string
  4122. description: 自定义档客户筛选
  4123. created_by:
  4124. type: string
  4125. description: 建档人筛选(R-14 台账收敛;=catalog_plan.created_by 账号 ID)
  4126. created_team_id:
  4127. type: string
  4128. description: 建档团队筛选(R-14 台账收敛;=建档时快照的 catalog_plan.created_team_id)
  4129. required:
  4130. - data
  4131. x-error-codes: [60001, 60202, 60203, 60204, 60205, 60206, 60227]
  4132. responses:
  4133. "200":
  4134. description: 成功。统一信封 code/message/data
  4135. /catalog/get@v1:
  4136. post:
  4137. summary: 套餐档位详情
  4138. description: 按档位 ID 查询详情。
  4139. operationId: catalog_get
  4140. tags:
  4141. - 套餐档位
  4142. x-require-auth: true
  4143. x-resource-type:
  4144. $ref: '#/components/x-resource-types/catalog/code'
  4145. x-action:
  4146. $ref: '#/components/x-actions/view/code'
  4147. x-version: v1
  4148. x-permission-visibility: catalog
  4149. requestBody:
  4150. required: true
  4151. description: JSON 请求体,业务字段置于 data
  4152. content:
  4153. application/json:
  4154. schema:
  4155. type: object
  4156. description: 统一信封请求体,业务字段放在 data 内
  4157. properties:
  4158. data:
  4159. type: object
  4160. description: 业务参数
  4161. properties:
  4162. plan_id:
  4163. type: string
  4164. description: 档位 ID
  4165. required:
  4166. - plan_id
  4167. required:
  4168. - data
  4169. x-error-codes: [60001, 60202, 60203, 60204, 60205, 60206, 60227]
  4170. responses:
  4171. "200":
  4172. description: 成功。统一信封 code/message/data
  4173. /catalog/delete@v1:
  4174. post:
  4175. summary: 套餐档位条件删除
  4176. description: 按档位 ID 条件删除(第3册§3.7):引用份数+两栏阻塞清单(subscriptions/items),在用⇒KLT-K205;固定档仅 Admin。
  4177. operationId: catalog_delete
  4178. tags:
  4179. - 套餐档位
  4180. x-require-auth: true
  4181. x-resource-type:
  4182. $ref: '#/components/x-resource-types/catalog/code'
  4183. x-action:
  4184. $ref: '#/components/x-actions/delete/code'
  4185. x-version: v1
  4186. x-permission-visibility: catalog
  4187. requestBody:
  4188. required: true
  4189. description: JSON 请求体,业务字段置于 data
  4190. content:
  4191. application/json:
  4192. schema:
  4193. type: object
  4194. description: 统一信封请求体,业务字段放在 data 内
  4195. properties:
  4196. data:
  4197. type: object
  4198. description: 业务参数
  4199. properties:
  4200. plan_id:
  4201. type: string
  4202. description: 档位 ID
  4203. required:
  4204. - plan_id
  4205. required:
  4206. - data
  4207. x-error-codes: [60001, 60202, 60203, 60204, 60205, 60206, 60227]
  4208. responses:
  4209. "200":
  4210. description: 成功。统一信封 code/message/data
  4211. /catalog/customer_options@v1:
  4212. post:
  4213. summary: 归属客户下拉
  4214. description: 只列操作人可见客户(自定义档归属客户下拉,第3册§3.2);硬上限 500 行⇒truncated。
  4215. operationId: catalog_customer_options
  4216. tags:
  4217. - 套餐档位
  4218. x-require-auth: true
  4219. x-resource-type:
  4220. $ref: '#/components/x-resource-types/catalog/code'
  4221. x-action:
  4222. $ref: '#/components/x-actions/list/code'
  4223. x-version: v1
  4224. x-permission-visibility: catalog
  4225. requestBody:
  4226. required: true
  4227. description: JSON 请求体,业务字段置于 data
  4228. content:
  4229. application/json:
  4230. schema:
  4231. type: object
  4232. description: 统一信封请求体,业务字段放在 data 内
  4233. properties:
  4234. data:
  4235. type: object
  4236. description: 列表筛选参数
  4237. properties:
  4238. keyword:
  4239. type: string
  4240. description: 客户名称关键字(可选)
  4241. required:
  4242. - data
  4243. x-error-codes: [60001, 60202, 60203, 60204, 60205, 60206, 60227]
  4244. responses:
  4245. "200":
  4246. description: 成功。统一信封 code/message/data
  4247. /plan_cost_item/get_list@v1:
  4248. post:
  4249. summary: 档位随附成本项列表
  4250. description: 按档位读取随附成本项(第3册§3.5;D-1:以 cost_item_id 强引用全局 cost_item,名称/类别/计费口径读时 JOIN 全局现名,全局改名套餐侧跟随);frozen 仅供前端提示。
  4251. operationId: plan_cost_item_get_list
  4252. tags:
  4253. - 套餐档位
  4254. x-require-auth: true
  4255. x-resource-type:
  4256. $ref: '#/components/x-resource-types/plan_cost_item/code'
  4257. x-action:
  4258. $ref: '#/components/x-actions/list/code'
  4259. x-version: v1
  4260. x-permission-visibility: catalog
  4261. requestBody:
  4262. required: true
  4263. description: JSON 请求体,业务字段置于 data
  4264. content:
  4265. application/json:
  4266. schema:
  4267. type: object
  4268. description: 统一信封请求体,业务字段放在 data 内
  4269. properties:
  4270. data:
  4271. type: object
  4272. description: 业务参数
  4273. properties:
  4274. plan_id:
  4275. type: string
  4276. description: 档位 ID
  4277. required:
  4278. - plan_id
  4279. required:
  4280. - data
  4281. x-error-codes: [60001, 60202, 60203, 60204, 60205, 60206, 60227]
  4282. responses:
  4283. "200":
  4284. description: 成功。统一信封 code/message/data
  4285. /plan_cost_item/save@v1:
  4286. post:
  4287. summary: 档位随附成本项整段全量替换
  4288. description: 一次提交该档位全部成本项(先按 plan_id 删净再逐条插,第3册§3.5;D-1:以 cost_item_id 强引用全局 cost_item,名称/类别/计费口径由服务端快照全局现值,前端只能从全局清单按 id 选择);同档位 cost_item_id 重复⇒KLT-K206;引用的 cost_item_id 不存在⇒60005。
  4289. operationId: plan_cost_item_save
  4290. tags:
  4291. - 套餐档位
  4292. x-require-auth: true
  4293. x-resource-type:
  4294. $ref: '#/components/x-resource-types/plan_cost_item/code'
  4295. x-action:
  4296. $ref: '#/components/x-actions/update/code'
  4297. x-version: v1
  4298. x-permission-visibility: catalog
  4299. requestBody:
  4300. required: true
  4301. description: JSON 请求体,业务字段置于 data
  4302. content:
  4303. application/json:
  4304. schema:
  4305. type: object
  4306. description: 统一信封请求体,业务字段放在 data 内
  4307. properties:
  4308. data:
  4309. type: object
  4310. description: 业务参数
  4311. properties:
  4312. plan_id:
  4313. type: string
  4314. description: 档位 ID
  4315. items:
  4316. type: array
  4317. description: 成本项整段(全量替换,上限 50 条)
  4318. maxItems: 50
  4319. items:
  4320. type: object
  4321. description: 成本项条目(D-1:cost_item_id 为强引用,必填;item_name/category/billing_unit 由服务端快照全局现值覆盖,传值仅作长度兜底)
  4322. properties:
  4323. cost_item_id:
  4324. type: string
  4325. description: 全局成本项 ID(必填,强引用;须在全局 cost_item 清单中存在)
  4326. item_name:
  4327. type: string
  4328. description: 成本项名称(可选,服务端以全局现名快照覆盖;传值仅校验长度≤128)
  4329. amount_cents:
  4330. type: integer
  4331. description: 金额(分,≥0)
  4332. minimum: 0
  4333. billing_unit:
  4334. type: string
  4335. description: 计费单位(可选,服务端以全局现值覆盖)
  4336. enum:
  4337. - per_customer
  4338. - per_account
  4339. - per_copy
  4340. category:
  4341. type: string
  4342. description: 成本项分类(可选,服务端以全局现值覆盖)
  4343. enum:
  4344. - intl_resource
  4345. - device_purchase
  4346. - project_fee
  4347. remark:
  4348. type: string
  4349. description: 备注(可选,上限 512 字)
  4350. sort_no:
  4351. type: integer
  4352. description: 排序号(≥0)
  4353. minimum: 0
  4354. required:
  4355. - cost_item_id
  4356. - amount_cents
  4357. required:
  4358. - plan_id
  4359. required:
  4360. - data
  4361. x-error-codes: [60001, 60202, 60203, 60204, 60205, 60206, 60227]
  4362. responses:
  4363. "200":
  4364. description: 成功。统一信封 code/message/data
  4365. /contract/create@v1:
  4366. post:
  4367. summary: 新建合同
  4368. description: 客户段+合同段+服务构成条目一次提交(⚠️ 2026-11-17 起不再受理 IP 条目:`ip_entries`/`has_fixed_ip` 视为未知键 ⇒ 11103;境外 IP 由套餐档位所含 IP × 订阅份数表达)。客户未命中时用 data.customer_inline 随合同建档(先建档、后签合同,两个事务),成功时 data.inline_customer 回显客户号/主账号/激活码发放态/影像待补(激活码明文不在应答内,走客户列表「导出激活码」)。拒收 source(服务端定);created_by/created_by_name/created_by_org/created_by_mobile(录入经办人:机构/姓名/联系方式)由服务端从鉴权上下文写入、不取入参;agent_* 是运营商交接单上的经办人(姓名/电话/交接日期必填、机构选填)。
  4369. operationId: contract_create
  4370. tags:
  4371. - 合同
  4372. x-require-auth: true
  4373. x-resource-type:
  4374. $ref: '#/components/x-resource-types/contract/code'
  4375. x-action:
  4376. $ref: '#/components/x-actions/create/code'
  4377. x-version: v1
  4378. x-permission-visibility: catalog
  4379. requestBody:
  4380. required: true
  4381. description: JSON 请求体,业务字段置于 data
  4382. content:
  4383. application/json:
  4384. schema:
  4385. type: object
  4386. description: 统一信封请求体,业务字段放在 data 内
  4387. properties:
  4388. data:
  4389. type: object
  4390. description: 业务参数(`customer_id` 与 `customer_inline` **至少给一个且不可同时给**)
  4391. properties:
  4392. customer_id:
  4393. type: string
  4394. description: 签约客户 ID。与 customer_inline **只可二选一**:命中已有客户填本项;未命中改用内联建档段
  4395. customer_inline:
  4396. type: object
  4397. description: >-
  4398. 客户未命中时的内联建档段(需求 §5.3 CU-13;业主 2026-11-16 定案关闭 CU-41)。
  4399. 本段先按 `/customer/create@v1` 的同一套规则建档(两个事务:建档 → 合同,不合并),
  4400. 再签本合同;建档含客户主账号(未设初始口令 ⇒ 待激活、发激活码,明文不在本响应内下发)。
  4401. 注意:企业营业执照影像**选填**(业主 2026-11-19 定案,与页面建档同口径),
  4402. 留空不影响建档,建档后到客户档案「登记材料」格补传/替换。主体类型非企业时不收 license。
  4403. properties:
  4404. customer_name:
  4405. type: string
  4406. description: 客户名称(必填;允许重名,查重靠识别号)
  4407. subject_type:
  4408. type: string
  4409. description: 主体类型(必填):enterprise/individual/sole_proprietor
  4410. enum:
  4411. - enterprise
  4412. - individual
  4413. - sole_proprietor
  4414. id_code:
  4415. type: string
  4416. description: 客户识别号(必填):既是安全存储载体,也是合同事务失败后重试的幂等键(不得省略)
  4417. contact_name:
  4418. type: string
  4419. description: 客户经办联系人(与联系电话、地址同属 CU-13 第 1 步字段)
  4420. contact_mobile:
  4421. type: string
  4422. description: 联系电话
  4423. tech_contact_name:
  4424. type: string
  4425. description: 技术联系人姓名(选填)
  4426. tech_contact_mobile:
  4427. type: string
  4428. description: 技术联系人电话(选填)
  4429. finance_contact_name:
  4430. type: string
  4431. description: 财务联系人姓名(选填)
  4432. finance_contact_mobile:
  4433. type: string
  4434. description: 财务联系人电话(选填)
  4435. remark:
  4436. type: string
  4437. description: 客户备注(选填,≤512 字)
  4438. partner_id:
  4439. type: string
  4440. description: 归属合伙人(选填;反查所得,落 customer.partner_id)
  4441. address:
  4442. type: string
  4443. description: 客户地址
  4444. parent_node_id:
  4445. type: string
  4446. description: 挂载区域(必填;区域树节点 ID,与 /customer/create@v1 的 parent_node_id 同义)
  4447. operator_id:
  4448. type: string
  4449. description: 归属运营商(必填;弹窗下拉,候选=所挂区域省份下可见的运营商档案)
  4450. ops_team_ids:
  4451. type: array
  4452. description: 运维团队(必填且**恰好 1 支**,单支定案;不得为空数组/不得传多支)
  4453. items:
  4454. type: string
  4455. description: 团队 ID
  4456. license:
  4457. type: object
  4458. description: 营业执照影像(**选填**;非企业主体不收)。两键成对
  4459. properties:
  4460. object_key:
  4461. type: string
  4462. description: 平台对象存储对象键(浏览器直传后回报,须在客户影像前缀下)
  4463. file_name:
  4464. type: string
  4465. description: 原始文件名(仅展示)
  4466. required:
  4467. - object_key
  4468. - file_name
  4469. primary_username:
  4470. type: string
  4471. description: 客户主账号登录名(选填;留空按主体号派生,4~32 位字母数字与 . _ -)
  4472. primary_mobile:
  4473. type: string
  4474. description: 主账号绑定手机号(选填,11 位)
  4475. required:
  4476. - customer_name
  4477. - subject_type
  4478. - id_code
  4479. - parent_node_id
  4480. - operator_id
  4481. - ops_team_ids
  4482. contract_no:
  4483. type: string
  4484. description: 合同编号(空则服务端发号)
  4485. external_no:
  4486. type: string
  4487. description: 外部合同号(可选)
  4488. contract_type:
  4489. type: string
  4490. description: >-
  4491. 合同类型:new(新建,缺省)/renew(续签)/expand(扩容补充协议)/change(变更协议)。
  4492. 语义收口:renew 必须同时给 renew_from_contract_id;expand 的服务构成必须整批为增量叠加服务;
  4493. 带 renew_from_contract_id 的合同类型只能是 renew。
  4494. enum:
  4495. - new
  4496. - renew
  4497. - expand
  4498. - change
  4499. sign_date:
  4500. type: string
  4501. description: 签署日期(YYYY-MM-DD;选填,缺省按 agent_handover_on 兜底)
  4502. format: date
  4503. contract_amount_cents:
  4504. type: integer
  4505. description: 合同金额(分,可选)
  4506. service_months:
  4507. type: integer
  4508. description: >-
  4509. 服务期(月,1~600,必填):替代原 pay_cycle;结束日=生效日+服务期−1 天
  4510. (该月无对应日先取月末),页面锁定为只读推算值。
  4511. minimum: 1
  4512. maximum: 600
  4513. start_date:
  4514. type: string
  4515. description: 合同开始日期(YYYY-MM-DD)
  4516. format: date
  4517. end_date:
  4518. type: string
  4519. description: >-
  4520. 合同结束日期(YYYY-MM-DD,可省略):省略时服务端按「生效日+服务期(月)−1 天」
  4521. 推算(该月无对应日先取月末);显式给出则按显式值落库。
  4522. format: date
  4523. agent_name:
  4524. type: string
  4525. description: 运营商经办人姓名(交接单三段之二,必填;不是录入账号 created_by)
  4526. agent_mobile:
  4527. type: string
  4528. description: 运营商经办人联系方式(交接单三段之三,必填)
  4529. agent_handover_on:
  4530. type: string
  4531. description: 经办交接日期(必填;与姓名/联系电话构成运营商经办人三件套,只用于回溯交接来源)
  4532. format: date
  4533. agent_org:
  4534. type: string
  4535. description: 运营商经办人机构(交接单三段之一,选填)
  4536. attachment_url:
  4537. type: string
  4538. maxLength: 512
  4539. description: >-
  4540. 合同附件(单值,可选):外部 http(s) 链接,或浏览器直传平台对象存储
  4541. (seoh-unified-oss 两段式)成功后回报的对象键,前缀必须为
  4542. klt/contract/attachment/。空串=清空。对象键不得当作可直接打开的链接,
  4543. 详情读口另下发 attachment_view_url(短时效现签)。
  4544. service_items:
  4545. type: array
  4546. description: 服务构成条目列表
  4547. items:
  4548. type: object
  4549. description: 服务条目
  4550. properties:
  4551. plan_id:
  4552. type: string
  4553. description: 档位 ID(必填;2026-11-19 D-15 起条目只能引用目录档位)
  4554. quantity:
  4555. type: integer
  4556. description: 份数:link 档恒 1;addon 档≥1
  4557. item_family:
  4558. type: string
  4559. description: 交付形态(只读确认位,可缺省):只能与所引档位的 plan_family 相同,不同即 KLT-L216
  4560. enum:
  4561. - link
  4562. - addon
  4563. item_mode:
  4564. type: string
  4565. description: >-
  4566. 条目模式(D-9):new=常规条目(缺省);increment=增量叠加服务,只能引用本客户
  4567. 既有 link 订阅(只传 ref_subscription_id,⛔ 再填 serves_item_id/
  4568. serves_item_index),档位必须是 addon。读口按同一编码原样回传。
  4569. enum:
  4570. - new
  4571. - increment
  4572. serves_item_index:
  4573. type: integer
  4574. minimum: 0
  4575. description: >-
  4576. 从属宿主(D-7):普通叠加服务叠加于同一请求 service_items 的哪一条,
  4577. **0 基下标**(新建父条目尚无 item_id 时用)。父条目已存在时也可改传 serves_item_id;
  4578. 二者同时给即 11103。仅 item_mode=new 且档位为 addon 时必填其一。
  4579. serves_item_id:
  4580. type: string
  4581. description: >-
  4582. 从属宿主的条目 ID(编辑合同、父条目已存在时用);与 serves_item_index 二选一。
  4583. 增量条目(increment)⛔ 不得填本键。
  4584. ref_subscription_id:
  4585. type: string
  4586. description: >-
  4587. 增量合同引用的原订阅号(D-2):仅 item_mode=increment 时必填(且不得填 serves_*);
  4588. 非增量条目带本键即 KLT-L216。订阅须属本客户、为 link 档、状态 ∈ active/pending。
  4589. 生成的 service_open 单以增量合同 external_no 作为 carrier_order_no(D-11)。
  4590. line_exits:
  4591. type: array
  4592. maxItems: 1
  4593. description: >-
  4594. 线路出口(2026-11-17 起**单选**:长度必须为 1)。新建/修改条目出现 2 个以上
  4595. 由服务端回 KLT-L222;存量多出口条目**不迁移**(编辑合同须原样回传)。
  4596. items:
  4597. type: string
  4598. description: 出口标识
  4599. succession:
  4600. type: object
  4601. description: >-
  4602. 契约内逐条替换(升降配,2026-11-17):本条目的新订阅顶替哪份原订阅。
  4603. **仅在新建合同受理**,编辑合同出现即 KLT-L222。只接受三键(价格/状态/
  4604. row_version 等只读派生列出现即点名)。候选须同客户、status ∈ active/pending、
  4605. 同 line_exit_key、双方均 plan_family=link、未被替换过(KLT-M226);
  4606. 同一 replaces_subscription_id 在本请求内至多一次;link 条目 quantity 须为 1。
  4607. 替换与合同写入同一条 dml_batch(任一条失败=整批回滚),应答回 data.replacements[]。
  4608. properties:
  4609. replaces_subscription_id:
  4610. type: string
  4611. description: 被替换的原订阅号(必填)
  4612. start_date:
  4613. type: string
  4614. format: date
  4615. description: 新订阅起日,缺省=max(业务当天, 合同生效日);须 ≤ 合同止期。结束日恒取合同止期
  4616. term:
  4617. type: string
  4618. description: 订阅方式(yearly/quarterly/monthly);缺省按档位与账期派生
  4619. required:
  4620. - replaces_subscription_id
  4621. required:
  4622. - contract_amount_cents
  4623. - service_months
  4624. - start_date
  4625. - end_date
  4626. - agent_name
  4627. - agent_mobile
  4628. - agent_handover_on
  4629. required:
  4630. - data
  4631. x-error-codes: [60001, 60201, 60207, 60209, 60210, 60211]
  4632. responses:
  4633. "200":
  4634. description: 成功。统一信封 code/message/data
  4635. /contract/update@v1:
  4636. post:
  4637. summary: 编辑合同
  4638. description: 编号与签约客户不可改;条目按 item_id 三向对比增删改。可改范围=bos-invariant::contract_edit_scope 的两条轴(billing:金额/服务期(月)/期间/服务构成;archive:合同类型/签署日期/外部单号/交接日期),两轴独立判定、source=operator_sync 全只读(KLT-L220)、已开通两轴全冻(KLT-L219)、录后 72 小时内两轴全开、未生效只放 billing、未到期只放 archive;经办人(created_by 与录入经办人机构/姓名/联系方式)建后恒只读(KLT-L221);agent_* 为运营商交接单上的经办人,受各自轴约束。⚠️ 2026-11-17:`ip_entries`/`has_fixed_ip` 已下线(视为未知键 ⇒ 11103,境外 IP 由套餐档位 × 订阅份数表达)。保存形态=只提交变了的字段(键缺席=保持现值);审计 INSERT 与业务语句同批提交。
  4639. operationId: contract_update
  4640. tags:
  4641. - 合同
  4642. x-require-auth: true
  4643. x-resource-type:
  4644. $ref: '#/components/x-resource-types/contract/code'
  4645. x-action:
  4646. $ref: '#/components/x-actions/update/code'
  4647. x-version: v1
  4648. x-permission-visibility: catalog
  4649. requestBody:
  4650. required: true
  4651. description: JSON 请求体,业务字段置于 data
  4652. content:
  4653. application/json:
  4654. schema:
  4655. type: object
  4656. description: 统一信封请求体,业务字段放在 data 内
  4657. properties:
  4658. data:
  4659. type: object
  4660. description: 业务参数
  4661. properties:
  4662. contract_id:
  4663. type: string
  4664. description: 合同 ID
  4665. row_version:
  4666. type: integer
  4667. description: 乐观锁版本
  4668. external_no:
  4669. type: string
  4670. description: 外部合同号
  4671. contract_type:
  4672. type: string
  4673. description: 合同类型(new/renew/expand/change);受 archive 轴约束
  4674. enum:
  4675. - new
  4676. - renew
  4677. - expand
  4678. - change
  4679. sign_date:
  4680. type: string
  4681. description: 签署日期(受 archive 轴约束)
  4682. format: date
  4683. contract_amount_cents:
  4684. type: integer
  4685. description: 合同金额(分)
  4686. service_months:
  4687. type: integer
  4688. description: 服务期(月,1~600);受 billing 轴约束,结束日按「生效日+服务期−1 天」重算
  4689. minimum: 1
  4690. maximum: 600
  4691. start_date:
  4692. type: string
  4693. description: 开始日期
  4694. format: date
  4695. end_date:
  4696. type: string
  4697. description: 结束日期
  4698. format: date
  4699. agent_name:
  4700. type: string
  4701. description: 运营商经办人姓名(交接单口径,不是录入账号 created_by);受 billing/archive 轴约束,冻结时提交改动值 ⇒ KLT-L219/L220
  4702. agent_mobile:
  4703. type: string
  4704. description: 运营商经办人联系方式(交接单三段之三;archive 轴)
  4705. agent_handover_on:
  4706. type: string
  4707. description: 交接日期(archive 轴)
  4708. agent_org:
  4709. type: string
  4710. description: 运营商经办人机构(交接单三段之一;选填,archive 轴)
  4711. attachment_url:
  4712. type: string
  4713. maxLength: 512
  4714. description: >-
  4715. 合同附件(单值,archive 轴):外部 http(s) 链接,或前缀为
  4716. klt/contract/attachment/ 的对象键;空串=清空附件。
  4717. service_items:
  4718. type: array
  4719. description: >-
  4720. 服务构成条目(含 item_id 的增删改)。条目形态只含 plan_id/quantity/item_family/
  4721. line_exits/item_mode/serves_item_id/serves_item_index/ref_subscription_id(item_family
  4722. 由档位带入,⛔ 自造);年价/账号数/带宽等旧字段已删列,
  4723. 出现即视为未知键。D-7/D-9:普通叠加服务用 serves_item_id(或 0 基 serves_item_index)
  4724. 声明从属,服务端按父子关系回树;增量条目用 item_mode=increment + ref_subscription_id
  4725. 引用既有链路订阅(⛔ 再挂 serves_*)。订阅/工单/台账列表不扩散,仍平铺。
  4726. items:
  4727. type: object
  4728. properties:
  4729. item_id:
  4730. type: string
  4731. description: 既有条目主键(三向对比:带=UPDATE/不带=INSERT/库有载荷无=DELETE)
  4732. plan_id:
  4733. type: string
  4734. description: 档位 ID
  4735. quantity:
  4736. type: integer
  4737. description: 份数:link 档恒 1;addon 档≥1
  4738. item_family:
  4739. type: string
  4740. description: 交付形态(只读确认位,可缺省):与档位 plan_family 不同即 KLT-L216
  4741. enum:
  4742. - link
  4743. - addon
  4744. item_mode:
  4745. type: string
  4746. description: >-
  4747. 条目模式(D-9):new=常规;increment=增量叠加服务(档位必须为 addon,且只引用
  4748. ref_subscription_id,⛔ 挂 serves_*)。读口按同一编码回传。
  4749. enum:
  4750. - new
  4751. - increment
  4752. serves_item_index:
  4753. type: integer
  4754. minimum: 0
  4755. description: 父条目在本载荷 service_items 的 0 基下标(普通叠加服务、父条目为本次新建时用)
  4756. serves_item_id:
  4757. type: string
  4758. description: >-
  4759. 父条目 ID(普通叠加服务、父条目已存在时用);与 serves_item_index 二选一,
  4760. 同时给即 11103;增量条目⛔ 不得填本键
  4761. ref_subscription_id:
  4762. type: string
  4763. description: >-
  4764. 增量合同引用的原订阅号(D-2):item_mode=increment 时必填,须属本客户、为 link 档、
  4765. 状态 ∈ active/pending;非增量条目带本键即 KLT-L216。
  4766. line_exits:
  4767. type: array
  4768. maxItems: 1
  4769. description: 线路出口(单选,长度 1)
  4770. items:
  4771. type: string
  4772. required:
  4773. - contract_id
  4774. - row_version
  4775. required:
  4776. - data
  4777. x-error-codes: [60001, 60201, 60207, 60209, 60210, 60211, 60228, 60229, 60230]
  4778. responses:
  4779. "200":
  4780. description: 成功。统一信封 code/message/data
  4781. /contract/get_list@v1:
  4782. post:
  4783. summary: 合同列表
  4784. description: >-
  4785. 按客户/状态等筛选合同列表。每行随 `attachment_kind`(none/link/object/other)说明附件形态;
  4786. `attachment_view_url` 在列表口恒 null(签名只在详情读口现签,不按行 N 次调平台)。
  4787. operationId: contract_get_list
  4788. tags:
  4789. - 合同
  4790. x-require-auth: true
  4791. x-resource-type:
  4792. $ref: '#/components/x-resource-types/contract/code'
  4793. x-action:
  4794. $ref: '#/components/x-actions/list/code'
  4795. x-version: v1
  4796. x-permission-visibility: catalog
  4797. requestBody:
  4798. required: true
  4799. description: JSON 请求体,业务字段置于 data
  4800. content:
  4801. application/json:
  4802. schema:
  4803. type: object
  4804. description: 统一信封请求体,业务字段放在 data 内
  4805. properties:
  4806. data:
  4807. type: object
  4808. description: 列表筛选参数
  4809. properties:
  4810. page:
  4811. type: integer
  4812. description: 页码(0 基索引,默认 0)
  4813. minimum: 0
  4814. default: 0
  4815. page_size:
  4816. type: integer
  4817. description: 每页条数(默认 20,上限 200)
  4818. minimum: 1
  4819. maximum: 200
  4820. default: 20
  4821. keyword:
  4822. type: string
  4823. description: 关键字筛选(编号/客户名/外部单号/经办人等)
  4824. customer_id:
  4825. type: string
  4826. description: 客户 ID 筛选
  4827. status:
  4828. type: string
  4829. description: 生命周期态(effective/not_effective/expired 或中文)
  4830. source:
  4831. type: string
  4832. description: 来源(manual/import/operator_sync 或中文标签)
  4833. line_exit:
  4834. type: string
  4835. description: 线路出口名称(命中服务构成条目 line_exits)
  4836. expiring_within_days:
  4837. type: integer
  4838. description: 快到期天数(止期 ∈ [today, today+N];已到期不算)
  4839. minimum: 0
  4840. opened:
  4841. type: boolean
  4842. description: 是否已开通筛选(三态:true/false/缺省不筛)
  4843. required:
  4844. - data
  4845. x-error-codes: [60001, 60201, 60207, 60209, 60210, 60211]
  4846. responses:
  4847. "200":
  4848. description: 成功。统一信封 code/message/data
  4849. /contract/change_log@v1:
  4850. post:
  4851. summary: 合同修改记录
  4852. description: 本合同在 bos_audit_log 的 contract.* 流水(时间倒序+(occurred_at,id) 游标,不用 OFFSET)。先过合同可见性(与详情同一条谓词,越权=11104),再按 resource_type='contract' AND resource_id=$contract_id 取行——不复用 audit/get_list@v1(其对 TeamLead/Ops 按本团队成员过滤,会把可见合同的历史滤空)。行内含 detail.fields(字段级 {old,new})、items_diff(条目的三向增删改);`ip_diff` 仅 2026-11-17 之前的存量行才有(固定 IP 条目已下线)。
  4853. operationId: contract_change_log
  4854. tags:
  4855. - 合同
  4856. x-require-auth: true
  4857. x-resource-type:
  4858. $ref: '#/components/x-resource-types/contract/code'
  4859. x-action:
  4860. $ref: '#/components/x-actions/list/code'
  4861. x-version: v1
  4862. x-permission-visibility: catalog
  4863. requestBody:
  4864. required: true
  4865. description: JSON 请求体,业务字段置于 data
  4866. content:
  4867. application/json:
  4868. schema:
  4869. type: object
  4870. description: 统一信封请求体,业务字段放在 data 内
  4871. properties:
  4872. data:
  4873. type: object
  4874. description: 业务参数
  4875. properties:
  4876. contract_id:
  4877. type: string
  4878. description: 合同 ID
  4879. page_size:
  4880. type: integer
  4881. description: 每页条数(默认 20,夹在 1~50)
  4882. minimum: 1
  4883. maximum: 50
  4884. default: 20
  4885. cursor:
  4886. type: string
  4887. description: 游标,形态 occurred_at|id(与审计页同形态);由上一页响应的 next_cursor 原样带回
  4888. required:
  4889. - contract_id
  4890. required:
  4891. - data
  4892. x-error-codes: [60053, 60201, 60207]
  4893. responses:
  4894. "200":
  4895. description: 成功。统一信封 code/message/data(items/page_size/next_cursor/cursor_usable)
  4896. /contract/get@v1:
  4897. post:
  4898. summary: 合同详情
  4899. description: >-
  4900. 按合同 ID 查询详情(含服务条目与 IP 条件)。出参含 edit_scope(billing/archive 两轴 editable+reason,判据=bos-invariant::contract_edit_scope)、created_by/created_by_name/created_by_org/created_by_mobile(录入经办人=录入账号的机构/姓名/联系方式,录入时由账号自动带入、建后只读;联系方式已按需求 §3.3 掩码)。
  4901. 附件(单值):`attachment_url` 原值照回(外部链接或 klt/contract/attachment/ 下的对象键),
  4902. `attachment_kind` 说明形态,`attachment_view_url`/`attachment_view_url_expires_at`
  4903. 为读口现签的短时效下载地址(`link` 形态=原链接);对象键不得当作可直接打开的链接。
  4904. D-7:服务条目行额外带 `item_mode`(new/increment)/`serves_item_id`/`ref_subscription_id`,
  4905. 前端据此把增量叠加服务以父子缩进树呈现;订阅/工单/台账仍为平铺列表,只标注「叠加于 SUB-xxx」。
  4906. operationId: contract_get
  4907. tags:
  4908. - 合同
  4909. x-require-auth: true
  4910. x-resource-type:
  4911. $ref: '#/components/x-resource-types/contract/code'
  4912. x-action:
  4913. $ref: '#/components/x-actions/view/code'
  4914. x-version: v1
  4915. x-permission-visibility: catalog
  4916. requestBody:
  4917. required: true
  4918. description: JSON 请求体,业务字段置于 data
  4919. content:
  4920. application/json:
  4921. schema:
  4922. type: object
  4923. description: 统一信封请求体,业务字段放在 data 内
  4924. properties:
  4925. data:
  4926. type: object
  4927. description: 业务参数
  4928. properties:
  4929. contract_id:
  4930. type: string
  4931. description: 合同 ID
  4932. required:
  4933. - contract_id
  4934. required:
  4935. - data
  4936. x-error-codes: [60001, 60201, 60207, 60209, 60210, 60211]
  4937. responses:
  4938. "200":
  4939. description: 成功。统一信封 code/message/data
  4940. /contract/customer_lookup@v1:
  4941. post:
  4942. summary: 合同客户身份解析
  4943. description: 第3册§4.2 第 1 步:query_type=credit_code 主体号精确点查/identity 归一化精确点查/keyword 客户名称模糊联想;未命中=matched:false 成功响应(不报错),越权读单客户=11104。
  4944. operationId: contract_customer_lookup
  4945. tags:
  4946. - 合同
  4947. x-require-auth: true
  4948. x-resource-type:
  4949. $ref: '#/components/x-resource-types/contract/code'
  4950. x-action:
  4951. $ref: '#/components/x-actions/list/code'
  4952. x-version: v1
  4953. x-permission-visibility: catalog
  4954. requestBody:
  4955. required: true
  4956. description: JSON 请求体,业务字段置于 data
  4957. content:
  4958. application/json:
  4959. schema:
  4960. type: object
  4961. description: 统一信封请求体,业务字段放在 data 内
  4962. properties:
  4963. data:
  4964. type: object
  4965. description: 业务参数
  4966. properties:
  4967. query_type:
  4968. type: string
  4969. description: 查询通道
  4970. enum:
  4971. - credit_code
  4972. - identity
  4973. - keyword
  4974. value:
  4975. type: string
  4976. description: 查询值(主体号/识别号/客户名称关键字)
  4977. required:
  4978. - query_type
  4979. - value
  4980. required:
  4981. - data
  4982. x-error-codes: [60001, 60201, 60207, 60209, 60210, 60211]
  4983. responses:
  4984. "200":
  4985. description: 成功。统一信封 code/message/data
  4986. /contract/delete@v1:
  4987. post:
  4988. summary: 合同条件删除
  4989. description: 第3册§4.8:两类阻塞分栏(subscriptions/tickets),有阻塞⇒KLT-L213;工单取数失败⇒KLT-S406(不得中途放行)。
  4990. operationId: contract_delete
  4991. tags:
  4992. - 合同
  4993. x-require-auth: true
  4994. x-resource-type:
  4995. $ref: '#/components/x-resource-types/contract/code'
  4996. x-action:
  4997. $ref: '#/components/x-actions/delete/code'
  4998. x-version: v1
  4999. x-permission-visibility: catalog
  5000. requestBody:
  5001. required: true
  5002. description: JSON 请求体,业务字段置于 data
  5003. content:
  5004. application/json:
  5005. schema:
  5006. type: object
  5007. description: 统一信封请求体,业务字段放在 data 内
  5008. properties:
  5009. data:
  5010. type: object
  5011. description: 业务参数
  5012. properties:
  5013. contract_id:
  5014. type: string
  5015. description: 合同 ID
  5016. required:
  5017. - contract_id
  5018. required:
  5019. - data
  5020. x-error-codes: [60001, 60201, 60207, 60209, 60210, 60211]
  5021. responses:
  5022. "200":
  5023. description: 成功。统一信封 code/message/data
  5024. /contract/attachment_discard@v1:
  5025. post:
  5026. summary: 回收无人引用的上传附件(孤儿对象)
  5027. description: >-
  5028. 还原 2026-11-16 定案的孤儿附件回收:浏览器直传是「先上传、后落库」,用户换文件/移除/
  5029. 取消编辑/保存被拦时会在桶里留下无引用对象。平台 unified-oss 明确「不做后台遍历删对象、
  5030. 不按业务字段回收」,只有即时删除一条通道(object/delete@v1),故回收由本服务在引用面判定后发起。
  5031. 三条安全线:object_key 必须是本服务前缀下无路径穿越的对象键;查库确认没有任何合同仍指向它;
  5032. 角色限 Admin/OpsMain(与合同写口同一道闸)。referenced=true 与「对象已不在」都不算失败(幂等)。
  5033. operationId: contract_attachment_discard
  5034. tags:
  5035. - 合同
  5036. x-require-auth: true
  5037. x-resource-type:
  5038. $ref: '#/components/x-resource-types/contract_attachment/code'
  5039. x-action:
  5040. $ref: '#/components/x-actions/delete/code'
  5041. x-version: v1
  5042. x-permission-visibility: catalog
  5043. requestBody:
  5044. required: true
  5045. description: JSON 请求体,业务字段置于 data
  5046. content:
  5047. application/json:
  5048. schema:
  5049. type: object
  5050. description: 统一信封请求体,业务字段放在 data 内
  5051. properties:
  5052. data:
  5053. type: object
  5054. description: 业务参数
  5055. properties:
  5056. object_key:
  5057. type: string
  5058. description: 直传回报的对象键(klt/contract/attachment/ 前缀下)
  5059. required:
  5060. - object_key
  5061. required:
  5062. - data
  5063. x-error-codes: [60001, 60004, 60006, 60058, 60201]
  5064. responses:
  5065. "200":
  5066. description: 成功。统一信封 code/message/data
  5067. /subscription/create@v1:
  5068. post:
  5069. summary: 新建订阅
  5070. description: 拒收 line_exits、sub_mode、order_no、新建时的 end_date、opened_at。
  5071. 响应 data 附 delivery_ticket=交付侧建单结论(工单册§3.2.3):kind=open/service_open/
  5072. merged(并入既有未完成开户工单,工单册§7.5)/failed/skipped,另有 ticket_id、ticket_no、
  5073. items=本次落地服务清单项数、note=面向运营的说明。工单侧失败不回滚订阅(订阅仍已保存),
  5074. 此时 failed=true,运营须按 note 人工补发工单。
  5075. operationId: subscription_create
  5076. tags:
  5077. - 订阅
  5078. x-require-auth: true
  5079. x-resource-type:
  5080. $ref: '#/components/x-resource-types/subscription/code'
  5081. x-action:
  5082. $ref: '#/components/x-actions/create/code'
  5083. x-version: v1
  5084. x-permission-visibility: catalog
  5085. requestBody:
  5086. required: true
  5087. description: JSON 请求体,业务字段置于 data
  5088. content:
  5089. application/json:
  5090. schema:
  5091. type: object
  5092. description: 统一信封请求体,业务字段放在 data 内
  5093. properties:
  5094. data:
  5095. type: object
  5096. description: 业务参数
  5097. properties:
  5098. customer_id:
  5099. type: string
  5100. description: 客户 ID
  5101. plan_id:
  5102. type: string
  5103. description: 档位 ID
  5104. contract_id:
  5105. type: string
  5106. description: 合同 ID
  5107. contract_item_id:
  5108. type: string
  5109. description: 合同服务条目 ID(可空=该合同内一条匹配条目都没有,服务端按档位反查)
  5110. start_date:
  5111. type: string
  5112. description: 订阅开始日期
  5113. format: date
  5114. annual_price_cents:
  5115. type: integer
  5116. description: 不得传的只读派生列:按档位与账期折算落库(传值即 KLT-S20004 拒收)
  5117. monthly_settle_cents:
  5118. type: integer
  5119. description: 不得传的只读派生列:由 `monthly_settle_of` 按年价折算落库(传值即 KLT-S20004 拒收)
  5120. plan_family:
  5121. type: string
  5122. description: 交付形态(只读确认位,可缺省):只能与所选档位的 plan_family 相同,不同即 11103
  5123. enum:
  5124. - link
  5125. - addon
  5126. term:
  5127. type: string
  5128. description: 账期(三态:yearly/quarterly/monthly)
  5129. enum:
  5130. - yearly
  5131. - quarterly
  5132. - monthly
  5133. trial_months:
  5134. type: integer
  5135. description: 试用月数(默认 0,≥0)
  5136. minimum: 0
  5137. discount_monthly_cents:
  5138. type: integer
  5139. description: 每月优惠金额(分,默认 0,≥0)
  5140. minimum: 0
  5141. required:
  5142. - customer_id
  5143. - plan_id
  5144. - contract_id
  5145. - start_date
  5146. required:
  5147. - data
  5148. x-error-codes: [60001, 60201, 60212, 60214, 60215, 60216, 60218, 60219, 60221, 60222]
  5149. responses:
  5150. "200":
  5151. description: 成功。统一信封 code/message/data
  5152. /subscription/change@v1:
  5153. post:
  5154. summary: 订阅升降配
  5155. description: >-
  5156. 升降配须填 replaces_subscription_id 与 contract_id(新合同,不得沿用原合同;缺省时回退原合同并在回执说明中提示)。
  5157. `contract_item_id` 给出时按其取条目并校验档位匹配,缺省时按新档位在合同内反查。
  5158. `customer_id` 仅做一致性校验(与原订阅客户不同即 60201/KLT-M221)。
  5159. 年价、月结算标准、end_date、线路出口、用途分类为只读派生列,传即 11103。
  5160. ⚠️ 2026-11-17 起本口保留为「单订阅快捷通道」:常规路径是在合同新建页逐条带
  5161. service_items[].succession 一次提交(见 /contract/create@v1);两条路径共用同一份计划层与
  5162. 截原谓词(已被替换过 ⇒ KLT-M226)。工单类型按交付态:已交付且客户在用 ⇒ 一张 updown
  5163. (新档交付+原档回收,清单带原值/新值);未交付 ⇒ open/service_open。
  5164. operationId: subscription_change
  5165. tags:
  5166. - 订阅
  5167. x-require-auth: true
  5168. x-resource-type:
  5169. $ref: '#/components/x-resource-types/subscription/code'
  5170. x-action:
  5171. $ref: '#/components/x-actions/update/code'
  5172. x-version: v1
  5173. x-permission-visibility: catalog
  5174. requestBody:
  5175. required: true
  5176. description: JSON 请求体,业务字段置于 data
  5177. content:
  5178. application/json:
  5179. schema:
  5180. type: object
  5181. description: 统一信封请求体,业务字段放在 data 内
  5182. properties:
  5183. data:
  5184. type: object
  5185. description: 业务参数
  5186. properties:
  5187. replaces_subscription_id:
  5188. type: string
  5189. description: 被替换的原订阅 ID
  5190. customer_id:
  5191. type: string
  5192. description: 客户 ID
  5193. plan_id:
  5194. type: string
  5195. description: 新档位 ID
  5196. contract_id:
  5197. type: string
  5198. description: 新合同 ID(不得沿用原合同)
  5199. contract_item_id:
  5200. type: string
  5201. description: 新合同服务条目 ID
  5202. start_date:
  5203. type: string
  5204. description: 新订阅开始日期
  5205. format: date
  5206. annual_price_cents:
  5207. type: integer
  5208. description: 只读派生列(服务端按档位与时长折算);传即 11103
  5209. readOnly: true
  5210. monthly_settle_cents:
  5211. type: integer
  5212. description: 只读派生列(服务端按档位折算);传即 11103
  5213. readOnly: true
  5214. plan_family:
  5215. type: string
  5216. description: 只读派生列(随新档位);传不同值即 11103
  5217. readOnly: true
  5218. enum:
  5219. - link
  5220. - addon
  5221. term:
  5222. type: string
  5223. description: 账期(三态:yearly/quarterly/monthly;缺省沿用原订阅或按年)
  5224. enum:
  5225. - yearly
  5226. - quarterly
  5227. - monthly
  5228. trial_months:
  5229. type: integer
  5230. description: 试用月数(默认 0,≥0)
  5231. minimum: 0
  5232. discount_monthly_cents:
  5233. type: integer
  5234. description: 每月优惠金额(分,默认 0,≥0)
  5235. minimum: 0
  5236. row_version:
  5237. type: integer
  5238. description: 乐观锁版本号(可选,缺省不校验)
  5239. required:
  5240. - replaces_subscription_id
  5241. - plan_id
  5242. - contract_id
  5243. required:
  5244. - data
  5245. x-error-codes: [60001, 60201, 60212, 60214, 60215, 60216, 60218, 60219, 60221, 60222]
  5246. responses:
  5247. "200":
  5248. description: 成功。统一信封 code/message/data
  5249. /subscription/replacement_candidates@v1:
  5250. post:
  5251. summary: 替换候选探测(只读)
  5252. description: >-
  5253. 合同新建页逐条判定「是否已有可替换的原订阅」(契约内逐条替换=升降配,2026-11-17)。
  5254. 交付形态唯一取档位 `plan_family`(D-15),按「同客户 × 同出口 × 双方均 link」
  5255. 过滤(status ∈ active/pending、排除 addon 档、排除已被指过的 replaces_subscription_id),
  5256. 与 /contract/create@v1 的保存期校验是**同一份函数**(succession::candidate_filter),前端不得自造候选范围。
  5257. index 与 service_items 的 0 基下标对齐;档位或出口判定不出 ⇒ KLT-L222 点名 probes[i]。
  5258. operationId: subscription_replacement_candidates
  5259. tags:
  5260. - 订阅
  5261. x-require-auth: true
  5262. x-resource-type:
  5263. $ref: '#/components/x-resource-types/subscription/code'
  5264. x-action:
  5265. $ref: '#/components/x-actions/list/code'
  5266. x-version: v1
  5267. x-permission-visibility: catalog
  5268. requestBody:
  5269. required: true
  5270. description: JSON 请求体,业务字段置于 data
  5271. content:
  5272. application/json:
  5273. schema:
  5274. type: object
  5275. description: 统一信封请求体,业务字段放在 data 内
  5276. properties:
  5277. data:
  5278. type: object
  5279. description: 业务参数
  5280. properties:
  5281. customer_id:
  5282. type: string
  5283. description: 签约客户 ID(候选范围限本客户)
  5284. probes:
  5285. type: array
  5286. description: 探测项(至少 1 项,每项对应一个服务构成条目)
  5287. items:
  5288. type: object
  5289. properties:
  5290. index:
  5291. type: integer
  5292. description: 0 基条目下标(缺省=数组位置)
  5293. plan_id:
  5294. type: string
  5295. description: 档位 ID(交付形态由档位带出)
  5296. line_exits:
  5297. type: array
  5298. maxItems: 1
  5299. description: 线路出口(须恰 1 个;缺省时回落档位上的出口集合)
  5300. items:
  5301. type: string
  5302. required:
  5303. - line_exits
  5304. required:
  5305. - customer_id
  5306. - probes
  5307. required:
  5308. - data
  5309. x-error-codes: [60001, 60201, 60221, 60231]
  5310. responses:
  5311. "200":
  5312. description: >-
  5313. 成功。data.probes[] 每项回 index/plan_id/plan_family(后端按档位解析)/
  5314. line_exit_key/line_exits/candidates[];候选行含 subscription_id/plan_id/plan_name/
  5315. plan_kind/contract_id/contract_no/start_date/end_date/status/annual_price_cents/
  5316. monthly_settle_cents/customized(true=定制档,须用户显式勾选确认后才允许替换)。
  5317. /subscription/stack@v1:
  5318. post:
  5319. summary: 订阅叠加(已停用 · 请改走 create)
  5320. description: D-03 起拒写。权威「叠加」=新建并存订阅,请走 `/subscription/create@v1`(客户在用时自动生成服务开通工单)。本口保留路由与入参形态,一律返回参数错误并点名 create。
  5321. operationId: subscription_stack
  5322. tags:
  5323. - 订阅
  5324. x-require-auth: true
  5325. x-resource-type:
  5326. $ref: '#/components/x-resource-types/subscription/code'
  5327. x-action:
  5328. $ref: '#/components/x-actions/create/code'
  5329. x-version: v1
  5330. x-permission-visibility: catalog
  5331. requestBody:
  5332. required: true
  5333. description: JSON 请求体,业务字段置于 data
  5334. content:
  5335. application/json:
  5336. schema:
  5337. type: object
  5338. description: 统一信封请求体,业务字段放在 data 内
  5339. properties:
  5340. data:
  5341. type: object
  5342. description: 业务参数
  5343. properties:
  5344. subscription_id:
  5345. type: string
  5346. description: 订阅 ID(更新场景)
  5347. customer_id:
  5348. type: string
  5349. description: 客户 ID(叠加新建时)
  5350. plan_id:
  5351. type: string
  5352. description: 档位 ID(叠加新建时)
  5353. contract_id:
  5354. type: string
  5355. description: 合同 ID
  5356. contract_item_id:
  5357. type: string
  5358. description: 合同服务条目 ID
  5359. annual_price_cents:
  5360. type: integer
  5361. description: 年价(分,可改)
  5362. monthly_settle_cents:
  5363. type: integer
  5364. description: 月结算金额(分,可改)
  5365. end_date:
  5366. type: string
  5367. description: 结束日期(可改)
  5368. format: date
  5369. start_date:
  5370. type: string
  5371. description: 开始日期(叠加新建时)
  5372. format: date
  5373. row_version:
  5374. type: integer
  5375. description: 乐观锁版本号(可选,缺省不校验)
  5376. required:
  5377. - data
  5378. x-error-codes: [60001, 60201, 60212, 60214, 60215, 60216, 60218, 60219, 60221, 60222]
  5379. responses:
  5380. "200":
  5381. description: 成功。统一信封 code/message/data
  5382. /subscription/get_list@v1:
  5383. post:
  5384. summary: 订阅列表
  5385. description: >-
  5386. 按客户等维度筛选订阅列表。D-2:叠加服务订阅行带 `parent_subscription_id`(所属链路订阅号),
  5387. 列表面板保持平铺并标注「叠加于 SUB-xxx」,不把子订阅折叠进父行(不扩散)。
  5388. operationId: subscription_get_list
  5389. tags:
  5390. - 订阅
  5391. x-require-auth: true
  5392. x-resource-type:
  5393. $ref: '#/components/x-resource-types/subscription/code'
  5394. x-action:
  5395. $ref: '#/components/x-actions/list/code'
  5396. x-version: v1
  5397. x-permission-visibility: catalog
  5398. # 工单回件 §5.2 B1 点名的「订阅列表」(PG-4 空列表那条):列表行经客户维度收窄
  5399. # (subscription.rs:680 get_list → :687 customer_scope_pred),订阅在平台侧登记为
  5400. # klt.subscription 树叶 ⇒ 其可见集应由授权上界决定,故按 list 声明真源列举。
  5401. # 注意:同 L-2:本轮只打通「声明+上界落到 AuthContext」,运维分支仍走本地口径,
  5402. # 且注入 id 与我方 subscription_id 对齐的前提=订阅已登记为资源树叶(待平台确认)。
  5403. x-enumeration-kind: list
  5404. requestBody:
  5405. required: true
  5406. description: JSON 请求体,业务字段置于 data
  5407. content:
  5408. application/json:
  5409. schema:
  5410. type: object
  5411. description: 统一信封请求体,业务字段放在 data 内
  5412. properties:
  5413. data:
  5414. type: object
  5415. description: 列表筛选参数
  5416. properties:
  5417. customer_id:
  5418. type: string
  5419. description: 客户 ID(常必填)
  5420. page:
  5421. type: integer
  5422. description: 页码(0 基索引,默认 0)
  5423. minimum: 0
  5424. default: 0
  5425. page_size:
  5426. type: integer
  5427. description: 每页条数(默认 20,上限 200)
  5428. minimum: 1
  5429. maximum: 200
  5430. default: 20
  5431. keyword:
  5432. type: string
  5433. description: 关键字(套餐名/订阅号/订单号/客户名/合同号)
  5434. status:
  5435. type: string
  5436. description: 状态筛选(pending/active/expired/cancelled/replaced/early_stopped)
  5437. plan_kind:
  5438. type: string
  5439. description: 套餐类型(fixed/custom)
  5440. enum: [fixed, custom]
  5441. line_exit:
  5442. type: string
  5443. description: 线路出口名称(命中 line_exits 快照)
  5444. expiring_within_days:
  5445. type: integer
  5446. description: 快到期天数(止期 ∈ [today, today+N];已到期不算)
  5447. minimum: 0
  5448. contract_id:
  5449. type: string
  5450. description: 合同 ID 筛选
  5451. region_ids:
  5452. type: array
  5453. description: 区域 ID 集合(经客户挂载区域展开)
  5454. items:
  5455. type: string
  5456. description: 区域 ID
  5457. required:
  5458. - data
  5459. x-error-codes: [60001, 60201, 60212, 60214, 60215, 60216, 60218, 60219, 60221, 60222]
  5460. responses:
  5461. "200":
  5462. description: 成功。统一信封 code/message/data
  5463. /subscription/get@v1:
  5464. post:
  5465. summary: 订阅详情
  5466. description: 按订阅 ID 查询详情。
  5467. operationId: subscription_get
  5468. tags:
  5469. - 订阅
  5470. x-require-auth: true
  5471. x-resource-type:
  5472. $ref: '#/components/x-resource-types/subscription/code'
  5473. x-action:
  5474. $ref: '#/components/x-actions/view/code'
  5475. x-version: v1
  5476. x-permission-visibility: catalog
  5477. requestBody:
  5478. required: true
  5479. description: JSON 请求体,业务字段置于 data
  5480. content:
  5481. application/json:
  5482. schema:
  5483. type: object
  5484. description: 统一信封请求体,业务字段放在 data 内
  5485. properties:
  5486. data:
  5487. type: object
  5488. description: 业务参数
  5489. properties:
  5490. subscription_id:
  5491. type: string
  5492. description: 订阅 ID
  5493. required:
  5494. - subscription_id
  5495. required:
  5496. - data
  5497. x-error-codes: [60001, 60201, 60212, 60214, 60215, 60216, 60218, 60219, 60221, 60222]
  5498. responses:
  5499. "200":
  5500. description: 成功。统一信封 code/message/data
  5501. /subscription/plan_options@v1:
  5502. post:
  5503. summary: 订阅档位候选
  5504. description: 第3册§5.2 第 3 步:本客户自定义档(含合同条目派生档)+全部固定档,不含他客户自定义档;行内带只读 sub_mode 与 available/unavailable_reason。
  5505. operationId: subscription_plan_options
  5506. tags:
  5507. - 订阅
  5508. x-require-auth: true
  5509. x-resource-type:
  5510. $ref: '#/components/x-resource-types/subscription/code'
  5511. x-action:
  5512. $ref: '#/components/x-actions/list/code'
  5513. x-version: v1
  5514. x-permission-visibility: catalog
  5515. requestBody:
  5516. required: true
  5517. description: JSON 请求体,业务字段置于 data
  5518. content:
  5519. application/json:
  5520. schema:
  5521. type: object
  5522. description: 统一信封请求体,业务字段放在 data 内
  5523. properties:
  5524. data:
  5525. type: object
  5526. description: 业务参数
  5527. properties:
  5528. customer_id:
  5529. type: string
  5530. description: 客户 ID(必填)
  5531. keyword:
  5532. type: string
  5533. description: 套餐名称关键字(仅本口有)
  5534. required:
  5535. - customer_id
  5536. required:
  5537. - data
  5538. x-error-codes: [60001, 60201, 60212, 60214, 60215, 60216, 60218, 60219, 60221, 60222]
  5539. responses:
  5540. "200":
  5541. description: 成功。统一信封 code/message/data
  5542. /subscription/contract_options@v1:
  5543. post:
  5544. summary: 未开通合同与服务条目候选
  5545. description: 第3册§5.2 第 2 步:只出「未开通」合同及其尚未被订阅引用的条目;开通态取数失败⇒KLT-S406;无可选合同⇒KLT-M222。
  5546. operationId: subscription_contract_options
  5547. tags:
  5548. - 订阅
  5549. x-require-auth: true
  5550. x-resource-type:
  5551. $ref: '#/components/x-resource-types/subscription/code'
  5552. x-action:
  5553. $ref: '#/components/x-actions/list/code'
  5554. x-version: v1
  5555. x-permission-visibility: catalog
  5556. requestBody:
  5557. required: true
  5558. description: JSON 请求体,业务字段置于 data
  5559. content:
  5560. application/json:
  5561. schema:
  5562. type: object
  5563. description: 统一信封请求体,业务字段放在 data 内
  5564. properties:
  5565. data:
  5566. type: object
  5567. description: 业务参数
  5568. properties:
  5569. customer_id:
  5570. type: string
  5571. description: 客户 ID(必填)
  5572. keyword:
  5573. type: string
  5574. description: 合同名称关键字(仅本口有)
  5575. required:
  5576. - customer_id
  5577. required:
  5578. - data
  5579. x-error-codes: [60001, 60201, 60212, 60214, 60215, 60216, 60218, 60219, 60221, 60222]
  5580. responses:
  5581. "200":
  5582. description: 成功。统一信封 code/message/data
  5583. /subscription/update@v1:
  5584. post:
  5585. summary: 订阅修改(白名单)
  5586. description: 第3册§5.6:可改字段只有 trial_months/discount_monthly_cents;row_version 必填,落空⇒KLT-S407;换套餐/换合同⇒KLT-M229。
  5587. operationId: subscription_update
  5588. tags:
  5589. - 订阅
  5590. x-require-auth: true
  5591. x-resource-type:
  5592. $ref: '#/components/x-resource-types/subscription/code'
  5593. x-action:
  5594. $ref: '#/components/x-actions/update/code'
  5595. x-version: v1
  5596. x-permission-visibility: catalog
  5597. requestBody:
  5598. required: true
  5599. description: JSON 请求体,业务字段置于 data
  5600. content:
  5601. application/json:
  5602. schema:
  5603. type: object
  5604. description: 统一信封请求体,业务字段放在 data 内
  5605. properties:
  5606. data:
  5607. type: object
  5608. description: 业务参数
  5609. properties:
  5610. subscription_id:
  5611. type: string
  5612. description: 订阅 ID
  5613. row_version:
  5614. type: integer
  5615. description: 乐观锁版本号(必填,落空⇒KLT-S407)
  5616. trial_months:
  5617. type: integer
  5618. description: 试用月数(白名单可改)
  5619. minimum: 0
  5620. discount_monthly_cents:
  5621. type: integer
  5622. description: 每月优惠金额(分,白名单可改)
  5623. minimum: 0
  5624. required:
  5625. - subscription_id
  5626. - row_version
  5627. required:
  5628. - data
  5629. x-error-codes: [60001, 60201, 60212, 60214, 60215, 60216, 60218, 60219, 60221, 60222]
  5630. responses:
  5631. "200":
  5632. description: 成功。统一信封 code/message/data
  5633. /subscription/delete_check@v1:
  5634. post:
  5635. summary: 订阅删除前阻塞检查
  5636. description: 第3册§5.6:两栏阻塞分列(账单明细⇒KLT-M227、升降配链原订阅⇒KLT-M230);账单只读口未接线⇒billing_state=unconfigured。
  5637. operationId: subscription_delete_check
  5638. tags:
  5639. - 订阅
  5640. x-require-auth: true
  5641. x-resource-type:
  5642. $ref: '#/components/x-resource-types/subscription/code'
  5643. x-action:
  5644. $ref: '#/components/x-actions/view/code'
  5645. x-version: v1
  5646. x-permission-visibility: catalog
  5647. requestBody:
  5648. required: true
  5649. description: JSON 请求体,业务字段置于 data
  5650. content:
  5651. application/json:
  5652. schema:
  5653. type: object
  5654. description: 统一信封请求体,业务字段放在 data 内
  5655. properties:
  5656. data:
  5657. type: object
  5658. description: 业务参数
  5659. properties:
  5660. subscription_id:
  5661. type: string
  5662. description: 订阅 ID
  5663. required:
  5664. - subscription_id
  5665. required:
  5666. - data
  5667. x-error-codes: [60001, 60201, 60212, 60214, 60215, 60216, 60218, 60219, 60221, 60222]
  5668. responses:
  5669. "200":
  5670. description: 成功。统一信封 code/message/data
  5671. /subscription/delete@v1:
  5672. post:
  5673. summary: 删除订阅并回退额度
  5674. description: 第3册§5.6:删除前复算阻塞;终态⇒11103;同事务回退 customer.quota_cents,档位 first_referred_at 打点不回滚。
  5675. operationId: subscription_delete
  5676. tags:
  5677. - 订阅
  5678. x-require-auth: true
  5679. x-resource-type:
  5680. $ref: '#/components/x-resource-types/subscription/code'
  5681. x-action:
  5682. $ref: '#/components/x-actions/delete/code'
  5683. x-version: v1
  5684. x-permission-visibility: catalog
  5685. requestBody:
  5686. required: true
  5687. description: JSON 请求体,业务字段置于 data
  5688. content:
  5689. application/json:
  5690. schema:
  5691. type: object
  5692. description: 统一信封请求体,业务字段放在 data 内
  5693. properties:
  5694. data:
  5695. type: object
  5696. description: 业务参数
  5697. properties:
  5698. subscription_id:
  5699. type: string
  5700. description: 订阅 ID
  5701. required:
  5702. - subscription_id
  5703. required:
  5704. - data
  5705. x-error-codes: [60001, 60201, 60212, 60214, 60215, 60216, 60218, 60219, 60221, 60222]
  5706. responses:
  5707. "200":
  5708. description: 成功。统一信封 code/message/data
  5709. /subscription/list_all@v1:
  5710. post:
  5711. summary: 全部订阅(跨客户)
  5712. description: >-
  5713. 跨客户订阅列表,customer_id 可选;region_ids 经客户挂载区域展开。
  5714. keyword 命中套餐名/订阅号/订单号/客户名/合同号;page 0 基,page_size 上限 200。
  5715. operationId: subscription_list_all
  5716. tags:
  5717. - 订阅
  5718. x-require-auth: true
  5719. x-resource-type:
  5720. $ref: '#/components/x-resource-types/subscription/code'
  5721. x-action:
  5722. $ref: '#/components/x-actions/list/code'
  5723. x-version: v1
  5724. x-permission-visibility: catalog
  5725. requestBody:
  5726. required: true
  5727. description: JSON 请求体,业务字段置于 data
  5728. content:
  5729. application/json:
  5730. schema:
  5731. type: object
  5732. description: 统一信封请求体,业务字段放在 data 内
  5733. properties:
  5734. data:
  5735. type: object
  5736. description: 列表筛选参数
  5737. properties:
  5738. page:
  5739. type: integer
  5740. description: 页码(0 基索引,默认 0)
  5741. minimum: 0
  5742. default: 0
  5743. page_size:
  5744. type: integer
  5745. description: 每页条数(默认 20,上限 200)
  5746. minimum: 1
  5747. maximum: 200
  5748. default: 20
  5749. keyword:
  5750. type: string
  5751. description: 关键字(套餐名/订阅号/订单号/客户名/合同号)
  5752. customer_id:
  5753. type: string
  5754. description: 客户 ID 筛选(跨客户列表下可选)
  5755. contract_id:
  5756. type: string
  5757. description: 合同 ID 筛选
  5758. status:
  5759. type: string
  5760. description: 状态筛选(pending/active/expired/cancelled/replaced/early_stopped)
  5761. plan_kind:
  5762. type: string
  5763. description: 套餐类型(fixed/custom)
  5764. enum: [fixed, custom]
  5765. line_exit:
  5766. type: string
  5767. description: 线路出口名称(命中 line_exits 快照)
  5768. expiring_within_days:
  5769. type: integer
  5770. description: 快到期天数(止期 ∈ [today, today+N];已到期不算)
  5771. minimum: 0
  5772. region_ids:
  5773. type: array
  5774. description: 区域 ID 集合(经客户挂载区域展开)
  5775. items:
  5776. type: string
  5777. description: 区域 ID
  5778. required:
  5779. - data
  5780. x-error-codes: [60001, 60201, 60212, 60214, 60215, 60216, 60218, 60219, 60221, 60222]
  5781. responses:
  5782. "200":
  5783. description: 成功。统一信封 code/message/data
  5784. /cost_item/save@v1:
  5785. post:
  5786. summary: 保存成本项定义
  5787. description: 仅 admin。增改成本项定义。拒收金额、客户、运营商、省份、cycle、is_system。
  5788. operationId: cost_item_save
  5789. tags:
  5790. - 成本与分成
  5791. x-require-auth: true
  5792. x-resource-type:
  5793. $ref: '#/components/x-resource-types/cost_item/code'
  5794. x-action:
  5795. $ref: '#/components/x-actions/manage/code'
  5796. x-version: v1
  5797. x-permission-visibility: catalog
  5798. requestBody:
  5799. required: true
  5800. description: JSON 请求体,业务字段置于 data
  5801. content:
  5802. application/json:
  5803. schema:
  5804. type: object
  5805. description: 统一信封请求体,业务字段放在 data 内
  5806. properties:
  5807. data:
  5808. type: object
  5809. description: 业务参数
  5810. properties:
  5811. cost_item_id:
  5812. type: string
  5813. description: 成本项 ID(更新时必填)
  5814. category:
  5815. type: string
  5816. description: 类别:intl_resource/device_purchase/project_fee
  5817. enum:
  5818. - intl_resource
  5819. - device_purchase
  5820. - project_fee
  5821. item_name:
  5822. type: string
  5823. description: 成本项名称
  5824. billing_unit:
  5825. type: string
  5826. description: 计费单位:per_customer/per_account/per_copy
  5827. enum:
  5828. - per_customer
  5829. - per_account
  5830. - per_copy
  5831. is_amortized:
  5832. type: boolean
  5833. description: 是否摊销
  5834. amortization_months:
  5835. type: integer
  5836. description: 摊销月数(勾选摊销时可空=每月摊销不结束)
  5837. deduct_from_base:
  5838. type: boolean
  5839. description: 是否从基数扣除
  5840. remark:
  5841. type: string
  5842. description: 备注
  5843. row_version:
  5844. type: integer
  5845. description: 乐观锁版本(更新时)
  5846. required:
  5847. - category
  5848. - item_name
  5849. - billing_unit
  5850. - is_amortized
  5851. - deduct_from_base
  5852. required:
  5853. - data
  5854. x-error-codes: [60001]
  5855. responses:
  5856. "200":
  5857. description: 成功。统一信封 code/message/data
  5858. /cost_item/delete@v1:
  5859. post:
  5860. summary: 删除成本项定义
  5861. description: 仅 admin。顺序固定「引用检查 → 真删」;D-1:按 plan_cost_item.cost_item_id 强引用反查,
  5862. 命中 ⇒ KLT-E002 并在 data.referring_plan_count 回引用档位数(文案含「先在档位上解除引用」出路);改名不影响引用数。
  5863. 无引用才真删:同一批清理该成本项名下全部 cost_amount 行(级联行数只进审计摘要、不进响应体)。
  5864. operationId: cost_item_delete
  5865. tags:
  5866. - 成本与分成
  5867. x-require-auth: true
  5868. x-resource-type:
  5869. $ref: '#/components/x-resource-types/cost_item/code'
  5870. x-action:
  5871. $ref: '#/components/x-actions/delete/code'
  5872. x-version: v1
  5873. x-permission-visibility: catalog
  5874. requestBody:
  5875. required: true
  5876. description: JSON 请求体,业务字段置于 data
  5877. content:
  5878. application/json:
  5879. schema:
  5880. type: object
  5881. description: 统一信封请求体,业务字段放在 data 内
  5882. properties:
  5883. data:
  5884. type: object
  5885. description: 业务参数
  5886. properties:
  5887. cost_item_id:
  5888. type: string
  5889. description: 成本项 ID(待删除的定义主键)
  5890. required:
  5891. - cost_item_id
  5892. required:
  5893. - data
  5894. x-error-codes: [60005, 60302]
  5895. responses:
  5896. "200":
  5897. description: 成功。统一信封 code/message/data
  5898. /cost_item/get_list@v1:
  5899. post:
  5900. summary: 成本项列表
  5901. description: 全局成本项目录;可选类别/名称关键字;无客户过滤。
  5902. operationId: cost_item_get_list
  5903. tags:
  5904. - 成本与分成
  5905. x-require-auth: true
  5906. x-resource-type:
  5907. $ref: '#/components/x-resource-types/cost_item/code'
  5908. x-action:
  5909. $ref: '#/components/x-actions/list/code'
  5910. x-version: v1
  5911. x-permission-visibility: catalog
  5912. requestBody:
  5913. required: true
  5914. description: JSON 请求体,业务字段置于 data
  5915. content:
  5916. application/json:
  5917. schema:
  5918. type: object
  5919. description: 统一信封请求体,业务字段放在 data 内
  5920. properties:
  5921. data:
  5922. type: object
  5923. description: 列表筛选参数
  5924. properties:
  5925. page:
  5926. type: integer
  5927. description: 页码(0 基索引,默认 0)
  5928. minimum: 0
  5929. default: 0
  5930. page_size:
  5931. type: integer
  5932. description: 每页条数(默认 20,上限 200)
  5933. minimum: 1
  5934. maximum: 200
  5935. default: 20
  5936. keyword:
  5937. type: string
  5938. description: 关键字筛选(可选)
  5939. category:
  5940. type: string
  5941. description: 类别筛选
  5942. required:
  5943. - data
  5944. x-error-codes: [60001]
  5945. responses:
  5946. "200":
  5947. description: 成功。统一信封 code/message/data
  5948. /cost_amount/save@v1:
  5949. post:
  5950. summary: 保存成本金额
  5951. description: 按「省份×运营商×成本项」只写差异金额;留空项表示删除该差异。
  5952. operationId: cost_amount_save
  5953. tags:
  5954. - 成本与分成
  5955. x-require-auth: true
  5956. x-resource-type:
  5957. $ref: '#/components/x-resource-types/cost_amount/code'
  5958. x-action:
  5959. $ref: '#/components/x-actions/manage/code'
  5960. x-version: v1
  5961. x-permission-visibility: catalog
  5962. requestBody:
  5963. required: true
  5964. description: JSON 请求体,业务字段置于 data
  5965. content:
  5966. application/json:
  5967. schema:
  5968. type: object
  5969. description: 统一信封请求体,业务字段放在 data 内
  5970. properties:
  5971. data:
  5972. type: object
  5973. description: 业务参数
  5974. properties:
  5975. province_node_id:
  5976. type: string
  5977. description: 省份节点 ID
  5978. operator_id:
  5979. type: string
  5980. description: 运营商 ID
  5981. items:
  5982. type: array
  5983. description: 变更项列表;留空金额表示删除该差异行
  5984. items:
  5985. type: object
  5986. properties:
  5987. cost_item_id:
  5988. type: string
  5989. description: 成本项 ID
  5990. amount_cents:
  5991. type: integer
  5992. description: 金额(分);空/省略表示删除
  5993. row_version:
  5994. type: integer
  5995. description: 乐观锁版本
  5996. required:
  5997. - cost_item_id
  5998. required:
  5999. - province_node_id
  6000. - operator_id
  6001. - items
  6002. required:
  6003. - data
  6004. x-error-codes: [60001]
  6005. responses:
  6006. "200":
  6007. description: 成功。统一信封 code/message/data
  6008. /cost_amount/get_list@v1:
  6009. post:
  6010. summary: 成本金额一览
  6011. description: 透视表;admin 全量,区域运营按可见省/运营商收窄。
  6012. operationId: cost_amount_get_list
  6013. tags:
  6014. - 成本与分成
  6015. x-require-auth: true
  6016. x-resource-type:
  6017. $ref: '#/components/x-resource-types/cost_amount/code'
  6018. x-action:
  6019. $ref: '#/components/x-actions/list/code'
  6020. x-version: v1
  6021. x-permission-visibility: catalog
  6022. requestBody:
  6023. required: true
  6024. description: JSON 请求体,业务字段置于 data
  6025. content:
  6026. application/json:
  6027. schema:
  6028. type: object
  6029. description: 统一信封请求体,业务字段放在 data 内
  6030. properties:
  6031. data:
  6032. type: object
  6033. description: 列表筛选参数
  6034. properties:
  6035. province_node_id:
  6036. type: string
  6037. description: 省份筛选
  6038. operator_id:
  6039. type: string
  6040. description: 运营商筛选
  6041. page:
  6042. type: integer
  6043. description: 页码(0 基索引,默认 0)
  6044. minimum: 0
  6045. default: 0
  6046. page_size:
  6047. type: integer
  6048. description: 每页条数(默认 20,上限 200)
  6049. minimum: 1
  6050. maximum: 200
  6051. default: 20
  6052. keyword:
  6053. type: string
  6054. description: 关键字筛选(可选)
  6055. required:
  6056. - data
  6057. x-error-codes: [60001]
  6058. responses:
  6059. "200":
  6060. description: 成功。统一信封 code/message/data
  6061. /share_rule/save@v1:
  6062. post:
  6063. summary: 保存分成规则
  6064. description: holder_type 仅 operator/ops_team(无 partner)。share_value 填 0/负表示删除该行。
  6065. operationId: share_rule_save
  6066. tags:
  6067. - 成本与分成
  6068. x-require-auth: true
  6069. x-resource-type:
  6070. $ref: '#/components/x-resource-types/share_rule/code'
  6071. x-action:
  6072. $ref: '#/components/x-actions/manage/code'
  6073. x-version: v1
  6074. x-permission-visibility: catalog
  6075. requestBody:
  6076. required: true
  6077. description: JSON 请求体,业务字段置于 data
  6078. content:
  6079. application/json:
  6080. schema:
  6081. type: object
  6082. description: 统一信封请求体,业务字段放在 data 内
  6083. properties:
  6084. data:
  6085. type: object
  6086. description: 业务参数
  6087. properties:
  6088. holder_type:
  6089. type: string
  6090. description: 持有方类型:operator/ops_team
  6091. enum:
  6092. - operator
  6093. - ops_team
  6094. holder_id:
  6095. type: string
  6096. description: 持有方 ID
  6097. rules:
  6098. type: array
  6099. description: 规则行列表
  6100. items:
  6101. type: object
  6102. properties:
  6103. rule_id:
  6104. type: string
  6105. description: 规则 ID(更新/删除时)
  6106. customer_id:
  6107. type: string
  6108. description: 客户 ID
  6109. rule_level:
  6110. type: string
  6111. description: 规则层级:contract_addon/region_regular
  6112. enum:
  6113. - contract_addon
  6114. - region_regular
  6115. share_mode:
  6116. type: string
  6117. description: 分成方式:ratio_total/per_account/fixed_amount
  6118. enum:
  6119. - ratio_total
  6120. - per_account
  6121. - fixed_amount
  6122. share_value:
  6123. type: number
  6124. description: 分成值:比例 (0,1];金额/每账号>0 分;0/负=删除该行
  6125. remark:
  6126. type: string
  6127. description: 备注
  6128. required:
  6129. - holder_type
  6130. - holder_id
  6131. - rules
  6132. required:
  6133. - data
  6134. x-error-codes: []
  6135. responses:
  6136. "200":
  6137. description: 成功。统一信封 code/message/data
  6138. /share_rule/get_list@v1:
  6139. post:
  6140. summary: 分成规则列表
  6141. description: 按持有方等条件列出分成规则。
  6142. operationId: share_rule_get_list
  6143. tags:
  6144. - 成本与分成
  6145. x-require-auth: true
  6146. x-resource-type:
  6147. $ref: '#/components/x-resource-types/share_rule/code'
  6148. x-action:
  6149. $ref: '#/components/x-actions/list/code'
  6150. x-version: v1
  6151. x-permission-visibility: catalog
  6152. requestBody:
  6153. required: true
  6154. description: JSON 请求体,业务字段置于 data
  6155. content:
  6156. application/json:
  6157. schema:
  6158. type: object
  6159. description: 统一信封请求体,业务字段放在 data 内
  6160. properties:
  6161. data:
  6162. type: object
  6163. description: 列表筛选参数
  6164. properties:
  6165. holder_type:
  6166. type: string
  6167. description: 持有方类型
  6168. holder_id:
  6169. type: string
  6170. description: 持有方 ID
  6171. page:
  6172. type: integer
  6173. description: 页码(0 基索引,默认 0)
  6174. minimum: 0
  6175. default: 0
  6176. page_size:
  6177. type: integer
  6178. description: 每页条数(默认 20,上限 200)
  6179. minimum: 1
  6180. maximum: 200
  6181. default: 20
  6182. keyword:
  6183. type: string
  6184. description: 关键字筛选(可选)
  6185. required:
  6186. - data
  6187. x-error-codes: []
  6188. responses:
  6189. "200":
  6190. description: 成功。统一信封 code/message/data
  6191. /share_rule/get@v1:
  6192. post:
  6193. summary: 分成规则详情
  6194. description: 按持有方一次返回四卡摘要与规则表。
  6195. operationId: share_rule_get
  6196. tags:
  6197. - 成本与分成
  6198. x-require-auth: true
  6199. x-resource-type:
  6200. $ref: '#/components/x-resource-types/share_rule/code'
  6201. x-action:
  6202. $ref: '#/components/x-actions/view/code'
  6203. x-version: v1
  6204. x-permission-visibility: catalog
  6205. requestBody:
  6206. required: true
  6207. description: JSON 请求体,业务字段置于 data
  6208. content:
  6209. application/json:
  6210. schema:
  6211. type: object
  6212. description: 统一信封请求体,业务字段放在 data 内
  6213. properties:
  6214. data:
  6215. type: object
  6216. description: 业务参数
  6217. properties:
  6218. holder_type:
  6219. type: string
  6220. description: 持有方类型:operator/ops_team
  6221. holder_id:
  6222. type: string
  6223. description: 持有方 ID
  6224. required:
  6225. - holder_type
  6226. - holder_id
  6227. required:
  6228. - data
  6229. x-error-codes: []
  6230. responses:
  6231. "200":
  6232. description: 成功。统一信封 code/message/data
  6233. /share_rule/delete@v1:
  6234. post:
  6235. summary: 删除分成规则
  6236. description: 按 rule_id 删除单条分成规则(亦可在 save 内以 0/负值删除)。
  6237. operationId: share_rule_delete
  6238. tags:
  6239. - 成本与分成
  6240. x-require-auth: true
  6241. x-resource-type:
  6242. $ref: '#/components/x-resource-types/share_rule/code'
  6243. x-action:
  6244. $ref: '#/components/x-actions/delete/code'
  6245. x-version: v1
  6246. x-permission-visibility: catalog
  6247. requestBody:
  6248. required: true
  6249. description: JSON 请求体,业务字段置于 data
  6250. content:
  6251. application/json:
  6252. schema:
  6253. type: object
  6254. description: 统一信封请求体,业务字段放在 data 内
  6255. properties:
  6256. data:
  6257. type: object
  6258. description: 业务参数
  6259. properties:
  6260. rule_id:
  6261. type: string
  6262. description: 规则 ID
  6263. required:
  6264. - rule_id
  6265. required:
  6266. - data
  6267. x-error-codes: []
  6268. responses:
  6269. "200":
  6270. description: 成功。统一信封 code/message/data
  6271. /opsview/home@v1:
  6272. get:
  6273. summary: 运维只读首页
  6274. description: 运维侧只读首页(U-60),返回工单/逾期等概览数据。
  6275. operationId: opsview_home
  6276. tags:
  6277. - 运维视图
  6278. x-require-auth: true
  6279. x-resource-type:
  6280. $ref: '#/components/x-resource-types/opsview/code'
  6281. x-action:
  6282. $ref: '#/components/x-actions/view/code'
  6283. x-version: v1
  6284. x-permission-visibility: catalog
  6285. x-error-codes: []
  6286. responses:
  6287. "200":
  6288. description: 成功。统一信封 code/message/data
  6289. /jobs/get_list@v1:
  6290. get:
  6291. summary: 定时作业清单
  6292. description: 返回第 10 册 13 行清单(注册位 11 +标注行 2)及运行态:启用态、可操作性位、最近执行、五格计数、累计轮次、KPI 五卡与待补跑轮次。运行态取数失败时仍返回 13 行,runtime_available=false。
  6293. operationId: jobs_get_list
  6294. tags:
  6295. - 定时作业
  6296. x-require-auth: true
  6297. x-resource-type:
  6298. $ref: '#/components/x-resource-types/jobs/code'
  6299. x-action:
  6300. $ref: '#/components/x-actions/list/code'
  6301. x-version: v1
  6302. x-permission-visibility: catalog
  6303. x-error-codes: []
  6304. responses:
  6305. "200":
  6306. description: 成功。统一信封 code/message/data
  6307. /jobs/toggle@v1:
  6308. post:
  6309. summary: 启停定时作业
  6310. description: 仅 admin。按作业 key 启停。
  6311. operationId: jobs_toggle
  6312. tags:
  6313. - 定时作业
  6314. x-require-auth: true
  6315. x-resource-type:
  6316. $ref: '#/components/x-resource-types/jobs/code'
  6317. x-action:
  6318. $ref: '#/components/x-actions/manage/code'
  6319. x-version: v1
  6320. x-permission-visibility: catalog
  6321. requestBody:
  6322. required: true
  6323. description: JSON 请求体,业务字段置于 data
  6324. content:
  6325. application/json:
  6326. schema:
  6327. type: object
  6328. description: 统一信封请求体,业务字段放在 data 内
  6329. properties:
  6330. data:
  6331. type: object
  6332. description: 业务参数
  6333. properties:
  6334. key:
  6335. type: string
  6336. description: 作业键
  6337. enabled:
  6338. type: boolean
  6339. description: 是否启用
  6340. required:
  6341. - key
  6342. - enabled
  6343. required:
  6344. - data
  6345. x-error-codes: []
  6346. responses:
  6347. "200":
  6348. description: 成功。统一信封 code/message/data
  6349. /jobs/runs@v1:
  6350. post:
  6351. summary: 作业执行记录
  6352. description: 查询执行记录,支持任务、关键字(执行编号/任务/结果说明,不检索对象级明细)、触发方式、执行结果与日期区间筛选;分页 page 0 基、page_size 默认 50。标注行返回空流水并标记 annotation=true。
  6353. operationId: jobs_runs
  6354. tags:
  6355. - 定时作业
  6356. x-require-auth: true
  6357. x-resource-type:
  6358. $ref: '#/components/x-resource-types/jobs/code'
  6359. x-action:
  6360. $ref: '#/components/x-actions/view/code'
  6361. x-version: v1
  6362. x-permission-visibility: catalog
  6363. requestBody:
  6364. required: true
  6365. description: JSON 请求体,业务字段置于 data
  6366. content:
  6367. application/json:
  6368. schema:
  6369. type: object
  6370. description: 统一信封请求体,业务字段放在 data 内
  6371. properties:
  6372. data:
  6373. type: object
  6374. description: 业务参数
  6375. properties:
  6376. key:
  6377. type: string
  6378. description: 作业键(可省略=全部任务)
  6379. job_key:
  6380. type: string
  6381. description: 作业键(契约字段名,可省略)
  6382. keyword:
  6383. type: string
  6384. description: 关键字(执行编号/任务/结果说明;不检索对象级明细)
  6385. trigger:
  6386. type: string
  6387. description: 触发方式
  6388. enum:
  6389. - 定时
  6390. - 事件
  6391. - 人工
  6392. result:
  6393. type: string
  6394. description: 执行结果
  6395. enum:
  6396. - 成功
  6397. - 部分成功
  6398. - 失败
  6399. - 异常
  6400. date_from:
  6401. type: string
  6402. description: 开始日期(YYYY-MM-DD,Asia/Shanghai 日界)
  6403. pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2}$'
  6404. date_to:
  6405. type: string
  6406. description: 结束日期(YYYY-MM-DD,含当日)
  6407. pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2}$'
  6408. page:
  6409. type: integer
  6410. description: 页码(0 基,默认 0)
  6411. minimum: 0
  6412. default: 0
  6413. page_size:
  6414. type: integer
  6415. description: 每页条数(默认 50,上限 200)
  6416. minimum: 1
  6417. maximum: 200
  6418. default: 50
  6419. required:
  6420. - data
  6421. x-error-codes: []
  6422. responses:
  6423. "200":
  6424. description: 成功。统一信封 code/message/data
  6425. /jobs/run_once@v1:
  6426. post:
  6427. summary: 补跑作业一次
  6428. description: 触发一次指定作业。prod 环境仅总运营可补跑。可选 key:SUB-EFF/SNAPSHOT-FREEZE/DELEG-SYNC/STOP-GEN/OVERDUE/AUTO-CLOSE/RECON/ORPHAN-CLEAN/REGION-WARM/ONEDIR-CHECK/OSS-ORPHAN-CLEAN/CONTRACT-RENEW。执行轮次落 bos_job_run,返回本轮五格计数与对象级明细。`AUTO-CLOSE`=手册 P7「客户 7 天未确认则系统自动关闭」:扫停在 completed 的故障/售后**客户自报**单,完成日早于「业务日 − 7 天」的逐张置 settled(动作键 confirm_close、主体 AUTO-CLOSE);运维代建/系统生成单不进本作业(标记完成即结束)。`STOP-GEN`/`AUTO-CLOSE`/`CONTRACT-RENEW` 可选传 biz_date(YYYY-MM-DD,缺省=今天)补跑历史某日。
  6429. operationId: jobs_run_once
  6430. tags:
  6431. - 定时作业
  6432. x-require-auth: true
  6433. x-resource-type:
  6434. $ref: '#/components/x-resource-types/jobs/code'
  6435. x-action:
  6436. $ref: '#/components/x-actions/manage/code'
  6437. x-version: v1
  6438. x-permission-visibility: catalog
  6439. requestBody:
  6440. required: true
  6441. description: JSON 请求体,业务字段置于 data
  6442. content:
  6443. application/json:
  6444. schema:
  6445. type: object
  6446. description: 统一信封请求体,业务字段放在 data 内
  6447. properties:
  6448. data:
  6449. type: object
  6450. description: 业务参数
  6451. properties:
  6452. key:
  6453. type: string
  6454. description: 作业键
  6455. enum:
  6456. - SUB-EFF
  6457. - SNAPSHOT-FREEZE
  6458. - DELEG-SYNC
  6459. - STOP-GEN
  6460. - OVERDUE
  6461. - AUTO-CLOSE
  6462. - RECON
  6463. - ORPHAN-CLEAN
  6464. - REGION-WARM
  6465. - ONEDIR-CHECK
  6466. - OSS-ORPHAN-CLEAN
  6467. - CONTRACT-RENEW
  6468. period:
  6469. type: string
  6470. description: 仅 RECON 用;指定已结束自然月(YYYY-MM)回填,前端传 1 基以外的月份格式即 11103
  6471. pattern: '^[0-9]{4}-[0-9]{2}$'
  6472. biz_date:
  6473. type: string
  6474. description: 仅 STOP-GEN/AUTO-CLOSE/CONTRACT-RENEW 用;业务日(YYYY-MM-DD),缺省=当天。STOP-GEN 按「订阅结束日早于该业务日」扫描;CONTRACT-RENEW 按「合同结束日在 [业务日, 业务日+提前天数] 窗口内」扫描;幂等键含业务日
  6475. pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2}$'
  6476. required:
  6477. - key
  6478. required:
  6479. - data
  6480. x-error-codes: []
  6481. responses:
  6482. "200":
  6483. description: 成功。统一信封 code/message/data
  6484. /share_rule/param_summary@v1:
  6485. post:
  6486. summary: 分成参数摘要
  6487. description: |
  6488. 批量取分成方的分成方式/数值与覆盖客户数(分成管理页徽标);最多 500 项。
  6489. holders 必填且非空(null/缺键/[] ⇒ 60004);按 holder_type|holder_id 去重;
  6490. holder_id 号段须匹配发号前缀(operator=OP-/partner=PT-/ops_team=OPS-),空串或前缀不符 ⇒ 11103;
  6491. 未知主体逐项返回 configured=false+item_error(⛔ 整批 11104);share_value=十进制字符串(与档案 settle_value 同型)。
  6492. ⛔ 无 `share-rule/holder-options`(连字符)口;分成方候选=`operator`/`partner`/`ops_team` 的 `get_list`。
  6493. operationId: share_rule_param_summary
  6494. tags:
  6495. - 成本与分成
  6496. x-require-auth: true
  6497. x-resource-type:
  6498. $ref: '#/components/x-resource-types/share_rule/code'
  6499. x-action:
  6500. $ref: '#/components/x-actions/list/code'
  6501. x-version: v1
  6502. x-permission-visibility: catalog
  6503. x-error-codes: [11103, 11104]
  6504. responses:
  6505. "200":
  6506. description: 成功。统一信封 code/message/data
  6507. /billing/config_get@v1:
  6508. get:
  6509. summary: 出账配置读
  6510. description: 默认对账日、成本生效口径、行版本与运营商对账账号列表(仅总运营)。
  6511. operationId: billing_config_get
  6512. tags:
  6513. - 计费与对账
  6514. x-require-auth: true
  6515. x-resource-type:
  6516. $ref: '#/components/x-resource-types/billing_config/code'
  6517. x-action:
  6518. $ref: '#/components/x-actions/view/code'
  6519. x-version: v1
  6520. x-permission-visibility: catalog
  6521. x-error-codes: []
  6522. responses:
  6523. "200":
  6524. description: 成功。统一信封 code/message/data
  6525. /billing/config_update@v1:
  6526. post:
  6527. summary: 出账配置写
  6528. description: 乐观锁 row_version;提交同值 ⇒ changed=0 不写审计;运营商对账日只读(写口在 operator/update)。
  6529. operationId: billing_config_update
  6530. tags:
  6531. - 计费与对账
  6532. x-require-auth: true
  6533. x-resource-type:
  6534. $ref: '#/components/x-resource-types/billing_config/code'
  6535. x-action:
  6536. $ref: '#/components/x-actions/update/code'
  6537. x-version: v1
  6538. x-permission-visibility: catalog
  6539. x-error-codes: [11103, 60001]
  6540. responses:
  6541. "200":
  6542. description: 成功。统一信封 code/message/data
  6543. /recon/periods@v1:
  6544. get:
  6545. summary: 对账期次下拉
  6546. description: 有数据的自然月(倒序),不并入 get_list。
  6547. operationId: recon_periods
  6548. tags:
  6549. - 计费与对账
  6550. x-require-auth: true
  6551. x-resource-type:
  6552. $ref: '#/components/x-resource-types/recon/code'
  6553. x-action:
  6554. $ref: '#/components/x-actions/list/code'
  6555. x-version: v1
  6556. x-permission-visibility: catalog
  6557. x-error-codes: []
  6558. responses:
  6559. "200":
  6560. description: 成功。统一信封 code/message/data
  6561. /recon/get_list@v1:
  6562. post:
  6563. summary: 对账批次清单
  6564. description: 三统计卡与期次出账进度随同一响应下发;出账状态为派生筛选(settled/abnormal/unsettled)。
  6565. operationId: recon_get_list
  6566. tags:
  6567. - 计费与对账
  6568. x-require-auth: true
  6569. x-resource-type:
  6570. $ref: '#/components/x-resource-types/recon/code'
  6571. x-action:
  6572. $ref: '#/components/x-actions/list/code'
  6573. x-version: v1
  6574. x-permission-visibility: catalog
  6575. x-error-codes: [11103]
  6576. responses:
  6577. "200":
  6578. description: 成功。统一信封 code/message/data
  6579. /recon/detail@v1:
  6580. get:
  6581. summary: 对账批次详情
  6582. description: 批次头+活跃明细行+动作可用性布尔位(服务端算)。
  6583. operationId: recon_detail
  6584. tags:
  6585. - 计费与对账
  6586. x-require-auth: true
  6587. x-resource-type:
  6588. $ref: '#/components/x-resource-types/recon/code'
  6589. x-action:
  6590. $ref: '#/components/x-actions/view/code'
  6591. x-version: v1
  6592. x-permission-visibility: catalog
  6593. x-error-codes: [11103, 11104]
  6594. responses:
  6595. "200":
  6596. description: 成功。统一信封 code/message/data
  6597. /recon/rerun@v1:
  6598. post:
  6599. summary: 人工补跑出账
  6600. description: 仅总运营。四道前置依次返回 KLT-H20502/60503/60504/60506;作废旧 failed 批并回填 replaced_by_batch_no。
  6601. operationId: recon_rerun
  6602. tags:
  6603. - 计费与对账
  6604. x-require-auth: true
  6605. x-resource-type:
  6606. $ref: '#/components/x-resource-types/recon/code'
  6607. x-action:
  6608. $ref: '#/components/x-actions/update/code'
  6609. x-version: v1
  6610. x-permission-visibility: catalog
  6611. x-error-codes: [11103, 60502, 60503, 60504, 60506, 60001]
  6612. responses:
  6613. "200":
  6614. description: 成功。统一信封 code/message/data
  6615. /recon/export_list@v1:
  6616. post:
  6617. summary: 导出对账清单(B 表)
  6618. description: 按当前筛选结果导出批次清单一行一批次,末行合计;行集与 /recon/get_list 同源;未加筛选=导出全部批次;每次导出写操作日志(记筛选条件与导出批数)。
  6619. operationId: recon_export_list
  6620. tags:
  6621. - 计费与对账
  6622. x-require-auth: true
  6623. x-resource-type:
  6624. $ref: '#/components/x-resource-types/recon/code'
  6625. x-action:
  6626. $ref: '#/components/x-actions/export/code'
  6627. x-version: v1
  6628. x-permission-visibility: catalog
  6629. x-error-codes: [11103]
  6630. responses:
  6631. "200":
  6632. description: 成功。统一信封 code/message/data
  6633. /recon/export_detail@v1:
  6634. post:
  6635. summary: 导出账单明细(A 表)
  6636. description: 导出本批交给分成方核对的账单明细,一行一条末行本批合计;本批未执行或无明细返回 KLT-H20505(不产文件不写审计)。
  6637. operationId: recon_export_detail
  6638. tags:
  6639. - 计费与对账
  6640. x-require-auth: true
  6641. x-resource-type:
  6642. $ref: '#/components/x-resource-types/recon/code'
  6643. x-action:
  6644. $ref: '#/components/x-actions/export/code'
  6645. x-version: v1
  6646. x-permission-visibility: catalog
  6647. x-error-codes: [11103, 11104, 60505]
  6648. responses:
  6649. "200":
  6650. description: 成功。统一信封 code/message/data
  6651. /view/partner_recon@v1:
  6652. get:
  6653. summary: 合伙人与运维团队本方对账合并页
  6654. description: 第 8 册 V-I1。卡 1(分成方式与取值)+卡 2/3(批次数与明细条数)+表 1(本方对账清单)+表 2(本方账单明细)+卡 4(分成合计双值)+月份选项一次返回;行集恒等于「分成方=本方」,入参只有 month/keyword/page/page_size,任何范围类入参 ⇒ 11103。快照未建立 ⇒ snapshot_state=not_ready(整页态,仍回 200 与空骨架);月份选项取数失败 ⇒ month_options="failed"。
  6655. operationId: view_partner_recon
  6656. tags:
  6657. - 合伙人与运营商只读视图
  6658. x-require-auth: true
  6659. x-resource-type:
  6660. $ref: '#/components/x-resource-types/view/code'
  6661. x-action:
  6662. $ref: '#/components/x-actions/partner_recon/code'
  6663. x-version: v1
  6664. x-permission-visibility: catalog
  6665. x-error-codes: [11103, 11104]
  6666. parameters:
  6667. - name: month
  6668. in: query
  6669. required: false
  6670. schema:
  6671. type: string
  6672. description: 自然月 YYYY-MM;省略=全部自然月
  6673. - name: keyword
  6674. in: query
  6675. required: false
  6676. schema:
  6677. type: string
  6678. description: 对账单号/明细号模糊匹配(不分大小写)
  6679. - name: page
  6680. in: query
  6681. required: false
  6682. schema:
  6683. type: integer
  6684. minimum: 0
  6685. default: 0
  6686. description: 页码(0 基索引)
  6687. - name: page_size
  6688. in: query
  6689. required: false
  6690. schema:
  6691. type: integer
  6692. minimum: 1
  6693. maximum: 200
  6694. default: 20
  6695. responses:
  6696. "200":
  6697. description: 成功。统一信封 code/message/data
  6698. /bill/get_list@v1:
  6699. post:
  6700. summary: 账单明细清单
  6701. description: 只含进入 executed 批次的 active 行。
  6702. operationId: bill_get_list
  6703. tags:
  6704. - 计费与对账
  6705. x-require-auth: true
  6706. x-resource-type:
  6707. $ref: '#/components/x-resource-types/bill/code'
  6708. x-action:
  6709. $ref: '#/components/x-actions/list/code'
  6710. x-version: v1
  6711. x-permission-visibility: catalog
  6712. x-error-codes: [11103]
  6713. responses:
  6714. "200":
  6715. description: 成功。统一信封 code/message/data
  6716. /bill/detail@v1:
  6717. get:
  6718. summary: 账单明细详情
  6719. description: 头+成本明细+在期分账号+同订阅其他分成方,七段同源一个接口。
  6720. operationId: bill_detail
  6721. tags:
  6722. - 计费与对账
  6723. x-require-auth: true
  6724. x-resource-type:
  6725. $ref: '#/components/x-resource-types/bill/code'
  6726. x-action:
  6727. $ref: '#/components/x-actions/view/code'
  6728. x-version: v1
  6729. x-permission-visibility: catalog
  6730. x-error-codes: [11103, 11104]
  6731. responses:
  6732. "200":
  6733. description: 成功。统一信封 code/message/data
  6734. /correction/create@v1:
  6735. post:
  6736. summary: 登记出账更正
  6737. description: 表单仅两字段(关联账单+错误内容);KLT-H20501 识别不到归属、KLT-H20507 候选未出账。不接受入参 `scope`/`severity`/`region_node_id`(三者皆为系统推导值),出现即 11103 且 `data.fields[]` 逐键给出原因。
  6738. operationId: correction_create
  6739. tags:
  6740. - 计费与对账
  6741. x-require-auth: true
  6742. x-resource-type:
  6743. $ref: '#/components/x-resource-types/correction/code'
  6744. x-action:
  6745. $ref: '#/components/x-actions/create/code'
  6746. x-version: v1
  6747. x-permission-visibility: catalog
  6748. x-error-codes: [11103, 11104, 60501, 60507, 60056]
  6749. responses:
  6750. "200":
  6751. description: 成功。统一信封 code/message/data
  6752. /correction/get_list@v1:
  6753. post:
  6754. summary: 出账更正列表
  6755. description: 自然月筛选不预选;无编辑/删除/导出入口。
  6756. operationId: correction_get_list
  6757. tags:
  6758. - 计费与对账
  6759. x-require-auth: true
  6760. x-resource-type:
  6761. $ref: '#/components/x-resource-types/correction/code'
  6762. x-action:
  6763. $ref: '#/components/x-actions/list/code'
  6764. x-version: v1
  6765. x-permission-visibility: catalog
  6766. x-error-codes: [11103]
  6767. responses:
  6768. "200":
  6769. description: 成功。统一信封 code/message/data
  6770. /correction/detail@v1:
  6771. get:
  6772. summary: 出账更正详情
  6773. description: 命中/未命中两种展示同源;越权与查无同码(11104)。
  6774. operationId: correction_detail
  6775. tags:
  6776. - 计费与对账
  6777. x-require-auth: true
  6778. x-resource-type:
  6779. $ref: '#/components/x-resource-types/correction/code'
  6780. x-action:
  6781. $ref: '#/components/x-actions/view/code'
  6782. x-version: v1
  6783. x-permission-visibility: catalog
  6784. x-error-codes: [11103, 11104]
  6785. responses:
  6786. "200":
  6787. description: 成功。统一信封 code/message/data
  6788. /correction/draft_save@v1:
  6789. post:
  6790. summary: 保存更正草稿
  6791. description: 按「admin × 本机」至多一份;表单整体 ≤64KB;不接受 user_id。
  6792. operationId: correction_draft_save
  6793. tags:
  6794. - 计费与对账
  6795. x-require-auth: true
  6796. x-resource-type:
  6797. $ref: '#/components/x-resource-types/correction/code'
  6798. x-action:
  6799. $ref: '#/components/x-actions/update/code'
  6800. x-version: v1
  6801. x-permission-visibility: catalog
  6802. x-error-codes: [11103]
  6803. responses:
  6804. "200":
  6805. description: 成功。统一信封 code/message/data
  6806. /correction/draft_get@v1:
  6807. get:
  6808. summary: 读取更正草稿
  6809. description: 无草稿 ⇒ 成功+空对象(不报 404/不报业务码)。
  6810. operationId: correction_draft_get
  6811. tags:
  6812. - 计费与对账
  6813. x-require-auth: true
  6814. x-resource-type:
  6815. $ref: '#/components/x-resource-types/correction/code'
  6816. x-action:
  6817. $ref: '#/components/x-actions/view/code'
  6818. x-version: v1
  6819. x-permission-visibility: catalog
  6820. x-error-codes: []
  6821. responses:
  6822. "200":
  6823. description: 成功。统一信封 code/message/data
  6824. /ticket/list@v1:
  6825. post:
  6826. summary: 工单列表查询
  6827. description: 跨 6 类工单统一分页;行集=判权谓词+可见范围五档+数据权限;排序=是否已超期→优先级→提醒时限(TK-1)。出参每行带 row_version 与可执行动作集合(服务端计算,前端不自拼)。主要失败:网关 11104(缺权限)。
  6828. operationId: ticket_list
  6829. tags:
  6830. - 工单与开停交付
  6831. x-require-auth: true
  6832. x-resource-type:
  6833. $ref: '#/components/x-resource-types/ticket/code'
  6834. x-action:
  6835. $ref: '#/components/x-actions/list/code'
  6836. x-version: v1
  6837. x-permission-visibility: catalog
  6838. requestBody:
  6839. required: true
  6840. description: JSON 请求体,业务字段置于 data
  6841. content:
  6842. application/json:
  6843. schema:
  6844. type: object
  6845. description: 统一信封请求体,业务字段放在 data 内
  6846. properties:
  6847. data:
  6848. type: object
  6849. description: 业务参数
  6850. properties:
  6851. ticket_types:
  6852. type: array
  6853. description: 工单类型(英文码):开户、服务开通、到期停机、服务停用、故障处理、售后处理;缺省=全部。兼容单数写法 `ticket_type`(传单字符串或逗号分隔串同样生效)
  6854. items:
  6855. type: string
  6856. statuses:
  6857. type: array
  6858. description: 工单状态(未分派/待处理/处理中/已满足闭环/待回执/已办结);缺省=全部。兼容单数写法 `status`(传单字符串或逗号分隔串同样生效)
  6859. items:
  6860. type: string
  6861. sources:
  6862. type: array
  6863. description: 来源:self/cust_svc/ops/system;缺省=全部。兼容单数写法 `source`(传单字符串或逗号分隔串同样生效)
  6864. items:
  6865. type: string
  6866. date_from:
  6867. type: string
  6868. description: 建单日期起(YYYY-MM-DD)
  6869. date_to:
  6870. type: string
  6871. description: 建单日期止(YYYY-MM-DD)
  6872. keyword:
  6873. type: string
  6874. description: 关键字:标题/客户名/工单号/关联单号/网络账号/工单 ID(雪花主键,纯数字关键字按**整值**精确命中——即审计日志「对象」列那串数字;不做前缀/模糊匹配,避免 1~4 位数字命中全表;不含报文原文)
  6875. subscription_id:
  6876. type: string
  6877. description: 订单(订阅)过滤:只回本订单的工单(订单详情「关联工单」现查,P3-D6)。空串=不过滤
  6878. contract_id:
  6879. type: string
  6880. description: 合同过滤:服务端先把该合同下的订单解成集合再过滤,合同还没有订单时回空集(不退化成不过滤,P3-D7)。空串=不过滤
  6881. customer_id:
  6882. type: string
  6883. description: 客户过滤:只回本客户的工单。空串=不过滤
  6884. assignee:
  6885. type: string
  6886. description: 责任人过滤:**只接受 `me`**(服务端按会话解析成当前登录账号,与可见性谓词逐段取交);供「我的待办」把可见行集收窄到本人名下。⛔ 接受任意 user_id(按他人过滤不开放),其它取值回 11103。空串=不过滤
  6887. page:
  6888. type: integer
  6889. description: 页码,从 1 起(越界收敛,不报错)
  6890. page_size:
  6891. type: integer
  6892. description: 每页条数,1–100,缺省 10
  6893. required:
  6894. - data
  6895. x-error-codes: [11104]
  6896. responses:
  6897. "200":
  6898. description: 成功。统一信封 code/message/data
  6899. /ticket/detail@v1:
  6900. get:
  6901. summary: 工单详情查询
  6902. description: >-
  6903. 出参骨架+时间线+按类型子域块(回填、分账号、开停记录、竣工、报文、故障、材料)。
  6904. ✅ 2026-11-22:另回只读块 `construction_guide`(套餐/带宽/席位/份数/境外 IP 权益;停机/变更另含
  6905. `prior_activation` 最近成功开户回填线路与 IP 只读快照,PIN/CPID 仅「已登记」)与可选
  6906. `backfill_draft`(服务端暂存草稿摘要,不明文回 PIN/CPID)。`actions.check_and_backfill`
  6907. 为真时变更协议走「核对并回填」合并口(同批清单+回填),独立 `check_done` 对 `updown` 关闭。
  6908. D-10:并行出单时另有 `subscriptions[]`。读事件:read_event 为真且当前人是责任人且态为待处理
  6909. ⇒ 同事务推进处理中并写首条处理记录。主要失败:60056(不可见)、KLT-G20401。
  6910. operationId: ticket_detail
  6911. tags:
  6912. - 工单与开停交付
  6913. x-require-auth: true
  6914. x-resource-type:
  6915. $ref: '#/components/x-resource-types/ticket/code'
  6916. x-action:
  6917. $ref: '#/components/x-actions/detail/code'
  6918. x-version: v1
  6919. x-permission-visibility: catalog
  6920. parameters:
  6921. - name: ticket_id
  6922. in: query
  6923. required: false
  6924. description: 工单标识(内部主键)。注意:与 ticket_no 二者至少给一个,都给以本参数为准
  6925. schema:
  6926. type: string
  6927. - name: ticket_no
  6928. in: query
  6929. required: false
  6930. description: 业务工单号(形如 T-20261114-5968)。客户门户不暴露内部主键,列表只回 ticket_no,
  6931. 故详情口按本参数定位;反查**在可见性谓词之内**执行,查无与越权同回 60005
  6932. (与按主键查无同一口径,不说破「存在但你不能看」)
  6933. schema:
  6934. type: string
  6935. - name: read_event
  6936. in: query
  6937. required: false
  6938. description: 阅读推进开关:true 时才尝试待处理→处理中
  6939. schema:
  6940. type: string
  6941. x-error-codes: [11103, 60005]
  6942. responses:
  6943. "200":
  6944. description: 成功。统一信封 code/message/data
  6945. /ticket/pending_queue@v1:
  6946. post:
  6947. summary: 待分派队列查询
  6948. description: 运维主管/运维组负责人的分派工作台数据源;权限键与工单列表分列,不复用(TK-13)。行集=可见范围内未分派+待处理(注意:待处理入列理由待裁定,18册 U-13)。
  6949. operationId: ticket_pending_queue
  6950. tags:
  6951. - 工单与开停交付
  6952. x-require-auth: true
  6953. x-resource-type:
  6954. $ref: '#/components/x-resource-types/ticket/code'
  6955. x-action:
  6956. $ref: '#/components/x-actions/pending_queue/code'
  6957. x-version: v1
  6958. x-permission-visibility: catalog
  6959. requestBody:
  6960. required: true
  6961. description: JSON 请求体,业务字段置于 data
  6962. content:
  6963. application/json:
  6964. schema:
  6965. type: object
  6966. description: 统一信封请求体,业务字段放在 data 内
  6967. properties:
  6968. data:
  6969. type: object
  6970. description: 业务参数
  6971. properties:
  6972. ticket_types:
  6973. type: array
  6974. description: 工单类型;缺省=本人团队可受理全部类型(授权范围是上限)
  6975. items:
  6976. type: string
  6977. assign_team_id:
  6978. type: string
  6979. description: 目标运维团队;缺省=本人所辖团队;指定时必须是本人所辖团队
  6980. keyword:
  6981. type: string
  6982. description: 关键字,含义同工单列表
  6983. page:
  6984. type: integer
  6985. description: 页码,从 1 起(越界收敛,不报错)
  6986. page_size:
  6987. type: integer
  6988. description: 每页条数,1–100,缺省 10
  6989. required:
  6990. - data
  6991. x-error-codes: [11104]
  6992. responses:
  6993. "200":
  6994. description: 成功。统一信封 code/message/data
  6995. /ticket/todo_counts@v1:
  6996. get:
  6997. summary: 待办计数查询
  6998. description: 一次返回四个角标:未分派、超期、待回填、报文待处置。不做超期明细列表(超期明细走工单列表的已超期筛选)。
  6999. operationId: ticket_todo_counts
  7000. tags:
  7001. - 工单与开停交付
  7002. x-require-auth: true
  7003. x-resource-type:
  7004. $ref: '#/components/x-resource-types/ticket/code'
  7005. x-action:
  7006. $ref: '#/components/x-actions/todo_counts/code'
  7007. x-version: v1
  7008. x-permission-visibility: catalog
  7009. x-error-codes: [11104, 60201]
  7010. responses:
  7011. "200":
  7012. description: 成功。统一信封 code/message/data
  7013. /ticket/trace@v1:
  7014. get:
  7015. summary: 跨主体追溯查询
  7016. description: 按工单号/报文单号/竣工号任一单值精确定位,返回工单+开停记录+报文+竣工回传+回执的关联链。不支持关键字模糊(U-16)。主要失败:KLT-G20415(无法定位)。
  7017. operationId: ticket_trace
  7018. tags:
  7019. - 工单与开停交付
  7020. x-require-auth: true
  7021. x-resource-type:
  7022. $ref: '#/components/x-resource-types/ticket/code'
  7023. x-action:
  7024. $ref: '#/components/x-actions/trace/code'
  7025. x-version: v1
  7026. x-permission-visibility: catalog
  7027. parameters:
  7028. - name: ticket_no
  7029. in: query
  7030. required: false
  7031. description: 恪澜通工单号
  7032. schema:
  7033. type: string
  7034. - name: carrier_order_no
  7035. in: query
  7036. required: false
  7037. description: 运营商单号
  7038. schema:
  7039. type: string
  7040. - name: completion_no
  7041. in: query
  7042. required: false
  7043. description: 竣工单号
  7044. schema:
  7045. type: string
  7046. - name: ticket_id
  7047. in: query
  7048. required: false
  7049. description: 工单标识
  7050. schema:
  7051. type: string
  7052. x-error-codes: [11104]
  7053. responses:
  7054. "200":
  7055. description: 成功。统一信封 code/message/data
  7056. /message/pending@v1:
  7057. post:
  7058. summary: 报文待处置队列查询
  7059. description: 运维主管/运维组负责人的报文处置工作台数据源;不返回 raw_payload 正文(D7、U-51),只回动作/单号/归属态+归属失败原因码等已脱敏列。
  7060. operationId: message_pending
  7061. tags:
  7062. - 报文人工处置
  7063. x-require-auth: true
  7064. x-resource-type:
  7065. $ref: '#/components/x-resource-types/message/code'
  7066. x-action:
  7067. $ref: '#/components/x-actions/pending/code'
  7068. x-version: v1
  7069. x-permission-visibility: catalog
  7070. requestBody:
  7071. required: true
  7072. description: JSON 请求体,业务字段置于 data
  7073. content:
  7074. application/json:
  7075. schema:
  7076. type: object
  7077. description: 统一信封请求体,业务字段放在 data 内
  7078. properties:
  7079. data:
  7080. type: object
  7081. description: 业务参数
  7082. properties:
  7083. page:
  7084. type: integer
  7085. description: 页码,从 1 起(越界收敛,不报错)
  7086. page_size:
  7087. type: integer
  7088. description: 每页条数,1–100,缺省 10
  7089. required:
  7090. - data
  7091. x-error-codes: [11104]
  7092. responses:
  7093. "200":
  7094. description: 成功。统一信封 code/message/data
  7095. /ticket/create@v1:
  7096. post:
  7097. summary: 新建工单
  7098. description: 6 类共用;一次原子提交:客户当前在办唯一性(KLT-G20405)→ 雪花发号 → 建单+状态历史+建单动作+首条处理记录+初始材料。入参不得出现金额/资费/带宽购买/对账字段;不得传 status/assign_*(传入报 11103)。主要失败:11103、60056、KLT-G20405、11112、KLT-G20416。角色闸门按类型选档(手册 P7「客户通过企业微信联系/客服转交后运维代建」):`fault`/`after_sale` 放行七档=admin、opsMain、opsSub、teamLead、enterprise、sub + **运维成员 ops(代客建单,落 submitter_type='ops',不冒充客户自建)**;`service_open`/`expiry_stop`/`open` 三类仍走六档,ops 建主线单报 11104。<br>**`service_stop`(运营人工发起,工单§3.2.1「运营人工发起(客户详情页/订阅详情页)」+手册 P6)=本入口受理的第 3 类**:档位从六档**收紧到运营三类**=admin、opsMain、opsSub(客户两档/团队主/运维成员发起报 11104,代客建单页不开放本类型选项),并须同时满足三条——① 带 `subscription_id` 且该订阅属于 `customer_id`;② 服务**未到期**(订阅落库态非 expired/replaced/cancelled,且到期日不早于当日;到期停机由 STOP-GEN 作业出 `expiry_stop`,不得人工补单);③ `confirm=true` 显式二次确认。三条任一不成立即不建单(分别报 11103/60001/11103);受理成功后 `submitter_type` 记 `ops`,并按工单§3.2.3 随单落一条 `exec_status='pending'` 的待执行开停记录(形态与 STOP-GEN 建的到期停机单一致,生效日期/回填号两栏留空,后续由 `ticket/handle@v1` 回填时写)。
  7099. operationId: ticket_create
  7100. tags:
  7101. - 工单与开停交付
  7102. x-require-auth: true
  7103. x-resource-type:
  7104. $ref: '#/components/x-resource-types/ticket/code'
  7105. x-action:
  7106. $ref: '#/components/x-actions/create/code'
  7107. x-version: v1
  7108. x-permission-visibility: catalog
  7109. requestBody:
  7110. required: true
  7111. description: JSON 请求体,业务字段置于 data
  7112. content:
  7113. application/json:
  7114. schema:
  7115. type: object
  7116. description: 统一信封请求体,业务字段放在 data 内
  7117. properties:
  7118. data:
  7119. type: object
  7120. description: 业务参数
  7121. properties:
  7122. ticket_type:
  7123. type: string
  7124. description: 工单类型(6 个英文码之一:开户、服务开通、到期停机、服务停用、故障处理、售后处理)
  7125. customer_id:
  7126. type: string
  7127. description: 客户标识
  7128. title:
  7129. type: string
  7130. description: 工单标题
  7131. detail:
  7132. type: string
  7133. description: 工单详情(工单描述)
  7134. subscription_id:
  7135. type: string
  7136. description: 关联订阅标识;服务开通类可不关联。**`ticket_type=service_stop` 时必填**,且该订阅必须属于 `customer_id` 那个客户、服务未到期(工单§3.2.1)
  7137. confirm:
  7138. type: boolean
  7139. description: 提交时二次确认。客户两档发起 `fault`/`after_sale` 必须 `true`;运营发起 `service_stop` 必须 `true`(缺省或非 `true` 报 11103,工单§3.2.1/手册 P6)
  7140. materials:
  7141. type: array
  7142. description: 初始材料(建单即随附),最多 5 个;超限报 11103
  7143. items:
  7144. type: object
  7145. properties:
  7146. oss_key:
  7147. type: string
  7148. description: OSS 对象键
  7149. file_name:
  7150. type: string
  7151. description: 原始文件名
  7152. size_bytes:
  7153. type: integer
  7154. description: 文件字节数
  7155. required:
  7156. - ticket_type
  7157. - customer_id
  7158. - title
  7159. required:
  7160. - data
  7161. x-error-codes: [11103, 11104, 60001, 60108, 60804]
  7162. responses:
  7163. "200":
  7164. description: 成功。统一信封 code/message/data
  7165. /ticket/assign@v1:
  7166. post:
  7167. summary: 手动分派工单
  7168. description: 运维主管/组负责人在待分派队列指定处理人(TK-14)。目标处理人必须是在职人员∧本人团队∧持有该单类型;不改已完成/已办结单;不分给自己(自接单走创建即自assign 路径)。主要失败:11104、KLT-G20401、KLT-G20416、KLT-G20417。
  7169. operationId: ticket_assign
  7170. tags:
  7171. - 工单与开停交付
  7172. x-require-auth: true
  7173. x-resource-type:
  7174. $ref: '#/components/x-resource-types/ticket/code'
  7175. x-action:
  7176. $ref: '#/components/x-actions/assign/code'
  7177. x-version: v1
  7178. x-permission-visibility: catalog
  7179. requestBody:
  7180. required: true
  7181. description: JSON 请求体,业务字段置于 data
  7182. content:
  7183. application/json:
  7184. schema:
  7185. type: object
  7186. description: 统一信封请求体,业务字段放在 data 内
  7187. properties:
  7188. data:
  7189. type: object
  7190. description: 业务参数
  7191. properties:
  7192. ticket_id:
  7193. type: string
  7194. description: 工单标识(字符串下发,服务侧转 bigint)
  7195. assignee_user_id:
  7196. type: string
  7197. description: 目标责任人标识
  7198. required:
  7199. - ticket_id
  7200. - assignee_user_id
  7201. required:
  7202. - data
  7203. x-error-codes: [11103, 60401, 60402]
  7204. responses:
  7205. "200":
  7206. description: 成功。统一信封 code/message/data
  7207. /ticket/dispatch_auto@v1:
  7208. post:
  7209. summary: 自动分派(整批)
  7210. description: 对目标团队队列内可见的未分派单逐单按负载量最少判定:唯一最少⇒分派到人(assign_type=auto);并列最少/目标团队零人持有该类型⇒不分派,该单留队列并在结果里给出原因。不接受队列筛选条件入参。
  7211. operationId: ticket_dispatch_auto
  7212. tags:
  7213. - 工单与开停交付
  7214. x-require-auth: true
  7215. x-resource-type:
  7216. $ref: '#/components/x-resource-types/ticket/code'
  7217. x-action:
  7218. $ref: '#/components/x-actions/dispatch_auto/code'
  7219. x-version: v1
  7220. x-permission-visibility: catalog
  7221. requestBody:
  7222. required: true
  7223. description: JSON 请求体,业务字段置于 data
  7224. content:
  7225. application/json:
  7226. schema:
  7227. type: object
  7228. description: 统一信封请求体,业务字段放在 data 内
  7229. properties:
  7230. data:
  7231. type: object
  7232. description: 业务参数
  7233. properties:
  7234. team_id:
  7235. type: string
  7236. description: 目标运维团队;缺省=本人所辖团队
  7237. required:
  7238. - team_id
  7239. required:
  7240. - data
  7241. x-error-codes: [11103, 60402]
  7242. responses:
  7243. "200":
  7244. description: 成功。统一信封 code/message/data
  7245. /ticket/delegate@v1:
  7246. post:
  7247. summary: 交接转派
  7248. description: 人员交接时把名下未闭环工单批量改派给承接人;不得改派已完成单(TK-10)。承接人必须在职∧同团队∧持有对应工单类型;出参逐单结果,未成功单保持未分派并给原因。
  7249. operationId: ticket_delegate
  7250. tags:
  7251. - 工单与开停交付
  7252. x-require-auth: true
  7253. x-resource-type:
  7254. $ref: '#/components/x-resource-types/ticket/code'
  7255. x-action:
  7256. $ref: '#/components/x-actions/delegate/code'
  7257. x-version: v1
  7258. x-permission-visibility: catalog
  7259. requestBody:
  7260. required: true
  7261. description: JSON 请求体,业务字段置于 data
  7262. content:
  7263. application/json:
  7264. schema:
  7265. type: object
  7266. description: 统一信封请求体,业务字段放在 data 内
  7267. properties:
  7268. data:
  7269. type: object
  7270. description: 业务参数
  7271. properties:
  7272. ticket_id:
  7273. type: string
  7274. description: 被转派的工单标识
  7275. trustee_user_id:
  7276. type: string
  7277. description: 承接人标识
  7278. required:
  7279. - ticket_id
  7280. - trustee_user_id
  7281. required:
  7282. - data
  7283. x-error-codes: [60401, 60402, 60416]
  7284. responses:
  7285. "200":
  7286. description: 成功。统一信封 code/message/data
  7287. /ticket/start@v1:
  7288. post:
  7289. summary: 进入处理中(阅读推进)
  7290. description: 落库入口是工单详情读事件,不是人工按钮(U-39)。分支:待处理→处理中;处理中幂等成功;未分派不推进回成功;已完成/已办结报 KLT-G20401。
  7291. operationId: ticket_start
  7292. tags:
  7293. - 工单与开停交付
  7294. x-require-auth: true
  7295. x-resource-type:
  7296. $ref: '#/components/x-resource-types/ticket/code'
  7297. x-action:
  7298. $ref: '#/components/x-actions/start/code'
  7299. x-version: v1
  7300. x-permission-visibility: catalog
  7301. requestBody:
  7302. required: true
  7303. description: JSON 请求体,业务字段置于 data
  7304. content:
  7305. application/json:
  7306. schema:
  7307. type: object
  7308. description: 统一信封请求体,业务字段放在 data 内
  7309. properties:
  7310. data:
  7311. type: object
  7312. description: 业务参数
  7313. properties:
  7314. ticket_id:
  7315. type: string
  7316. description: 工单标识(字符串下发,服务侧转 bigint)
  7317. required:
  7318. - ticket_id
  7319. required:
  7320. - data
  7321. x-error-codes: [60401]
  7322. responses:
  7323. "200":
  7324. description: 成功。统一信封 code/message/data
  7325. /ticket/backfill@v1:
  7326. post:
  7327. summary: 回填竣工信息
  7328. description: >-
  7329. 开户/到期停机/服务停用/变更协议(`updown`)共用,按类型分叉必填矩阵(工单§5.1.1)。
  7330. 一次原子提交:回填头→明细→开停记录→分账号事实→客户状态+变更历史→订阅实际开通日→处理记录;
  7331. `updown` 另同批勾选清单(`check_item_ids`)写核对留痕。境外 IP 的 PIN/CPID 经 Keybox 加密入库,
  7332. 出参不出现明文。`pin_bind_mode`:`shared`(默认,PIN 挂 IP 行)/`per_account`(一账号一 PIN)。
  7333. 可选 `evidence_material_ids`(`kind=backfill_evidence`)。正式提交成功后删除该单草稿。
  7334. ✅ 2026-11-17:不再与合同/订阅交叉比对。主要失败:11103、KLT-G20404、KLT-G20417、11112。
  7335. operationId: ticket_backfill
  7336. tags:
  7337. - 工单与开停交付
  7338. x-require-auth: true
  7339. x-resource-type:
  7340. $ref: '#/components/x-resource-types/ticket/code'
  7341. x-action:
  7342. $ref: '#/components/x-actions/backfill/code'
  7343. x-version: v1
  7344. x-permission-visibility: catalog
  7345. requestBody:
  7346. required: true
  7347. description: JSON 请求体,业务字段置于 data
  7348. content:
  7349. application/json:
  7350. schema:
  7351. type: object
  7352. description: 统一信封请求体,业务字段放在 data 内
  7353. properties:
  7354. data:
  7355. type: object
  7356. description: 业务参数
  7357. properties:
  7358. ticket_id:
  7359. type: string
  7360. description: 工单标识(字符串下发,服务侧转 bigint)
  7361. exec_conclusion:
  7362. type: string
  7363. description: 执行结论:success/partial/fail;partial 存行不生效(工单§5.1.4)
  7364. conclusion_note:
  7365. type: string
  7366. description: 结论说明;非成功时必填(KLT-G20404)
  7367. actual_opened_date:
  7368. type: string
  7369. description: 实际开通日(YYYY-MM-DD,开户类三件套之一)
  7370. stop_done_date:
  7371. type: string
  7372. description: 停机完成日(YYYY-MM-DD,停机类三件套之一)
  7373. builder_user_id:
  7374. type: string
  7375. description: 施工人(可选)
  7376. evidence_text:
  7377. type: string
  7378. description: 凭证说明
  7379. pin_bind_mode:
  7380. type: string
  7381. description: PIN 绑定模式;缺省 shared
  7382. enum:
  7383. - shared
  7384. - per_account
  7385. route_rows:
  7386. type: array
  7387. description: 组一+组二回填行(按分账号一行;条数比对基准=勾选开账号数)
  7388. items:
  7389. type: object
  7390. properties:
  7391. sub_account_id:
  7392. type: string
  7393. description: 分账号标识;未传⇒视为漏填
  7394. network_account_name:
  7395. type: string
  7396. description: 网络账号名
  7397. intranet_ip:
  7398. type: string
  7399. description: 内网 IP
  7400. subnet_mask:
  7401. type: string
  7402. description: 子网掩码
  7403. gateway:
  7404. type: string
  7405. description: 网关
  7406. vlan:
  7407. type: string
  7408. description: VLAN
  7409. vni:
  7410. type: string
  7411. description: VNI
  7412. src_endpoint:
  7413. type: string
  7414. description: 源端
  7415. dst_endpoint:
  7416. type: string
  7417. description: 目的端
  7418. egress_pop:
  7419. type: string
  7420. description: 出口 POP
  7421. down_mbps:
  7422. type: number
  7423. description: 下行带宽 Mbps(信息项,不参与计价)
  7424. up_mbps:
  7425. type: number
  7426. description: 上行带宽 Mbps(信息项)
  7427. open_this_time:
  7428. type: boolean
  7429. description: 「随本次开通」勾选位,缺省=已勾选
  7430. ip_rows:
  7431. type: array
  7432. description: >-
  7433. 组三境外 IP 回填行。D-14:每行带 `action`(allocate/release)。
  7434. `per_account` 模式下每绑定账号独立 PIN(经 `sub_account_ids`)。
  7435. items:
  7436. type: object
  7437. properties:
  7438. action:
  7439. type: string
  7440. description: 行动作:allocate(缺省)/release;其它值 11103
  7441. enum:
  7442. - allocate
  7443. - release
  7444. egress:
  7445. type: string
  7446. description: 出口
  7447. overseas_ip:
  7448. type: string
  7449. description: 境外 IP 地址
  7450. ip_type:
  7451. type: string
  7452. description: IP 类型(fixed_ip/nat_forward)
  7453. bandwidth_mbps:
  7454. type: integer
  7455. description: 带宽档位 Mbps(信息项)
  7456. pin:
  7457. type: string
  7458. description: PIN(明文入参,服务端经 Keybox 加密入库,不明文落库)
  7459. cpid:
  7460. type: string
  7461. description: CPID(同上)
  7462. sub_account_ids:
  7463. type: array
  7464. description: 绑定分账号(per_account 时每账号须有独立 PIN)
  7465. items:
  7466. type: string
  7467. check_item_ids:
  7468. type: array
  7469. description: 变更协议(updown)同批勾选的服务项;其它类型忽略
  7470. items:
  7471. type: string
  7472. check_note:
  7473. type: string
  7474. description: 变更协议核对说明(可选)
  7475. evidence_material_ids:
  7476. type: array
  7477. description: 已登记的回填凭证材料 ID(kind=backfill_evidence)
  7478. items:
  7479. type: string
  7480. ext:
  7481. type: object
  7482. description: 扩展表单(可选);无已发布模板时忽略
  7483. properties:
  7484. template_id:
  7485. type: string
  7486. template_version:
  7487. type: integer
  7488. values:
  7489. type: object
  7490. additionalProperties: true
  7491. expected_version:
  7492. type: integer
  7493. description: 乐观并发基线(读详情时的 row_version);缺省=不做并发校验
  7494. required:
  7495. - ticket_id
  7496. required:
  7497. - data
  7498. x-error-codes: [11103, 60401, 60403, 60404, 60417]
  7499. responses:
  7500. "200":
  7501. description: 成功。统一信封 code/message/data
  7502. /ticket/backfill_draft@v1:
  7503. post:
  7504. summary: 暂存施工回填草稿
  7505. description: >-
  7506. 服务端暂存回填表单(方案 A)。鉴权同正式回填;⛔ 不调 open_stop_apply、⛔ 不改工单状态、
  7507. ⛔ 不递增 attempt_count。PIN/CPID 仅密文入库;读详情 `backfill_draft` 与本口应答均不回明文。
  7508. 正式 `backfill@v1` 成功后删除该单草稿。乐观锁用草稿自有 `row_version`(与正式回填锁分离)。
  7509. operationId: ticket_backfill_draft
  7510. tags:
  7511. - 工单与开停交付
  7512. x-require-auth: true
  7513. x-resource-type:
  7514. $ref: '#/components/x-resource-types/ticket/code'
  7515. x-action:
  7516. $ref: '#/components/x-actions/backfill_draft/code'
  7517. x-version: v1
  7518. x-permission-visibility: catalog
  7519. requestBody:
  7520. required: true
  7521. description: JSON 请求体,业务字段置于 data
  7522. content:
  7523. application/json:
  7524. schema:
  7525. type: object
  7526. description: 统一信封请求体,业务字段放在 data 内
  7527. properties:
  7528. data:
  7529. type: object
  7530. description: 业务参数(字段子集同 backfill,可缺省;中间态允许)
  7531. properties:
  7532. ticket_id:
  7533. type: string
  7534. description: 工单标识
  7535. exec_conclusion:
  7536. type: string
  7537. conclusion_note:
  7538. type: string
  7539. actual_opened_date:
  7540. type: string
  7541. stop_done_date:
  7542. type: string
  7543. evidence_text:
  7544. type: string
  7545. pin_bind_mode:
  7546. type: string
  7547. enum:
  7548. - shared
  7549. - per_account
  7550. route_rows:
  7551. type: array
  7552. items:
  7553. type: object
  7554. additionalProperties: true
  7555. ip_rows:
  7556. type: array
  7557. items:
  7558. type: object
  7559. additionalProperties: true
  7560. check_item_ids:
  7561. type: array
  7562. items:
  7563. type: string
  7564. check_note:
  7565. type: string
  7566. evidence_material_ids:
  7567. type: array
  7568. items:
  7569. type: string
  7570. ext:
  7571. type: object
  7572. additionalProperties: true
  7573. expected_version:
  7574. type: integer
  7575. description: 草稿 row_version;缺省=不做并发校验
  7576. required:
  7577. - ticket_id
  7578. required:
  7579. - data
  7580. x-error-codes: [11103, 60401, 60417]
  7581. responses:
  7582. "200":
  7583. description: 成功。统一信封 code/message/data(含草稿 row_version;不含 PIN/CPID 明文)
  7584. /ticket/check_done@v1:
  7585. post:
  7586. summary: 服务项完成直接闭环
  7587. description: >-
  7588. 服务开通/故障处理/售后处理勾选服务项并直接闭环;不关联客户/订阅、不回填、不生成回传。
  7589. ✅ 2026-11-22:`updown`(变更协议)⛔ 经本口——须走 `backfill@v1` 的「核对并回填」合并提交
  7590. (`check_item_ids`+回填同事务),单独核对会与回填双入口死锁。主要失败:KLT-G20404、KLT-G20417。
  7591. operationId: ticket_check_done
  7592. tags:
  7593. - 工单与开停交付
  7594. x-require-auth: true
  7595. x-resource-type:
  7596. $ref: '#/components/x-resource-types/ticket/code'
  7597. x-action:
  7598. $ref: '#/components/x-actions/check_done/code'
  7599. x-version: v1
  7600. x-permission-visibility: catalog
  7601. requestBody:
  7602. required: true
  7603. description: JSON 请求体,业务字段置于 data
  7604. content:
  7605. application/json:
  7606. schema:
  7607. type: object
  7608. description: 统一信封请求体,业务字段放在 data 内
  7609. properties:
  7610. data:
  7611. type: object
  7612. description: 业务参数
  7613. properties:
  7614. ticket_id:
  7615. type: string
  7616. description: 工单标识(字符串下发,服务侧转 bigint)
  7617. item_ids:
  7618. type: array
  7619. description: 本次勾选完成的服务项标识;不由服务端推导(U-15)
  7620. items:
  7621. type: string
  7622. note:
  7623. type: string
  7624. description: 说明(故障/售后必填;服务开通可不填)
  7625. expected_version:
  7626. type: integer
  7627. description: 乐观并发基线(读详情时的 row_version);缺省=不做并发校验
  7628. required:
  7629. - ticket_id
  7630. required:
  7631. - data
  7632. x-error-codes: [60401, 60404, 60417]
  7633. responses:
  7634. "200":
  7635. description: 成功。统一信封 code/message/data
  7636. /ticket/mark_done@v1:
  7637. post:
  7638. summary: 标记已处理(仅服务开通)
  7639. description: 不走手选工单类型(U-04):只有未关联客户/订阅的服务开通工单可走通路 5。必填:未关联原因+说明+处理人(缺项报 KLT-G20404)。前置:服务开通∧客户为空∧订阅为空⇒已办结。注意:2026-11-14 校正代码口径+收口分岔(手册 P7):本口当前只受理 `fault`/`after_sale`(其余类型报 11103),推到 completed 后若该单是**运维代建/系统生成**(submitter_type != 'customer')⇒ 同批直达 settled 并补一条 confirm_close 处理记录,出参 `status='settled'`、`auto_settled=true`、`settled_at`;客户自报的故障/售后行为不变(停在 completed 等 `/ticket/confirm_close@v1`,客户 7 天未确认改由作业 `AUTO-CLOSE` 自动关闭)。
  7640. operationId: ticket_mark_done
  7641. tags:
  7642. - 工单与开停交付
  7643. x-require-auth: true
  7644. x-resource-type:
  7645. $ref: '#/components/x-resource-types/ticket/code'
  7646. x-action:
  7647. $ref: '#/components/x-actions/mark_done/code'
  7648. x-version: v1
  7649. x-permission-visibility: catalog
  7650. requestBody:
  7651. required: true
  7652. description: JSON 请求体,业务字段置于 data
  7653. content:
  7654. application/json:
  7655. schema:
  7656. type: object
  7657. description: 统一信封请求体,业务字段放在 data 内
  7658. properties:
  7659. data:
  7660. type: object
  7661. description: 业务参数
  7662. properties:
  7663. ticket_id:
  7664. type: string
  7665. description: 工单标识(字符串下发,服务侧转 bigint)
  7666. note:
  7667. type: string
  7668. description: 说明(必填,含未关联原因)
  7669. expected_version:
  7670. type: integer
  7671. description: 乐观并发基线(读详情时的 row_version);缺省=不做并发校验
  7672. required:
  7673. - ticket_id
  7674. - note
  7675. required:
  7676. - data
  7677. x-error-codes: [11103, 60401, 60417]
  7678. responses:
  7679. "200":
  7680. description: 成功。统一信封 code/message/data
  7681. /ticket/close@v1:
  7682. post:
  7683. summary: 关闭工单
  7684. description: 仅未分派/待处理可关闭。不得把处理中的单直接关闭(必须先撤回)。主要失败:KLT-G20401、KLT-G20417。
  7685. operationId: ticket_close
  7686. tags:
  7687. - 工单与开停交付
  7688. x-require-auth: true
  7689. x-resource-type:
  7690. $ref: '#/components/x-resource-types/ticket/code'
  7691. x-action:
  7692. $ref: '#/components/x-actions/close/code'
  7693. x-version: v1
  7694. x-permission-visibility: catalog
  7695. requestBody:
  7696. required: true
  7697. description: JSON 请求体,业务字段置于 data
  7698. content:
  7699. application/json:
  7700. schema:
  7701. type: object
  7702. description: 统一信封请求体,业务字段放在 data 内
  7703. properties:
  7704. data:
  7705. type: object
  7706. description: 业务参数
  7707. properties:
  7708. ticket_id:
  7709. type: string
  7710. description: 工单标识(字符串下发,服务侧转 bigint)
  7711. reason:
  7712. type: string
  7713. description: 关闭原因(必填)
  7714. expected_version:
  7715. type: integer
  7716. description: 乐观并发基线(读详情时的 row_version);缺省=不做并发校验
  7717. required:
  7718. - ticket_id
  7719. - reason
  7720. required:
  7721. - data
  7722. x-error-codes: [60401, 60409, 60413, 60417]
  7723. responses:
  7724. "200":
  7725. description: 成功。统一信封 code/message/data
  7726. /ticket/withdraw@v1:
  7727. post:
  7728. summary: 撤回工单
  7729. description: 撤回后状态回未分派、清空 assign_*、责任人写处理记录。不撤回已完成/已办结单。主要失败:KLT-G20401。
  7730. operationId: ticket_withdraw
  7731. tags:
  7732. - 工单与开停交付
  7733. x-require-auth: true
  7734. x-resource-type:
  7735. $ref: '#/components/x-resource-types/ticket/code'
  7736. x-action:
  7737. $ref: '#/components/x-actions/withdraw/code'
  7738. x-version: v1
  7739. x-permission-visibility: catalog
  7740. requestBody:
  7741. required: true
  7742. description: JSON 请求体,业务字段置于 data
  7743. content:
  7744. application/json:
  7745. schema:
  7746. type: object
  7747. description: 统一信封请求体,业务字段放在 data 内
  7748. properties:
  7749. data:
  7750. type: object
  7751. description: 业务参数
  7752. properties:
  7753. ticket_id:
  7754. type: string
  7755. description: 工单标识(字符串下发,服务侧转 bigint)
  7756. reason:
  7757. type: string
  7758. description: 撤回原因(必填)
  7759. required:
  7760. - ticket_id
  7761. - reason
  7762. required:
  7763. - data
  7764. x-error-codes: [60401, 60409, 60414]
  7765. responses:
  7766. "200":
  7767. description: 成功。统一信封 code/message/data
  7768. /ticket/confirm_close@v1:
  7769. post:
  7770. summary: 确认闭环
  7771. description: 闭环方式=回执类且已回传未回执时的人工兜底:待回执→已办结。不得在闭环方式=完成后即闭环下调用(KLT-G20415)。
  7772. operationId: ticket_confirm_close
  7773. tags:
  7774. - 工单与开停交付
  7775. x-require-auth: true
  7776. x-resource-type:
  7777. $ref: '#/components/x-resource-types/ticket/code'
  7778. x-action:
  7779. $ref: '#/components/x-actions/confirm_close/code'
  7780. x-version: v1
  7781. x-permission-visibility: catalog
  7782. requestBody:
  7783. required: true
  7784. description: JSON 请求体,业务字段置于 data
  7785. content:
  7786. application/json:
  7787. schema:
  7788. type: object
  7789. description: 统一信封请求体,业务字段放在 data 内
  7790. properties:
  7791. data:
  7792. type: object
  7793. description: 业务参数
  7794. properties:
  7795. ticket_id:
  7796. type: string
  7797. description: 工单标识(字符串下发,服务侧转 bigint)
  7798. expected_version:
  7799. type: integer
  7800. description: 乐观并发基线(读详情时的 row_version);缺省=不做并发校验
  7801. required:
  7802. - ticket_id
  7803. required:
  7804. - data
  7805. x-error-codes: [60401, 60414, 60417]
  7806. responses:
  7807. "200":
  7808. description: 成功。统一信封 code/message/data
  7809. /ticket/defer@v1:
  7810. post:
  7811. summary: 临时延期(延后提醒)
  7812. description: 两条分支:开停记录提醒(执行结论待处理)与在办未回填提醒(服务开通且未回填)。延期目标日由服务端固定为「今天+超期提醒天数」,不得入参传天数。注意:设计正文的「天数非法 11103」在本实现不存在(无天数入参)。主要失败:KLT-G20415。
  7813. operationId: ticket_defer
  7814. tags:
  7815. - 工单与开停交付
  7816. x-require-auth: true
  7817. x-resource-type:
  7818. $ref: '#/components/x-resource-types/ticket/code'
  7819. x-action:
  7820. $ref: '#/components/x-actions/defer/code'
  7821. x-version: v1
  7822. x-permission-visibility: catalog
  7823. requestBody:
  7824. required: true
  7825. description: JSON 请求体,业务字段置于 data
  7826. content:
  7827. application/json:
  7828. schema:
  7829. type: object
  7830. description: 统一信封请求体,业务字段放在 data 内
  7831. properties:
  7832. data:
  7833. type: object
  7834. description: 业务参数
  7835. properties:
  7836. ticket_id:
  7837. type: string
  7838. description: 工单标识(字符串下发,服务侧转 bigint)
  7839. defer_scope:
  7840. type: string
  7841. description: 延期对象:open_stop(开停记录提醒)/ticket(在办未回填提醒)
  7842. required:
  7843. - ticket_id
  7844. required:
  7845. - data
  7846. x-error-codes: [11103, 60401, 60415]
  7847. responses:
  7848. "200":
  7849. description: 成功。统一信封 code/message/data
  7850. /ticket/urge@v1:
  7851. post:
  7852. summary: 站内催办(向「卡在别人手里」的对家发催办信)
  7853. description: |
  7854. 工单停在 `completed` 等待对家确认时,向**对家账号**投递一封站内催办信(`bos_inbox_message.kind='ticket_urge'`)。
  7855. * 对家=主线五类取承接团队的团队主账号(无主账号回落总运营),故障/售后取提交方账号;续签单没有对家。
  7856. * 前置:`status=completed` ∧ 距 `completed_at` 满 24 小时 ∧ 对家≠本人;不满足 ⇒ `KLT-G20424`。
  7857. * 收件人、信体、业务日一律服务端取(不收 `to_user_id`/`biz_date`)——收件人可入参就等于开了任意发信通路。
  7858. * **一单一天一封**:同一业务日重复调用是**幂等成功**(`created=false`,`reason=already_sent_today`),
  7859. 由 `bos_inbox_message` 的 `n_recipient (kind, ref_id, user_id)` + `ON CONFLICT DO NOTHING` 兜并发。
  7860. * 只写审计(`action=urge`)、**不写处理记录**(工单§8.1:催办不进程客户可见的时间轴)。
  7861. operationId: ticket_urge
  7862. tags:
  7863. - 工单与开停交付
  7864. x-require-auth: true
  7865. x-resource-type:
  7866. $ref: '#/components/x-resource-types/ticket/code'
  7867. x-action:
  7868. $ref: '#/components/x-actions/urge/code'
  7869. x-version: v1
  7870. x-permission-visibility: catalog
  7871. requestBody:
  7872. required: true
  7873. description: JSON 请求体,业务字段置于 data
  7874. content:
  7875. application/json:
  7876. schema:
  7877. type: object
  7878. description: 统一信封请求体,业务字段放在 data 内
  7879. properties:
  7880. data:
  7881. type: object
  7882. description: 业务参数
  7883. properties:
  7884. ticket_id:
  7885. type: string
  7886. description: 工单标识(字符串下发,服务侧转 bigint)
  7887. required:
  7888. - ticket_id
  7889. required:
  7890. - data
  7891. x-error-codes: [11103, 11104, 60424]
  7892. responses:
  7893. "200":
  7894. description: 成功。统一信封 code/message/data
  7895. /ticket/revert@v1:
  7896. post:
  7897. summary: 退回重办
  7898. description: 把「已完成待确认(completed)/竣工驳回(rejected)」退回「处理中(processing)」,判权=总运营(全平台)或该单承接团队的主账号(仅本团队,2026-11-22 改判),原因必填并写审计。⛔ 已办结(settled)与已关闭(terminated)不可退回——终态只读,改历史走人工数据变更+审计(2026-11-18 定案)。只重开工单,不回滚服务开通状态、实际开通日与已生成的竣工记录(U-46)。主要失败:KLT-G20409、KLT-G20417、KLT-G20418、11104(非总运营且非本团队主)。
  7899. operationId: ticket_revert
  7900. tags:
  7901. - 工单与开停交付
  7902. x-require-auth: true
  7903. x-resource-type:
  7904. $ref: '#/components/x-resource-types/ticket/code'
  7905. x-action:
  7906. $ref: '#/components/x-actions/revert/code'
  7907. x-version: v1
  7908. x-permission-visibility: catalog
  7909. requestBody:
  7910. required: true
  7911. description: JSON 请求体,业务字段置于 data
  7912. content:
  7913. application/json:
  7914. schema:
  7915. type: object
  7916. description: 统一信封请求体,业务字段放在 data 内
  7917. properties:
  7918. data:
  7919. type: object
  7920. description: 业务参数
  7921. properties:
  7922. ticket_id:
  7923. type: string
  7924. description: 工单标识(字符串下发,服务侧转 bigint)
  7925. reason:
  7926. type: string
  7927. description: 退回原因(必填,写入审计)
  7928. expected_version:
  7929. type: integer
  7930. description: 乐观并发基线(读详情时的 row_version);缺省=不做并发校验
  7931. required:
  7932. - ticket_id
  7933. - reason
  7934. required:
  7935. - data
  7936. x-error-codes: [60409, 60417, 60418]
  7937. responses:
  7938. "200":
  7939. description: 成功。统一信封 code/message/data
  7940. /completion/generate@v1:
  7941. post:
  7942. summary: 生成竣工回传文件
  7943. description: 生成出参=文件元信息+可下载凭证;不同步返回文件字节流。回填未通过闸门(结论=成功∧明细齐∧比对通过)时不生成(KLT-G20401)。重复生成⇒作废旧版本、留最新并写处理记录。
  7944. operationId: completion_generate
  7945. tags:
  7946. - 竣工与回执
  7947. x-require-auth: true
  7948. x-resource-type:
  7949. $ref: '#/components/x-resource-types/completion/code'
  7950. x-action:
  7951. $ref: '#/components/x-actions/generate/code'
  7952. x-version: v1
  7953. x-permission-visibility: catalog
  7954. requestBody:
  7955. required: true
  7956. description: JSON 请求体,业务字段置于 data
  7957. content:
  7958. application/json:
  7959. schema:
  7960. type: object
  7961. description: 统一信封请求体,业务字段放在 data 内
  7962. properties:
  7963. data:
  7964. type: object
  7965. description: 业务参数
  7966. properties:
  7967. ticket_id:
  7968. type: string
  7969. description: 工单标识(字符串下发,服务侧转 bigint)
  7970. required:
  7971. - ticket_id
  7972. required:
  7973. - data
  7974. x-error-codes: [60401, 60404, 60410, 60417]
  7975. responses:
  7976. "200":
  7977. description: 成功。统一信封 code/message/data
  7978. /completion/receipt@v1:
  7979. post:
  7980. summary: 录入运营商回执
  7981. description: 先判定完成日(TK-11):回填三件套齐全⇒取回填日期值;缺失⇒不取回执录入当日(KLT-G20418),须先补录。录入⇒待回执→已办结+AUTO-CLOSE;同事务写完成日与闭环方式来源=回执。主要失败:KLT-G20418、KLT-G20417。注意:该单已被 `completion/reject@v1` 登记驳回时本接口默认拒绝(KLT-G20423 互斥);唯一出口=总运营提交 `override_state_conflict=true`(设计方案§3.3 纠正窗口,以回执为准;非 admin 提交该参数同样落 KLT-G20423)。
  7982. operationId: completion_receipt
  7983. tags:
  7984. - 竣工与回执
  7985. x-require-auth: true
  7986. x-resource-type:
  7987. $ref: '#/components/x-resource-types/completion/code'
  7988. x-action:
  7989. $ref: '#/components/x-actions/receipt/code'
  7990. x-version: v1
  7991. x-permission-visibility: catalog
  7992. requestBody:
  7993. required: true
  7994. description: JSON 请求体,业务字段置于 data
  7995. content:
  7996. application/json:
  7997. schema:
  7998. type: object
  7999. description: 统一信封请求体,业务字段放在 data 内
  8000. properties:
  8001. data:
  8002. type: object
  8003. description: 业务参数
  8004. properties:
  8005. ticket_id:
  8006. type: string
  8007. description: 工单标识(字符串下发,服务侧转 bigint)
  8008. completion_no:
  8009. type: string
  8010. description: 竣工单号;缺省取该单当前有效回传版本
  8011. external_order_no:
  8012. type: string
  8013. description: 运营商单号
  8014. receipt_remark:
  8015. type: string
  8016. description: 回执说明
  8017. expect_version:
  8018. type: integer
  8019. description: 乐观并发基线(读取口回传的 row_version);缺省=不做并发校验
  8020. override_state_conflict:
  8021. type: boolean
  8022. description: 纠正窗口(设计方案§3.3):仅 admin、仅当该单处于竣工驳回态有效;以回执为准闭环,审计记「驳回态冲突纠正」并引用被推翻的驳回序号,不改写原驳回行。非驳回态提交本参数不产生任何效果。
  8023. required:
  8024. - ticket_id
  8025. required:
  8026. - data
  8027. x-error-codes: [60401, 60410, 60411, 60417, 60423]
  8028. responses:
  8029. "200":
  8030. description: 成功。统一信封 code/message/data
  8031. /completion/reject@v1:
  8032. post:
  8033. summary: 登记竣工驳回
  8034. description: 待回执→竣工驳回(U-115 方案 (d));理由必填(枚举 1~3 个,归一化后首位=主原因;`其他` 不得与其它项混选)+补充说明 5~500 字;只可驳回该单**当前最新一次**回传,且工单须停在待回执态;不从已办结驳回(TK-7 同闸,落 KLT-G20423)。同事务写 ticket_completion_reject + 处理记录 `completion_reject` + 审计;不接受调用方传入驳回时刻(一律服务端时间)、不新发驳回号段(对外引用=ticket_id+reject_seq)。主要失败:KLT-G20421、KLT-G20422、KLT-G20423、KLT-G20417。
  8035. operationId: completion_reject
  8036. tags:
  8037. - 竣工与回执
  8038. x-require-auth: true
  8039. x-resource-type:
  8040. $ref: '#/components/x-resource-types/completion/code'
  8041. x-action:
  8042. $ref: '#/components/x-actions/reject/code'
  8043. x-version: v1
  8044. x-permission-visibility: catalog
  8045. requestBody:
  8046. required: true
  8047. description: JSON 请求体,业务字段置于 data
  8048. content:
  8049. application/json:
  8050. schema:
  8051. type: object
  8052. description: 统一信封请求体,业务字段放在 data 内
  8053. properties:
  8054. data:
  8055. type: object
  8056. description: 业务参数
  8057. properties:
  8058. ticket_id:
  8059. type: string
  8060. description: 工单标识(字符串下发,服务侧转 bigint)
  8061. reason_codes:
  8062. type: array
  8063. description: 驳回原因码,1~3 个;「其他」不得与其它项混选;服务端按枚举定义序归一化后落库
  8064. items:
  8065. type: string
  8066. enum:
  8067. - doc_mismatch
  8068. - resource_unavailable
  8069. - duplicate
  8070. - out_of_scope
  8071. - doc_missing
  8072. - site_not_ready
  8073. - other
  8074. minItems: 1
  8075. maxItems: 3
  8076. reason_text:
  8077. type: string
  8078. description: 补充说明,5~500 字(按字符计)
  8079. completion_no:
  8080. type: string
  8081. description: 期望驳回的竣工单号;与当前最新一次回传不一致 ⇒ KLT-G20421(兜住拿旧快照点按钮)
  8082. external_reject_no:
  8083. type: string
  8084. description: 运营商内部编号;不在门户/合伙人回显
  8085. expect_version:
  8086. type: integer
  8087. description: 乐观并发基线(读取口回传的 row_version);缺省=不做并发校验
  8088. required:
  8089. - ticket_id
  8090. - reason_codes
  8091. - reason_text
  8092. required:
  8093. - data
  8094. x-error-codes: [60401, 60410, 60421, 60422, 60423, 60417]
  8095. responses:
  8096. "200":
  8097. description: 成功。统一信封 code/message/data
  8098. /message/attach@v1:
  8099. post:
  8100. summary: 挂接并生效
  8101. description: 人工侧只有「挂接并生效」一个动作(§5.6.4,A14 已关闭):一次原子提交⇒报文置已生效+工单侧生效链(与人工回填同一个函数)+回填头改写为报文内容+明细清空+处理记录【运营商反馈】前缀。不得人工指定生效日期(取报文实际日期)。报文动作与工单类型不符报 KLT-G20407(提示语逐字照抄§5.6.3)。主要失败:KLT-G20401、KLT-G20407、KLT-G20419、KLT-G20417。
  8102. operationId: message_attach
  8103. tags:
  8104. - 报文人工处置
  8105. x-require-auth: true
  8106. x-resource-type:
  8107. $ref: '#/components/x-resource-types/message/code'
  8108. x-action:
  8109. $ref: '#/components/x-actions/attach/code'
  8110. x-version: v1
  8111. x-permission-visibility: catalog
  8112. requestBody:
  8113. required: true
  8114. description: JSON 请求体,业务字段置于 data
  8115. content:
  8116. application/json:
  8117. schema:
  8118. type: object
  8119. description: 统一信封请求体,业务字段放在 data 内
  8120. properties:
  8121. data:
  8122. type: object
  8123. description: 业务参数
  8124. properties:
  8125. message_id:
  8126. type: string
  8127. description: 报文标识
  8128. ticket_id:
  8129. type: string
  8130. description: 拟挂接的工单标识
  8131. expect_version:
  8132. type: integer
  8133. description: 乐观并发基线(读取口回传的 row_version);缺省=不做并发校验
  8134. required:
  8135. - message_id
  8136. - ticket_id
  8137. required:
  8138. - data
  8139. x-error-codes: [11104, 60401, 60407, 60419]
  8140. responses:
  8141. "200":
  8142. description: 成功。统一信封 code/message/data
  8143. /message/void@v1:
  8144. post:
  8145. summary: 作废报文
  8146. description: 置已作废+原因必填(缺原因报 11103)。不删除 raw_payload(§5.6.5:作废后仍可读)。主要失败:KLT-G20419。
  8147. operationId: message_void
  8148. tags:
  8149. - 报文人工处置
  8150. x-require-auth: true
  8151. x-resource-type:
  8152. $ref: '#/components/x-resource-types/message/code'
  8153. x-action:
  8154. $ref: '#/components/x-actions/void/code'
  8155. x-version: v1
  8156. x-permission-visibility: catalog
  8157. requestBody:
  8158. required: true
  8159. description: JSON 请求体,业务字段置于 data
  8160. content:
  8161. application/json:
  8162. schema:
  8163. type: object
  8164. description: 统一信封请求体,业务字段放在 data 内
  8165. properties:
  8166. data:
  8167. type: object
  8168. description: 业务参数
  8169. properties:
  8170. message_id:
  8171. type: string
  8172. description: 报文标识
  8173. void_reason:
  8174. type: string
  8175. description: 作废原因(必填)
  8176. expect_version:
  8177. type: integer
  8178. description: 乐观并发基线(读取口回传的 row_version);缺省=不做并发校验
  8179. required:
  8180. - message_id
  8181. - void_reason
  8182. required:
  8183. - data
  8184. x-error-codes: [60412, 60419]
  8185. responses:
  8186. "200":
  8187. description: 成功。统一信封 code/message/data
  8188. /message/confirm_conflict@v1:
  8189. post:
  8190. summary: 冲突确认
  8191. description: 处置方式二选一:维持当前值(仅记录不生效)/采用外部值(触发与挂接相同的生效逻辑)。主要失败:KLT-G20419。
  8192. operationId: message_confirm_conflict
  8193. tags:
  8194. - 报文人工处置
  8195. x-require-auth: true
  8196. x-resource-type:
  8197. $ref: '#/components/x-resource-types/message/code'
  8198. x-action:
  8199. $ref: '#/components/x-actions/confirm_conflict/code'
  8200. x-version: v1
  8201. x-permission-visibility: catalog
  8202. requestBody:
  8203. required: true
  8204. description: JSON 请求体,业务字段置于 data
  8205. content:
  8206. application/json:
  8207. schema:
  8208. type: object
  8209. description: 统一信封请求体,业务字段放在 data 内
  8210. properties:
  8211. data:
  8212. type: object
  8213. description: 业务参数
  8214. properties:
  8215. message_id:
  8216. type: string
  8217. description: 报文标识
  8218. disposition:
  8219. type: string
  8220. description: 处置方式:as_is(维持当前值)/apply_external(采用外部值并生效);缺省 as_is
  8221. note:
  8222. type: string
  8223. description: 处置说明
  8224. expect_version:
  8225. type: integer
  8226. description: 乐观并发基线(读取口回传的 row_version);缺省=不做并发校验
  8227. required:
  8228. - message_id
  8229. required:
  8230. - data
  8231. x-error-codes: [60401, 60419]
  8232. responses:
  8233. "200":
  8234. description: 成功。统一信封 code/message/data
  8235. /message/rematch@v1:
  8236. post:
  8237. summary: 改挂归属工单
  8238. description: 改挂到另一张工单+写改挂审计;不触发生效(§5.6.4:生效仍走挂接口)。主要失败:KLT-G20407、KLT-G20419。
  8239. operationId: message_rematch
  8240. tags:
  8241. - 报文人工处置
  8242. x-require-auth: true
  8243. x-resource-type:
  8244. $ref: '#/components/x-resource-types/message/code'
  8245. x-action:
  8246. $ref: '#/components/x-actions/rematch/code'
  8247. x-version: v1
  8248. x-permission-visibility: catalog
  8249. requestBody:
  8250. required: true
  8251. description: JSON 请求体,业务字段置于 data
  8252. content:
  8253. application/json:
  8254. schema:
  8255. type: object
  8256. description: 统一信封请求体,业务字段放在 data 内
  8257. properties:
  8258. data:
  8259. type: object
  8260. description: 业务参数
  8261. properties:
  8262. message_id:
  8263. type: string
  8264. description: 报文标识
  8265. ticket_id:
  8266. type: string
  8267. description: 改挂目标工单标识
  8268. expect_version:
  8269. type: integer
  8270. description: 乐观并发基线(读取口回传的 row_version);缺省=不做并发校验
  8271. required:
  8272. - message_id
  8273. - ticket_id
  8274. required:
  8275. - data
  8276. x-error-codes: [60407, 60419]
  8277. responses:
  8278. "200":
  8279. description: 成功。统一信封 code/message/data
  8280. /ticket/material_grant@v1:
  8281. post:
  8282. summary: 材料上传/下载凭证
  8283. description: 上传两段(申请凭证 → 直传 → material_attach 登记);下载一段(传 material_id 或 oss_key,服务端现签并直接回 download_url)。一次一凭证、短时效、绑定对象键;不出批量凭证、不开通用上传口。purpose=upload 需 file_name,purpose=download 需 material_id 或 oss_key。终态(settled/terminated)只拦上传,⛔ 拦下载——竣工材料事后仍可导出。不接受对象键上的任意路径。主要失败:11103、60056、KLT-G20401、KLT-G20420。
  8284. operationId: ticket_material_grant
  8285. tags:
  8286. - 工单与开停交付
  8287. x-require-auth: true
  8288. x-resource-type:
  8289. $ref: '#/components/x-resource-types/ticket/code'
  8290. x-action:
  8291. $ref: '#/components/x-actions/material_grant/code'
  8292. x-version: v1
  8293. x-permission-visibility: catalog
  8294. requestBody:
  8295. required: true
  8296. description: JSON 请求体,业务字段置于 data
  8297. content:
  8298. application/json:
  8299. schema:
  8300. type: object
  8301. description: 统一信封请求体,业务字段放在 data 内
  8302. properties:
  8303. data:
  8304. type: object
  8305. description: 业务参数
  8306. properties:
  8307. ticket_id:
  8308. type: string
  8309. description: 工单标识(字符串下发,服务侧转 bigint)
  8310. kind:
  8311. type: string
  8312. description: 材料类别:backfill_evidence(回填凭证)/handover(开通准备资料)/completion_pdf(竣工回传)/construct_material(补充过程材料)/submit_evidence(客户提交材料)。前两类中的回填凭证与竣工回传由服务端在业务事务内登记,不经 material_attach
  8313. file_name:
  8314. type: string
  8315. description: 原始文件名(purpose=upload 时必填)
  8316. purpose:
  8317. type: string
  8318. description: 用途:upload(上传,缺省)/download(下载)
  8319. material_id:
  8320. type: string
  8321. description: 材料主键(purpose=download 二选一,首选)。detail@v1 不下发对象键,列表页下载只能靠它
  8322. oss_key:
  8323. type: string
  8324. description: OSS 对象键(purpose=download 二选一,仅限刚由 material_attach 换回的同一次交互)
  8325. required:
  8326. - ticket_id
  8327. - kind
  8328. required:
  8329. - data
  8330. x-error-codes: [11103, 11104, 60401, 60804]
  8331. responses:
  8332. "200":
  8333. description: 成功。统一信封 code/message/data
  8334. /ticket/material_attach@v1:
  8335. post:
  8336. summary: 登记材料元信息
  8337. description: 登记文件名+大小+上传人+时间+可下载凭证。不把上传动作记进 ticket_process_log(D2)。数量上限:工单材料 5 份、故障处理材料 5 份(超限报 KLT-G20420)。主要失败:KLT-G20420、60056。
  8338. operationId: ticket_material_attach
  8339. tags:
  8340. - 工单与开停交付
  8341. x-require-auth: true
  8342. x-resource-type:
  8343. $ref: '#/components/x-resource-types/ticket/code'
  8344. x-action:
  8345. $ref: '#/components/x-actions/material_attach/code'
  8346. x-version: v1
  8347. x-permission-visibility: catalog
  8348. requestBody:
  8349. required: true
  8350. description: JSON 请求体,业务字段置于 data
  8351. content:
  8352. application/json:
  8353. schema:
  8354. type: object
  8355. description: 统一信封请求体,业务字段放在 data 内
  8356. properties:
  8357. data:
  8358. type: object
  8359. description: 业务参数
  8360. properties:
  8361. ticket_id:
  8362. type: string
  8363. description: 工单标识(字符串下发,服务侧转 bigint)
  8364. kind:
  8365. type: string
  8366. description: 材料类别前缀:attachment/opening/alteration/return/other
  8367. oss_key:
  8368. type: string
  8369. description: OSS 对象键
  8370. file_name:
  8371. type: string
  8372. description: 原始文件名
  8373. size_bytes:
  8374. type: integer
  8375. description: 文件字节数
  8376. required:
  8377. - ticket_id
  8378. - kind
  8379. - oss_key
  8380. required:
  8381. - data
  8382. x-error-codes: [11103, 11104, 60401]
  8383. responses:
  8384. "200":
  8385. description: 成功。统一信封 code/message/data
  8386. /ticket/config_get@v1:
  8387. get:
  8388. summary: 域配置查询(闭环方式)
  8389. description: 出参=闭环方式当前值+版本+更新人/更新时间+生效说明;不暴露超期天数等系统参数(U-19)。
  8390. operationId: ticket_config_get
  8391. tags:
  8392. - 工单与开停交付
  8393. x-require-auth: true
  8394. x-resource-type:
  8395. $ref: '#/components/x-resource-types/ticket/code'
  8396. x-action:
  8397. $ref: '#/components/x-actions/config_get/code'
  8398. x-version: v1
  8399. x-permission-visibility: catalog
  8400. x-error-codes: [11104]
  8401. responses:
  8402. "200":
  8403. description: 成功。统一信封 code/message/data
  8404. /ticket/config_update@v1:
  8405. post:
  8406. summary: 域配置修改(闭环方式)
  8407. description: 仅 admin;一次原子提交⇒配置更新+历史追加+审计;不改既有工单的闭环方式(工单§5.5.3)。主要失败:KLT-G20417。
  8408. operationId: ticket_config_update
  8409. tags:
  8410. - 工单与开停交付
  8411. x-require-auth: true
  8412. x-resource-type:
  8413. $ref: '#/components/x-resource-types/ticket/code'
  8414. x-action:
  8415. $ref: '#/components/x-actions/config_update/code'
  8416. x-version: v1
  8417. x-permission-visibility: catalog
  8418. requestBody:
  8419. required: true
  8420. description: JSON 请求体,业务字段置于 data
  8421. content:
  8422. application/json:
  8423. schema:
  8424. type: object
  8425. description: 统一信封请求体,业务字段放在 data 内
  8426. properties:
  8427. data:
  8428. type: object
  8429. description: 业务参数
  8430. properties:
  8431. closure_mode:
  8432. type: string
  8433. description: 闭环方式:receipt(回执闭环)/on_complete(完成后即闭环)
  8434. expect_version:
  8435. type: integer
  8436. description: 乐观并发基线(读取口回传的 row_version);缺省=不做并发校验
  8437. reason:
  8438. type: string
  8439. description: 变更原因
  8440. required:
  8441. - closure_mode
  8442. required:
  8443. - data
  8444. x-error-codes: [11103, 11104, 60001]
  8445. responses:
  8446. "200":
  8447. description: 成功。统一信封 code/message/data
  8448. /ticket/form_template_get@v1:
  8449. get:
  8450. summary: 施工回填扩展模板查询
  8451. description: 运营侧可读;可选 ticket_type。回当前 published、draft(若有)、版本列表。权限档对齐 config_get。
  8452. operationId: ticket_form_template_get
  8453. tags:
  8454. - 工单与开停交付
  8455. x-require-auth: true
  8456. x-resource-type:
  8457. $ref: '#/components/x-resource-types/ticket/code'
  8458. x-action:
  8459. $ref: '#/components/x-actions/config_get/code'
  8460. x-version: v1
  8461. x-permission-visibility: catalog
  8462. parameters:
  8463. - name: ticket_type
  8464. in: query
  8465. required: false
  8466. schema:
  8467. type: string
  8468. description: open/updown/expiry_stop/service_stop;缺省=四类全量
  8469. x-error-codes: [11103, 11104]
  8470. responses:
  8471. "200":
  8472. description: 成功。统一信封 code/message/data
  8473. /ticket/form_template_save@v1:
  8474. post:
  8475. summary: 施工回填扩展模板保存草稿
  8476. description: 仅 admin;每类型至多一个 draft;schema 非法 ⇒ KLT-G20425;并发 ⇒ KLT-S407。权限档对齐 config_update。
  8477. operationId: ticket_form_template_save
  8478. tags:
  8479. - 工单与开停交付
  8480. x-require-auth: true
  8481. x-resource-type:
  8482. $ref: '#/components/x-resource-types/ticket/code'
  8483. x-action:
  8484. $ref: '#/components/x-actions/config_update/code'
  8485. x-version: v1
  8486. x-permission-visibility: catalog
  8487. requestBody:
  8488. required: true
  8489. description: JSON 请求体,业务字段置于 data
  8490. content:
  8491. application/json:
  8492. schema:
  8493. type: object
  8494. properties:
  8495. data:
  8496. type: object
  8497. properties:
  8498. ticket_type:
  8499. type: string
  8500. schema:
  8501. type: object
  8502. expect_version:
  8503. type: integer
  8504. template_id:
  8505. type: string
  8506. required:
  8507. - ticket_type
  8508. - schema
  8509. required:
  8510. - data
  8511. x-error-codes: [11103, 11104, 60001, 60425]
  8512. responses:
  8513. "200":
  8514. description: 成功。统一信封 code/message/data
  8515. /ticket/form_template_publish@v1:
  8516. post:
  8517. summary: 施工回填扩展模板发布
  8518. description: 仅 admin;旧 published→retired;新增/改 required 须 ack_required_change;失败 KLT-G20425/KLT-S407。权限档对齐 config_update。
  8519. operationId: ticket_form_template_publish
  8520. tags:
  8521. - 工单与开停交付
  8522. x-require-auth: true
  8523. x-resource-type:
  8524. $ref: '#/components/x-resource-types/ticket/code'
  8525. x-action:
  8526. $ref: '#/components/x-actions/config_update/code'
  8527. x-version: v1
  8528. x-permission-visibility: catalog
  8529. requestBody:
  8530. required: true
  8531. description: JSON 请求体,业务字段置于 data
  8532. content:
  8533. application/json:
  8534. schema:
  8535. type: object
  8536. properties:
  8537. data:
  8538. type: object
  8539. properties:
  8540. ticket_type:
  8541. type: string
  8542. template_id:
  8543. type: string
  8544. expect_version:
  8545. type: integer
  8546. ack_required_change:
  8547. type: boolean
  8548. required:
  8549. - ticket_type
  8550. required:
  8551. - data
  8552. x-error-codes: [11103, 11104, 60001, 60425]
  8553. responses:
  8554. "200":
  8555. description: 成功。统一信封 code/message/data
  8556. /contract/renewal_config@v1:
  8557. post:
  8558. summary: 合同续签提醒配置查询
  8559. description: |
  8560. 续签提前天数(1..180,默认 7)与续签工单生成方式(manual 人工/auto 自动);运营侧三类身份可读。
  8561. 网关对 klt-bos 一律 POST(与其它合同口同形);响应含 notice_days/generate_mode/row_version。
  8562. operationId: contract_renewal_config
  8563. tags:
  8564. - 合同
  8565. x-require-auth: true
  8566. x-resource-type:
  8567. $ref: '#/components/x-resource-types/contract/code'
  8568. x-action:
  8569. $ref: '#/components/x-actions/renewal_config/code'
  8570. x-version: v1
  8571. x-permission-visibility: catalog
  8572. x-error-codes: [11104]
  8573. requestBody:
  8574. required: true
  8575. description: JSON 请求体,业务字段置于 data(本口无必填业务字段,传空对象即可)
  8576. content:
  8577. application/json:
  8578. schema:
  8579. type: object
  8580. properties:
  8581. data:
  8582. type: object
  8583. required:
  8584. - data
  8585. responses:
  8586. "200":
  8587. description: 成功。统一信封 code/message/data;data 含 notice_days、generate_mode、generate_mode_name、row_version、updated_at、updated_by
  8588. /contract/renewal_config_update@v1:
  8589. post:
  8590. summary: 合同续签提醒配置修改
  8591. description: 仅 admin;改提前天数与生成方式,写审计、即刻生效。同值不写库;并发版本不符回 KLT-S407。
  8592. operationId: contract_renewal_config_update
  8593. tags:
  8594. - 合同
  8595. x-require-auth: true
  8596. x-resource-type:
  8597. $ref: '#/components/x-resource-types/contract/code'
  8598. x-action:
  8599. $ref: '#/components/x-actions/renewal_config_update/code'
  8600. x-version: v1
  8601. x-permission-visibility: catalog
  8602. requestBody:
  8603. required: true
  8604. description: JSON 请求体,业务字段置于 data
  8605. content:
  8606. application/json:
  8607. schema:
  8608. type: object
  8609. properties:
  8610. data:
  8611. type: object
  8612. properties:
  8613. notice_days:
  8614. type: integer
  8615. description: 提前提醒天数(1..180,默认 7)
  8616. generate_mode:
  8617. type: string
  8618. description: 生成方式:manual(人工,先发站内提醒)/auto(自动生成续签工单)
  8619. enum: [manual, auto]
  8620. expect_version:
  8621. type: integer
  8622. description: 乐观并发基线(读取口回传的 row_version);缺省=不做并发校验
  8623. reason:
  8624. type: string
  8625. description: 变更原因
  8626. required:
  8627. - notice_days
  8628. - generate_mode
  8629. required:
  8630. - data
  8631. x-error-codes: [11103, 11104, 60001]
  8632. responses:
  8633. "200":
  8634. description: 成功。统一信封 code/message/data
  8635. /inbox/list@v1:
  8636. post:
  8637. summary: 本人站内提醒箱
  8638. description: 未读优先、按时间倒序分页;仅回当前账号本人的消息(来源不可越权)。
  8639. operationId: inbox_list
  8640. tags:
  8641. - 站内提醒箱
  8642. x-require-auth: true
  8643. x-resource-type:
  8644. $ref: '#/components/x-resource-types/inbox/code'
  8645. x-action:
  8646. $ref: '#/components/x-actions/list/code'
  8647. x-version: v1
  8648. x-permission-visibility: catalog
  8649. requestBody:
  8650. required: false
  8651. description: JSON 请求体,业务字段置于 data
  8652. content:
  8653. application/json:
  8654. schema:
  8655. type: object
  8656. properties:
  8657. data:
  8658. type: object
  8659. properties:
  8660. unread_only:
  8661. type: boolean
  8662. description: 只看未读
  8663. page:
  8664. type: integer
  8665. description: 页码(1 起)
  8666. page_size:
  8667. type: integer
  8668. description: 每页条数(1..100)
  8669. x-error-codes: [11104]
  8670. responses:
  8671. "200":
  8672. description: 成功。统一信封 code/message/data
  8673. /inbox/read@v1:
  8674. post:
  8675. summary: 标记站内提醒已读
  8676. description: 只能标记本人消息;已读时间只写首次。
  8677. operationId: inbox_read
  8678. tags:
  8679. - 站内提醒箱
  8680. x-require-auth: true
  8681. x-resource-type:
  8682. $ref: '#/components/x-resource-types/inbox/code'
  8683. x-action:
  8684. $ref: '#/components/x-actions/read/code'
  8685. x-version: v1
  8686. x-permission-visibility: catalog
  8687. requestBody:
  8688. required: true
  8689. description: JSON 请求体,业务字段置于 data
  8690. content:
  8691. application/json:
  8692. schema:
  8693. type: object
  8694. properties:
  8695. data:
  8696. type: object
  8697. properties:
  8698. message_id:
  8699. type: string
  8700. description: 消息 ID(数字串)
  8701. required:
  8702. - message_id
  8703. required:
  8704. - data
  8705. x-error-codes: [11103, 11104, 60401]
  8706. responses:
  8707. "200":
  8708. description: 成功。统一信封 code/message/data
  8709. /inbox/renewal_candidates@v1:
  8710. post:
  8711. summary: 续签工单可指派人员
  8712. description: 提醒所属客户当期运维团队内、可接 renewal 类型且负责范围覆盖该客户的成员。
  8713. operationId: inbox_renewal_candidates
  8714. tags:
  8715. - 站内提醒箱
  8716. x-require-auth: true
  8717. x-resource-type:
  8718. $ref: '#/components/x-resource-types/inbox/code'
  8719. x-action:
  8720. $ref: '#/components/x-actions/renewal_candidates/code'
  8721. x-version: v1
  8722. x-permission-visibility: catalog
  8723. requestBody:
  8724. required: true
  8725. description: JSON 请求体,业务字段置于 data
  8726. content:
  8727. application/json:
  8728. schema:
  8729. type: object
  8730. properties:
  8731. data:
  8732. type: object
  8733. properties:
  8734. message_id:
  8735. type: string
  8736. description: 消息 ID(数字串)
  8737. required:
  8738. - message_id
  8739. required:
  8740. - data
  8741. x-error-codes: [11103, 11104, 60401]
  8742. responses:
  8743. "200":
  8744. description: 成功。统一信封 code/message/data
  8745. /inbox/renewal_ticket@v1:
  8746. post:
  8747. summary: 读信人生成续签工单并指派
  8748. description: 从站内续签提醒一键生成 renewal 工单并分派;同一合同只出一张(已有则复用并改派),生成后同合同提醒全部置为已处理。
  8749. operationId: inbox_renewal_ticket
  8750. tags:
  8751. - 站内提醒箱
  8752. x-require-auth: true
  8753. x-resource-type:
  8754. $ref: '#/components/x-resource-types/inbox/code'
  8755. x-action:
  8756. $ref: '#/components/x-actions/renewal_ticket/code'
  8757. x-version: v1
  8758. x-permission-visibility: catalog
  8759. requestBody:
  8760. required: true
  8761. description: JSON 请求体,业务字段置于 data
  8762. content:
  8763. application/json:
  8764. schema:
  8765. type: object
  8766. properties:
  8767. data:
  8768. type: object
  8769. properties:
  8770. message_id:
  8771. type: string
  8772. description: 提醒消息 ID(数字串)
  8773. assignee_user_id:
  8774. type: string
  8775. description: 承接续签工单的运营人员账号 ID(须在客户当期团队、可接 renewal、负责范围覆盖客户)
  8776. required:
  8777. - message_id
  8778. - assignee_user_id
  8779. required:
  8780. - data
  8781. x-error-codes: [11103, 11104, 60001, 60401]
  8782. responses:
  8783. "200":
  8784. description: 成功。统一信封 code/message/data
  8785. components:
  8786. x-resource-types:
  8787. health:
  8788. code: 'bos.health'
  8789. ping:
  8790. code: 'bos.ping'
  8791. auth:
  8792. code: 'bos.auth'
  8793. region:
  8794. code: 'bos.region'
  8795. account:
  8796. code: 'bos.account'
  8797. ent_team:
  8798. code: 'bos.ent_team'
  8799. ops_team:
  8800. code: 'bos.ops_team'
  8801. audit:
  8802. code: 'bos.audit'
  8803. activation:
  8804. code: 'bos.activation'
  8805. operator:
  8806. code: 'bos.operator'
  8807. operator_recon_account:
  8808. code: 'bos.operator.recon_account'
  8809. partner:
  8810. code: 'bos.partner'
  8811. partner_scope:
  8812. code: 'bos.partner.scope'
  8813. ent_team_scope:
  8814. code: 'bos.ent_team.scope'
  8815. ops_team_scope:
  8816. code: 'bos.ops_team.scope'
  8817. ops_member_scope:
  8818. code: 'bos.ops_member.scope'
  8819. ops_team_dispatch_mode:
  8820. code: 'bos.ops_team.dispatch_mode'
  8821. ops_team_coverage:
  8822. code: 'bos.ops_team.coverage'
  8823. customer:
  8824. code: 'bos.customer'
  8825. customer_attribution:
  8826. code: 'bos.customer.attribution'
  8827. import_batch:
  8828. code: 'bos.import_batch'
  8829. sub_account:
  8830. code: 'bos.sub_account'
  8831. delivery:
  8832. code: 'bos.delivery'
  8833. catalog:
  8834. code: 'bos.catalog'
  8835. plan_cost_item:
  8836. code: 'bos.plan_cost_item'
  8837. contract:
  8838. code: 'bos.contract'
  8839. contract_attachment:
  8840. code: 'bos.contract_attachment'
  8841. subscription:
  8842. code: 'bos.subscription'
  8843. cost_item:
  8844. code: 'bos.cost_item'
  8845. cost_amount:
  8846. code: 'bos.cost_amount'
  8847. share_rule:
  8848. code: 'bos.share_rule'
  8849. opsview:
  8850. code: 'bos.opsview'
  8851. jobs:
  8852. code: 'bos.jobs'
  8853. billing_config:
  8854. code: 'bos.billing_config'
  8855. recon:
  8856. code: 'bos.recon'
  8857. bill:
  8858. code: 'bos.bill'
  8859. correction:
  8860. code: 'bos.correction'
  8861. ticket:
  8862. code: 'bos.ticket'
  8863. completion:
  8864. code: 'bos.completion'
  8865. message:
  8866. code: 'bos.message'
  8867. inbox:
  8868. code: 'bos.inbox'
  8869. view:
  8870. code: 'bos.view'
  8871. portal:
  8872. code: 'bos.portal'
  8873. x-actions:
  8874. view:
  8875. code: 'view'
  8876. create:
  8877. code: 'create'
  8878. update:
  8879. code: 'update'
  8880. delete:
  8881. code: 'delete'
  8882. list:
  8883. code: 'list'
  8884. manage:
  8885. code: 'manage'
  8886. export:
  8887. code: 'export'
  8888. detail:
  8889. code: 'detail'
  8890. pending_queue:
  8891. code: 'pending_queue'
  8892. todo_counts:
  8893. code: 'todo_counts'
  8894. trace:
  8895. code: 'trace'
  8896. pending:
  8897. code: 'pending'
  8898. assign:
  8899. code: 'assign'
  8900. dispatch_auto:
  8901. code: 'dispatch_auto'
  8902. delegate:
  8903. code: 'delegate'
  8904. start:
  8905. code: 'start'
  8906. backfill:
  8907. code: 'backfill'
  8908. backfill_draft:
  8909. code: 'backfill_draft'
  8910. check_done:
  8911. code: 'check_done'
  8912. mark_done:
  8913. code: 'mark_done'
  8914. close:
  8915. code: 'close'
  8916. withdraw:
  8917. code: 'withdraw'
  8918. confirm_close:
  8919. code: 'confirm_close'
  8920. defer:
  8921. code: 'defer'
  8922. revert:
  8923. code: 'revert'
  8924. generate:
  8925. code: 'generate'
  8926. receipt:
  8927. code: 'receipt'
  8928. reject:
  8929. code: 'reject'
  8930. attach:
  8931. code: 'attach'
  8932. void:
  8933. code: 'void'
  8934. confirm_conflict:
  8935. code: 'confirm_conflict'
  8936. rematch:
  8937. code: 'rematch'
  8938. urge:
  8939. code: 'urge'
  8940. material_grant:
  8941. code: 'material_grant'
  8942. material_attach:
  8943. code: 'material_attach'
  8944. config_get:
  8945. code: 'config_get'
  8946. config_update:
  8947. code: 'config_update'
  8948. form_template_get:
  8949. code: 'form_template_get'
  8950. form_template_save:
  8951. code: 'form_template_save'
  8952. form_template_publish:
  8953. code: 'form_template_publish'
  8954. renewal_config:
  8955. code: 'renewal_config'
  8956. renewal_config_update:
  8957. code: 'renewal_config_update'
  8958. read:
  8959. code: 'read'
  8960. renewal_candidates:
  8961. code: 'renewal_candidates'
  8962. renewal_ticket:
  8963. code: 'renewal_ticket'
  8964. partner_recon:
  8965. code: 'partner_recon'
  8966. plan_board:
  8967. code: 'plan_board'
  8968. schemas:
  8969. PortalPlanBoardRow:
  8970. type: object
  8971. description: |
  8972. 门户 4 两表的一行(§4.3 七列)。⛔ 金额账目列(已出账/累计成本/分成)、
  8973. ⛔ 工单、⛔ 操作位(第 9 册 §4.6)。
  8974. properties:
  8975. subscription_id:
  8976. type: string
  8977. description: 订阅 ID(详情入口预留)
  8978. plan_name:
  8979. type: string
  8980. description: 列 1 上行=档位名(订阅快照列,⛔ 现取档位表)
  8981. contract_id:
  8982. type: string
  8983. nullable: true
  8984. contract_no:
  8985. type: string
  8986. nullable: true
  8987. description: 列 1 下行=合同编号;合同缺失 ⇒「—」
  8988. contract_amount_cents:
  8989. type: integer
  8990. nullable: true
  8991. description: 列 3=合同总额(分),来源 contract.amount_cents;缺失 ⇒「—」(⛔ 回落订阅价)
  8992. sub_mode:
  8993. type: string
  8994. nullable: true
  8995. description: 列 4=冻结方式原码(upgrade/stackable/customized)
  8996. line_exits:
  8997. type: array
  8998. nullable: true
  8999. description: 列 5=随合同冻结的线路出口集合;空集 ⇒「—」
  9000. items:
  9001. type: string
  9002. start_date:
  9003. type: string
  9004. nullable: true
  9005. description: 列 6 起
  9006. end_date:
  9007. type: string
  9008. nullable: true
  9009. description: 列 6 止
  9010. status:
  9011. type: object
  9012. description: 列 7=读侧三态结论
  9013. properties:
  9014. key:
  9015. type: string
  9016. enum: [active, pending, expired, cancelled, replaced]
  9017. label:
  9018. type: string
  9019. required:
  9020. - subscription_id
  9021. - plan_name
  9022. - status
  9023. ApiEnvelope:
  9024. type: object
  9025. description: 统一响应信封
  9026. properties:
  9027. code:
  9028. type: integer
  9029. description: 业务/协议码,0 表示成功
  9030. message:
  9031. type: string
  9032. description: 提示信息
  9033. error_code:
  9034. type: string
  9035. description: 稳定错误码(失败时)
  9036. data:
  9037. description: 业务数据载荷
  9038. required:
  9039. - code
  9040. - message
  9041. PageQuery:
  9042. type: object
  9043. description: 分页查询(0 基)
  9044. properties:
  9045. page:
  9046. type: integer
  9047. description: 页码(0 基索引,默认 0)
  9048. minimum: 0
  9049. default: 0
  9050. page_size:
  9051. type: integer
  9052. description: 每页条数(默认 20,上限 200)
  9053. minimum: 1
  9054. maximum: 200
  9055. default: 20
  9056. keyword:
  9057. type: string
  9058. description: 关键字筛选(可选)