openapi.yaml 363 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060
  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):名称是弱引用,不校验是否在全局清单;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);同档位名称重复⇒KLT-K206。
  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: 成本项条目
  4322. properties:
  4323. item_name:
  4324. type: string
  4325. description: 成本项名称(弱引用,1~128 字)
  4326. amount_cents:
  4327. type: integer
  4328. description: 金额(分,≥0)
  4329. minimum: 0
  4330. billing_unit:
  4331. type: string
  4332. description: 计费单位(可选)
  4333. enum:
  4334. - per_customer
  4335. - per_account
  4336. - per_copy
  4337. category:
  4338. type: string
  4339. description: 成本项分类(可选)
  4340. enum:
  4341. - intl_resource
  4342. - device_purchase
  4343. - project_fee
  4344. remark:
  4345. type: string
  4346. description: 备注(可选,上限 512 字)
  4347. sort_no:
  4348. type: integer
  4349. description: 排序号(≥0)
  4350. minimum: 0
  4351. required:
  4352. - item_name
  4353. - amount_cents
  4354. required:
  4355. - plan_id
  4356. required:
  4357. - data
  4358. x-error-codes: [60001, 60202, 60203, 60204, 60205, 60206, 60227]
  4359. responses:
  4360. "200":
  4361. description: 成功。统一信封 code/message/data
  4362. /contract/create@v1:
  4363. post:
  4364. summary: 新建合同
  4365. 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_* 是运营商交接单上的经办人(姓名/电话/交接日期必填、机构选填)。
  4366. operationId: contract_create
  4367. tags:
  4368. - 合同
  4369. x-require-auth: true
  4370. x-resource-type:
  4371. $ref: '#/components/x-resource-types/contract/code'
  4372. x-action:
  4373. $ref: '#/components/x-actions/create/code'
  4374. x-version: v1
  4375. x-permission-visibility: catalog
  4376. requestBody:
  4377. required: true
  4378. description: JSON 请求体,业务字段置于 data
  4379. content:
  4380. application/json:
  4381. schema:
  4382. type: object
  4383. description: 统一信封请求体,业务字段放在 data 内
  4384. properties:
  4385. data:
  4386. type: object
  4387. description: 业务参数(`customer_id` 与 `customer_inline` **至少给一个且不可同时给**)
  4388. properties:
  4389. customer_id:
  4390. type: string
  4391. description: 签约客户 ID。与 customer_inline **只可二选一**:命中已有客户填本项;未命中改用内联建档段
  4392. customer_inline:
  4393. type: object
  4394. description: >-
  4395. 客户未命中时的内联建档段(需求 §5.3 CU-13;业主 2026-11-16 定案关闭 CU-41)。
  4396. 本段先按 `/customer/create@v1` 的同一套规则建档(两个事务:建档 → 合同,不合并),
  4397. 再签本合同;建档含客户主账号(未设初始口令 ⇒ 待激活、发激活码,明文不在本响应内下发)。
  4398. 注意:企业营业执照影像**选填**(业主 2026-11-19 定案,与页面建档同口径),
  4399. 留空不影响建档,建档后到客户档案「登记材料」格补传/替换。主体类型非企业时不收 license。
  4400. properties:
  4401. customer_name:
  4402. type: string
  4403. description: 客户名称(必填;允许重名,查重靠识别号)
  4404. subject_type:
  4405. type: string
  4406. description: 主体类型(必填):enterprise/individual/sole_proprietor
  4407. enum:
  4408. - enterprise
  4409. - individual
  4410. - sole_proprietor
  4411. id_code:
  4412. type: string
  4413. description: 客户识别号(必填):既是安全存储载体,也是合同事务失败后重试的幂等键(不得省略)
  4414. contact_name:
  4415. type: string
  4416. description: 客户经办联系人(与联系电话、地址同属 CU-13 第 1 步字段)
  4417. contact_mobile:
  4418. type: string
  4419. description: 联系电话
  4420. tech_contact_name:
  4421. type: string
  4422. description: 技术联系人姓名(选填)
  4423. tech_contact_mobile:
  4424. type: string
  4425. description: 技术联系人电话(选填)
  4426. finance_contact_name:
  4427. type: string
  4428. description: 财务联系人姓名(选填)
  4429. finance_contact_mobile:
  4430. type: string
  4431. description: 财务联系人电话(选填)
  4432. remark:
  4433. type: string
  4434. description: 客户备注(选填,≤512 字)
  4435. partner_id:
  4436. type: string
  4437. description: 归属合伙人(选填;反查所得,落 customer.partner_id)
  4438. address:
  4439. type: string
  4440. description: 客户地址
  4441. parent_node_id:
  4442. type: string
  4443. description: 挂载区域(必填;区域树节点 ID,与 /customer/create@v1 的 parent_node_id 同义)
  4444. operator_id:
  4445. type: string
  4446. description: 归属运营商(必填;弹窗下拉,候选=所挂区域省份下可见的运营商档案)
  4447. ops_team_ids:
  4448. type: array
  4449. description: 运维团队(必填且**恰好 1 支**,单支定案;不得为空数组/不得传多支)
  4450. items:
  4451. type: string
  4452. description: 团队 ID
  4453. license:
  4454. type: object
  4455. description: 营业执照影像(**选填**;非企业主体不收)。两键成对
  4456. properties:
  4457. object_key:
  4458. type: string
  4459. description: 平台对象存储对象键(浏览器直传后回报,须在客户影像前缀下)
  4460. file_name:
  4461. type: string
  4462. description: 原始文件名(仅展示)
  4463. required:
  4464. - object_key
  4465. - file_name
  4466. primary_username:
  4467. type: string
  4468. description: 客户主账号登录名(选填;留空按主体号派生,4~32 位字母数字与 . _ -)
  4469. primary_mobile:
  4470. type: string
  4471. description: 主账号绑定手机号(选填,11 位)
  4472. required:
  4473. - customer_name
  4474. - subject_type
  4475. - id_code
  4476. - parent_node_id
  4477. - operator_id
  4478. - ops_team_ids
  4479. contract_no:
  4480. type: string
  4481. description: 合同编号(空则服务端发号)
  4482. external_no:
  4483. type: string
  4484. description: 外部合同号(可选)
  4485. contract_type:
  4486. type: string
  4487. description: >-
  4488. 合同类型:new(新建,缺省)/renew(续签)/expand(扩容补充协议)/change(变更协议)。
  4489. 语义收口:renew 必须同时给 renew_from_contract_id;expand 的服务构成必须整批为增量叠加服务;
  4490. 带 renew_from_contract_id 的合同类型只能是 renew。
  4491. enum:
  4492. - new
  4493. - renew
  4494. - expand
  4495. - change
  4496. sign_date:
  4497. type: string
  4498. description: 签署日期(YYYY-MM-DD;选填,缺省按 agent_handover_on 兜底)
  4499. format: date
  4500. contract_amount_cents:
  4501. type: integer
  4502. description: 合同金额(分,可选)
  4503. service_months:
  4504. type: integer
  4505. description: >-
  4506. 服务期(月,1~600,必填):替代原 pay_cycle;结束日=生效日+服务期−1 天
  4507. (该月无对应日先取月末),页面锁定为只读推算值。
  4508. minimum: 1
  4509. maximum: 600
  4510. start_date:
  4511. type: string
  4512. description: 合同开始日期(YYYY-MM-DD)
  4513. format: date
  4514. end_date:
  4515. type: string
  4516. description: >-
  4517. 合同结束日期(YYYY-MM-DD,可省略):省略时服务端按「生效日+服务期(月)−1 天」
  4518. 推算(该月无对应日先取月末);显式给出则按显式值落库。
  4519. format: date
  4520. agent_name:
  4521. type: string
  4522. description: 运营商经办人姓名(交接单三段之二,必填;不是录入账号 created_by)
  4523. agent_mobile:
  4524. type: string
  4525. description: 运营商经办人联系方式(交接单三段之三,必填)
  4526. agent_handover_on:
  4527. type: string
  4528. description: 经办交接日期(必填;与姓名/联系电话构成运营商经办人三件套,只用于回溯交接来源)
  4529. format: date
  4530. agent_org:
  4531. type: string
  4532. description: 运营商经办人机构(交接单三段之一,选填)
  4533. attachment_url:
  4534. type: string
  4535. maxLength: 512
  4536. description: >-
  4537. 合同附件(单值,可选):外部 http(s) 链接,或浏览器直传平台对象存储
  4538. (seoh-unified-oss 两段式)成功后回报的对象键,前缀必须为
  4539. klt/contract/attachment/。空串=清空。对象键不得当作可直接打开的链接,
  4540. 详情读口另下发 attachment_view_url(短时效现签)。
  4541. service_items:
  4542. type: array
  4543. description: 服务构成条目列表
  4544. items:
  4545. type: object
  4546. description: 服务条目
  4547. properties:
  4548. plan_id:
  4549. type: string
  4550. description: 档位 ID(必填;2026-11-19 D-15 起条目只能引用目录档位)
  4551. quantity:
  4552. type: integer
  4553. description: 份数:link 档恒 1;addon 档≥1
  4554. item_family:
  4555. type: string
  4556. description: 交付形态(只读确认位,可缺省):只能与所引档位的 plan_family 相同,不同即 KLT-L216
  4557. enum:
  4558. - link
  4559. - addon
  4560. item_mode:
  4561. type: string
  4562. description: >-
  4563. 条目模式(D-9):new=常规条目(缺省);increment=增量叠加服务,只能引用本客户
  4564. 既有 link 订阅(只传 ref_subscription_id,⛔ 再填 serves_item_id/
  4565. serves_item_index),档位必须是 addon。读口按同一编码原样回传。
  4566. enum:
  4567. - new
  4568. - increment
  4569. serves_item_index:
  4570. type: integer
  4571. minimum: 0
  4572. description: >-
  4573. 从属宿主(D-7):普通叠加服务叠加于同一请求 service_items 的哪一条,
  4574. **0 基下标**(新建父条目尚无 item_id 时用)。父条目已存在时也可改传 serves_item_id;
  4575. 二者同时给即 11103。仅 item_mode=new 且档位为 addon 时必填其一。
  4576. serves_item_id:
  4577. type: string
  4578. description: >-
  4579. 从属宿主的条目 ID(编辑合同、父条目已存在时用);与 serves_item_index 二选一。
  4580. 增量条目(increment)⛔ 不得填本键。
  4581. ref_subscription_id:
  4582. type: string
  4583. description: >-
  4584. 增量合同引用的原订阅号(D-2):仅 item_mode=increment 时必填(且不得填 serves_*);
  4585. 非增量条目带本键即 KLT-L216。订阅须属本客户、为 link 档、状态 ∈ active/pending。
  4586. 生成的 service_open 单以增量合同 external_no 作为 carrier_order_no(D-11)。
  4587. line_exits:
  4588. type: array
  4589. maxItems: 1
  4590. description: >-
  4591. 线路出口(2026-11-17 起**单选**:长度必须为 1)。新建/修改条目出现 2 个以上
  4592. 由服务端回 KLT-L222;存量多出口条目**不迁移**(编辑合同须原样回传)。
  4593. items:
  4594. type: string
  4595. description: 出口标识
  4596. succession:
  4597. type: object
  4598. description: >-
  4599. 契约内逐条替换(升降配,2026-11-17):本条目的新订阅顶替哪份原订阅。
  4600. **仅在新建合同受理**,编辑合同出现即 KLT-L222。只接受三键(价格/状态/
  4601. row_version 等只读派生列出现即点名)。候选须同客户、status ∈ active/pending、
  4602. 同 line_exit_key、双方均 plan_family=link、未被替换过(KLT-M226);
  4603. 同一 replaces_subscription_id 在本请求内至多一次;link 条目 quantity 须为 1。
  4604. 替换与合同写入同一条 dml_batch(任一条失败=整批回滚),应答回 data.replacements[]。
  4605. properties:
  4606. replaces_subscription_id:
  4607. type: string
  4608. description: 被替换的原订阅号(必填)
  4609. start_date:
  4610. type: string
  4611. format: date
  4612. description: 新订阅起日,缺省=max(业务当天, 合同生效日);须 ≤ 合同止期。结束日恒取合同止期
  4613. term:
  4614. type: string
  4615. description: 订阅方式(yearly/quarterly/monthly);缺省按档位与账期派生
  4616. required:
  4617. - replaces_subscription_id
  4618. required:
  4619. - contract_amount_cents
  4620. - service_months
  4621. - start_date
  4622. - end_date
  4623. - agent_name
  4624. - agent_mobile
  4625. - agent_handover_on
  4626. required:
  4627. - data
  4628. x-error-codes: [60001, 60201, 60207, 60209, 60210, 60211]
  4629. responses:
  4630. "200":
  4631. description: 成功。统一信封 code/message/data
  4632. /contract/update@v1:
  4633. post:
  4634. summary: 编辑合同
  4635. 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 与业务语句同批提交。
  4636. operationId: contract_update
  4637. tags:
  4638. - 合同
  4639. x-require-auth: true
  4640. x-resource-type:
  4641. $ref: '#/components/x-resource-types/contract/code'
  4642. x-action:
  4643. $ref: '#/components/x-actions/update/code'
  4644. x-version: v1
  4645. x-permission-visibility: catalog
  4646. requestBody:
  4647. required: true
  4648. description: JSON 请求体,业务字段置于 data
  4649. content:
  4650. application/json:
  4651. schema:
  4652. type: object
  4653. description: 统一信封请求体,业务字段放在 data 内
  4654. properties:
  4655. data:
  4656. type: object
  4657. description: 业务参数
  4658. properties:
  4659. contract_id:
  4660. type: string
  4661. description: 合同 ID
  4662. row_version:
  4663. type: integer
  4664. description: 乐观锁版本
  4665. external_no:
  4666. type: string
  4667. description: 外部合同号
  4668. contract_type:
  4669. type: string
  4670. description: 合同类型(new/renew/expand/change);受 archive 轴约束
  4671. enum:
  4672. - new
  4673. - renew
  4674. - expand
  4675. - change
  4676. sign_date:
  4677. type: string
  4678. description: 签署日期(受 archive 轴约束)
  4679. format: date
  4680. contract_amount_cents:
  4681. type: integer
  4682. description: 合同金额(分)
  4683. service_months:
  4684. type: integer
  4685. description: 服务期(月,1~600);受 billing 轴约束,结束日按「生效日+服务期−1 天」重算
  4686. minimum: 1
  4687. maximum: 600
  4688. start_date:
  4689. type: string
  4690. description: 开始日期
  4691. format: date
  4692. end_date:
  4693. type: string
  4694. description: 结束日期
  4695. format: date
  4696. agent_name:
  4697. type: string
  4698. description: 运营商经办人姓名(交接单口径,不是录入账号 created_by);受 billing/archive 轴约束,冻结时提交改动值 ⇒ KLT-L219/L220
  4699. agent_mobile:
  4700. type: string
  4701. description: 运营商经办人联系方式(交接单三段之三;archive 轴)
  4702. agent_handover_on:
  4703. type: string
  4704. description: 交接日期(archive 轴)
  4705. agent_org:
  4706. type: string
  4707. description: 运营商经办人机构(交接单三段之一;选填,archive 轴)
  4708. attachment_url:
  4709. type: string
  4710. maxLength: 512
  4711. description: >-
  4712. 合同附件(单值,archive 轴):外部 http(s) 链接,或前缀为
  4713. klt/contract/attachment/ 的对象键;空串=清空附件。
  4714. service_items:
  4715. type: array
  4716. description: >-
  4717. 服务构成条目(含 item_id 的增删改)。条目形态只含 plan_id/quantity/item_family/
  4718. line_exits/item_mode/serves_item_id/serves_item_index/ref_subscription_id(item_family
  4719. 由档位带入,⛔ 自造);年价/账号数/带宽等旧字段已删列,
  4720. 出现即视为未知键。D-7/D-9:普通叠加服务用 serves_item_id(或 0 基 serves_item_index)
  4721. 声明从属,服务端按父子关系回树;增量条目用 item_mode=increment + ref_subscription_id
  4722. 引用既有链路订阅(⛔ 再挂 serves_*)。订阅/工单/台账列表不扩散,仍平铺。
  4723. items:
  4724. type: object
  4725. properties:
  4726. item_id:
  4727. type: string
  4728. description: 既有条目主键(三向对比:带=UPDATE/不带=INSERT/库有载荷无=DELETE)
  4729. plan_id:
  4730. type: string
  4731. description: 档位 ID
  4732. quantity:
  4733. type: integer
  4734. description: 份数:link 档恒 1;addon 档≥1
  4735. item_family:
  4736. type: string
  4737. description: 交付形态(只读确认位,可缺省):与档位 plan_family 不同即 KLT-L216
  4738. enum:
  4739. - link
  4740. - addon
  4741. item_mode:
  4742. type: string
  4743. description: >-
  4744. 条目模式(D-9):new=常规;increment=增量叠加服务(档位必须为 addon,且只引用
  4745. ref_subscription_id,⛔ 挂 serves_*)。读口按同一编码回传。
  4746. enum:
  4747. - new
  4748. - increment
  4749. serves_item_index:
  4750. type: integer
  4751. minimum: 0
  4752. description: 父条目在本载荷 service_items 的 0 基下标(普通叠加服务、父条目为本次新建时用)
  4753. serves_item_id:
  4754. type: string
  4755. description: >-
  4756. 父条目 ID(普通叠加服务、父条目已存在时用);与 serves_item_index 二选一,
  4757. 同时给即 11103;增量条目⛔ 不得填本键
  4758. ref_subscription_id:
  4759. type: string
  4760. description: >-
  4761. 增量合同引用的原订阅号(D-2):item_mode=increment 时必填,须属本客户、为 link 档、
  4762. 状态 ∈ active/pending;非增量条目带本键即 KLT-L216。
  4763. line_exits:
  4764. type: array
  4765. maxItems: 1
  4766. description: 线路出口(单选,长度 1)
  4767. items:
  4768. type: string
  4769. required:
  4770. - contract_id
  4771. - row_version
  4772. required:
  4773. - data
  4774. x-error-codes: [60001, 60201, 60207, 60209, 60210, 60211, 60228, 60229, 60230]
  4775. responses:
  4776. "200":
  4777. description: 成功。统一信封 code/message/data
  4778. /contract/get_list@v1:
  4779. post:
  4780. summary: 合同列表
  4781. description: >-
  4782. 按客户/状态等筛选合同列表。每行随 `attachment_kind`(none/link/object/other)说明附件形态;
  4783. `attachment_view_url` 在列表口恒 null(签名只在详情读口现签,不按行 N 次调平台)。
  4784. operationId: contract_get_list
  4785. tags:
  4786. - 合同
  4787. x-require-auth: true
  4788. x-resource-type:
  4789. $ref: '#/components/x-resource-types/contract/code'
  4790. x-action:
  4791. $ref: '#/components/x-actions/list/code'
  4792. x-version: v1
  4793. x-permission-visibility: catalog
  4794. requestBody:
  4795. required: true
  4796. description: JSON 请求体,业务字段置于 data
  4797. content:
  4798. application/json:
  4799. schema:
  4800. type: object
  4801. description: 统一信封请求体,业务字段放在 data 内
  4802. properties:
  4803. data:
  4804. type: object
  4805. description: 列表筛选参数
  4806. properties:
  4807. page:
  4808. type: integer
  4809. description: 页码(0 基索引,默认 0)
  4810. minimum: 0
  4811. default: 0
  4812. page_size:
  4813. type: integer
  4814. description: 每页条数(默认 20,上限 200)
  4815. minimum: 1
  4816. maximum: 200
  4817. default: 20
  4818. keyword:
  4819. type: string
  4820. description: 关键字筛选(可选)
  4821. customer_id:
  4822. type: string
  4823. description: 客户 ID 筛选
  4824. status:
  4825. type: string
  4826. description: 状态筛选
  4827. opened:
  4828. type: boolean
  4829. description: 是否已开通筛选(三态:true/false/缺省不筛)
  4830. required:
  4831. - data
  4832. x-error-codes: [60001, 60201, 60207, 60209, 60210, 60211]
  4833. responses:
  4834. "200":
  4835. description: 成功。统一信封 code/message/data
  4836. /contract/change_log@v1:
  4837. post:
  4838. summary: 合同修改记录
  4839. 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 条目已下线)。
  4840. operationId: contract_change_log
  4841. tags:
  4842. - 合同
  4843. x-require-auth: true
  4844. x-resource-type:
  4845. $ref: '#/components/x-resource-types/contract/code'
  4846. x-action:
  4847. $ref: '#/components/x-actions/list/code'
  4848. x-version: v1
  4849. x-permission-visibility: catalog
  4850. requestBody:
  4851. required: true
  4852. description: JSON 请求体,业务字段置于 data
  4853. content:
  4854. application/json:
  4855. schema:
  4856. type: object
  4857. description: 统一信封请求体,业务字段放在 data 内
  4858. properties:
  4859. data:
  4860. type: object
  4861. description: 业务参数
  4862. properties:
  4863. contract_id:
  4864. type: string
  4865. description: 合同 ID
  4866. page_size:
  4867. type: integer
  4868. description: 每页条数(默认 20,夹在 1~50)
  4869. minimum: 1
  4870. maximum: 50
  4871. default: 20
  4872. cursor:
  4873. type: string
  4874. description: 游标,形态 occurred_at|id(与审计页同形态);由上一页响应的 next_cursor 原样带回
  4875. required:
  4876. - contract_id
  4877. required:
  4878. - data
  4879. x-error-codes: [60053, 60201, 60207]
  4880. responses:
  4881. "200":
  4882. description: 成功。统一信封 code/message/data(items/page_size/next_cursor/cursor_usable)
  4883. /contract/get@v1:
  4884. post:
  4885. summary: 合同详情
  4886. description: >-
  4887. 按合同 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 掩码)。
  4888. 附件(单值):`attachment_url` 原值照回(外部链接或 klt/contract/attachment/ 下的对象键),
  4889. `attachment_kind` 说明形态,`attachment_view_url`/`attachment_view_url_expires_at`
  4890. 为读口现签的短时效下载地址(`link` 形态=原链接);对象键不得当作可直接打开的链接。
  4891. D-7:服务条目行额外带 `item_mode`(new/increment)/`serves_item_id`/`ref_subscription_id`,
  4892. 前端据此把增量叠加服务以父子缩进树呈现;订阅/工单/台账仍为平铺列表,只标注「叠加于 SUB-xxx」。
  4893. operationId: contract_get
  4894. tags:
  4895. - 合同
  4896. x-require-auth: true
  4897. x-resource-type:
  4898. $ref: '#/components/x-resource-types/contract/code'
  4899. x-action:
  4900. $ref: '#/components/x-actions/view/code'
  4901. x-version: v1
  4902. x-permission-visibility: catalog
  4903. requestBody:
  4904. required: true
  4905. description: JSON 请求体,业务字段置于 data
  4906. content:
  4907. application/json:
  4908. schema:
  4909. type: object
  4910. description: 统一信封请求体,业务字段放在 data 内
  4911. properties:
  4912. data:
  4913. type: object
  4914. description: 业务参数
  4915. properties:
  4916. contract_id:
  4917. type: string
  4918. description: 合同 ID
  4919. required:
  4920. - contract_id
  4921. required:
  4922. - data
  4923. x-error-codes: [60001, 60201, 60207, 60209, 60210, 60211]
  4924. responses:
  4925. "200":
  4926. description: 成功。统一信封 code/message/data
  4927. /contract/customer_lookup@v1:
  4928. post:
  4929. summary: 合同客户身份解析
  4930. description: 第3册§4.2 第 1 步:query_type=credit_code 主体号精确点查/identity 归一化精确点查/keyword 客户名称模糊联想;未命中=matched:false 成功响应(不报错),越权读单客户=11104。
  4931. operationId: contract_customer_lookup
  4932. tags:
  4933. - 合同
  4934. x-require-auth: true
  4935. x-resource-type:
  4936. $ref: '#/components/x-resource-types/contract/code'
  4937. x-action:
  4938. $ref: '#/components/x-actions/list/code'
  4939. x-version: v1
  4940. x-permission-visibility: catalog
  4941. requestBody:
  4942. required: true
  4943. description: JSON 请求体,业务字段置于 data
  4944. content:
  4945. application/json:
  4946. schema:
  4947. type: object
  4948. description: 统一信封请求体,业务字段放在 data 内
  4949. properties:
  4950. data:
  4951. type: object
  4952. description: 业务参数
  4953. properties:
  4954. query_type:
  4955. type: string
  4956. description: 查询通道
  4957. enum:
  4958. - credit_code
  4959. - identity
  4960. - keyword
  4961. value:
  4962. type: string
  4963. description: 查询值(主体号/识别号/客户名称关键字)
  4964. required:
  4965. - query_type
  4966. - value
  4967. required:
  4968. - data
  4969. x-error-codes: [60001, 60201, 60207, 60209, 60210, 60211]
  4970. responses:
  4971. "200":
  4972. description: 成功。统一信封 code/message/data
  4973. /contract/delete@v1:
  4974. post:
  4975. summary: 合同条件删除
  4976. description: 第3册§4.8:两类阻塞分栏(subscriptions/tickets),有阻塞⇒KLT-L213;工单取数失败⇒KLT-S406(不得中途放行)。
  4977. operationId: contract_delete
  4978. tags:
  4979. - 合同
  4980. x-require-auth: true
  4981. x-resource-type:
  4982. $ref: '#/components/x-resource-types/contract/code'
  4983. x-action:
  4984. $ref: '#/components/x-actions/delete/code'
  4985. x-version: v1
  4986. x-permission-visibility: catalog
  4987. requestBody:
  4988. required: true
  4989. description: JSON 请求体,业务字段置于 data
  4990. content:
  4991. application/json:
  4992. schema:
  4993. type: object
  4994. description: 统一信封请求体,业务字段放在 data 内
  4995. properties:
  4996. data:
  4997. type: object
  4998. description: 业务参数
  4999. properties:
  5000. contract_id:
  5001. type: string
  5002. description: 合同 ID
  5003. required:
  5004. - contract_id
  5005. required:
  5006. - data
  5007. x-error-codes: [60001, 60201, 60207, 60209, 60210, 60211]
  5008. responses:
  5009. "200":
  5010. description: 成功。统一信封 code/message/data
  5011. /contract/attachment_discard@v1:
  5012. post:
  5013. summary: 回收无人引用的上传附件(孤儿对象)
  5014. description: >-
  5015. 还原 2026-11-16 定案的孤儿附件回收:浏览器直传是「先上传、后落库」,用户换文件/移除/
  5016. 取消编辑/保存被拦时会在桶里留下无引用对象。平台 unified-oss 明确「不做后台遍历删对象、
  5017. 不按业务字段回收」,只有即时删除一条通道(object/delete@v1),故回收由本服务在引用面判定后发起。
  5018. 三条安全线:object_key 必须是本服务前缀下无路径穿越的对象键;查库确认没有任何合同仍指向它;
  5019. 角色限 Admin/OpsMain(与合同写口同一道闸)。referenced=true 与「对象已不在」都不算失败(幂等)。
  5020. operationId: contract_attachment_discard
  5021. tags:
  5022. - 合同
  5023. x-require-auth: true
  5024. x-resource-type:
  5025. $ref: '#/components/x-resource-types/contract_attachment/code'
  5026. x-action:
  5027. $ref: '#/components/x-actions/delete/code'
  5028. x-version: v1
  5029. x-permission-visibility: catalog
  5030. requestBody:
  5031. required: true
  5032. description: JSON 请求体,业务字段置于 data
  5033. content:
  5034. application/json:
  5035. schema:
  5036. type: object
  5037. description: 统一信封请求体,业务字段放在 data 内
  5038. properties:
  5039. data:
  5040. type: object
  5041. description: 业务参数
  5042. properties:
  5043. object_key:
  5044. type: string
  5045. description: 直传回报的对象键(klt/contract/attachment/ 前缀下)
  5046. required:
  5047. - object_key
  5048. required:
  5049. - data
  5050. x-error-codes: [60001, 60004, 60006, 60058, 60201]
  5051. responses:
  5052. "200":
  5053. description: 成功。统一信封 code/message/data
  5054. /subscription/create@v1:
  5055. post:
  5056. summary: 新建订阅
  5057. description: 拒收 line_exits、sub_mode、order_no、新建时的 end_date、opened_at。
  5058. 响应 data 附 delivery_ticket=交付侧建单结论(工单册§3.2.3):kind=open/service_open/
  5059. merged(并入既有未完成开户工单,工单册§7.5)/failed/skipped,另有 ticket_id、ticket_no、
  5060. items=本次落地服务清单项数、note=面向运营的说明。工单侧失败不回滚订阅(订阅仍已保存),
  5061. 此时 failed=true,运营须按 note 人工补发工单。
  5062. operationId: subscription_create
  5063. tags:
  5064. - 订阅
  5065. x-require-auth: true
  5066. x-resource-type:
  5067. $ref: '#/components/x-resource-types/subscription/code'
  5068. x-action:
  5069. $ref: '#/components/x-actions/create/code'
  5070. x-version: v1
  5071. x-permission-visibility: catalog
  5072. requestBody:
  5073. required: true
  5074. description: JSON 请求体,业务字段置于 data
  5075. content:
  5076. application/json:
  5077. schema:
  5078. type: object
  5079. description: 统一信封请求体,业务字段放在 data 内
  5080. properties:
  5081. data:
  5082. type: object
  5083. description: 业务参数
  5084. properties:
  5085. customer_id:
  5086. type: string
  5087. description: 客户 ID
  5088. plan_id:
  5089. type: string
  5090. description: 档位 ID
  5091. contract_id:
  5092. type: string
  5093. description: 合同 ID
  5094. contract_item_id:
  5095. type: string
  5096. description: 合同服务条目 ID(可空=该合同内一条匹配条目都没有,服务端按档位反查)
  5097. start_date:
  5098. type: string
  5099. description: 订阅开始日期
  5100. format: date
  5101. annual_price_cents:
  5102. type: integer
  5103. description: 不得传的只读派生列:按档位与账期折算落库(传值即 KLT-S20004 拒收)
  5104. monthly_settle_cents:
  5105. type: integer
  5106. description: 不得传的只读派生列:由 `monthly_settle_of` 按年价折算落库(传值即 KLT-S20004 拒收)
  5107. plan_family:
  5108. type: string
  5109. description: 交付形态(只读确认位,可缺省):只能与所选档位的 plan_family 相同,不同即 11103
  5110. enum:
  5111. - link
  5112. - addon
  5113. term:
  5114. type: string
  5115. description: 账期(三态:yearly/quarterly/monthly)
  5116. enum:
  5117. - yearly
  5118. - quarterly
  5119. - monthly
  5120. trial_months:
  5121. type: integer
  5122. description: 试用月数(默认 0,≥0)
  5123. minimum: 0
  5124. discount_monthly_cents:
  5125. type: integer
  5126. description: 每月优惠金额(分,默认 0,≥0)
  5127. minimum: 0
  5128. required:
  5129. - customer_id
  5130. - plan_id
  5131. - contract_id
  5132. - start_date
  5133. required:
  5134. - data
  5135. x-error-codes: [60001, 60201, 60212, 60214, 60215, 60216, 60218, 60219, 60221, 60222]
  5136. responses:
  5137. "200":
  5138. description: 成功。统一信封 code/message/data
  5139. /subscription/change@v1:
  5140. post:
  5141. summary: 订阅升降配
  5142. description: >-
  5143. 升降配须填 replaces_subscription_id 与 contract_id(新合同,不得沿用原合同;缺省时回退原合同并在回执说明中提示)。
  5144. `contract_item_id` 给出时按其取条目并校验档位匹配,缺省时按新档位在合同内反查。
  5145. `customer_id` 仅做一致性校验(与原订阅客户不同即 60201/KLT-M221)。
  5146. 年价、月结算标准、end_date、线路出口、用途分类为只读派生列,传即 11103。
  5147. ⚠️ 2026-11-17 起本口保留为「单订阅快捷通道」:常规路径是在合同新建页逐条带
  5148. service_items[].succession 一次提交(见 /contract/create@v1);两条路径共用同一份计划层与
  5149. 截原谓词(已被替换过 ⇒ KLT-M226)。工单类型按交付态:已交付且客户在用 ⇒ 一张 updown
  5150. (新档交付+原档回收,清单带原值/新值);未交付 ⇒ open/service_open。
  5151. operationId: subscription_change
  5152. tags:
  5153. - 订阅
  5154. x-require-auth: true
  5155. x-resource-type:
  5156. $ref: '#/components/x-resource-types/subscription/code'
  5157. x-action:
  5158. $ref: '#/components/x-actions/update/code'
  5159. x-version: v1
  5160. x-permission-visibility: catalog
  5161. requestBody:
  5162. required: true
  5163. description: JSON 请求体,业务字段置于 data
  5164. content:
  5165. application/json:
  5166. schema:
  5167. type: object
  5168. description: 统一信封请求体,业务字段放在 data 内
  5169. properties:
  5170. data:
  5171. type: object
  5172. description: 业务参数
  5173. properties:
  5174. replaces_subscription_id:
  5175. type: string
  5176. description: 被替换的原订阅 ID
  5177. customer_id:
  5178. type: string
  5179. description: 客户 ID
  5180. plan_id:
  5181. type: string
  5182. description: 新档位 ID
  5183. contract_id:
  5184. type: string
  5185. description: 新合同 ID(不得沿用原合同)
  5186. contract_item_id:
  5187. type: string
  5188. description: 新合同服务条目 ID
  5189. start_date:
  5190. type: string
  5191. description: 新订阅开始日期
  5192. format: date
  5193. annual_price_cents:
  5194. type: integer
  5195. description: 只读派生列(服务端按档位与时长折算);传即 11103
  5196. readOnly: true
  5197. monthly_settle_cents:
  5198. type: integer
  5199. description: 只读派生列(服务端按档位折算);传即 11103
  5200. readOnly: true
  5201. plan_family:
  5202. type: string
  5203. description: 只读派生列(随新档位);传不同值即 11103
  5204. readOnly: true
  5205. enum:
  5206. - link
  5207. - addon
  5208. term:
  5209. type: string
  5210. description: 账期(三态:yearly/quarterly/monthly;缺省沿用原订阅或按年)
  5211. enum:
  5212. - yearly
  5213. - quarterly
  5214. - monthly
  5215. trial_months:
  5216. type: integer
  5217. description: 试用月数(默认 0,≥0)
  5218. minimum: 0
  5219. discount_monthly_cents:
  5220. type: integer
  5221. description: 每月优惠金额(分,默认 0,≥0)
  5222. minimum: 0
  5223. row_version:
  5224. type: integer
  5225. description: 乐观锁版本号(可选,缺省不校验)
  5226. required:
  5227. - replaces_subscription_id
  5228. - plan_id
  5229. - contract_id
  5230. required:
  5231. - data
  5232. x-error-codes: [60001, 60201, 60212, 60214, 60215, 60216, 60218, 60219, 60221, 60222]
  5233. responses:
  5234. "200":
  5235. description: 成功。统一信封 code/message/data
  5236. /subscription/replacement_candidates@v1:
  5237. post:
  5238. summary: 替换候选探测(只读)
  5239. description: >-
  5240. 合同新建页逐条判定「是否已有可替换的原订阅」(契约内逐条替换=升降配,2026-11-17)。
  5241. 交付形态唯一取档位 `plan_family`(D-15),按「同客户 × 同出口 × 双方均 link」
  5242. 过滤(status ∈ active/pending、排除 addon 档、排除已被指过的 replaces_subscription_id),
  5243. 与 /contract/create@v1 的保存期校验是**同一份函数**(succession::candidate_filter),前端不得自造候选范围。
  5244. index 与 service_items 的 0 基下标对齐;档位或出口判定不出 ⇒ KLT-L222 点名 probes[i]。
  5245. operationId: subscription_replacement_candidates
  5246. tags:
  5247. - 订阅
  5248. x-require-auth: true
  5249. x-resource-type:
  5250. $ref: '#/components/x-resource-types/subscription/code'
  5251. x-action:
  5252. $ref: '#/components/x-actions/list/code'
  5253. x-version: v1
  5254. x-permission-visibility: catalog
  5255. requestBody:
  5256. required: true
  5257. description: JSON 请求体,业务字段置于 data
  5258. content:
  5259. application/json:
  5260. schema:
  5261. type: object
  5262. description: 统一信封请求体,业务字段放在 data 内
  5263. properties:
  5264. data:
  5265. type: object
  5266. description: 业务参数
  5267. properties:
  5268. customer_id:
  5269. type: string
  5270. description: 签约客户 ID(候选范围限本客户)
  5271. probes:
  5272. type: array
  5273. description: 探测项(至少 1 项,每项对应一个服务构成条目)
  5274. items:
  5275. type: object
  5276. properties:
  5277. index:
  5278. type: integer
  5279. description: 0 基条目下标(缺省=数组位置)
  5280. plan_id:
  5281. type: string
  5282. description: 档位 ID(交付形态由档位带出)
  5283. line_exits:
  5284. type: array
  5285. maxItems: 1
  5286. description: 线路出口(须恰 1 个;缺省时回落档位上的出口集合)
  5287. items:
  5288. type: string
  5289. required:
  5290. - line_exits
  5291. required:
  5292. - customer_id
  5293. - probes
  5294. required:
  5295. - data
  5296. x-error-codes: [60001, 60201, 60221, 60231]
  5297. responses:
  5298. "200":
  5299. description: >-
  5300. 成功。data.probes[] 每项回 index/plan_id/plan_family(后端按档位解析)/
  5301. line_exit_key/line_exits/candidates[];候选行含 subscription_id/plan_id/plan_name/
  5302. plan_kind/contract_id/contract_no/start_date/end_date/status/annual_price_cents/
  5303. monthly_settle_cents/customized(true=定制档,须用户显式勾选确认后才允许替换)。
  5304. /subscription/stack@v1:
  5305. post:
  5306. summary: 订阅叠加(已停用 · 请改走 create)
  5307. description: D-03 起拒写。权威「叠加」=新建并存订阅,请走 `/subscription/create@v1`(客户在用时自动生成服务开通工单)。本口保留路由与入参形态,一律返回参数错误并点名 create。
  5308. operationId: subscription_stack
  5309. tags:
  5310. - 订阅
  5311. x-require-auth: true
  5312. x-resource-type:
  5313. $ref: '#/components/x-resource-types/subscription/code'
  5314. x-action:
  5315. $ref: '#/components/x-actions/create/code'
  5316. x-version: v1
  5317. x-permission-visibility: catalog
  5318. requestBody:
  5319. required: true
  5320. description: JSON 请求体,业务字段置于 data
  5321. content:
  5322. application/json:
  5323. schema:
  5324. type: object
  5325. description: 统一信封请求体,业务字段放在 data 内
  5326. properties:
  5327. data:
  5328. type: object
  5329. description: 业务参数
  5330. properties:
  5331. subscription_id:
  5332. type: string
  5333. description: 订阅 ID(更新场景)
  5334. customer_id:
  5335. type: string
  5336. description: 客户 ID(叠加新建时)
  5337. plan_id:
  5338. type: string
  5339. description: 档位 ID(叠加新建时)
  5340. contract_id:
  5341. type: string
  5342. description: 合同 ID
  5343. contract_item_id:
  5344. type: string
  5345. description: 合同服务条目 ID
  5346. annual_price_cents:
  5347. type: integer
  5348. description: 年价(分,可改)
  5349. monthly_settle_cents:
  5350. type: integer
  5351. description: 月结算金额(分,可改)
  5352. end_date:
  5353. type: string
  5354. description: 结束日期(可改)
  5355. format: date
  5356. start_date:
  5357. type: string
  5358. description: 开始日期(叠加新建时)
  5359. format: date
  5360. row_version:
  5361. type: integer
  5362. description: 乐观锁版本号(可选,缺省不校验)
  5363. required:
  5364. - data
  5365. x-error-codes: [60001, 60201, 60212, 60214, 60215, 60216, 60218, 60219, 60221, 60222]
  5366. responses:
  5367. "200":
  5368. description: 成功。统一信封 code/message/data
  5369. /subscription/get_list@v1:
  5370. post:
  5371. summary: 订阅列表
  5372. description: >-
  5373. 按客户等维度筛选订阅列表。D-2:叠加服务订阅行带 `parent_subscription_id`(所属链路订阅号),
  5374. 列表面板保持平铺并标注「叠加于 SUB-xxx」,不把子订阅折叠进父行(不扩散)。
  5375. operationId: subscription_get_list
  5376. tags:
  5377. - 订阅
  5378. x-require-auth: true
  5379. x-resource-type:
  5380. $ref: '#/components/x-resource-types/subscription/code'
  5381. x-action:
  5382. $ref: '#/components/x-actions/list/code'
  5383. x-version: v1
  5384. x-permission-visibility: catalog
  5385. # 工单回件 §5.2 B1 点名的「订阅列表」(PG-4 空列表那条):列表行经客户维度收窄
  5386. # (subscription.rs:680 get_list → :687 customer_scope_pred),订阅在平台侧登记为
  5387. # klt.subscription 树叶 ⇒ 其可见集应由授权上界决定,故按 list 声明真源列举。
  5388. # 注意:同 L-2:本轮只打通「声明+上界落到 AuthContext」,运维分支仍走本地口径,
  5389. # 且注入 id 与我方 subscription_id 对齐的前提=订阅已登记为资源树叶(待平台确认)。
  5390. x-enumeration-kind: list
  5391. requestBody:
  5392. required: true
  5393. description: JSON 请求体,业务字段置于 data
  5394. content:
  5395. application/json:
  5396. schema:
  5397. type: object
  5398. description: 统一信封请求体,业务字段放在 data 内
  5399. properties:
  5400. data:
  5401. type: object
  5402. description: 列表筛选参数
  5403. properties:
  5404. customer_id:
  5405. type: string
  5406. description: 客户 ID(常必填)
  5407. page:
  5408. type: integer
  5409. description: 页码(0 基索引,默认 0)
  5410. minimum: 0
  5411. default: 0
  5412. page_size:
  5413. type: integer
  5414. description: 每页条数(默认 20,上限 200)
  5415. minimum: 1
  5416. maximum: 200
  5417. default: 20
  5418. keyword:
  5419. type: string
  5420. description: 关键字筛选(可选)
  5421. status:
  5422. type: string
  5423. description: 状态筛选
  5424. contract_id:
  5425. type: string
  5426. description: 合同 ID 筛选
  5427. region_ids:
  5428. type: array
  5429. description: 区域 ID 集合(经客户挂载区域展开)
  5430. items:
  5431. type: string
  5432. description: 区域 ID
  5433. required:
  5434. - data
  5435. x-error-codes: [60001, 60201, 60212, 60214, 60215, 60216, 60218, 60219, 60221, 60222]
  5436. responses:
  5437. "200":
  5438. description: 成功。统一信封 code/message/data
  5439. /subscription/get@v1:
  5440. post:
  5441. summary: 订阅详情
  5442. description: 按订阅 ID 查询详情。
  5443. operationId: subscription_get
  5444. tags:
  5445. - 订阅
  5446. x-require-auth: true
  5447. x-resource-type:
  5448. $ref: '#/components/x-resource-types/subscription/code'
  5449. x-action:
  5450. $ref: '#/components/x-actions/view/code'
  5451. x-version: v1
  5452. x-permission-visibility: catalog
  5453. requestBody:
  5454. required: true
  5455. description: JSON 请求体,业务字段置于 data
  5456. content:
  5457. application/json:
  5458. schema:
  5459. type: object
  5460. description: 统一信封请求体,业务字段放在 data 内
  5461. properties:
  5462. data:
  5463. type: object
  5464. description: 业务参数
  5465. properties:
  5466. subscription_id:
  5467. type: string
  5468. description: 订阅 ID
  5469. required:
  5470. - subscription_id
  5471. required:
  5472. - data
  5473. x-error-codes: [60001, 60201, 60212, 60214, 60215, 60216, 60218, 60219, 60221, 60222]
  5474. responses:
  5475. "200":
  5476. description: 成功。统一信封 code/message/data
  5477. /subscription/plan_options@v1:
  5478. post:
  5479. summary: 订阅档位候选
  5480. description: 第3册§5.2 第 3 步:本客户自定义档(含合同条目派生档)+全部固定档,不含他客户自定义档;行内带只读 sub_mode 与 available/unavailable_reason。
  5481. operationId: subscription_plan_options
  5482. tags:
  5483. - 订阅
  5484. x-require-auth: true
  5485. x-resource-type:
  5486. $ref: '#/components/x-resource-types/subscription/code'
  5487. x-action:
  5488. $ref: '#/components/x-actions/list/code'
  5489. x-version: v1
  5490. x-permission-visibility: catalog
  5491. requestBody:
  5492. required: true
  5493. description: JSON 请求体,业务字段置于 data
  5494. content:
  5495. application/json:
  5496. schema:
  5497. type: object
  5498. description: 统一信封请求体,业务字段放在 data 内
  5499. properties:
  5500. data:
  5501. type: object
  5502. description: 业务参数
  5503. properties:
  5504. customer_id:
  5505. type: string
  5506. description: 客户 ID(必填)
  5507. keyword:
  5508. type: string
  5509. description: 套餐名称关键字(仅本口有)
  5510. required:
  5511. - customer_id
  5512. required:
  5513. - data
  5514. x-error-codes: [60001, 60201, 60212, 60214, 60215, 60216, 60218, 60219, 60221, 60222]
  5515. responses:
  5516. "200":
  5517. description: 成功。统一信封 code/message/data
  5518. /subscription/contract_options@v1:
  5519. post:
  5520. summary: 未开通合同与服务条目候选
  5521. description: 第3册§5.2 第 2 步:只出「未开通」合同及其尚未被订阅引用的条目;开通态取数失败⇒KLT-S406;无可选合同⇒KLT-M222。
  5522. operationId: subscription_contract_options
  5523. tags:
  5524. - 订阅
  5525. x-require-auth: true
  5526. x-resource-type:
  5527. $ref: '#/components/x-resource-types/subscription/code'
  5528. x-action:
  5529. $ref: '#/components/x-actions/list/code'
  5530. x-version: v1
  5531. x-permission-visibility: catalog
  5532. requestBody:
  5533. required: true
  5534. description: JSON 请求体,业务字段置于 data
  5535. content:
  5536. application/json:
  5537. schema:
  5538. type: object
  5539. description: 统一信封请求体,业务字段放在 data 内
  5540. properties:
  5541. data:
  5542. type: object
  5543. description: 业务参数
  5544. properties:
  5545. customer_id:
  5546. type: string
  5547. description: 客户 ID(必填)
  5548. keyword:
  5549. type: string
  5550. description: 合同名称关键字(仅本口有)
  5551. required:
  5552. - customer_id
  5553. required:
  5554. - data
  5555. x-error-codes: [60001, 60201, 60212, 60214, 60215, 60216, 60218, 60219, 60221, 60222]
  5556. responses:
  5557. "200":
  5558. description: 成功。统一信封 code/message/data
  5559. /subscription/update@v1:
  5560. post:
  5561. summary: 订阅修改(白名单)
  5562. description: 第3册§5.6:可改字段只有 trial_months/discount_monthly_cents;row_version 必填,落空⇒KLT-S407;换套餐/换合同⇒KLT-M229。
  5563. operationId: subscription_update
  5564. tags:
  5565. - 订阅
  5566. x-require-auth: true
  5567. x-resource-type:
  5568. $ref: '#/components/x-resource-types/subscription/code'
  5569. x-action:
  5570. $ref: '#/components/x-actions/update/code'
  5571. x-version: v1
  5572. x-permission-visibility: catalog
  5573. requestBody:
  5574. required: true
  5575. description: JSON 请求体,业务字段置于 data
  5576. content:
  5577. application/json:
  5578. schema:
  5579. type: object
  5580. description: 统一信封请求体,业务字段放在 data 内
  5581. properties:
  5582. data:
  5583. type: object
  5584. description: 业务参数
  5585. properties:
  5586. subscription_id:
  5587. type: string
  5588. description: 订阅 ID
  5589. row_version:
  5590. type: integer
  5591. description: 乐观锁版本号(必填,落空⇒KLT-S407)
  5592. trial_months:
  5593. type: integer
  5594. description: 试用月数(白名单可改)
  5595. minimum: 0
  5596. discount_monthly_cents:
  5597. type: integer
  5598. description: 每月优惠金额(分,白名单可改)
  5599. minimum: 0
  5600. required:
  5601. - subscription_id
  5602. - row_version
  5603. required:
  5604. - data
  5605. x-error-codes: [60001, 60201, 60212, 60214, 60215, 60216, 60218, 60219, 60221, 60222]
  5606. responses:
  5607. "200":
  5608. description: 成功。统一信封 code/message/data
  5609. /subscription/delete_check@v1:
  5610. post:
  5611. summary: 订阅删除前阻塞检查
  5612. description: 第3册§5.6:两栏阻塞分列(账单明细⇒KLT-M227、升降配链原订阅⇒KLT-M230);账单只读口未接线⇒billing_state=unconfigured。
  5613. operationId: subscription_delete_check
  5614. tags:
  5615. - 订阅
  5616. x-require-auth: true
  5617. x-resource-type:
  5618. $ref: '#/components/x-resource-types/subscription/code'
  5619. x-action:
  5620. $ref: '#/components/x-actions/view/code'
  5621. x-version: v1
  5622. x-permission-visibility: catalog
  5623. requestBody:
  5624. required: true
  5625. description: JSON 请求体,业务字段置于 data
  5626. content:
  5627. application/json:
  5628. schema:
  5629. type: object
  5630. description: 统一信封请求体,业务字段放在 data 内
  5631. properties:
  5632. data:
  5633. type: object
  5634. description: 业务参数
  5635. properties:
  5636. subscription_id:
  5637. type: string
  5638. description: 订阅 ID
  5639. required:
  5640. - subscription_id
  5641. required:
  5642. - data
  5643. x-error-codes: [60001, 60201, 60212, 60214, 60215, 60216, 60218, 60219, 60221, 60222]
  5644. responses:
  5645. "200":
  5646. description: 成功。统一信封 code/message/data
  5647. /subscription/delete@v1:
  5648. post:
  5649. summary: 删除订阅并回退额度
  5650. description: 第3册§5.6:删除前复算阻塞;终态⇒11103;同事务回退 customer.quota_cents,档位 first_referred_at 打点不回滚。
  5651. operationId: subscription_delete
  5652. tags:
  5653. - 订阅
  5654. x-require-auth: true
  5655. x-resource-type:
  5656. $ref: '#/components/x-resource-types/subscription/code'
  5657. x-action:
  5658. $ref: '#/components/x-actions/delete/code'
  5659. x-version: v1
  5660. x-permission-visibility: catalog
  5661. requestBody:
  5662. required: true
  5663. description: JSON 请求体,业务字段置于 data
  5664. content:
  5665. application/json:
  5666. schema:
  5667. type: object
  5668. description: 统一信封请求体,业务字段放在 data 内
  5669. properties:
  5670. data:
  5671. type: object
  5672. description: 业务参数
  5673. properties:
  5674. subscription_id:
  5675. type: string
  5676. description: 订阅 ID
  5677. required:
  5678. - subscription_id
  5679. required:
  5680. - data
  5681. x-error-codes: [60001, 60201, 60212, 60214, 60215, 60216, 60218, 60219, 60221, 60222]
  5682. responses:
  5683. "200":
  5684. description: 成功。统一信封 code/message/data
  5685. /subscription/list_all@v1:
  5686. post:
  5687. summary: 全部订阅(跨客户)
  5688. description: 第3册§5.8:跨客户订阅列表,customer_id 可选;region_ids 经客户挂载区域展开;不按客户名称/合同编号检索。
  5689. operationId: subscription_list_all
  5690. tags:
  5691. - 订阅
  5692. x-require-auth: true
  5693. x-resource-type:
  5694. $ref: '#/components/x-resource-types/subscription/code'
  5695. x-action:
  5696. $ref: '#/components/x-actions/list/code'
  5697. x-version: v1
  5698. x-permission-visibility: catalog
  5699. requestBody:
  5700. required: true
  5701. description: JSON 请求体,业务字段置于 data
  5702. content:
  5703. application/json:
  5704. schema:
  5705. type: object
  5706. description: 统一信封请求体,业务字段放在 data 内
  5707. properties:
  5708. data:
  5709. type: object
  5710. description: 列表筛选参数
  5711. properties:
  5712. page:
  5713. type: integer
  5714. description: 页码
  5715. minimum: 1
  5716. page_size:
  5717. type: integer
  5718. description: 每页条数
  5719. minimum: 1
  5720. maximum: 500
  5721. keyword:
  5722. type: string
  5723. description: 关键字筛选
  5724. customer_id:
  5725. type: string
  5726. description: 客户 ID 筛选(跨客户列表下可选)
  5727. contract_id:
  5728. type: string
  5729. description: 合同 ID 筛选
  5730. status:
  5731. type: string
  5732. description: 状态筛选
  5733. region_ids:
  5734. type: array
  5735. description: 区域 ID 集合(经客户挂载区域展开)
  5736. items:
  5737. type: string
  5738. description: 区域 ID
  5739. required:
  5740. - data
  5741. x-error-codes: [60001, 60201, 60212, 60214, 60215, 60216, 60218, 60219, 60221, 60222]
  5742. responses:
  5743. "200":
  5744. description: 成功。统一信封 code/message/data
  5745. /cost_item/save@v1:
  5746. post:
  5747. summary: 保存成本项定义
  5748. description: 仅 admin。增改成本项定义。拒收金额、客户、运营商、省份、cycle、is_system。
  5749. operationId: cost_item_save
  5750. tags:
  5751. - 成本与分成
  5752. x-require-auth: true
  5753. x-resource-type:
  5754. $ref: '#/components/x-resource-types/cost_item/code'
  5755. x-action:
  5756. $ref: '#/components/x-actions/manage/code'
  5757. x-version: v1
  5758. x-permission-visibility: catalog
  5759. requestBody:
  5760. required: true
  5761. description: JSON 请求体,业务字段置于 data
  5762. content:
  5763. application/json:
  5764. schema:
  5765. type: object
  5766. description: 统一信封请求体,业务字段放在 data 内
  5767. properties:
  5768. data:
  5769. type: object
  5770. description: 业务参数
  5771. properties:
  5772. cost_item_id:
  5773. type: string
  5774. description: 成本项 ID(更新时必填)
  5775. category:
  5776. type: string
  5777. description: 类别:intl_resource/device_purchase/project_fee
  5778. enum:
  5779. - intl_resource
  5780. - device_purchase
  5781. - project_fee
  5782. item_name:
  5783. type: string
  5784. description: 成本项名称
  5785. billing_unit:
  5786. type: string
  5787. description: 计费单位:per_customer/per_account/per_copy
  5788. enum:
  5789. - per_customer
  5790. - per_account
  5791. - per_copy
  5792. is_amortized:
  5793. type: boolean
  5794. description: 是否摊销
  5795. amortization_months:
  5796. type: integer
  5797. description: 摊销月数(勾选摊销时可空=每月摊销不结束)
  5798. deduct_from_base:
  5799. type: boolean
  5800. description: 是否从基数扣除
  5801. remark:
  5802. type: string
  5803. description: 备注
  5804. row_version:
  5805. type: integer
  5806. description: 乐观锁版本(更新时)
  5807. required:
  5808. - category
  5809. - item_name
  5810. - billing_unit
  5811. - is_amortized
  5812. - deduct_from_base
  5813. required:
  5814. - data
  5815. x-error-codes: [60001]
  5816. responses:
  5817. "200":
  5818. description: 成功。统一信封 code/message/data
  5819. /cost_item/delete@v1:
  5820. post:
  5821. summary: 删除成本项定义
  5822. description: 仅 admin。顺序固定「引用检查 → 真删」;按 plan_cost_item.item_name 名称弱引用反查,
  5823. 命中 ⇒ KLT-E002 并在 data.referring_plan_count 回引用档位数(文案含「先在档位上解除引用」出路)。
  5824. 无引用才真删:同一批清理该成本项名下全部 cost_amount 行(级联行数只进审计摘要、不进响应体)。
  5825. operationId: cost_item_delete
  5826. tags:
  5827. - 成本与分成
  5828. x-require-auth: true
  5829. x-resource-type:
  5830. $ref: '#/components/x-resource-types/cost_item/code'
  5831. x-action:
  5832. $ref: '#/components/x-actions/delete/code'
  5833. x-version: v1
  5834. x-permission-visibility: catalog
  5835. requestBody:
  5836. required: true
  5837. description: JSON 请求体,业务字段置于 data
  5838. content:
  5839. application/json:
  5840. schema:
  5841. type: object
  5842. description: 统一信封请求体,业务字段放在 data 内
  5843. properties:
  5844. data:
  5845. type: object
  5846. description: 业务参数
  5847. properties:
  5848. cost_item_id:
  5849. type: string
  5850. description: 成本项 ID(待删除的定义主键)
  5851. required:
  5852. - cost_item_id
  5853. required:
  5854. - data
  5855. x-error-codes: [60005, 60302]
  5856. responses:
  5857. "200":
  5858. description: 成功。统一信封 code/message/data
  5859. /cost_item/get_list@v1:
  5860. post:
  5861. summary: 成本项列表
  5862. description: 全局成本项目录;可选类别/名称关键字;无客户过滤。
  5863. operationId: cost_item_get_list
  5864. tags:
  5865. - 成本与分成
  5866. x-require-auth: true
  5867. x-resource-type:
  5868. $ref: '#/components/x-resource-types/cost_item/code'
  5869. x-action:
  5870. $ref: '#/components/x-actions/list/code'
  5871. x-version: v1
  5872. x-permission-visibility: catalog
  5873. requestBody:
  5874. required: true
  5875. description: JSON 请求体,业务字段置于 data
  5876. content:
  5877. application/json:
  5878. schema:
  5879. type: object
  5880. description: 统一信封请求体,业务字段放在 data 内
  5881. properties:
  5882. data:
  5883. type: object
  5884. description: 列表筛选参数
  5885. properties:
  5886. page:
  5887. type: integer
  5888. description: 页码(0 基索引,默认 0)
  5889. minimum: 0
  5890. default: 0
  5891. page_size:
  5892. type: integer
  5893. description: 每页条数(默认 20,上限 200)
  5894. minimum: 1
  5895. maximum: 200
  5896. default: 20
  5897. keyword:
  5898. type: string
  5899. description: 关键字筛选(可选)
  5900. category:
  5901. type: string
  5902. description: 类别筛选
  5903. required:
  5904. - data
  5905. x-error-codes: [60001]
  5906. responses:
  5907. "200":
  5908. description: 成功。统一信封 code/message/data
  5909. /cost_amount/save@v1:
  5910. post:
  5911. summary: 保存成本金额
  5912. description: 按「省份×运营商×成本项」只写差异金额;留空项表示删除该差异。
  5913. operationId: cost_amount_save
  5914. tags:
  5915. - 成本与分成
  5916. x-require-auth: true
  5917. x-resource-type:
  5918. $ref: '#/components/x-resource-types/cost_amount/code'
  5919. x-action:
  5920. $ref: '#/components/x-actions/manage/code'
  5921. x-version: v1
  5922. x-permission-visibility: catalog
  5923. requestBody:
  5924. required: true
  5925. description: JSON 请求体,业务字段置于 data
  5926. content:
  5927. application/json:
  5928. schema:
  5929. type: object
  5930. description: 统一信封请求体,业务字段放在 data 内
  5931. properties:
  5932. data:
  5933. type: object
  5934. description: 业务参数
  5935. properties:
  5936. province_node_id:
  5937. type: string
  5938. description: 省份节点 ID
  5939. operator_id:
  5940. type: string
  5941. description: 运营商 ID
  5942. items:
  5943. type: array
  5944. description: 变更项列表;留空金额表示删除该差异行
  5945. items:
  5946. type: object
  5947. properties:
  5948. cost_item_id:
  5949. type: string
  5950. description: 成本项 ID
  5951. amount_cents:
  5952. type: integer
  5953. description: 金额(分);空/省略表示删除
  5954. row_version:
  5955. type: integer
  5956. description: 乐观锁版本
  5957. required:
  5958. - cost_item_id
  5959. required:
  5960. - province_node_id
  5961. - operator_id
  5962. - items
  5963. required:
  5964. - data
  5965. x-error-codes: [60001]
  5966. responses:
  5967. "200":
  5968. description: 成功。统一信封 code/message/data
  5969. /cost_amount/get_list@v1:
  5970. post:
  5971. summary: 成本金额一览
  5972. description: 透视表;admin 全量,区域运营按可见省/运营商收窄。
  5973. operationId: cost_amount_get_list
  5974. tags:
  5975. - 成本与分成
  5976. x-require-auth: true
  5977. x-resource-type:
  5978. $ref: '#/components/x-resource-types/cost_amount/code'
  5979. x-action:
  5980. $ref: '#/components/x-actions/list/code'
  5981. x-version: v1
  5982. x-permission-visibility: catalog
  5983. requestBody:
  5984. required: true
  5985. description: JSON 请求体,业务字段置于 data
  5986. content:
  5987. application/json:
  5988. schema:
  5989. type: object
  5990. description: 统一信封请求体,业务字段放在 data 内
  5991. properties:
  5992. data:
  5993. type: object
  5994. description: 列表筛选参数
  5995. properties:
  5996. province_node_id:
  5997. type: string
  5998. description: 省份筛选
  5999. operator_id:
  6000. type: string
  6001. description: 运营商筛选
  6002. page:
  6003. type: integer
  6004. description: 页码(0 基索引,默认 0)
  6005. minimum: 0
  6006. default: 0
  6007. page_size:
  6008. type: integer
  6009. description: 每页条数(默认 20,上限 200)
  6010. minimum: 1
  6011. maximum: 200
  6012. default: 20
  6013. keyword:
  6014. type: string
  6015. description: 关键字筛选(可选)
  6016. required:
  6017. - data
  6018. x-error-codes: [60001]
  6019. responses:
  6020. "200":
  6021. description: 成功。统一信封 code/message/data
  6022. /share_rule/save@v1:
  6023. post:
  6024. summary: 保存分成规则
  6025. description: holder_type 仅 operator/ops_team(无 partner)。share_value 填 0/负表示删除该行。
  6026. operationId: share_rule_save
  6027. tags:
  6028. - 成本与分成
  6029. x-require-auth: true
  6030. x-resource-type:
  6031. $ref: '#/components/x-resource-types/share_rule/code'
  6032. x-action:
  6033. $ref: '#/components/x-actions/manage/code'
  6034. x-version: v1
  6035. x-permission-visibility: catalog
  6036. requestBody:
  6037. required: true
  6038. description: JSON 请求体,业务字段置于 data
  6039. content:
  6040. application/json:
  6041. schema:
  6042. type: object
  6043. description: 统一信封请求体,业务字段放在 data 内
  6044. properties:
  6045. data:
  6046. type: object
  6047. description: 业务参数
  6048. properties:
  6049. holder_type:
  6050. type: string
  6051. description: 持有方类型:operator/ops_team
  6052. enum:
  6053. - operator
  6054. - ops_team
  6055. holder_id:
  6056. type: string
  6057. description: 持有方 ID
  6058. rules:
  6059. type: array
  6060. description: 规则行列表
  6061. items:
  6062. type: object
  6063. properties:
  6064. rule_id:
  6065. type: string
  6066. description: 规则 ID(更新/删除时)
  6067. customer_id:
  6068. type: string
  6069. description: 客户 ID
  6070. rule_level:
  6071. type: string
  6072. description: 规则层级:contract_addon/region_regular
  6073. enum:
  6074. - contract_addon
  6075. - region_regular
  6076. share_mode:
  6077. type: string
  6078. description: 分成方式:ratio_total/per_account/fixed_amount
  6079. enum:
  6080. - ratio_total
  6081. - per_account
  6082. - fixed_amount
  6083. share_value:
  6084. type: number
  6085. description: 分成值:比例 (0,1];金额/每账号>0 分;0/负=删除该行
  6086. remark:
  6087. type: string
  6088. description: 备注
  6089. required:
  6090. - holder_type
  6091. - holder_id
  6092. - rules
  6093. required:
  6094. - data
  6095. x-error-codes: []
  6096. responses:
  6097. "200":
  6098. description: 成功。统一信封 code/message/data
  6099. /share_rule/get_list@v1:
  6100. post:
  6101. summary: 分成规则列表
  6102. description: 按持有方等条件列出分成规则。
  6103. operationId: share_rule_get_list
  6104. tags:
  6105. - 成本与分成
  6106. x-require-auth: true
  6107. x-resource-type:
  6108. $ref: '#/components/x-resource-types/share_rule/code'
  6109. x-action:
  6110. $ref: '#/components/x-actions/list/code'
  6111. x-version: v1
  6112. x-permission-visibility: catalog
  6113. requestBody:
  6114. required: true
  6115. description: JSON 请求体,业务字段置于 data
  6116. content:
  6117. application/json:
  6118. schema:
  6119. type: object
  6120. description: 统一信封请求体,业务字段放在 data 内
  6121. properties:
  6122. data:
  6123. type: object
  6124. description: 列表筛选参数
  6125. properties:
  6126. holder_type:
  6127. type: string
  6128. description: 持有方类型
  6129. holder_id:
  6130. type: string
  6131. description: 持有方 ID
  6132. page:
  6133. type: integer
  6134. description: 页码(0 基索引,默认 0)
  6135. minimum: 0
  6136. default: 0
  6137. page_size:
  6138. type: integer
  6139. description: 每页条数(默认 20,上限 200)
  6140. minimum: 1
  6141. maximum: 200
  6142. default: 20
  6143. keyword:
  6144. type: string
  6145. description: 关键字筛选(可选)
  6146. required:
  6147. - data
  6148. x-error-codes: []
  6149. responses:
  6150. "200":
  6151. description: 成功。统一信封 code/message/data
  6152. /share_rule/get@v1:
  6153. post:
  6154. summary: 分成规则详情
  6155. description: 按持有方一次返回四卡摘要与规则表。
  6156. operationId: share_rule_get
  6157. tags:
  6158. - 成本与分成
  6159. x-require-auth: true
  6160. x-resource-type:
  6161. $ref: '#/components/x-resource-types/share_rule/code'
  6162. x-action:
  6163. $ref: '#/components/x-actions/view/code'
  6164. x-version: v1
  6165. x-permission-visibility: catalog
  6166. requestBody:
  6167. required: true
  6168. description: JSON 请求体,业务字段置于 data
  6169. content:
  6170. application/json:
  6171. schema:
  6172. type: object
  6173. description: 统一信封请求体,业务字段放在 data 内
  6174. properties:
  6175. data:
  6176. type: object
  6177. description: 业务参数
  6178. properties:
  6179. holder_type:
  6180. type: string
  6181. description: 持有方类型:operator/ops_team
  6182. holder_id:
  6183. type: string
  6184. description: 持有方 ID
  6185. required:
  6186. - holder_type
  6187. - holder_id
  6188. required:
  6189. - data
  6190. x-error-codes: []
  6191. responses:
  6192. "200":
  6193. description: 成功。统一信封 code/message/data
  6194. /share_rule/delete@v1:
  6195. post:
  6196. summary: 删除分成规则
  6197. description: 按 rule_id 删除单条分成规则(亦可在 save 内以 0/负值删除)。
  6198. operationId: share_rule_delete
  6199. tags:
  6200. - 成本与分成
  6201. x-require-auth: true
  6202. x-resource-type:
  6203. $ref: '#/components/x-resource-types/share_rule/code'
  6204. x-action:
  6205. $ref: '#/components/x-actions/delete/code'
  6206. x-version: v1
  6207. x-permission-visibility: catalog
  6208. requestBody:
  6209. required: true
  6210. description: JSON 请求体,业务字段置于 data
  6211. content:
  6212. application/json:
  6213. schema:
  6214. type: object
  6215. description: 统一信封请求体,业务字段放在 data 内
  6216. properties:
  6217. data:
  6218. type: object
  6219. description: 业务参数
  6220. properties:
  6221. rule_id:
  6222. type: string
  6223. description: 规则 ID
  6224. required:
  6225. - rule_id
  6226. required:
  6227. - data
  6228. x-error-codes: []
  6229. responses:
  6230. "200":
  6231. description: 成功。统一信封 code/message/data
  6232. /opsview/home@v1:
  6233. get:
  6234. summary: 运维只读首页
  6235. description: 运维侧只读首页(U-60),返回工单/逾期等概览数据。
  6236. operationId: opsview_home
  6237. tags:
  6238. - 运维视图
  6239. x-require-auth: true
  6240. x-resource-type:
  6241. $ref: '#/components/x-resource-types/opsview/code'
  6242. x-action:
  6243. $ref: '#/components/x-actions/view/code'
  6244. x-version: v1
  6245. x-permission-visibility: catalog
  6246. x-error-codes: []
  6247. responses:
  6248. "200":
  6249. description: 成功。统一信封 code/message/data
  6250. /jobs/get_list@v1:
  6251. get:
  6252. summary: 定时作业清单
  6253. description: 返回第 10 册 13 行清单(注册位 11 +标注行 2)及运行态:启用态、可操作性位、最近执行、五格计数、累计轮次、KPI 五卡与待补跑轮次。运行态取数失败时仍返回 13 行,runtime_available=false。
  6254. operationId: jobs_get_list
  6255. tags:
  6256. - 定时作业
  6257. x-require-auth: true
  6258. x-resource-type:
  6259. $ref: '#/components/x-resource-types/jobs/code'
  6260. x-action:
  6261. $ref: '#/components/x-actions/list/code'
  6262. x-version: v1
  6263. x-permission-visibility: catalog
  6264. x-error-codes: []
  6265. responses:
  6266. "200":
  6267. description: 成功。统一信封 code/message/data
  6268. /jobs/toggle@v1:
  6269. post:
  6270. summary: 启停定时作业
  6271. description: 仅 admin。按作业 key 启停。
  6272. operationId: jobs_toggle
  6273. tags:
  6274. - 定时作业
  6275. x-require-auth: true
  6276. x-resource-type:
  6277. $ref: '#/components/x-resource-types/jobs/code'
  6278. x-action:
  6279. $ref: '#/components/x-actions/manage/code'
  6280. x-version: v1
  6281. x-permission-visibility: catalog
  6282. requestBody:
  6283. required: true
  6284. description: JSON 请求体,业务字段置于 data
  6285. content:
  6286. application/json:
  6287. schema:
  6288. type: object
  6289. description: 统一信封请求体,业务字段放在 data 内
  6290. properties:
  6291. data:
  6292. type: object
  6293. description: 业务参数
  6294. properties:
  6295. key:
  6296. type: string
  6297. description: 作业键
  6298. enabled:
  6299. type: boolean
  6300. description: 是否启用
  6301. required:
  6302. - key
  6303. - enabled
  6304. required:
  6305. - data
  6306. x-error-codes: []
  6307. responses:
  6308. "200":
  6309. description: 成功。统一信封 code/message/data
  6310. /jobs/runs@v1:
  6311. post:
  6312. summary: 作业执行记录
  6313. description: 查询执行记录,支持任务、关键字(执行编号/任务/结果说明,不检索对象级明细)、触发方式、执行结果与日期区间筛选;分页 page 0 基、page_size 默认 50。标注行返回空流水并标记 annotation=true。
  6314. operationId: jobs_runs
  6315. tags:
  6316. - 定时作业
  6317. x-require-auth: true
  6318. x-resource-type:
  6319. $ref: '#/components/x-resource-types/jobs/code'
  6320. x-action:
  6321. $ref: '#/components/x-actions/view/code'
  6322. x-version: v1
  6323. x-permission-visibility: catalog
  6324. requestBody:
  6325. required: true
  6326. description: JSON 请求体,业务字段置于 data
  6327. content:
  6328. application/json:
  6329. schema:
  6330. type: object
  6331. description: 统一信封请求体,业务字段放在 data 内
  6332. properties:
  6333. data:
  6334. type: object
  6335. description: 业务参数
  6336. properties:
  6337. key:
  6338. type: string
  6339. description: 作业键(可省略=全部任务)
  6340. job_key:
  6341. type: string
  6342. description: 作业键(契约字段名,可省略)
  6343. keyword:
  6344. type: string
  6345. description: 关键字(执行编号/任务/结果说明;不检索对象级明细)
  6346. trigger:
  6347. type: string
  6348. description: 触发方式
  6349. enum:
  6350. - 定时
  6351. - 事件
  6352. - 人工
  6353. result:
  6354. type: string
  6355. description: 执行结果
  6356. enum:
  6357. - 成功
  6358. - 部分成功
  6359. - 失败
  6360. - 异常
  6361. date_from:
  6362. type: string
  6363. description: 开始日期(YYYY-MM-DD,Asia/Shanghai 日界)
  6364. pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2}$'
  6365. date_to:
  6366. type: string
  6367. description: 结束日期(YYYY-MM-DD,含当日)
  6368. pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2}$'
  6369. page:
  6370. type: integer
  6371. description: 页码(0 基,默认 0)
  6372. minimum: 0
  6373. default: 0
  6374. page_size:
  6375. type: integer
  6376. description: 每页条数(默认 50,上限 200)
  6377. minimum: 1
  6378. maximum: 200
  6379. default: 50
  6380. required:
  6381. - data
  6382. x-error-codes: []
  6383. responses:
  6384. "200":
  6385. description: 成功。统一信封 code/message/data
  6386. /jobs/run_once@v1:
  6387. post:
  6388. summary: 补跑作业一次
  6389. 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,缺省=今天)补跑历史某日。
  6390. operationId: jobs_run_once
  6391. tags:
  6392. - 定时作业
  6393. x-require-auth: true
  6394. x-resource-type:
  6395. $ref: '#/components/x-resource-types/jobs/code'
  6396. x-action:
  6397. $ref: '#/components/x-actions/manage/code'
  6398. x-version: v1
  6399. x-permission-visibility: catalog
  6400. requestBody:
  6401. required: true
  6402. description: JSON 请求体,业务字段置于 data
  6403. content:
  6404. application/json:
  6405. schema:
  6406. type: object
  6407. description: 统一信封请求体,业务字段放在 data 内
  6408. properties:
  6409. data:
  6410. type: object
  6411. description: 业务参数
  6412. properties:
  6413. key:
  6414. type: string
  6415. description: 作业键
  6416. enum:
  6417. - SUB-EFF
  6418. - SNAPSHOT-FREEZE
  6419. - DELEG-SYNC
  6420. - STOP-GEN
  6421. - OVERDUE
  6422. - AUTO-CLOSE
  6423. - RECON
  6424. - ORPHAN-CLEAN
  6425. - REGION-WARM
  6426. - ONEDIR-CHECK
  6427. - OSS-ORPHAN-CLEAN
  6428. - CONTRACT-RENEW
  6429. period:
  6430. type: string
  6431. description: 仅 RECON 用;指定已结束自然月(YYYY-MM)回填,前端传 1 基以外的月份格式即 11103
  6432. pattern: '^[0-9]{4}-[0-9]{2}$'
  6433. biz_date:
  6434. type: string
  6435. description: 仅 STOP-GEN/AUTO-CLOSE/CONTRACT-RENEW 用;业务日(YYYY-MM-DD),缺省=当天。STOP-GEN 按「订阅结束日早于该业务日」扫描;CONTRACT-RENEW 按「合同结束日在 [业务日, 业务日+提前天数] 窗口内」扫描;幂等键含业务日
  6436. pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2}$'
  6437. required:
  6438. - key
  6439. required:
  6440. - data
  6441. x-error-codes: []
  6442. responses:
  6443. "200":
  6444. description: 成功。统一信封 code/message/data
  6445. /share_rule/param_summary@v1:
  6446. post:
  6447. summary: 分成参数摘要
  6448. description: |
  6449. 批量取分成方的分成方式/数值与覆盖客户数(分成管理页徽标);最多 500 项。
  6450. holders 必填且非空(null/缺键/[] ⇒ 60004);按 holder_type|holder_id 去重;
  6451. holder_id 号段须匹配发号前缀(operator=OP-/partner=PT-/ops_team=OPS-),空串或前缀不符 ⇒ 11103;
  6452. 未知主体逐项返回 configured=false+item_error(⛔ 整批 11104);share_value=十进制字符串(与档案 settle_value 同型)。
  6453. ⛔ 无 `share-rule/holder-options`(连字符)口;分成方候选=`operator`/`partner`/`ops_team` 的 `get_list`。
  6454. operationId: share_rule_param_summary
  6455. tags:
  6456. - 成本与分成
  6457. x-require-auth: true
  6458. x-resource-type:
  6459. $ref: '#/components/x-resource-types/share_rule/code'
  6460. x-action:
  6461. $ref: '#/components/x-actions/list/code'
  6462. x-version: v1
  6463. x-permission-visibility: catalog
  6464. x-error-codes: [11103, 11104]
  6465. responses:
  6466. "200":
  6467. description: 成功。统一信封 code/message/data
  6468. /billing/config_get@v1:
  6469. get:
  6470. summary: 出账配置读
  6471. description: 默认对账日、成本生效口径、行版本与运营商对账账号列表(仅总运营)。
  6472. operationId: billing_config_get
  6473. tags:
  6474. - 计费与对账
  6475. x-require-auth: true
  6476. x-resource-type:
  6477. $ref: '#/components/x-resource-types/billing_config/code'
  6478. x-action:
  6479. $ref: '#/components/x-actions/view/code'
  6480. x-version: v1
  6481. x-permission-visibility: catalog
  6482. x-error-codes: []
  6483. responses:
  6484. "200":
  6485. description: 成功。统一信封 code/message/data
  6486. /billing/config_update@v1:
  6487. post:
  6488. summary: 出账配置写
  6489. description: 乐观锁 row_version;提交同值 ⇒ changed=0 不写审计;运营商对账日只读(写口在 operator/update)。
  6490. operationId: billing_config_update
  6491. tags:
  6492. - 计费与对账
  6493. x-require-auth: true
  6494. x-resource-type:
  6495. $ref: '#/components/x-resource-types/billing_config/code'
  6496. x-action:
  6497. $ref: '#/components/x-actions/update/code'
  6498. x-version: v1
  6499. x-permission-visibility: catalog
  6500. x-error-codes: [11103, 60001]
  6501. responses:
  6502. "200":
  6503. description: 成功。统一信封 code/message/data
  6504. /recon/periods@v1:
  6505. get:
  6506. summary: 对账期次下拉
  6507. description: 有数据的自然月(倒序),不并入 get_list。
  6508. operationId: recon_periods
  6509. tags:
  6510. - 计费与对账
  6511. x-require-auth: true
  6512. x-resource-type:
  6513. $ref: '#/components/x-resource-types/recon/code'
  6514. x-action:
  6515. $ref: '#/components/x-actions/list/code'
  6516. x-version: v1
  6517. x-permission-visibility: catalog
  6518. x-error-codes: []
  6519. responses:
  6520. "200":
  6521. description: 成功。统一信封 code/message/data
  6522. /recon/get_list@v1:
  6523. post:
  6524. summary: 对账批次清单
  6525. description: 三统计卡与期次出账进度随同一响应下发;出账状态为派生筛选(settled/abnormal/unsettled)。
  6526. operationId: recon_get_list
  6527. tags:
  6528. - 计费与对账
  6529. x-require-auth: true
  6530. x-resource-type:
  6531. $ref: '#/components/x-resource-types/recon/code'
  6532. x-action:
  6533. $ref: '#/components/x-actions/list/code'
  6534. x-version: v1
  6535. x-permission-visibility: catalog
  6536. x-error-codes: [11103]
  6537. responses:
  6538. "200":
  6539. description: 成功。统一信封 code/message/data
  6540. /recon/detail@v1:
  6541. get:
  6542. summary: 对账批次详情
  6543. description: 批次头+活跃明细行+动作可用性布尔位(服务端算)。
  6544. operationId: recon_detail
  6545. tags:
  6546. - 计费与对账
  6547. x-require-auth: true
  6548. x-resource-type:
  6549. $ref: '#/components/x-resource-types/recon/code'
  6550. x-action:
  6551. $ref: '#/components/x-actions/view/code'
  6552. x-version: v1
  6553. x-permission-visibility: catalog
  6554. x-error-codes: [11103, 11104]
  6555. responses:
  6556. "200":
  6557. description: 成功。统一信封 code/message/data
  6558. /recon/rerun@v1:
  6559. post:
  6560. summary: 人工补跑出账
  6561. description: 仅总运营。四道前置依次返回 KLT-H20502/60503/60504/60506;作废旧 failed 批并回填 replaced_by_batch_no。
  6562. operationId: recon_rerun
  6563. tags:
  6564. - 计费与对账
  6565. x-require-auth: true
  6566. x-resource-type:
  6567. $ref: '#/components/x-resource-types/recon/code'
  6568. x-action:
  6569. $ref: '#/components/x-actions/update/code'
  6570. x-version: v1
  6571. x-permission-visibility: catalog
  6572. x-error-codes: [11103, 60502, 60503, 60504, 60506, 60001]
  6573. responses:
  6574. "200":
  6575. description: 成功。统一信封 code/message/data
  6576. /recon/export_list@v1:
  6577. post:
  6578. summary: 导出对账清单(B 表)
  6579. description: 按当前筛选结果导出批次清单一行一批次,末行合计;行集与 /recon/get_list 同源;未加筛选=导出全部批次;每次导出写操作日志(记筛选条件与导出批数)。
  6580. operationId: recon_export_list
  6581. tags:
  6582. - 计费与对账
  6583. x-require-auth: true
  6584. x-resource-type:
  6585. $ref: '#/components/x-resource-types/recon/code'
  6586. x-action:
  6587. $ref: '#/components/x-actions/export/code'
  6588. x-version: v1
  6589. x-permission-visibility: catalog
  6590. x-error-codes: [11103]
  6591. responses:
  6592. "200":
  6593. description: 成功。统一信封 code/message/data
  6594. /recon/export_detail@v1:
  6595. post:
  6596. summary: 导出账单明细(A 表)
  6597. description: 导出本批交给分成方核对的账单明细,一行一条末行本批合计;本批未执行或无明细返回 KLT-H20505(不产文件不写审计)。
  6598. operationId: recon_export_detail
  6599. tags:
  6600. - 计费与对账
  6601. x-require-auth: true
  6602. x-resource-type:
  6603. $ref: '#/components/x-resource-types/recon/code'
  6604. x-action:
  6605. $ref: '#/components/x-actions/export/code'
  6606. x-version: v1
  6607. x-permission-visibility: catalog
  6608. x-error-codes: [11103, 11104, 60505]
  6609. responses:
  6610. "200":
  6611. description: 成功。统一信封 code/message/data
  6612. /view/partner_recon@v1:
  6613. get:
  6614. summary: 合伙人与运维团队本方对账合并页
  6615. description: 第 8 册 V-I1。卡 1(分成方式与取值)+卡 2/3(批次数与明细条数)+表 1(本方对账清单)+表 2(本方账单明细)+卡 4(分成合计双值)+月份选项一次返回;行集恒等于「分成方=本方」,入参只有 month/keyword/page/page_size,任何范围类入参 ⇒ 11103。快照未建立 ⇒ snapshot_state=not_ready(整页态,仍回 200 与空骨架);月份选项取数失败 ⇒ month_options="failed"。
  6616. operationId: view_partner_recon
  6617. tags:
  6618. - 合伙人与运营商只读视图
  6619. x-require-auth: true
  6620. x-resource-type:
  6621. $ref: '#/components/x-resource-types/view/code'
  6622. x-action:
  6623. $ref: '#/components/x-actions/partner_recon/code'
  6624. x-version: v1
  6625. x-permission-visibility: catalog
  6626. x-error-codes: [11103, 11104]
  6627. parameters:
  6628. - name: month
  6629. in: query
  6630. required: false
  6631. schema:
  6632. type: string
  6633. description: 自然月 YYYY-MM;省略=全部自然月
  6634. - name: keyword
  6635. in: query
  6636. required: false
  6637. schema:
  6638. type: string
  6639. description: 对账单号/明细号模糊匹配(不分大小写)
  6640. - name: page
  6641. in: query
  6642. required: false
  6643. schema:
  6644. type: integer
  6645. minimum: 0
  6646. default: 0
  6647. description: 页码(0 基索引)
  6648. - name: page_size
  6649. in: query
  6650. required: false
  6651. schema:
  6652. type: integer
  6653. minimum: 1
  6654. maximum: 200
  6655. default: 20
  6656. responses:
  6657. "200":
  6658. description: 成功。统一信封 code/message/data
  6659. /bill/get_list@v1:
  6660. post:
  6661. summary: 账单明细清单
  6662. description: 只含进入 executed 批次的 active 行。
  6663. operationId: bill_get_list
  6664. tags:
  6665. - 计费与对账
  6666. x-require-auth: true
  6667. x-resource-type:
  6668. $ref: '#/components/x-resource-types/bill/code'
  6669. x-action:
  6670. $ref: '#/components/x-actions/list/code'
  6671. x-version: v1
  6672. x-permission-visibility: catalog
  6673. x-error-codes: [11103]
  6674. responses:
  6675. "200":
  6676. description: 成功。统一信封 code/message/data
  6677. /bill/detail@v1:
  6678. get:
  6679. summary: 账单明细详情
  6680. description: 头+成本明细+在期分账号+同订阅其他分成方,七段同源一个接口。
  6681. operationId: bill_detail
  6682. tags:
  6683. - 计费与对账
  6684. x-require-auth: true
  6685. x-resource-type:
  6686. $ref: '#/components/x-resource-types/bill/code'
  6687. x-action:
  6688. $ref: '#/components/x-actions/view/code'
  6689. x-version: v1
  6690. x-permission-visibility: catalog
  6691. x-error-codes: [11103, 11104]
  6692. responses:
  6693. "200":
  6694. description: 成功。统一信封 code/message/data
  6695. /correction/create@v1:
  6696. post:
  6697. summary: 登记出账更正
  6698. description: 表单仅两字段(关联账单+错误内容);KLT-H20501 识别不到归属、KLT-H20507 候选未出账。不接受入参 `scope`/`severity`/`region_node_id`(三者皆为系统推导值),出现即 11103 且 `data.fields[]` 逐键给出原因。
  6699. operationId: correction_create
  6700. tags:
  6701. - 计费与对账
  6702. x-require-auth: true
  6703. x-resource-type:
  6704. $ref: '#/components/x-resource-types/correction/code'
  6705. x-action:
  6706. $ref: '#/components/x-actions/create/code'
  6707. x-version: v1
  6708. x-permission-visibility: catalog
  6709. x-error-codes: [11103, 11104, 60501, 60507, 60056]
  6710. responses:
  6711. "200":
  6712. description: 成功。统一信封 code/message/data
  6713. /correction/get_list@v1:
  6714. post:
  6715. summary: 出账更正列表
  6716. description: 自然月筛选不预选;无编辑/删除/导出入口。
  6717. operationId: correction_get_list
  6718. tags:
  6719. - 计费与对账
  6720. x-require-auth: true
  6721. x-resource-type:
  6722. $ref: '#/components/x-resource-types/correction/code'
  6723. x-action:
  6724. $ref: '#/components/x-actions/list/code'
  6725. x-version: v1
  6726. x-permission-visibility: catalog
  6727. x-error-codes: [11103]
  6728. responses:
  6729. "200":
  6730. description: 成功。统一信封 code/message/data
  6731. /correction/detail@v1:
  6732. get:
  6733. summary: 出账更正详情
  6734. description: 命中/未命中两种展示同源;越权与查无同码(11104)。
  6735. operationId: correction_detail
  6736. tags:
  6737. - 计费与对账
  6738. x-require-auth: true
  6739. x-resource-type:
  6740. $ref: '#/components/x-resource-types/correction/code'
  6741. x-action:
  6742. $ref: '#/components/x-actions/view/code'
  6743. x-version: v1
  6744. x-permission-visibility: catalog
  6745. x-error-codes: [11103, 11104]
  6746. responses:
  6747. "200":
  6748. description: 成功。统一信封 code/message/data
  6749. /correction/draft_save@v1:
  6750. post:
  6751. summary: 保存更正草稿
  6752. description: 按「admin × 本机」至多一份;表单整体 ≤64KB;不接受 user_id。
  6753. operationId: correction_draft_save
  6754. tags:
  6755. - 计费与对账
  6756. x-require-auth: true
  6757. x-resource-type:
  6758. $ref: '#/components/x-resource-types/correction/code'
  6759. x-action:
  6760. $ref: '#/components/x-actions/update/code'
  6761. x-version: v1
  6762. x-permission-visibility: catalog
  6763. x-error-codes: [11103]
  6764. responses:
  6765. "200":
  6766. description: 成功。统一信封 code/message/data
  6767. /correction/draft_get@v1:
  6768. get:
  6769. summary: 读取更正草稿
  6770. description: 无草稿 ⇒ 成功+空对象(不报 404/不报业务码)。
  6771. operationId: correction_draft_get
  6772. tags:
  6773. - 计费与对账
  6774. x-require-auth: true
  6775. x-resource-type:
  6776. $ref: '#/components/x-resource-types/correction/code'
  6777. x-action:
  6778. $ref: '#/components/x-actions/view/code'
  6779. x-version: v1
  6780. x-permission-visibility: catalog
  6781. x-error-codes: []
  6782. responses:
  6783. "200":
  6784. description: 成功。统一信封 code/message/data
  6785. /ticket/list@v1:
  6786. post:
  6787. summary: 工单列表查询
  6788. description: 跨 6 类工单统一分页;行集=判权谓词+可见范围五档+数据权限;排序=是否已超期→优先级→提醒时限(TK-1)。出参每行带 row_version 与可执行动作集合(服务端计算,前端不自拼)。主要失败:网关 11104(缺权限)。
  6789. operationId: ticket_list
  6790. tags:
  6791. - 工单与开停交付
  6792. x-require-auth: true
  6793. x-resource-type:
  6794. $ref: '#/components/x-resource-types/ticket/code'
  6795. x-action:
  6796. $ref: '#/components/x-actions/list/code'
  6797. x-version: v1
  6798. x-permission-visibility: catalog
  6799. requestBody:
  6800. required: true
  6801. description: JSON 请求体,业务字段置于 data
  6802. content:
  6803. application/json:
  6804. schema:
  6805. type: object
  6806. description: 统一信封请求体,业务字段放在 data 内
  6807. properties:
  6808. data:
  6809. type: object
  6810. description: 业务参数
  6811. properties:
  6812. ticket_types:
  6813. type: array
  6814. description: 工单类型(英文码):开户、服务开通、到期停机、服务停用、故障处理、售后处理;缺省=全部。兼容单数写法 `ticket_type`(传单字符串或逗号分隔串同样生效)
  6815. items:
  6816. type: string
  6817. statuses:
  6818. type: array
  6819. description: 工单状态(未分派/待处理/处理中/已满足闭环/待回执/已办结);缺省=全部。兼容单数写法 `status`(传单字符串或逗号分隔串同样生效)
  6820. items:
  6821. type: string
  6822. sources:
  6823. type: array
  6824. description: 来源:self/cust_svc/ops/system;缺省=全部。兼容单数写法 `source`(传单字符串或逗号分隔串同样生效)
  6825. items:
  6826. type: string
  6827. date_from:
  6828. type: string
  6829. description: 建单日期起(YYYY-MM-DD)
  6830. date_to:
  6831. type: string
  6832. description: 建单日期止(YYYY-MM-DD)
  6833. keyword:
  6834. type: string
  6835. description: 关键字:标题/客户名/工单号/关联单号/网络账号/工单 ID(雪花主键,纯数字关键字按**整值**精确命中——即审计日志「对象」列那串数字;不做前缀/模糊匹配,避免 1~4 位数字命中全表;不含报文原文)
  6836. subscription_id:
  6837. type: string
  6838. description: 订单(订阅)过滤:只回本订单的工单(订单详情「关联工单」现查,P3-D6)。空串=不过滤
  6839. contract_id:
  6840. type: string
  6841. description: 合同过滤:服务端先把该合同下的订单解成集合再过滤,合同还没有订单时回空集(不退化成不过滤,P3-D7)。空串=不过滤
  6842. customer_id:
  6843. type: string
  6844. description: 客户过滤:只回本客户的工单。空串=不过滤
  6845. assignee:
  6846. type: string
  6847. description: 责任人过滤:**只接受 `me`**(服务端按会话解析成当前登录账号,与可见性谓词逐段取交);供「我的待办」把可见行集收窄到本人名下。⛔ 接受任意 user_id(按他人过滤不开放),其它取值回 11103。空串=不过滤
  6848. page:
  6849. type: integer
  6850. description: 页码,从 1 起(越界收敛,不报错)
  6851. page_size:
  6852. type: integer
  6853. description: 每页条数,1–100,缺省 10
  6854. required:
  6855. - data
  6856. x-error-codes: [11104]
  6857. responses:
  6858. "200":
  6859. description: 成功。统一信封 code/message/data
  6860. /ticket/detail@v1:
  6861. get:
  6862. summary: 工单详情查询
  6863. description: >-
  6864. 出参骨架+时间线+按类型子域块(回填、分账号、开停记录、竣工、报文、故障、材料)。
  6865. ✅ 2026-11-22:另回只读块 `construction_guide`(套餐/带宽/席位/份数/境外 IP 权益;停机/变更另含
  6866. `prior_activation` 最近成功开户回填线路与 IP 只读快照,PIN/CPID 仅「已登记」)与可选
  6867. `backfill_draft`(服务端暂存草稿摘要,不明文回 PIN/CPID)。`actions.check_and_backfill`
  6868. 为真时变更协议走「核对并回填」合并口(同批清单+回填),独立 `check_done` 对 `updown` 关闭。
  6869. D-10:并行出单时另有 `subscriptions[]`。读事件:read_event 为真且当前人是责任人且态为待处理
  6870. ⇒ 同事务推进处理中并写首条处理记录。主要失败:60056(不可见)、KLT-G20401。
  6871. operationId: ticket_detail
  6872. tags:
  6873. - 工单与开停交付
  6874. x-require-auth: true
  6875. x-resource-type:
  6876. $ref: '#/components/x-resource-types/ticket/code'
  6877. x-action:
  6878. $ref: '#/components/x-actions/detail/code'
  6879. x-version: v1
  6880. x-permission-visibility: catalog
  6881. parameters:
  6882. - name: ticket_id
  6883. in: query
  6884. required: false
  6885. description: 工单标识(内部主键)。注意:与 ticket_no 二者至少给一个,都给以本参数为准
  6886. schema:
  6887. type: string
  6888. - name: ticket_no
  6889. in: query
  6890. required: false
  6891. description: 业务工单号(形如 T-20261114-5968)。客户门户不暴露内部主键,列表只回 ticket_no,
  6892. 故详情口按本参数定位;反查**在可见性谓词之内**执行,查无与越权同回 60005
  6893. (与按主键查无同一口径,不说破「存在但你不能看」)
  6894. schema:
  6895. type: string
  6896. - name: read_event
  6897. in: query
  6898. required: false
  6899. description: 阅读推进开关:true 时才尝试待处理→处理中
  6900. schema:
  6901. type: string
  6902. x-error-codes: [11103, 60005]
  6903. responses:
  6904. "200":
  6905. description: 成功。统一信封 code/message/data
  6906. /ticket/pending_queue@v1:
  6907. post:
  6908. summary: 待分派队列查询
  6909. description: 运维主管/运维组负责人的分派工作台数据源;权限键与工单列表分列,不复用(TK-13)。行集=可见范围内未分派+待处理(注意:待处理入列理由待裁定,18册 U-13)。
  6910. operationId: ticket_pending_queue
  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/pending_queue/code'
  6918. x-version: v1
  6919. x-permission-visibility: catalog
  6920. requestBody:
  6921. required: true
  6922. description: JSON 请求体,业务字段置于 data
  6923. content:
  6924. application/json:
  6925. schema:
  6926. type: object
  6927. description: 统一信封请求体,业务字段放在 data 内
  6928. properties:
  6929. data:
  6930. type: object
  6931. description: 业务参数
  6932. properties:
  6933. ticket_types:
  6934. type: array
  6935. description: 工单类型;缺省=本人团队可受理全部类型(授权范围是上限)
  6936. items:
  6937. type: string
  6938. assign_team_id:
  6939. type: string
  6940. description: 目标运维团队;缺省=本人所辖团队;指定时必须是本人所辖团队
  6941. keyword:
  6942. type: string
  6943. description: 关键字,含义同工单列表
  6944. page:
  6945. type: integer
  6946. description: 页码,从 1 起(越界收敛,不报错)
  6947. page_size:
  6948. type: integer
  6949. description: 每页条数,1–100,缺省 10
  6950. required:
  6951. - data
  6952. x-error-codes: [11104]
  6953. responses:
  6954. "200":
  6955. description: 成功。统一信封 code/message/data
  6956. /ticket/todo_counts@v1:
  6957. get:
  6958. summary: 待办计数查询
  6959. description: 一次返回四个角标:未分派、超期、待回填、报文待处置。不做超期明细列表(超期明细走工单列表的已超期筛选)。
  6960. operationId: ticket_todo_counts
  6961. tags:
  6962. - 工单与开停交付
  6963. x-require-auth: true
  6964. x-resource-type:
  6965. $ref: '#/components/x-resource-types/ticket/code'
  6966. x-action:
  6967. $ref: '#/components/x-actions/todo_counts/code'
  6968. x-version: v1
  6969. x-permission-visibility: catalog
  6970. x-error-codes: [11104, 60201]
  6971. responses:
  6972. "200":
  6973. description: 成功。统一信封 code/message/data
  6974. /ticket/trace@v1:
  6975. get:
  6976. summary: 跨主体追溯查询
  6977. description: 按工单号/报文单号/竣工号任一单值精确定位,返回工单+开停记录+报文+竣工回传+回执的关联链。不支持关键字模糊(U-16)。主要失败:KLT-G20415(无法定位)。
  6978. operationId: ticket_trace
  6979. tags:
  6980. - 工单与开停交付
  6981. x-require-auth: true
  6982. x-resource-type:
  6983. $ref: '#/components/x-resource-types/ticket/code'
  6984. x-action:
  6985. $ref: '#/components/x-actions/trace/code'
  6986. x-version: v1
  6987. x-permission-visibility: catalog
  6988. parameters:
  6989. - name: ticket_no
  6990. in: query
  6991. required: false
  6992. description: 恪澜通工单号
  6993. schema:
  6994. type: string
  6995. - name: carrier_order_no
  6996. in: query
  6997. required: false
  6998. description: 运营商单号
  6999. schema:
  7000. type: string
  7001. - name: completion_no
  7002. in: query
  7003. required: false
  7004. description: 竣工单号
  7005. schema:
  7006. type: string
  7007. - name: ticket_id
  7008. in: query
  7009. required: false
  7010. description: 工单标识
  7011. schema:
  7012. type: string
  7013. x-error-codes: [11104]
  7014. responses:
  7015. "200":
  7016. description: 成功。统一信封 code/message/data
  7017. /message/pending@v1:
  7018. post:
  7019. summary: 报文待处置队列查询
  7020. description: 运维主管/运维组负责人的报文处置工作台数据源;不返回 raw_payload 正文(D7、U-51),只回动作/单号/归属态+归属失败原因码等已脱敏列。
  7021. operationId: message_pending
  7022. tags:
  7023. - 报文人工处置
  7024. x-require-auth: true
  7025. x-resource-type:
  7026. $ref: '#/components/x-resource-types/message/code'
  7027. x-action:
  7028. $ref: '#/components/x-actions/pending/code'
  7029. x-version: v1
  7030. x-permission-visibility: catalog
  7031. requestBody:
  7032. required: true
  7033. description: JSON 请求体,业务字段置于 data
  7034. content:
  7035. application/json:
  7036. schema:
  7037. type: object
  7038. description: 统一信封请求体,业务字段放在 data 内
  7039. properties:
  7040. data:
  7041. type: object
  7042. description: 业务参数
  7043. properties:
  7044. page:
  7045. type: integer
  7046. description: 页码,从 1 起(越界收敛,不报错)
  7047. page_size:
  7048. type: integer
  7049. description: 每页条数,1–100,缺省 10
  7050. required:
  7051. - data
  7052. x-error-codes: [11104]
  7053. responses:
  7054. "200":
  7055. description: 成功。统一信封 code/message/data
  7056. /ticket/create@v1:
  7057. post:
  7058. summary: 新建工单
  7059. 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` 回填时写)。
  7060. operationId: ticket_create
  7061. tags:
  7062. - 工单与开停交付
  7063. x-require-auth: true
  7064. x-resource-type:
  7065. $ref: '#/components/x-resource-types/ticket/code'
  7066. x-action:
  7067. $ref: '#/components/x-actions/create/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. ticket_type:
  7084. type: string
  7085. description: 工单类型(6 个英文码之一:开户、服务开通、到期停机、服务停用、故障处理、售后处理)
  7086. customer_id:
  7087. type: string
  7088. description: 客户标识
  7089. title:
  7090. type: string
  7091. description: 工单标题
  7092. detail:
  7093. type: string
  7094. description: 工单详情(工单描述)
  7095. subscription_id:
  7096. type: string
  7097. description: 关联订阅标识;服务开通类可不关联。**`ticket_type=service_stop` 时必填**,且该订阅必须属于 `customer_id` 那个客户、服务未到期(工单§3.2.1)
  7098. confirm:
  7099. type: boolean
  7100. description: 提交时二次确认。客户两档发起 `fault`/`after_sale` 必须 `true`;运营发起 `service_stop` 必须 `true`(缺省或非 `true` 报 11103,工单§3.2.1/手册 P6)
  7101. materials:
  7102. type: array
  7103. description: 初始材料(建单即随附),最多 5 个;超限报 11103
  7104. items:
  7105. type: object
  7106. properties:
  7107. oss_key:
  7108. type: string
  7109. description: OSS 对象键
  7110. file_name:
  7111. type: string
  7112. description: 原始文件名
  7113. size_bytes:
  7114. type: integer
  7115. description: 文件字节数
  7116. required:
  7117. - ticket_type
  7118. - customer_id
  7119. - title
  7120. required:
  7121. - data
  7122. x-error-codes: [11103, 11104, 60001, 60108, 60804]
  7123. responses:
  7124. "200":
  7125. description: 成功。统一信封 code/message/data
  7126. /ticket/assign@v1:
  7127. post:
  7128. summary: 手动分派工单
  7129. description: 运维主管/组负责人在待分派队列指定处理人(TK-14)。目标处理人必须是在职人员∧本人团队∧持有该单类型;不改已完成/已办结单;不分给自己(自接单走创建即自assign 路径)。主要失败:11104、KLT-G20401、KLT-G20416、KLT-G20417。
  7130. operationId: ticket_assign
  7131. tags:
  7132. - 工单与开停交付
  7133. x-require-auth: true
  7134. x-resource-type:
  7135. $ref: '#/components/x-resource-types/ticket/code'
  7136. x-action:
  7137. $ref: '#/components/x-actions/assign/code'
  7138. x-version: v1
  7139. x-permission-visibility: catalog
  7140. requestBody:
  7141. required: true
  7142. description: JSON 请求体,业务字段置于 data
  7143. content:
  7144. application/json:
  7145. schema:
  7146. type: object
  7147. description: 统一信封请求体,业务字段放在 data 内
  7148. properties:
  7149. data:
  7150. type: object
  7151. description: 业务参数
  7152. properties:
  7153. ticket_id:
  7154. type: string
  7155. description: 工单标识(字符串下发,服务侧转 bigint)
  7156. assignee_user_id:
  7157. type: string
  7158. description: 目标责任人标识
  7159. required:
  7160. - ticket_id
  7161. - assignee_user_id
  7162. required:
  7163. - data
  7164. x-error-codes: [11103, 60401, 60402]
  7165. responses:
  7166. "200":
  7167. description: 成功。统一信封 code/message/data
  7168. /ticket/dispatch_auto@v1:
  7169. post:
  7170. summary: 自动分派(整批)
  7171. description: 对目标团队队列内可见的未分派单逐单按负载量最少判定:唯一最少⇒分派到人(assign_type=auto);并列最少/目标团队零人持有该类型⇒不分派,该单留队列并在结果里给出原因。不接受队列筛选条件入参。
  7172. operationId: ticket_dispatch_auto
  7173. tags:
  7174. - 工单与开停交付
  7175. x-require-auth: true
  7176. x-resource-type:
  7177. $ref: '#/components/x-resource-types/ticket/code'
  7178. x-action:
  7179. $ref: '#/components/x-actions/dispatch_auto/code'
  7180. x-version: v1
  7181. x-permission-visibility: catalog
  7182. requestBody:
  7183. required: true
  7184. description: JSON 请求体,业务字段置于 data
  7185. content:
  7186. application/json:
  7187. schema:
  7188. type: object
  7189. description: 统一信封请求体,业务字段放在 data 内
  7190. properties:
  7191. data:
  7192. type: object
  7193. description: 业务参数
  7194. properties:
  7195. team_id:
  7196. type: string
  7197. description: 目标运维团队;缺省=本人所辖团队
  7198. required:
  7199. - team_id
  7200. required:
  7201. - data
  7202. x-error-codes: [11103, 60402]
  7203. responses:
  7204. "200":
  7205. description: 成功。统一信封 code/message/data
  7206. /ticket/delegate@v1:
  7207. post:
  7208. summary: 交接转派
  7209. description: 人员交接时把名下未闭环工单批量改派给承接人;不得改派已完成单(TK-10)。承接人必须在职∧同团队∧持有对应工单类型;出参逐单结果,未成功单保持未分派并给原因。
  7210. operationId: ticket_delegate
  7211. tags:
  7212. - 工单与开停交付
  7213. x-require-auth: true
  7214. x-resource-type:
  7215. $ref: '#/components/x-resource-types/ticket/code'
  7216. x-action:
  7217. $ref: '#/components/x-actions/delegate/code'
  7218. x-version: v1
  7219. x-permission-visibility: catalog
  7220. requestBody:
  7221. required: true
  7222. description: JSON 请求体,业务字段置于 data
  7223. content:
  7224. application/json:
  7225. schema:
  7226. type: object
  7227. description: 统一信封请求体,业务字段放在 data 内
  7228. properties:
  7229. data:
  7230. type: object
  7231. description: 业务参数
  7232. properties:
  7233. ticket_id:
  7234. type: string
  7235. description: 被转派的工单标识
  7236. trustee_user_id:
  7237. type: string
  7238. description: 承接人标识
  7239. required:
  7240. - ticket_id
  7241. - trustee_user_id
  7242. required:
  7243. - data
  7244. x-error-codes: [60401, 60402, 60416]
  7245. responses:
  7246. "200":
  7247. description: 成功。统一信封 code/message/data
  7248. /ticket/start@v1:
  7249. post:
  7250. summary: 进入处理中(阅读推进)
  7251. description: 落库入口是工单详情读事件,不是人工按钮(U-39)。分支:待处理→处理中;处理中幂等成功;未分派不推进回成功;已完成/已办结报 KLT-G20401。
  7252. operationId: ticket_start
  7253. tags:
  7254. - 工单与开停交付
  7255. x-require-auth: true
  7256. x-resource-type:
  7257. $ref: '#/components/x-resource-types/ticket/code'
  7258. x-action:
  7259. $ref: '#/components/x-actions/start/code'
  7260. x-version: v1
  7261. x-permission-visibility: catalog
  7262. requestBody:
  7263. required: true
  7264. description: JSON 请求体,业务字段置于 data
  7265. content:
  7266. application/json:
  7267. schema:
  7268. type: object
  7269. description: 统一信封请求体,业务字段放在 data 内
  7270. properties:
  7271. data:
  7272. type: object
  7273. description: 业务参数
  7274. properties:
  7275. ticket_id:
  7276. type: string
  7277. description: 工单标识(字符串下发,服务侧转 bigint)
  7278. required:
  7279. - ticket_id
  7280. required:
  7281. - data
  7282. x-error-codes: [60401]
  7283. responses:
  7284. "200":
  7285. description: 成功。统一信封 code/message/data
  7286. /ticket/backfill@v1:
  7287. post:
  7288. summary: 回填竣工信息
  7289. description: >-
  7290. 开户/到期停机/服务停用/变更协议(`updown`)共用,按类型分叉必填矩阵(工单§5.1.1)。
  7291. 一次原子提交:回填头→明细→开停记录→分账号事实→客户状态+变更历史→订阅实际开通日→处理记录;
  7292. `updown` 另同批勾选清单(`check_item_ids`)写核对留痕。境外 IP 的 PIN/CPID 经 Keybox 加密入库,
  7293. 出参不出现明文。`pin_bind_mode`:`shared`(默认,PIN 挂 IP 行)/`per_account`(一账号一 PIN)。
  7294. 可选 `evidence_material_ids`(`kind=backfill_evidence`)。正式提交成功后删除该单草稿。
  7295. ✅ 2026-11-17:不再与合同/订阅交叉比对。主要失败:11103、KLT-G20404、KLT-G20417、11112。
  7296. operationId: ticket_backfill
  7297. tags:
  7298. - 工单与开停交付
  7299. x-require-auth: true
  7300. x-resource-type:
  7301. $ref: '#/components/x-resource-types/ticket/code'
  7302. x-action:
  7303. $ref: '#/components/x-actions/backfill/code'
  7304. x-version: v1
  7305. x-permission-visibility: catalog
  7306. requestBody:
  7307. required: true
  7308. description: JSON 请求体,业务字段置于 data
  7309. content:
  7310. application/json:
  7311. schema:
  7312. type: object
  7313. description: 统一信封请求体,业务字段放在 data 内
  7314. properties:
  7315. data:
  7316. type: object
  7317. description: 业务参数
  7318. properties:
  7319. ticket_id:
  7320. type: string
  7321. description: 工单标识(字符串下发,服务侧转 bigint)
  7322. exec_conclusion:
  7323. type: string
  7324. description: 执行结论:success/partial/fail;partial 存行不生效(工单§5.1.4)
  7325. conclusion_note:
  7326. type: string
  7327. description: 结论说明;非成功时必填(KLT-G20404)
  7328. actual_opened_date:
  7329. type: string
  7330. description: 实际开通日(YYYY-MM-DD,开户类三件套之一)
  7331. stop_done_date:
  7332. type: string
  7333. description: 停机完成日(YYYY-MM-DD,停机类三件套之一)
  7334. builder_user_id:
  7335. type: string
  7336. description: 施工人(可选)
  7337. evidence_text:
  7338. type: string
  7339. description: 凭证说明
  7340. pin_bind_mode:
  7341. type: string
  7342. description: PIN 绑定模式;缺省 shared
  7343. enum:
  7344. - shared
  7345. - per_account
  7346. route_rows:
  7347. type: array
  7348. description: 组一+组二回填行(按分账号一行;条数比对基准=勾选开账号数)
  7349. items:
  7350. type: object
  7351. properties:
  7352. sub_account_id:
  7353. type: string
  7354. description: 分账号标识;未传⇒视为漏填
  7355. network_account_name:
  7356. type: string
  7357. description: 网络账号名
  7358. intranet_ip:
  7359. type: string
  7360. description: 内网 IP
  7361. subnet_mask:
  7362. type: string
  7363. description: 子网掩码
  7364. gateway:
  7365. type: string
  7366. description: 网关
  7367. vlan:
  7368. type: string
  7369. description: VLAN
  7370. vni:
  7371. type: string
  7372. description: VNI
  7373. src_endpoint:
  7374. type: string
  7375. description: 源端
  7376. dst_endpoint:
  7377. type: string
  7378. description: 目的端
  7379. egress_pop:
  7380. type: string
  7381. description: 出口 POP
  7382. down_mbps:
  7383. type: number
  7384. description: 下行带宽 Mbps(信息项,不参与计价)
  7385. up_mbps:
  7386. type: number
  7387. description: 上行带宽 Mbps(信息项)
  7388. open_this_time:
  7389. type: boolean
  7390. description: 「随本次开通」勾选位,缺省=已勾选
  7391. ip_rows:
  7392. type: array
  7393. description: >-
  7394. 组三境外 IP 回填行。D-14:每行带 `action`(allocate/release)。
  7395. `per_account` 模式下每绑定账号独立 PIN(经 `sub_account_ids`)。
  7396. items:
  7397. type: object
  7398. properties:
  7399. action:
  7400. type: string
  7401. description: 行动作:allocate(缺省)/release;其它值 11103
  7402. enum:
  7403. - allocate
  7404. - release
  7405. egress:
  7406. type: string
  7407. description: 出口
  7408. overseas_ip:
  7409. type: string
  7410. description: 境外 IP 地址
  7411. ip_type:
  7412. type: string
  7413. description: IP 类型(fixed_ip/nat_forward)
  7414. bandwidth_mbps:
  7415. type: integer
  7416. description: 带宽档位 Mbps(信息项)
  7417. pin:
  7418. type: string
  7419. description: PIN(明文入参,服务端经 Keybox 加密入库,不明文落库)
  7420. cpid:
  7421. type: string
  7422. description: CPID(同上)
  7423. sub_account_ids:
  7424. type: array
  7425. description: 绑定分账号(per_account 时每账号须有独立 PIN)
  7426. items:
  7427. type: string
  7428. check_item_ids:
  7429. type: array
  7430. description: 变更协议(updown)同批勾选的服务项;其它类型忽略
  7431. items:
  7432. type: string
  7433. check_note:
  7434. type: string
  7435. description: 变更协议核对说明(可选)
  7436. evidence_material_ids:
  7437. type: array
  7438. description: 已登记的回填凭证材料 ID(kind=backfill_evidence)
  7439. items:
  7440. type: string
  7441. ext:
  7442. type: object
  7443. description: 扩展表单(可选);无已发布模板时忽略
  7444. properties:
  7445. template_id:
  7446. type: string
  7447. template_version:
  7448. type: integer
  7449. values:
  7450. type: object
  7451. additionalProperties: true
  7452. expected_version:
  7453. type: integer
  7454. description: 乐观并发基线(读详情时的 row_version);缺省=不做并发校验
  7455. required:
  7456. - ticket_id
  7457. required:
  7458. - data
  7459. x-error-codes: [11103, 60401, 60403, 60404, 60417]
  7460. responses:
  7461. "200":
  7462. description: 成功。统一信封 code/message/data
  7463. /ticket/backfill_draft@v1:
  7464. post:
  7465. summary: 暂存施工回填草稿
  7466. description: >-
  7467. 服务端暂存回填表单(方案 A)。鉴权同正式回填;⛔ 不调 open_stop_apply、⛔ 不改工单状态、
  7468. ⛔ 不递增 attempt_count。PIN/CPID 仅密文入库;读详情 `backfill_draft` 与本口应答均不回明文。
  7469. 正式 `backfill@v1` 成功后删除该单草稿。乐观锁用草稿自有 `row_version`(与正式回填锁分离)。
  7470. operationId: ticket_backfill_draft
  7471. tags:
  7472. - 工单与开停交付
  7473. x-require-auth: true
  7474. x-resource-type:
  7475. $ref: '#/components/x-resource-types/ticket/code'
  7476. x-action:
  7477. $ref: '#/components/x-actions/backfill_draft/code'
  7478. x-version: v1
  7479. x-permission-visibility: catalog
  7480. requestBody:
  7481. required: true
  7482. description: JSON 请求体,业务字段置于 data
  7483. content:
  7484. application/json:
  7485. schema:
  7486. type: object
  7487. description: 统一信封请求体,业务字段放在 data 内
  7488. properties:
  7489. data:
  7490. type: object
  7491. description: 业务参数(字段子集同 backfill,可缺省;中间态允许)
  7492. properties:
  7493. ticket_id:
  7494. type: string
  7495. description: 工单标识
  7496. exec_conclusion:
  7497. type: string
  7498. conclusion_note:
  7499. type: string
  7500. actual_opened_date:
  7501. type: string
  7502. stop_done_date:
  7503. type: string
  7504. evidence_text:
  7505. type: string
  7506. pin_bind_mode:
  7507. type: string
  7508. enum:
  7509. - shared
  7510. - per_account
  7511. route_rows:
  7512. type: array
  7513. items:
  7514. type: object
  7515. additionalProperties: true
  7516. ip_rows:
  7517. type: array
  7518. items:
  7519. type: object
  7520. additionalProperties: true
  7521. check_item_ids:
  7522. type: array
  7523. items:
  7524. type: string
  7525. check_note:
  7526. type: string
  7527. evidence_material_ids:
  7528. type: array
  7529. items:
  7530. type: string
  7531. ext:
  7532. type: object
  7533. additionalProperties: true
  7534. expected_version:
  7535. type: integer
  7536. description: 草稿 row_version;缺省=不做并发校验
  7537. required:
  7538. - ticket_id
  7539. required:
  7540. - data
  7541. x-error-codes: [11103, 60401, 60417]
  7542. responses:
  7543. "200":
  7544. description: 成功。统一信封 code/message/data(含草稿 row_version;不含 PIN/CPID 明文)
  7545. /ticket/check_done@v1:
  7546. post:
  7547. summary: 服务项完成直接闭环
  7548. description: >-
  7549. 服务开通/故障处理/售后处理勾选服务项并直接闭环;不关联客户/订阅、不回填、不生成回传。
  7550. ✅ 2026-11-22:`updown`(变更协议)⛔ 经本口——须走 `backfill@v1` 的「核对并回填」合并提交
  7551. (`check_item_ids`+回填同事务),单独核对会与回填双入口死锁。主要失败:KLT-G20404、KLT-G20417。
  7552. operationId: ticket_check_done
  7553. tags:
  7554. - 工单与开停交付
  7555. x-require-auth: true
  7556. x-resource-type:
  7557. $ref: '#/components/x-resource-types/ticket/code'
  7558. x-action:
  7559. $ref: '#/components/x-actions/check_done/code'
  7560. x-version: v1
  7561. x-permission-visibility: catalog
  7562. requestBody:
  7563. required: true
  7564. description: JSON 请求体,业务字段置于 data
  7565. content:
  7566. application/json:
  7567. schema:
  7568. type: object
  7569. description: 统一信封请求体,业务字段放在 data 内
  7570. properties:
  7571. data:
  7572. type: object
  7573. description: 业务参数
  7574. properties:
  7575. ticket_id:
  7576. type: string
  7577. description: 工单标识(字符串下发,服务侧转 bigint)
  7578. item_ids:
  7579. type: array
  7580. description: 本次勾选完成的服务项标识;不由服务端推导(U-15)
  7581. items:
  7582. type: string
  7583. note:
  7584. type: string
  7585. description: 说明(故障/售后必填;服务开通可不填)
  7586. expected_version:
  7587. type: integer
  7588. description: 乐观并发基线(读详情时的 row_version);缺省=不做并发校验
  7589. required:
  7590. - ticket_id
  7591. required:
  7592. - data
  7593. x-error-codes: [60401, 60404, 60417]
  7594. responses:
  7595. "200":
  7596. description: 成功。统一信封 code/message/data
  7597. /ticket/mark_done@v1:
  7598. post:
  7599. summary: 标记已处理(仅服务开通)
  7600. 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` 自动关闭)。
  7601. operationId: ticket_mark_done
  7602. tags:
  7603. - 工单与开停交付
  7604. x-require-auth: true
  7605. x-resource-type:
  7606. $ref: '#/components/x-resource-types/ticket/code'
  7607. x-action:
  7608. $ref: '#/components/x-actions/mark_done/code'
  7609. x-version: v1
  7610. x-permission-visibility: catalog
  7611. requestBody:
  7612. required: true
  7613. description: JSON 请求体,业务字段置于 data
  7614. content:
  7615. application/json:
  7616. schema:
  7617. type: object
  7618. description: 统一信封请求体,业务字段放在 data 内
  7619. properties:
  7620. data:
  7621. type: object
  7622. description: 业务参数
  7623. properties:
  7624. ticket_id:
  7625. type: string
  7626. description: 工单标识(字符串下发,服务侧转 bigint)
  7627. note:
  7628. type: string
  7629. description: 说明(必填,含未关联原因)
  7630. expected_version:
  7631. type: integer
  7632. description: 乐观并发基线(读详情时的 row_version);缺省=不做并发校验
  7633. required:
  7634. - ticket_id
  7635. - note
  7636. required:
  7637. - data
  7638. x-error-codes: [11103, 60401, 60417]
  7639. responses:
  7640. "200":
  7641. description: 成功。统一信封 code/message/data
  7642. /ticket/close@v1:
  7643. post:
  7644. summary: 关闭工单
  7645. description: 仅未分派/待处理可关闭。不得把处理中的单直接关闭(必须先撤回)。主要失败:KLT-G20401、KLT-G20417。
  7646. operationId: ticket_close
  7647. tags:
  7648. - 工单与开停交付
  7649. x-require-auth: true
  7650. x-resource-type:
  7651. $ref: '#/components/x-resource-types/ticket/code'
  7652. x-action:
  7653. $ref: '#/components/x-actions/close/code'
  7654. x-version: v1
  7655. x-permission-visibility: catalog
  7656. requestBody:
  7657. required: true
  7658. description: JSON 请求体,业务字段置于 data
  7659. content:
  7660. application/json:
  7661. schema:
  7662. type: object
  7663. description: 统一信封请求体,业务字段放在 data 内
  7664. properties:
  7665. data:
  7666. type: object
  7667. description: 业务参数
  7668. properties:
  7669. ticket_id:
  7670. type: string
  7671. description: 工单标识(字符串下发,服务侧转 bigint)
  7672. reason:
  7673. type: string
  7674. description: 关闭原因(必填)
  7675. expected_version:
  7676. type: integer
  7677. description: 乐观并发基线(读详情时的 row_version);缺省=不做并发校验
  7678. required:
  7679. - ticket_id
  7680. - reason
  7681. required:
  7682. - data
  7683. x-error-codes: [60401, 60409, 60413, 60417]
  7684. responses:
  7685. "200":
  7686. description: 成功。统一信封 code/message/data
  7687. /ticket/withdraw@v1:
  7688. post:
  7689. summary: 撤回工单
  7690. description: 撤回后状态回未分派、清空 assign_*、责任人写处理记录。不撤回已完成/已办结单。主要失败:KLT-G20401。
  7691. operationId: ticket_withdraw
  7692. tags:
  7693. - 工单与开停交付
  7694. x-require-auth: true
  7695. x-resource-type:
  7696. $ref: '#/components/x-resource-types/ticket/code'
  7697. x-action:
  7698. $ref: '#/components/x-actions/withdraw/code'
  7699. x-version: v1
  7700. x-permission-visibility: catalog
  7701. requestBody:
  7702. required: true
  7703. description: JSON 请求体,业务字段置于 data
  7704. content:
  7705. application/json:
  7706. schema:
  7707. type: object
  7708. description: 统一信封请求体,业务字段放在 data 内
  7709. properties:
  7710. data:
  7711. type: object
  7712. description: 业务参数
  7713. properties:
  7714. ticket_id:
  7715. type: string
  7716. description: 工单标识(字符串下发,服务侧转 bigint)
  7717. reason:
  7718. type: string
  7719. description: 撤回原因(必填)
  7720. required:
  7721. - ticket_id
  7722. - reason
  7723. required:
  7724. - data
  7725. x-error-codes: [60401, 60409, 60414]
  7726. responses:
  7727. "200":
  7728. description: 成功。统一信封 code/message/data
  7729. /ticket/confirm_close@v1:
  7730. post:
  7731. summary: 确认闭环
  7732. description: 闭环方式=回执类且已回传未回执时的人工兜底:待回执→已办结。不得在闭环方式=完成后即闭环下调用(KLT-G20415)。
  7733. operationId: ticket_confirm_close
  7734. tags:
  7735. - 工单与开停交付
  7736. x-require-auth: true
  7737. x-resource-type:
  7738. $ref: '#/components/x-resource-types/ticket/code'
  7739. x-action:
  7740. $ref: '#/components/x-actions/confirm_close/code'
  7741. x-version: v1
  7742. x-permission-visibility: catalog
  7743. requestBody:
  7744. required: true
  7745. description: JSON 请求体,业务字段置于 data
  7746. content:
  7747. application/json:
  7748. schema:
  7749. type: object
  7750. description: 统一信封请求体,业务字段放在 data 内
  7751. properties:
  7752. data:
  7753. type: object
  7754. description: 业务参数
  7755. properties:
  7756. ticket_id:
  7757. type: string
  7758. description: 工单标识(字符串下发,服务侧转 bigint)
  7759. expected_version:
  7760. type: integer
  7761. description: 乐观并发基线(读详情时的 row_version);缺省=不做并发校验
  7762. required:
  7763. - ticket_id
  7764. required:
  7765. - data
  7766. x-error-codes: [60401, 60414, 60417]
  7767. responses:
  7768. "200":
  7769. description: 成功。统一信封 code/message/data
  7770. /ticket/defer@v1:
  7771. post:
  7772. summary: 临时延期(延后提醒)
  7773. description: 两条分支:开停记录提醒(执行结论待处理)与在办未回填提醒(服务开通且未回填)。延期目标日由服务端固定为「今天+超期提醒天数」,不得入参传天数。注意:设计正文的「天数非法 11103」在本实现不存在(无天数入参)。主要失败:KLT-G20415。
  7774. operationId: ticket_defer
  7775. tags:
  7776. - 工单与开停交付
  7777. x-require-auth: true
  7778. x-resource-type:
  7779. $ref: '#/components/x-resource-types/ticket/code'
  7780. x-action:
  7781. $ref: '#/components/x-actions/defer/code'
  7782. x-version: v1
  7783. x-permission-visibility: catalog
  7784. requestBody:
  7785. required: true
  7786. description: JSON 请求体,业务字段置于 data
  7787. content:
  7788. application/json:
  7789. schema:
  7790. type: object
  7791. description: 统一信封请求体,业务字段放在 data 内
  7792. properties:
  7793. data:
  7794. type: object
  7795. description: 业务参数
  7796. properties:
  7797. ticket_id:
  7798. type: string
  7799. description: 工单标识(字符串下发,服务侧转 bigint)
  7800. defer_scope:
  7801. type: string
  7802. description: 延期对象:open_stop(开停记录提醒)/ticket(在办未回填提醒)
  7803. required:
  7804. - ticket_id
  7805. required:
  7806. - data
  7807. x-error-codes: [11103, 60401, 60415]
  7808. responses:
  7809. "200":
  7810. description: 成功。统一信封 code/message/data
  7811. /ticket/urge@v1:
  7812. post:
  7813. summary: 站内催办(向「卡在别人手里」的对家发催办信)
  7814. description: |
  7815. 工单停在 `completed` 等待对家确认时,向**对家账号**投递一封站内催办信(`bos_inbox_message.kind='ticket_urge'`)。
  7816. * 对家=主线五类取承接团队的团队主账号(无主账号回落总运营),故障/售后取提交方账号;续签单没有对家。
  7817. * 前置:`status=completed` ∧ 距 `completed_at` 满 24 小时 ∧ 对家≠本人;不满足 ⇒ `KLT-G20424`。
  7818. * 收件人、信体、业务日一律服务端取(不收 `to_user_id`/`biz_date`)——收件人可入参就等于开了任意发信通路。
  7819. * **一单一天一封**:同一业务日重复调用是**幂等成功**(`created=false`,`reason=already_sent_today`),
  7820. 由 `bos_inbox_message` 的 `n_recipient (kind, ref_id, user_id)` + `ON CONFLICT DO NOTHING` 兜并发。
  7821. * 只写审计(`action=urge`)、**不写处理记录**(工单§8.1:催办不进程客户可见的时间轴)。
  7822. operationId: ticket_urge
  7823. tags:
  7824. - 工单与开停交付
  7825. x-require-auth: true
  7826. x-resource-type:
  7827. $ref: '#/components/x-resource-types/ticket/code'
  7828. x-action:
  7829. $ref: '#/components/x-actions/urge/code'
  7830. x-version: v1
  7831. x-permission-visibility: catalog
  7832. requestBody:
  7833. required: true
  7834. description: JSON 请求体,业务字段置于 data
  7835. content:
  7836. application/json:
  7837. schema:
  7838. type: object
  7839. description: 统一信封请求体,业务字段放在 data 内
  7840. properties:
  7841. data:
  7842. type: object
  7843. description: 业务参数
  7844. properties:
  7845. ticket_id:
  7846. type: string
  7847. description: 工单标识(字符串下发,服务侧转 bigint)
  7848. required:
  7849. - ticket_id
  7850. required:
  7851. - data
  7852. x-error-codes: [11103, 11104, 60424]
  7853. responses:
  7854. "200":
  7855. description: 成功。统一信封 code/message/data
  7856. /ticket/revert@v1:
  7857. post:
  7858. summary: 退回重办
  7859. description: 把「已完成待确认(completed)/竣工驳回(rejected)」退回「处理中(processing)」,判权=总运营(全平台)或该单承接团队的主账号(仅本团队,2026-11-22 改判),原因必填并写审计。⛔ 已办结(settled)与已关闭(terminated)不可退回——终态只读,改历史走人工数据变更+审计(2026-11-18 定案)。只重开工单,不回滚服务开通状态、实际开通日与已生成的竣工记录(U-46)。主要失败:KLT-G20409、KLT-G20417、KLT-G20418、11104(非总运营且非本团队主)。
  7860. operationId: ticket_revert
  7861. tags:
  7862. - 工单与开停交付
  7863. x-require-auth: true
  7864. x-resource-type:
  7865. $ref: '#/components/x-resource-types/ticket/code'
  7866. x-action:
  7867. $ref: '#/components/x-actions/revert/code'
  7868. x-version: v1
  7869. x-permission-visibility: catalog
  7870. requestBody:
  7871. required: true
  7872. description: JSON 请求体,业务字段置于 data
  7873. content:
  7874. application/json:
  7875. schema:
  7876. type: object
  7877. description: 统一信封请求体,业务字段放在 data 内
  7878. properties:
  7879. data:
  7880. type: object
  7881. description: 业务参数
  7882. properties:
  7883. ticket_id:
  7884. type: string
  7885. description: 工单标识(字符串下发,服务侧转 bigint)
  7886. reason:
  7887. type: string
  7888. description: 退回原因(必填,写入审计)
  7889. expected_version:
  7890. type: integer
  7891. description: 乐观并发基线(读详情时的 row_version);缺省=不做并发校验
  7892. required:
  7893. - ticket_id
  7894. - reason
  7895. required:
  7896. - data
  7897. x-error-codes: [60409, 60417, 60418]
  7898. responses:
  7899. "200":
  7900. description: 成功。统一信封 code/message/data
  7901. /completion/generate@v1:
  7902. post:
  7903. summary: 生成竣工回传文件
  7904. description: 生成出参=文件元信息+可下载凭证;不同步返回文件字节流。回填未通过闸门(结论=成功∧明细齐∧比对通过)时不生成(KLT-G20401)。重复生成⇒作废旧版本、留最新并写处理记录。
  7905. operationId: completion_generate
  7906. tags:
  7907. - 竣工与回执
  7908. x-require-auth: true
  7909. x-resource-type:
  7910. $ref: '#/components/x-resource-types/completion/code'
  7911. x-action:
  7912. $ref: '#/components/x-actions/generate/code'
  7913. x-version: v1
  7914. x-permission-visibility: catalog
  7915. requestBody:
  7916. required: true
  7917. description: JSON 请求体,业务字段置于 data
  7918. content:
  7919. application/json:
  7920. schema:
  7921. type: object
  7922. description: 统一信封请求体,业务字段放在 data 内
  7923. properties:
  7924. data:
  7925. type: object
  7926. description: 业务参数
  7927. properties:
  7928. ticket_id:
  7929. type: string
  7930. description: 工单标识(字符串下发,服务侧转 bigint)
  7931. required:
  7932. - ticket_id
  7933. required:
  7934. - data
  7935. x-error-codes: [60401, 60404, 60410, 60417]
  7936. responses:
  7937. "200":
  7938. description: 成功。统一信封 code/message/data
  7939. /completion/receipt@v1:
  7940. post:
  7941. summary: 录入运营商回执
  7942. 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)。
  7943. operationId: completion_receipt
  7944. tags:
  7945. - 竣工与回执
  7946. x-require-auth: true
  7947. x-resource-type:
  7948. $ref: '#/components/x-resource-types/completion/code'
  7949. x-action:
  7950. $ref: '#/components/x-actions/receipt/code'
  7951. x-version: v1
  7952. x-permission-visibility: catalog
  7953. requestBody:
  7954. required: true
  7955. description: JSON 请求体,业务字段置于 data
  7956. content:
  7957. application/json:
  7958. schema:
  7959. type: object
  7960. description: 统一信封请求体,业务字段放在 data 内
  7961. properties:
  7962. data:
  7963. type: object
  7964. description: 业务参数
  7965. properties:
  7966. ticket_id:
  7967. type: string
  7968. description: 工单标识(字符串下发,服务侧转 bigint)
  7969. completion_no:
  7970. type: string
  7971. description: 竣工单号;缺省取该单当前有效回传版本
  7972. external_order_no:
  7973. type: string
  7974. description: 运营商单号
  7975. receipt_remark:
  7976. type: string
  7977. description: 回执说明
  7978. expect_version:
  7979. type: integer
  7980. description: 乐观并发基线(读取口回传的 row_version);缺省=不做并发校验
  7981. override_state_conflict:
  7982. type: boolean
  7983. description: 纠正窗口(设计方案§3.3):仅 admin、仅当该单处于竣工驳回态有效;以回执为准闭环,审计记「驳回态冲突纠正」并引用被推翻的驳回序号,不改写原驳回行。非驳回态提交本参数不产生任何效果。
  7984. required:
  7985. - ticket_id
  7986. required:
  7987. - data
  7988. x-error-codes: [60401, 60410, 60411, 60417, 60423]
  7989. responses:
  7990. "200":
  7991. description: 成功。统一信封 code/message/data
  7992. /completion/reject@v1:
  7993. post:
  7994. summary: 登记竣工驳回
  7995. 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。
  7996. operationId: completion_reject
  7997. tags:
  7998. - 竣工与回执
  7999. x-require-auth: true
  8000. x-resource-type:
  8001. $ref: '#/components/x-resource-types/completion/code'
  8002. x-action:
  8003. $ref: '#/components/x-actions/reject/code'
  8004. x-version: v1
  8005. x-permission-visibility: catalog
  8006. requestBody:
  8007. required: true
  8008. description: JSON 请求体,业务字段置于 data
  8009. content:
  8010. application/json:
  8011. schema:
  8012. type: object
  8013. description: 统一信封请求体,业务字段放在 data 内
  8014. properties:
  8015. data:
  8016. type: object
  8017. description: 业务参数
  8018. properties:
  8019. ticket_id:
  8020. type: string
  8021. description: 工单标识(字符串下发,服务侧转 bigint)
  8022. reason_codes:
  8023. type: array
  8024. description: 驳回原因码,1~3 个;「其他」不得与其它项混选;服务端按枚举定义序归一化后落库
  8025. items:
  8026. type: string
  8027. enum:
  8028. - doc_mismatch
  8029. - resource_unavailable
  8030. - duplicate
  8031. - out_of_scope
  8032. - doc_missing
  8033. - site_not_ready
  8034. - other
  8035. minItems: 1
  8036. maxItems: 3
  8037. reason_text:
  8038. type: string
  8039. description: 补充说明,5~500 字(按字符计)
  8040. completion_no:
  8041. type: string
  8042. description: 期望驳回的竣工单号;与当前最新一次回传不一致 ⇒ KLT-G20421(兜住拿旧快照点按钮)
  8043. external_reject_no:
  8044. type: string
  8045. description: 运营商内部编号;不在门户/合伙人回显
  8046. expect_version:
  8047. type: integer
  8048. description: 乐观并发基线(读取口回传的 row_version);缺省=不做并发校验
  8049. required:
  8050. - ticket_id
  8051. - reason_codes
  8052. - reason_text
  8053. required:
  8054. - data
  8055. x-error-codes: [60401, 60410, 60421, 60422, 60423, 60417]
  8056. responses:
  8057. "200":
  8058. description: 成功。统一信封 code/message/data
  8059. /message/attach@v1:
  8060. post:
  8061. summary: 挂接并生效
  8062. description: 人工侧只有「挂接并生效」一个动作(§5.6.4,A14 已关闭):一次原子提交⇒报文置已生效+工单侧生效链(与人工回填同一个函数)+回填头改写为报文内容+明细清空+处理记录【运营商反馈】前缀。不得人工指定生效日期(取报文实际日期)。报文动作与工单类型不符报 KLT-G20407(提示语逐字照抄§5.6.3)。主要失败:KLT-G20401、KLT-G20407、KLT-G20419、KLT-G20417。
  8063. operationId: message_attach
  8064. tags:
  8065. - 报文人工处置
  8066. x-require-auth: true
  8067. x-resource-type:
  8068. $ref: '#/components/x-resource-types/message/code'
  8069. x-action:
  8070. $ref: '#/components/x-actions/attach/code'
  8071. x-version: v1
  8072. x-permission-visibility: catalog
  8073. requestBody:
  8074. required: true
  8075. description: JSON 请求体,业务字段置于 data
  8076. content:
  8077. application/json:
  8078. schema:
  8079. type: object
  8080. description: 统一信封请求体,业务字段放在 data 内
  8081. properties:
  8082. data:
  8083. type: object
  8084. description: 业务参数
  8085. properties:
  8086. message_id:
  8087. type: string
  8088. description: 报文标识
  8089. ticket_id:
  8090. type: string
  8091. description: 拟挂接的工单标识
  8092. expect_version:
  8093. type: integer
  8094. description: 乐观并发基线(读取口回传的 row_version);缺省=不做并发校验
  8095. required:
  8096. - message_id
  8097. - ticket_id
  8098. required:
  8099. - data
  8100. x-error-codes: [11104, 60401, 60407, 60419]
  8101. responses:
  8102. "200":
  8103. description: 成功。统一信封 code/message/data
  8104. /message/void@v1:
  8105. post:
  8106. summary: 作废报文
  8107. description: 置已作废+原因必填(缺原因报 11103)。不删除 raw_payload(§5.6.5:作废后仍可读)。主要失败:KLT-G20419。
  8108. operationId: message_void
  8109. tags:
  8110. - 报文人工处置
  8111. x-require-auth: true
  8112. x-resource-type:
  8113. $ref: '#/components/x-resource-types/message/code'
  8114. x-action:
  8115. $ref: '#/components/x-actions/void/code'
  8116. x-version: v1
  8117. x-permission-visibility: catalog
  8118. requestBody:
  8119. required: true
  8120. description: JSON 请求体,业务字段置于 data
  8121. content:
  8122. application/json:
  8123. schema:
  8124. type: object
  8125. description: 统一信封请求体,业务字段放在 data 内
  8126. properties:
  8127. data:
  8128. type: object
  8129. description: 业务参数
  8130. properties:
  8131. message_id:
  8132. type: string
  8133. description: 报文标识
  8134. void_reason:
  8135. type: string
  8136. description: 作废原因(必填)
  8137. expect_version:
  8138. type: integer
  8139. description: 乐观并发基线(读取口回传的 row_version);缺省=不做并发校验
  8140. required:
  8141. - message_id
  8142. - void_reason
  8143. required:
  8144. - data
  8145. x-error-codes: [60412, 60419]
  8146. responses:
  8147. "200":
  8148. description: 成功。统一信封 code/message/data
  8149. /message/confirm_conflict@v1:
  8150. post:
  8151. summary: 冲突确认
  8152. description: 处置方式二选一:维持当前值(仅记录不生效)/采用外部值(触发与挂接相同的生效逻辑)。主要失败:KLT-G20419。
  8153. operationId: message_confirm_conflict
  8154. tags:
  8155. - 报文人工处置
  8156. x-require-auth: true
  8157. x-resource-type:
  8158. $ref: '#/components/x-resource-types/message/code'
  8159. x-action:
  8160. $ref: '#/components/x-actions/confirm_conflict/code'
  8161. x-version: v1
  8162. x-permission-visibility: catalog
  8163. requestBody:
  8164. required: true
  8165. description: JSON 请求体,业务字段置于 data
  8166. content:
  8167. application/json:
  8168. schema:
  8169. type: object
  8170. description: 统一信封请求体,业务字段放在 data 内
  8171. properties:
  8172. data:
  8173. type: object
  8174. description: 业务参数
  8175. properties:
  8176. message_id:
  8177. type: string
  8178. description: 报文标识
  8179. disposition:
  8180. type: string
  8181. description: 处置方式:as_is(维持当前值)/apply_external(采用外部值并生效);缺省 as_is
  8182. note:
  8183. type: string
  8184. description: 处置说明
  8185. expect_version:
  8186. type: integer
  8187. description: 乐观并发基线(读取口回传的 row_version);缺省=不做并发校验
  8188. required:
  8189. - message_id
  8190. required:
  8191. - data
  8192. x-error-codes: [60401, 60419]
  8193. responses:
  8194. "200":
  8195. description: 成功。统一信封 code/message/data
  8196. /message/rematch@v1:
  8197. post:
  8198. summary: 改挂归属工单
  8199. description: 改挂到另一张工单+写改挂审计;不触发生效(§5.6.4:生效仍走挂接口)。主要失败:KLT-G20407、KLT-G20419。
  8200. operationId: message_rematch
  8201. tags:
  8202. - 报文人工处置
  8203. x-require-auth: true
  8204. x-resource-type:
  8205. $ref: '#/components/x-resource-types/message/code'
  8206. x-action:
  8207. $ref: '#/components/x-actions/rematch/code'
  8208. x-version: v1
  8209. x-permission-visibility: catalog
  8210. requestBody:
  8211. required: true
  8212. description: JSON 请求体,业务字段置于 data
  8213. content:
  8214. application/json:
  8215. schema:
  8216. type: object
  8217. description: 统一信封请求体,业务字段放在 data 内
  8218. properties:
  8219. data:
  8220. type: object
  8221. description: 业务参数
  8222. properties:
  8223. message_id:
  8224. type: string
  8225. description: 报文标识
  8226. ticket_id:
  8227. type: string
  8228. description: 改挂目标工单标识
  8229. expect_version:
  8230. type: integer
  8231. description: 乐观并发基线(读取口回传的 row_version);缺省=不做并发校验
  8232. required:
  8233. - message_id
  8234. - ticket_id
  8235. required:
  8236. - data
  8237. x-error-codes: [60407, 60419]
  8238. responses:
  8239. "200":
  8240. description: 成功。统一信封 code/message/data
  8241. /ticket/material_grant@v1:
  8242. post:
  8243. summary: 材料上传/下载凭证
  8244. 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。
  8245. operationId: ticket_material_grant
  8246. tags:
  8247. - 工单与开停交付
  8248. x-require-auth: true
  8249. x-resource-type:
  8250. $ref: '#/components/x-resource-types/ticket/code'
  8251. x-action:
  8252. $ref: '#/components/x-actions/material_grant/code'
  8253. x-version: v1
  8254. x-permission-visibility: catalog
  8255. requestBody:
  8256. required: true
  8257. description: JSON 请求体,业务字段置于 data
  8258. content:
  8259. application/json:
  8260. schema:
  8261. type: object
  8262. description: 统一信封请求体,业务字段放在 data 内
  8263. properties:
  8264. data:
  8265. type: object
  8266. description: 业务参数
  8267. properties:
  8268. ticket_id:
  8269. type: string
  8270. description: 工单标识(字符串下发,服务侧转 bigint)
  8271. kind:
  8272. type: string
  8273. description: 材料类别:backfill_evidence(回填凭证)/handover(开通准备资料)/completion_pdf(竣工回传)/construct_material(补充过程材料)/submit_evidence(客户提交材料)。前两类中的回填凭证与竣工回传由服务端在业务事务内登记,不经 material_attach
  8274. file_name:
  8275. type: string
  8276. description: 原始文件名(purpose=upload 时必填)
  8277. purpose:
  8278. type: string
  8279. description: 用途:upload(上传,缺省)/download(下载)
  8280. material_id:
  8281. type: string
  8282. description: 材料主键(purpose=download 二选一,首选)。detail@v1 不下发对象键,列表页下载只能靠它
  8283. oss_key:
  8284. type: string
  8285. description: OSS 对象键(purpose=download 二选一,仅限刚由 material_attach 换回的同一次交互)
  8286. required:
  8287. - ticket_id
  8288. - kind
  8289. required:
  8290. - data
  8291. x-error-codes: [11103, 11104, 60401, 60804]
  8292. responses:
  8293. "200":
  8294. description: 成功。统一信封 code/message/data
  8295. /ticket/material_attach@v1:
  8296. post:
  8297. summary: 登记材料元信息
  8298. description: 登记文件名+大小+上传人+时间+可下载凭证。不把上传动作记进 ticket_process_log(D2)。数量上限:工单材料 5 份、故障处理材料 5 份(超限报 KLT-G20420)。主要失败:KLT-G20420、60056。
  8299. operationId: ticket_material_attach
  8300. tags:
  8301. - 工单与开停交付
  8302. x-require-auth: true
  8303. x-resource-type:
  8304. $ref: '#/components/x-resource-types/ticket/code'
  8305. x-action:
  8306. $ref: '#/components/x-actions/material_attach/code'
  8307. x-version: v1
  8308. x-permission-visibility: catalog
  8309. requestBody:
  8310. required: true
  8311. description: JSON 请求体,业务字段置于 data
  8312. content:
  8313. application/json:
  8314. schema:
  8315. type: object
  8316. description: 统一信封请求体,业务字段放在 data 内
  8317. properties:
  8318. data:
  8319. type: object
  8320. description: 业务参数
  8321. properties:
  8322. ticket_id:
  8323. type: string
  8324. description: 工单标识(字符串下发,服务侧转 bigint)
  8325. kind:
  8326. type: string
  8327. description: 材料类别前缀:attachment/opening/alteration/return/other
  8328. oss_key:
  8329. type: string
  8330. description: OSS 对象键
  8331. file_name:
  8332. type: string
  8333. description: 原始文件名
  8334. size_bytes:
  8335. type: integer
  8336. description: 文件字节数
  8337. required:
  8338. - ticket_id
  8339. - kind
  8340. - oss_key
  8341. required:
  8342. - data
  8343. x-error-codes: [11103, 11104, 60401]
  8344. responses:
  8345. "200":
  8346. description: 成功。统一信封 code/message/data
  8347. /ticket/config_get@v1:
  8348. get:
  8349. summary: 域配置查询(闭环方式)
  8350. description: 出参=闭环方式当前值+版本+更新人/更新时间+生效说明;不暴露超期天数等系统参数(U-19)。
  8351. operationId: ticket_config_get
  8352. tags:
  8353. - 工单与开停交付
  8354. x-require-auth: true
  8355. x-resource-type:
  8356. $ref: '#/components/x-resource-types/ticket/code'
  8357. x-action:
  8358. $ref: '#/components/x-actions/config_get/code'
  8359. x-version: v1
  8360. x-permission-visibility: catalog
  8361. x-error-codes: [11104]
  8362. responses:
  8363. "200":
  8364. description: 成功。统一信封 code/message/data
  8365. /ticket/config_update@v1:
  8366. post:
  8367. summary: 域配置修改(闭环方式)
  8368. description: 仅 admin;一次原子提交⇒配置更新+历史追加+审计;不改既有工单的闭环方式(工单§5.5.3)。主要失败:KLT-G20417。
  8369. operationId: ticket_config_update
  8370. tags:
  8371. - 工单与开停交付
  8372. x-require-auth: true
  8373. x-resource-type:
  8374. $ref: '#/components/x-resource-types/ticket/code'
  8375. x-action:
  8376. $ref: '#/components/x-actions/config_update/code'
  8377. x-version: v1
  8378. x-permission-visibility: catalog
  8379. requestBody:
  8380. required: true
  8381. description: JSON 请求体,业务字段置于 data
  8382. content:
  8383. application/json:
  8384. schema:
  8385. type: object
  8386. description: 统一信封请求体,业务字段放在 data 内
  8387. properties:
  8388. data:
  8389. type: object
  8390. description: 业务参数
  8391. properties:
  8392. closure_mode:
  8393. type: string
  8394. description: 闭环方式:receipt(回执闭环)/on_complete(完成后即闭环)
  8395. expect_version:
  8396. type: integer
  8397. description: 乐观并发基线(读取口回传的 row_version);缺省=不做并发校验
  8398. reason:
  8399. type: string
  8400. description: 变更原因
  8401. required:
  8402. - closure_mode
  8403. required:
  8404. - data
  8405. x-error-codes: [11103, 11104, 60001]
  8406. responses:
  8407. "200":
  8408. description: 成功。统一信封 code/message/data
  8409. /ticket/form_template_get@v1:
  8410. get:
  8411. summary: 施工回填扩展模板查询
  8412. description: 运营侧可读;可选 ticket_type。回当前 published、draft(若有)、版本列表。权限档对齐 config_get。
  8413. operationId: ticket_form_template_get
  8414. tags:
  8415. - 工单与开停交付
  8416. x-require-auth: true
  8417. x-resource-type:
  8418. $ref: '#/components/x-resource-types/ticket/code'
  8419. x-action:
  8420. $ref: '#/components/x-actions/config_get/code'
  8421. x-version: v1
  8422. x-permission-visibility: catalog
  8423. parameters:
  8424. - name: ticket_type
  8425. in: query
  8426. required: false
  8427. schema:
  8428. type: string
  8429. description: open/updown/expiry_stop/service_stop;缺省=四类全量
  8430. x-error-codes: [11103, 11104]
  8431. responses:
  8432. "200":
  8433. description: 成功。统一信封 code/message/data
  8434. /ticket/form_template_save@v1:
  8435. post:
  8436. summary: 施工回填扩展模板保存草稿
  8437. description: 仅 admin;每类型至多一个 draft;schema 非法 ⇒ KLT-G20425;并发 ⇒ KLT-S407。权限档对齐 config_update。
  8438. operationId: ticket_form_template_save
  8439. tags:
  8440. - 工单与开停交付
  8441. x-require-auth: true
  8442. x-resource-type:
  8443. $ref: '#/components/x-resource-types/ticket/code'
  8444. x-action:
  8445. $ref: '#/components/x-actions/config_update/code'
  8446. x-version: v1
  8447. x-permission-visibility: catalog
  8448. requestBody:
  8449. required: true
  8450. description: JSON 请求体,业务字段置于 data
  8451. content:
  8452. application/json:
  8453. schema:
  8454. type: object
  8455. properties:
  8456. data:
  8457. type: object
  8458. properties:
  8459. ticket_type:
  8460. type: string
  8461. schema:
  8462. type: object
  8463. expect_version:
  8464. type: integer
  8465. template_id:
  8466. type: string
  8467. required:
  8468. - ticket_type
  8469. - schema
  8470. required:
  8471. - data
  8472. x-error-codes: [11103, 11104, 60001, 60425]
  8473. responses:
  8474. "200":
  8475. description: 成功。统一信封 code/message/data
  8476. /ticket/form_template_publish@v1:
  8477. post:
  8478. summary: 施工回填扩展模板发布
  8479. description: 仅 admin;旧 published→retired;新增/改 required 须 ack_required_change;失败 KLT-G20425/KLT-S407。权限档对齐 config_update。
  8480. operationId: ticket_form_template_publish
  8481. tags:
  8482. - 工单与开停交付
  8483. x-require-auth: true
  8484. x-resource-type:
  8485. $ref: '#/components/x-resource-types/ticket/code'
  8486. x-action:
  8487. $ref: '#/components/x-actions/config_update/code'
  8488. x-version: v1
  8489. x-permission-visibility: catalog
  8490. requestBody:
  8491. required: true
  8492. description: JSON 请求体,业务字段置于 data
  8493. content:
  8494. application/json:
  8495. schema:
  8496. type: object
  8497. properties:
  8498. data:
  8499. type: object
  8500. properties:
  8501. ticket_type:
  8502. type: string
  8503. template_id:
  8504. type: string
  8505. expect_version:
  8506. type: integer
  8507. ack_required_change:
  8508. type: boolean
  8509. required:
  8510. - ticket_type
  8511. required:
  8512. - data
  8513. x-error-codes: [11103, 11104, 60001, 60425]
  8514. responses:
  8515. "200":
  8516. description: 成功。统一信封 code/message/data
  8517. /contract/renewal_config@v1:
  8518. post:
  8519. summary: 合同续签提醒配置查询
  8520. description: |
  8521. 续签提前天数(1..180,默认 7)与续签工单生成方式(manual 人工/auto 自动);运营侧三类身份可读。
  8522. 网关对 klt-bos 一律 POST(与其它合同口同形);响应含 notice_days/generate_mode/row_version。
  8523. operationId: contract_renewal_config
  8524. tags:
  8525. - 合同
  8526. x-require-auth: true
  8527. x-resource-type:
  8528. $ref: '#/components/x-resource-types/contract/code'
  8529. x-action:
  8530. $ref: '#/components/x-actions/renewal_config/code'
  8531. x-version: v1
  8532. x-permission-visibility: catalog
  8533. x-error-codes: [11104]
  8534. requestBody:
  8535. required: true
  8536. description: JSON 请求体,业务字段置于 data(本口无必填业务字段,传空对象即可)
  8537. content:
  8538. application/json:
  8539. schema:
  8540. type: object
  8541. properties:
  8542. data:
  8543. type: object
  8544. required:
  8545. - data
  8546. responses:
  8547. "200":
  8548. description: 成功。统一信封 code/message/data;data 含 notice_days、generate_mode、generate_mode_name、row_version、updated_at、updated_by
  8549. /contract/renewal_config_update@v1:
  8550. post:
  8551. summary: 合同续签提醒配置修改
  8552. description: 仅 admin;改提前天数与生成方式,写审计、即刻生效。同值不写库;并发版本不符回 KLT-S407。
  8553. operationId: contract_renewal_config_update
  8554. tags:
  8555. - 合同
  8556. x-require-auth: true
  8557. x-resource-type:
  8558. $ref: '#/components/x-resource-types/contract/code'
  8559. x-action:
  8560. $ref: '#/components/x-actions/renewal_config_update/code'
  8561. x-version: v1
  8562. x-permission-visibility: catalog
  8563. requestBody:
  8564. required: true
  8565. description: JSON 请求体,业务字段置于 data
  8566. content:
  8567. application/json:
  8568. schema:
  8569. type: object
  8570. properties:
  8571. data:
  8572. type: object
  8573. properties:
  8574. notice_days:
  8575. type: integer
  8576. description: 提前提醒天数(1..180,默认 7)
  8577. generate_mode:
  8578. type: string
  8579. description: 生成方式:manual(人工,先发站内提醒)/auto(自动生成续签工单)
  8580. enum: [manual, auto]
  8581. expect_version:
  8582. type: integer
  8583. description: 乐观并发基线(读取口回传的 row_version);缺省=不做并发校验
  8584. reason:
  8585. type: string
  8586. description: 变更原因
  8587. required:
  8588. - notice_days
  8589. - generate_mode
  8590. required:
  8591. - data
  8592. x-error-codes: [11103, 11104, 60001]
  8593. responses:
  8594. "200":
  8595. description: 成功。统一信封 code/message/data
  8596. /inbox/list@v1:
  8597. post:
  8598. summary: 本人站内提醒箱
  8599. description: 未读优先、按时间倒序分页;仅回当前账号本人的消息(来源不可越权)。
  8600. operationId: inbox_list
  8601. tags:
  8602. - 站内提醒箱
  8603. x-require-auth: true
  8604. x-resource-type:
  8605. $ref: '#/components/x-resource-types/inbox/code'
  8606. x-action:
  8607. $ref: '#/components/x-actions/list/code'
  8608. x-version: v1
  8609. x-permission-visibility: catalog
  8610. requestBody:
  8611. required: false
  8612. description: JSON 请求体,业务字段置于 data
  8613. content:
  8614. application/json:
  8615. schema:
  8616. type: object
  8617. properties:
  8618. data:
  8619. type: object
  8620. properties:
  8621. unread_only:
  8622. type: boolean
  8623. description: 只看未读
  8624. page:
  8625. type: integer
  8626. description: 页码(1 起)
  8627. page_size:
  8628. type: integer
  8629. description: 每页条数(1..100)
  8630. x-error-codes: [11104]
  8631. responses:
  8632. "200":
  8633. description: 成功。统一信封 code/message/data
  8634. /inbox/read@v1:
  8635. post:
  8636. summary: 标记站内提醒已读
  8637. description: 只能标记本人消息;已读时间只写首次。
  8638. operationId: inbox_read
  8639. tags:
  8640. - 站内提醒箱
  8641. x-require-auth: true
  8642. x-resource-type:
  8643. $ref: '#/components/x-resource-types/inbox/code'
  8644. x-action:
  8645. $ref: '#/components/x-actions/read/code'
  8646. x-version: v1
  8647. x-permission-visibility: catalog
  8648. requestBody:
  8649. required: true
  8650. description: JSON 请求体,业务字段置于 data
  8651. content:
  8652. application/json:
  8653. schema:
  8654. type: object
  8655. properties:
  8656. data:
  8657. type: object
  8658. properties:
  8659. message_id:
  8660. type: string
  8661. description: 消息 ID(数字串)
  8662. required:
  8663. - message_id
  8664. required:
  8665. - data
  8666. x-error-codes: [11103, 11104, 60401]
  8667. responses:
  8668. "200":
  8669. description: 成功。统一信封 code/message/data
  8670. /inbox/renewal_candidates@v1:
  8671. post:
  8672. summary: 续签工单可指派人员
  8673. description: 提醒所属客户当期运维团队内、可接 renewal 类型且负责范围覆盖该客户的成员。
  8674. operationId: inbox_renewal_candidates
  8675. tags:
  8676. - 站内提醒箱
  8677. x-require-auth: true
  8678. x-resource-type:
  8679. $ref: '#/components/x-resource-types/inbox/code'
  8680. x-action:
  8681. $ref: '#/components/x-actions/renewal_candidates/code'
  8682. x-version: v1
  8683. x-permission-visibility: catalog
  8684. requestBody:
  8685. required: true
  8686. description: JSON 请求体,业务字段置于 data
  8687. content:
  8688. application/json:
  8689. schema:
  8690. type: object
  8691. properties:
  8692. data:
  8693. type: object
  8694. properties:
  8695. message_id:
  8696. type: string
  8697. description: 消息 ID(数字串)
  8698. required:
  8699. - message_id
  8700. required:
  8701. - data
  8702. x-error-codes: [11103, 11104, 60401]
  8703. responses:
  8704. "200":
  8705. description: 成功。统一信封 code/message/data
  8706. /inbox/renewal_ticket@v1:
  8707. post:
  8708. summary: 读信人生成续签工单并指派
  8709. description: 从站内续签提醒一键生成 renewal 工单并分派;同一合同只出一张(已有则复用并改派),生成后同合同提醒全部置为已处理。
  8710. operationId: inbox_renewal_ticket
  8711. tags:
  8712. - 站内提醒箱
  8713. x-require-auth: true
  8714. x-resource-type:
  8715. $ref: '#/components/x-resource-types/inbox/code'
  8716. x-action:
  8717. $ref: '#/components/x-actions/renewal_ticket/code'
  8718. x-version: v1
  8719. x-permission-visibility: catalog
  8720. requestBody:
  8721. required: true
  8722. description: JSON 请求体,业务字段置于 data
  8723. content:
  8724. application/json:
  8725. schema:
  8726. type: object
  8727. properties:
  8728. data:
  8729. type: object
  8730. properties:
  8731. message_id:
  8732. type: string
  8733. description: 提醒消息 ID(数字串)
  8734. assignee_user_id:
  8735. type: string
  8736. description: 承接续签工单的运营人员账号 ID(须在客户当期团队、可接 renewal、负责范围覆盖客户)
  8737. required:
  8738. - message_id
  8739. - assignee_user_id
  8740. required:
  8741. - data
  8742. x-error-codes: [11103, 11104, 60001, 60401]
  8743. responses:
  8744. "200":
  8745. description: 成功。统一信封 code/message/data
  8746. components:
  8747. x-resource-types:
  8748. health:
  8749. code: 'bos.health'
  8750. ping:
  8751. code: 'bos.ping'
  8752. auth:
  8753. code: 'bos.auth'
  8754. region:
  8755. code: 'bos.region'
  8756. account:
  8757. code: 'bos.account'
  8758. ent_team:
  8759. code: 'bos.ent_team'
  8760. ops_team:
  8761. code: 'bos.ops_team'
  8762. audit:
  8763. code: 'bos.audit'
  8764. activation:
  8765. code: 'bos.activation'
  8766. operator:
  8767. code: 'bos.operator'
  8768. operator_recon_account:
  8769. code: 'bos.operator.recon_account'
  8770. partner:
  8771. code: 'bos.partner'
  8772. partner_scope:
  8773. code: 'bos.partner.scope'
  8774. ent_team_scope:
  8775. code: 'bos.ent_team.scope'
  8776. ops_team_scope:
  8777. code: 'bos.ops_team.scope'
  8778. ops_member_scope:
  8779. code: 'bos.ops_member.scope'
  8780. ops_team_dispatch_mode:
  8781. code: 'bos.ops_team.dispatch_mode'
  8782. ops_team_coverage:
  8783. code: 'bos.ops_team.coverage'
  8784. customer:
  8785. code: 'bos.customer'
  8786. customer_attribution:
  8787. code: 'bos.customer.attribution'
  8788. import_batch:
  8789. code: 'bos.import_batch'
  8790. sub_account:
  8791. code: 'bos.sub_account'
  8792. delivery:
  8793. code: 'bos.delivery'
  8794. catalog:
  8795. code: 'bos.catalog'
  8796. plan_cost_item:
  8797. code: 'bos.plan_cost_item'
  8798. contract:
  8799. code: 'bos.contract'
  8800. contract_attachment:
  8801. code: 'bos.contract_attachment'
  8802. subscription:
  8803. code: 'bos.subscription'
  8804. cost_item:
  8805. code: 'bos.cost_item'
  8806. cost_amount:
  8807. code: 'bos.cost_amount'
  8808. share_rule:
  8809. code: 'bos.share_rule'
  8810. opsview:
  8811. code: 'bos.opsview'
  8812. jobs:
  8813. code: 'bos.jobs'
  8814. billing_config:
  8815. code: 'bos.billing_config'
  8816. recon:
  8817. code: 'bos.recon'
  8818. bill:
  8819. code: 'bos.bill'
  8820. correction:
  8821. code: 'bos.correction'
  8822. ticket:
  8823. code: 'bos.ticket'
  8824. completion:
  8825. code: 'bos.completion'
  8826. message:
  8827. code: 'bos.message'
  8828. inbox:
  8829. code: 'bos.inbox'
  8830. view:
  8831. code: 'bos.view'
  8832. portal:
  8833. code: 'bos.portal'
  8834. x-actions:
  8835. view:
  8836. code: 'view'
  8837. create:
  8838. code: 'create'
  8839. update:
  8840. code: 'update'
  8841. delete:
  8842. code: 'delete'
  8843. list:
  8844. code: 'list'
  8845. manage:
  8846. code: 'manage'
  8847. export:
  8848. code: 'export'
  8849. detail:
  8850. code: 'detail'
  8851. pending_queue:
  8852. code: 'pending_queue'
  8853. todo_counts:
  8854. code: 'todo_counts'
  8855. trace:
  8856. code: 'trace'
  8857. pending:
  8858. code: 'pending'
  8859. assign:
  8860. code: 'assign'
  8861. dispatch_auto:
  8862. code: 'dispatch_auto'
  8863. delegate:
  8864. code: 'delegate'
  8865. start:
  8866. code: 'start'
  8867. backfill:
  8868. code: 'backfill'
  8869. backfill_draft:
  8870. code: 'backfill_draft'
  8871. check_done:
  8872. code: 'check_done'
  8873. mark_done:
  8874. code: 'mark_done'
  8875. close:
  8876. code: 'close'
  8877. withdraw:
  8878. code: 'withdraw'
  8879. confirm_close:
  8880. code: 'confirm_close'
  8881. defer:
  8882. code: 'defer'
  8883. revert:
  8884. code: 'revert'
  8885. generate:
  8886. code: 'generate'
  8887. receipt:
  8888. code: 'receipt'
  8889. reject:
  8890. code: 'reject'
  8891. attach:
  8892. code: 'attach'
  8893. void:
  8894. code: 'void'
  8895. confirm_conflict:
  8896. code: 'confirm_conflict'
  8897. rematch:
  8898. code: 'rematch'
  8899. urge:
  8900. code: 'urge'
  8901. material_grant:
  8902. code: 'material_grant'
  8903. material_attach:
  8904. code: 'material_attach'
  8905. config_get:
  8906. code: 'config_get'
  8907. config_update:
  8908. code: 'config_update'
  8909. form_template_get:
  8910. code: 'form_template_get'
  8911. form_template_save:
  8912. code: 'form_template_save'
  8913. form_template_publish:
  8914. code: 'form_template_publish'
  8915. renewal_config:
  8916. code: 'renewal_config'
  8917. renewal_config_update:
  8918. code: 'renewal_config_update'
  8919. read:
  8920. code: 'read'
  8921. renewal_candidates:
  8922. code: 'renewal_candidates'
  8923. renewal_ticket:
  8924. code: 'renewal_ticket'
  8925. partner_recon:
  8926. code: 'partner_recon'
  8927. plan_board:
  8928. code: 'plan_board'
  8929. schemas:
  8930. PortalPlanBoardRow:
  8931. type: object
  8932. description: |
  8933. 门户 4 两表的一行(§4.3 七列)。⛔ 金额账目列(已出账/累计成本/分成)、
  8934. ⛔ 工单、⛔ 操作位(第 9 册 §4.6)。
  8935. properties:
  8936. subscription_id:
  8937. type: string
  8938. description: 订阅 ID(详情入口预留)
  8939. plan_name:
  8940. type: string
  8941. description: 列 1 上行=档位名(订阅快照列,⛔ 现取档位表)
  8942. contract_id:
  8943. type: string
  8944. nullable: true
  8945. contract_no:
  8946. type: string
  8947. nullable: true
  8948. description: 列 1 下行=合同编号;合同缺失 ⇒「—」
  8949. contract_amount_cents:
  8950. type: integer
  8951. nullable: true
  8952. description: 列 3=合同总额(分),来源 contract.amount_cents;缺失 ⇒「—」(⛔ 回落订阅价)
  8953. sub_mode:
  8954. type: string
  8955. nullable: true
  8956. description: 列 4=冻结方式原码(upgrade/stackable/customized)
  8957. line_exits:
  8958. type: array
  8959. nullable: true
  8960. description: 列 5=随合同冻结的线路出口集合;空集 ⇒「—」
  8961. items:
  8962. type: string
  8963. start_date:
  8964. type: string
  8965. nullable: true
  8966. description: 列 6 起
  8967. end_date:
  8968. type: string
  8969. nullable: true
  8970. description: 列 6 止
  8971. status:
  8972. type: object
  8973. description: 列 7=读侧三态结论
  8974. properties:
  8975. key:
  8976. type: string
  8977. enum: [active, pending, expired, cancelled, replaced]
  8978. label:
  8979. type: string
  8980. required:
  8981. - subscription_id
  8982. - plan_name
  8983. - status
  8984. ApiEnvelope:
  8985. type: object
  8986. description: 统一响应信封
  8987. properties:
  8988. code:
  8989. type: integer
  8990. description: 业务/协议码,0 表示成功
  8991. message:
  8992. type: string
  8993. description: 提示信息
  8994. error_code:
  8995. type: string
  8996. description: 稳定错误码(失败时)
  8997. data:
  8998. description: 业务数据载荷
  8999. required:
  9000. - code
  9001. - message
  9002. PageQuery:
  9003. type: object
  9004. description: 分页查询(0 基)
  9005. properties:
  9006. page:
  9007. type: integer
  9008. description: 页码(0 基索引,默认 0)
  9009. minimum: 0
  9010. default: 0
  9011. page_size:
  9012. type: integer
  9013. description: 每页条数(默认 20,上限 200)
  9014. minimum: 1
  9015. maximum: 200
  9016. default: 20
  9017. keyword:
  9018. type: string
  9019. description: 关键字筛选(可选)