openapi.yaml 371 KB

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