openapi.yaml 362 KB

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