openapi.yaml 362 KB

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