openapi.yaml 320 KB

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