openapi.yaml 360 KB

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