openapi.yaml 221 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628
  1. openapi: 3.0.0
  2. info:
  3. title: klt-bos
  4. version: 0.1.0
  5. description: |
  6. 恪澜通运营支撑扩展微服务(klt-bos)。
  7. 统一请求信封:`{ "data": { … } }`;统一响应信封:`{ code, message, error_code?, data }`。
  8. 业务错误码段 60000–60999(注意:2026-11-07 平台新口径:`60000` 以前平台已保留 ⇒
  9. 原 20000–20999 **整体 +40000 平移**,块结构与段内顺位不变;这是第二次对外契约破坏性平移)。
  10. 本服务**产出**的数字码落在该段内;唯一在册例外=**鉴权失败类透传平台原码**:
  11. 未认证 `11000`、无权限 `11001`(业主 2026-11-07 裁定=不收段,含平台 SDK 鉴权闸门
  12. 在本进程内产出的响应,业务侧不得改写)。其余平台通用码(11100/11103/11104/10110)
  13. 仍由 `S` 段自造码承接,平台原码在 `message` 原文保留。
  14. 通用块 60000–60049(`S` 段):`KLT-S407`/60001 通用冲突、`KLT-S20002`/11000 未认证(透传)、
  15. `KLT-S20003`/11001 无权限(透传)、`KLT-S20004`/60004 参数缺失或格式错误、`KLT-S20005`/60005 对象不存在、
  16. `KLT-S20006`/60006 下游依赖失败、`KLT-S20007`/60007 内部错误、`KLT-S20008`/60008 功能未实现;
  17. 注意:`KLT-*` 字符串不随段位改名(对外稳定契约)⇒ 字符串内嵌数字与 `code` 已脱钩。
  18. 成功码沿用平台统一值 10000。调用方断言**只绑** `error_code`(`KLT-*`),不绑数字顺位。
  19. 经网关对外前缀:`/api/klt/klt-bos/{resource}/{action}@v1`(本文件路径不含 namespace 前缀;
  20. 前缀口径=注册中心 `services/registry.rs:707` `format!("/api/{namespace}/{service_name}{path}")`,
  21. ⇒ namespace=`klt` + service_name=`klt-bos`。注意:此前写成的 `/api/klt/bos/` 系**前缀漂移**,
  22. 若本服务以 `prefix_mode=strip_prefix` 注册会被剥掉一段而全链路 404(平台 v1.5 件 §2.4)。)
  23. 分页约定:请求页码 0 基;呈现时再转为 1 基。
  24. x-error-code-range:
  25. start: 60000
  26. end: 60999
  27. servers:
  28. - url: /
  29. tags:
  30. - name: 系统健康
  31. description: 服务存活与状态探测,不含业务写操作。
  32. - name: 认证与激活
  33. description: 当前登录上下文查询;免登录的激活码校验与密码设置。
  34. - name: 区域管理
  35. description: 区域树节点新建、改名、删除与可见范围查询。
  36. - name: 账号管理
  37. description: 账号开通、状态、激活码、改密与客户分账号。
  38. - name: 运营商
  39. description: 运营商建档与对账账号。
  40. - name: 合伙人
  41. description: 合伙人建档、负责范围读写。
  42. - name: 运营团队
  43. description: 运营团队(ent_team)档案、成员与负责范围。
  44. - name: 运维团队与成员
  45. description: 运维团队建档、成员、分派方式、覆盖客户与成员范围。
  46. - name: 客户管理
  47. description: 客户建档、改挂区域、归属变更与变更历史。
  48. - name: 批量导入
  49. description: 客户批量导入模板、提交、批次、续传与导出。
  50. - name: 套餐档位
  51. description: 固定/自定义套餐档位维护。
  52. - name: 合同
  53. description: 合同新建、编辑与查询(含服务条目与 IP 条件)。
  54. - name: 订阅
  55. description: 订阅开通、升降配、叠加与查询。
  56. - name: 成本与分成
  57. description: 成本项定义、成本金额与分成规则。
  58. - name: 运维视图
  59. description: 运维侧只读首页概览。
  60. - name: 定时作业
  61. description: 已注册作业清单、启停、执行记录与补跑。
  62. paths:
  63. /health:
  64. get:
  65. summary: 健康检查
  66. description: 服务存活探测,无需登录。
  67. operationId: health
  68. tags:
  69. - 系统健康
  70. x-require-auth: false
  71. x-resource-type: bos.health
  72. x-action: view
  73. x-version: v1
  74. x-permission-visibility: catalog
  75. responses:
  76. "200":
  77. description: 成功。统一信封 code/message/data
  78. /health@v1:
  79. get:
  80. summary: 健康检查(v1)
  81. description: 服务存活探测,无需登录。
  82. operationId: health_v1
  83. tags:
  84. - 系统健康
  85. x-require-auth: false
  86. x-resource-type: bos.health
  87. x-action: view
  88. x-version: v1
  89. x-permission-visibility: catalog
  90. responses:
  91. "200":
  92. description: 成功。统一信封 code/message/data
  93. /ping@v1:
  94. get:
  95. summary: 存活探测
  96. description: 需登录的轻量探测,返回服务状态与绑定信息。
  97. operationId: ping
  98. tags:
  99. - 系统健康
  100. x-require-auth: true
  101. x-resource-type: bos.ping
  102. x-action: view
  103. x-version: v1
  104. x-permission-visibility: catalog
  105. responses:
  106. "200":
  107. description: 成功。统一信封 code/message/data
  108. /auth/context@v1:
  109. get:
  110. summary: 当前登录上下文
  111. description: 返回当前登录身份、业务角色、主体类型/ID、可见形态等;首次业务请求在此完成未激活/已过期拦截。
  112. operationId: auth_context
  113. tags:
  114. - 认证与激活
  115. x-require-auth: true
  116. x-resource-type: bos.auth
  117. x-action: view
  118. x-version: v1
  119. x-permission-visibility: catalog
  120. responses:
  121. "200":
  122. description: 成功。统一信封 code/message/data
  123. /region/create@v1:
  124. post:
  125. summary: 新建区域节点
  126. description: 在区域树下新建省/市/区县节点。admin 任意层级;区域运营主/子账号仅限本团队负责范围内已有省份下建市/区县。
  127. operationId: region_create
  128. tags:
  129. - 区域管理
  130. x-require-auth: true
  131. x-resource-type: bos.region
  132. x-action: create
  133. x-version: v1
  134. x-permission-visibility: catalog
  135. requestBody:
  136. required: true
  137. description: JSON 请求体,业务字段置于 data
  138. content:
  139. application/json:
  140. schema:
  141. type: object
  142. description: 统一信封请求体,业务字段放在 data 内
  143. properties:
  144. data:
  145. type: object
  146. description: 新建区域参数
  147. properties:
  148. parent_node_id:
  149. type: string
  150. description: 父节点 ID;根下建省时可空
  151. node_name:
  152. type: string
  153. description: 本级区域名称
  154. level:
  155. type: string
  156. description: 层级提示(省/市/区县等,业务侧自持,可选)
  157. required:
  158. - node_name
  159. required:
  160. - data
  161. responses:
  162. "200":
  163. description: 成功。统一信封 code/message/data
  164. /region/rename@v1:
  165. post:
  166. summary: 重命名区域节点
  167. description: 仅修改节点名称 node_name,不改层级与父子关系。
  168. operationId: region_rename
  169. tags:
  170. - 区域管理
  171. x-require-auth: true
  172. x-resource-type: bos.region
  173. x-action: update
  174. x-version: v1
  175. x-permission-visibility: catalog
  176. requestBody:
  177. required: true
  178. description: JSON 请求体,业务字段置于 data
  179. content:
  180. application/json:
  181. schema:
  182. type: object
  183. description: 统一信封请求体,业务字段放在 data 内
  184. properties:
  185. data:
  186. type: object
  187. description: 业务参数
  188. properties:
  189. node_id:
  190. type: string
  191. description: 区域节点 ID
  192. node_name:
  193. type: string
  194. description: 新名称
  195. required:
  196. - node_id
  197. - node_name
  198. required:
  199. - data
  200. responses:
  201. "200":
  202. description: 成功。统一信封 code/message/data
  203. /region/delete@v1:
  204. post:
  205. summary: 删除区域节点
  206. description: 仅 admin。须提交 confirm_name(与当前区域名逐字一致)并通过三重守卫(无下级/无挂载客户/无引用)。
  207. operationId: region_delete
  208. tags:
  209. - 区域管理
  210. x-require-auth: true
  211. x-resource-type: bos.region
  212. x-action: delete
  213. x-version: v1
  214. x-permission-visibility: catalog
  215. requestBody:
  216. required: true
  217. description: JSON 请求体,业务字段置于 data
  218. content:
  219. application/json:
  220. schema:
  221. type: object
  222. description: 统一信封请求体,业务字段放在 data 内
  223. properties:
  224. data:
  225. type: object
  226. description: 业务参数
  227. properties:
  228. node_id:
  229. type: string
  230. description: 待删除区域节点 ID
  231. confirm_name:
  232. type: string
  233. description: 确认名称,须与当前区域名逐字一致
  234. required:
  235. - node_id
  236. - confirm_name
  237. required:
  238. - data
  239. responses:
  240. "200":
  241. description: 成功。统一信封 code/message/data
  242. /region/tree@v1:
  243. post:
  244. summary: 查询可见区域树
  245. description: 按操作人可见范围返回区域节点集合/树;运营主/子账号只见本范围及下级。注意:2026-11-08 由 GET 改 POST(R-5:GET 无请求体,网关无法注入授权上界)。
  246. operationId: region_tree
  247. tags:
  248. - 区域管理
  249. x-require-auth: true
  250. x-resource-type: bos.region
  251. x-action: view
  252. x-version: v1
  253. x-permission-visibility: catalog
  254. x-enumeration-kind: tree
  255. requestBody:
  256. required: true
  257. description: 统一信封请求体(无业务参数,data 传空对象以使网关注入授权上界)
  258. content:
  259. application/json:
  260. schema:
  261. type: object
  262. properties:
  263. data:
  264. type: object
  265. description: 无业务参数
  266. required:
  267. - data
  268. responses:
  269. "200":
  270. description: 成功。统一信封 code/message/data
  271. /region/subtree@v1:
  272. post:
  273. summary: 查询区域子树
  274. description: 挂载弹窗左树、区域钻取共用;按可见范围裁剪。
  275. operationId: region_subtree
  276. tags:
  277. - 区域管理
  278. x-require-auth: true
  279. x-resource-type: bos.region
  280. x-action: view
  281. x-version: v1
  282. x-permission-visibility: catalog
  283. requestBody:
  284. required: true
  285. description: JSON 请求体,业务字段置于 data
  286. content:
  287. application/json:
  288. schema:
  289. type: object
  290. description: 统一信封请求体,业务字段放在 data 内
  291. properties:
  292. data:
  293. type: object
  294. description: 子树查询参数
  295. properties:
  296. node_id:
  297. type: string
  298. description: 根节点 ID(可选;空则按可见根展开)
  299. required:
  300. - data
  301. responses:
  302. "200":
  303. description: 成功。统一信封 code/message/data
  304. /region/change_log@v1:
  305. get:
  306. summary: 区域变更流水
  307. description: 仅 admin 可见;运营子账号可见节点但不可见变更流水。
  308. operationId: region_change_log
  309. tags:
  310. - 区域管理
  311. x-require-auth: true
  312. x-resource-type: bos.region
  313. x-action: view
  314. x-version: v1
  315. x-permission-visibility: catalog
  316. responses:
  317. "200":
  318. description: 成功。统一信封 code/message/data
  319. /region/orphans@v1:
  320. post:
  321. summary: 悬空区域节点
  322. description: 查询悬空/孤儿节点;按节点所在区域分派可见性,admin 全量。注意:2026-11-08 由 GET 改 POST(R-5)。
  323. operationId: region_orphans
  324. tags:
  325. - 区域管理
  326. x-require-auth: true
  327. x-resource-type: bos.region
  328. x-action: view
  329. x-version: v1
  330. x-permission-visibility: catalog
  331. x-enumeration-kind: tree
  332. requestBody:
  333. required: true
  334. description: 统一信封请求体(无业务参数,data 传空对象以使网关注入授权上界)
  335. content:
  336. application/json:
  337. schema:
  338. type: object
  339. properties:
  340. data:
  341. type: object
  342. description: 无业务参数
  343. required:
  344. - data
  345. responses:
  346. "200":
  347. description: 成功。统一信封 code/message/data
  348. /account/get_list@v1:
  349. post:
  350. summary: 成员账号列表
  351. description: 列登录名/手机号(掩码)/角色/主体/主-子账号标记/启停状态,并下发激活码生命周期(交付、激活、设密时间与有效截止日)。`status`=账号启停(`bos_user_binding.status`),`activation_status`=激活态(`bos_account_ext.status`),两者正交。运维侧全量,团队侧限本团队成员。注意:「姓名」列无数据源(`bos_user_binding` 无该列),见总则§18.3。
  352. operationId: account_get_list
  353. tags:
  354. - 账号管理
  355. x-require-auth: true
  356. x-resource-type: bos.account
  357. x-action: list
  358. x-version: v1
  359. x-permission-visibility: catalog
  360. requestBody:
  361. required: false
  362. description: 分页与过滤(page/page_size/keyword/role_code/subject_type/subject_id/status/activation_status),业务字段置于 data
  363. content:
  364. application/json:
  365. schema:
  366. type: object
  367. responses:
  368. "200":
  369. description: 成功。统一信封 code/message/data
  370. /ent_team/get_list@v1:
  371. post:
  372. summary: 运营团队列表
  373. description: 一条团队带负责人登录名、备注、成员数与成员明细(`members[]`,含 `name`/`display_name`/`username` 与账号启停 `binding_status`;主/子账号一并下发);仅 admin/opsMain/opsSub。注意:出参不含 `settle_mode`/`settle_value`——分成方是封闭的三类(运营商/合伙人/运维团队,第 4 册§5.1/§5.2),运营团队不是分成方(2026-11-08 业主定案,总则§18.3 `PG-7` 路线 A=原型回改删两列)。
  374. operationId: ent_team_get_list
  375. tags:
  376. - 运营团队
  377. x-require-auth: true
  378. x-resource-type: bos.ent_team
  379. x-action: list
  380. x-version: v1
  381. x-permission-visibility: catalog
  382. requestBody:
  383. required: false
  384. description: 分页与过滤(page/page_size/keyword),业务字段置于 data。keyword=「按名称 / 备注」模糊匹配(`team_name_norm LIKE %q%` **OR** `remark LIKE %q%`,第 1 册 05 册§5.4 OR-09)
  385. content:
  386. application/json:
  387. schema:
  388. type: object
  389. responses:
  390. "200":
  391. description: '成功。统一信封 code/message/data;items[] 含 remark(备注,VARCHAR(200) NULL,未配置回 null)'
  392. /ops_team/get_list@v1:
  393. post:
  394. summary: 运维团队列表
  395. description: 一页列出全部团队,带可分配工单类型、成员数与派单/结算口径。注意:「未完成工单」「超期未完成」两列负载暂无数源(工单表属第 2 册),回 null+顶层 load_pending,见总则§18.3。
  396. operationId: ops_team_get_list
  397. tags:
  398. - 运维团队
  399. x-require-auth: true
  400. x-resource-type: bos.ops_team
  401. x-action: list
  402. x-version: v1
  403. x-permission-visibility: catalog
  404. requestBody:
  405. required: false
  406. description: 分页与过滤(page/page_size/keyword/region_node_id),业务字段置于 data
  407. content:
  408. application/json:
  409. schema:
  410. type: object
  411. responses:
  412. "200":
  413. description: 成功。统一信封 code/message/data
  414. /audit/get_list@v1:
  415. post:
  416. summary: 审计日志检索
  417. description: SC-04 六列(时间/操作人/操作类型/对象/变更前/变更后);时间倒序+(occurred_at,id) 游标,不用 OFFSET。注意:bos_audit_log 暂无写入口,落地前恒空集(前端逐字空态「可见范围内暂无记录」),见总则§18.3。
  418. operationId: audit_get_list
  419. tags:
  420. - 审计日志
  421. x-require-auth: true
  422. x-resource-type: bos.audit
  423. x-action: list
  424. x-version: v1
  425. x-permission-visibility: catalog
  426. requestBody:
  427. required: false
  428. description: 游标与检索条件(cursor/page_size/object_type/object_ref/actor_user_id/occurred_from/occurred_to/keyword),业务字段置于 data
  429. content:
  430. application/json:
  431. schema:
  432. type: object
  433. responses:
  434. "200":
  435. description: 成功。统一信封 code/message/data
  436. /account/provision@v1:
  437. post:
  438. summary: 开通账号
  439. description: 四入口共用开通管线。唯一性守卫(登录名/手机号)先于平台调用;角色与主体须一致。
  440. operationId: account_provision
  441. tags:
  442. - 账号管理
  443. x-require-auth: true
  444. x-resource-type: bos.account
  445. x-action: create
  446. x-version: v1
  447. x-permission-visibility: catalog
  448. requestBody:
  449. required: true
  450. description: JSON 请求体,业务字段置于 data
  451. content:
  452. application/json:
  453. schema:
  454. type: object
  455. description: 统一信封请求体,业务字段放在 data 内
  456. properties:
  457. data:
  458. type: object
  459. description: 业务参数
  460. properties:
  461. username:
  462. type: string
  463. description: 登录名(归一化后全站唯一)
  464. role_code:
  465. type: string
  466. description: 业务角色码
  467. subject_type:
  468. type: string
  469. description: 主体类型(operator/partner/ent_team/ops_team/customer 等)
  470. subject_id:
  471. type: string
  472. description: 主体 ID
  473. mobile:
  474. type: string
  475. description: 手机号(可选,唯一)
  476. required:
  477. - username
  478. - role_code
  479. - subject_type
  480. - subject_id
  481. required:
  482. - data
  483. responses:
  484. "200":
  485. description: 成功。统一信封 code/message/data
  486. /account/update_status@v1:
  487. post:
  488. summary: 停用或恢复账号
  489. description: 停用/恢复账号状态;不可操作当前登录账号。
  490. operationId: account_update_status
  491. tags:
  492. - 账号管理
  493. x-require-auth: true
  494. x-resource-type: bos.account
  495. x-action: manage
  496. x-version: v1
  497. x-permission-visibility: catalog
  498. requestBody:
  499. required: true
  500. description: JSON 请求体,业务字段置于 data
  501. content:
  502. application/json:
  503. schema:
  504. type: object
  505. description: 统一信封请求体,业务字段放在 data 内
  506. properties:
  507. data:
  508. type: object
  509. description: 业务参数
  510. properties:
  511. user_id:
  512. type: string
  513. description: 目标用户 ID
  514. status:
  515. type: string
  516. description: 目标状态(如 disabled/active)
  517. required:
  518. - user_id
  519. - status
  520. required:
  521. - data
  522. responses:
  523. "200":
  524. description: 成功。统一信封 code/message/data
  525. /account/reset_code@v1:
  526. post:
  527. summary: 重置激活码
  528. description: 仅未激活账号可重置;已激活拒绝。新码仅当次返回。
  529. operationId: account_reset_code
  530. tags:
  531. - 账号管理
  532. x-require-auth: true
  533. x-resource-type: bos.account
  534. x-action: manage
  535. x-version: v1
  536. x-permission-visibility: catalog
  537. requestBody:
  538. required: true
  539. description: JSON 请求体,业务字段置于 data
  540. content:
  541. application/json:
  542. schema:
  543. type: object
  544. description: 统一信封请求体,业务字段放在 data 内
  545. properties:
  546. data:
  547. type: object
  548. description: 业务参数
  549. properties:
  550. user_id:
  551. type: string
  552. description: 目标用户 ID
  553. required:
  554. - user_id
  555. required:
  556. - data
  557. responses:
  558. "200":
  559. description: 成功。统一信封 code/message/data
  560. /account/export_codes@v1:
  561. post:
  562. summary: 导出激活码
  563. description: 导出未设密账号激活码明文。必传按本人可见范围收窄后的 user_ids(不得传空列表——平台侧空值=项目内全量);scope 一律服务端派生(`scope_type=end_user` +项目空间 ID),不收客户端的 scope_type/scope_id;validity 默认 `valid`(只读),`expired`/`all` 为写操作(先作废再换新码),不接受 `active`(平台非法值)。明文=调平台 `bootstrap_credential/export@v1`(调用身份=项目服务授权主体 keypair 六头,不用用户令牌/内部令牌),>200 人自动按 200 分片并按 `pagination.total` 翻页(不得漏页冒充成功)。出参 `data.items[].plaintext` **只随本次应答回显一次**、平台侧不落库 ⇒ 每次调用(含失败)逐次写审计,`data.audit_written` 如实回布尔。
  564. operationId: account_export_codes
  565. tags:
  566. - 账号管理
  567. x-require-auth: true
  568. x-resource-type: bos.account
  569. x-action: export
  570. x-version: v1
  571. x-permission-visibility: catalog
  572. requestBody:
  573. required: true
  574. description: JSON 请求体,业务字段置于 data
  575. content:
  576. application/json:
  577. schema:
  578. type: object
  579. description: 统一信封请求体,业务字段放在 data 内
  580. properties:
  581. data:
  582. type: object
  583. description: 业务参数
  584. properties:
  585. user_ids:
  586. type: array
  587. description: 按本人可见范围收窄后的用户 ID 列表(不可传空列表:平台侧空值=项目内全量导出)
  588. minItems: 1
  589. items:
  590. type: string
  591. description: 用户 ID
  592. validity:
  593. type: string
  594. description: 导出口径(平台取值域):valid=仍有效(只读,缺省);expired=已过期(写);all=全部(写)。不接受 active——平台合法值是 valid,传 active 会被 11103 拒收
  595. default: valid
  596. enum:
  597. - valid
  598. - expired
  599. - all
  600. required:
  601. - user_ids
  602. required:
  603. - data
  604. responses:
  605. "200":
  606. description: 成功。统一信封 code/message/data
  607. /account/change_password@v1:
  608. post:
  609. summary: 自助修改密码
  610. description: 已登录用户修改本人密码;新旧相同不保存。
  611. operationId: account_change_password
  612. tags:
  613. - 账号管理
  614. x-require-auth: true
  615. # AC-05 明定「任何已登录角色」:不挂业务权限键(`bos.account.manage` 只授给运营侧,
  616. # 客户/分账号/合伙人/运营商会被网关 11001 挡掉)。登录即可=复用所有人都在的
  617. # `bos.auth.view@v1`,身份边界由 handler 的「只改本人」保证。
  618. x-resource-type: bos.auth
  619. x-action: view
  620. x-version: v1
  621. x-permission-visibility: catalog
  622. requestBody:
  623. required: true
  624. description: JSON 请求体,业务字段置于 data
  625. content:
  626. application/json:
  627. schema:
  628. type: object
  629. description: 统一信封请求体,业务字段放在 data 内
  630. properties:
  631. data:
  632. type: object
  633. description: 业务参数
  634. properties:
  635. old_password:
  636. type: string
  637. description: 原密码
  638. new_password:
  639. type: string
  640. description: 新密码
  641. required:
  642. - old_password
  643. - new_password
  644. required:
  645. - data
  646. responses:
  647. "200":
  648. description: 成功。统一信封 code/message/data
  649. /account/profile/update@v1:
  650. post:
  651. summary: 本人维护姓名
  652. description: AC-05 个人资料;仅限本人。只写账号级自填姓名(bos_account_ext.display_name),不改主体档案(客户联系人/运营商名/团队名归运营侧)。空串或 null=清除自填、回落到档案派生名;超 64 字符或含控制字符 ⇒ 60004。
  653. operationId: account_profile_update
  654. tags:
  655. - 账号管理
  656. x-require-auth: true
  657. # AC-05:任何已登录角色且仅限本人 ⇒ 登录即可,不挂业务权限键(`bos.account.manage` 会把客户等角色挡在网关)。
  658. x-resource-type: bos.auth
  659. x-action: view
  660. x-version: v1
  661. x-permission-visibility: catalog
  662. requestBody:
  663. required: true
  664. description: JSON 请求体,业务字段置于 data
  665. content:
  666. application/json:
  667. schema:
  668. type: object
  669. description: 统一信封请求体,业务字段放在 data 内
  670. properties:
  671. data:
  672. type: object
  673. description: 业务参数
  674. properties:
  675. display_name:
  676. type: string
  677. maxLength: 64
  678. description: 本人姓名;空串或 null=清除自填(回落到档案派生名)
  679. required:
  680. - data
  681. responses:
  682. "200":
  683. description: 成功。统一信封 code/message/data
  684. /account/notify_pref@v1:
  685. get:
  686. summary: 读通知投递偏好
  687. description: AC-06;只读本人三通道(站内/邮箱/短信)的 enabled/available/address_hint。站内恒开不可关;地址摘要一律脱敏。任何已登录角色。
  688. operationId: account_notify_pref
  689. tags:
  690. - 账号管理
  691. x-require-auth: true
  692. # AC-06:任何已登录角色只读本人;不挂业务权限键(见 06-接口清单「登录即可」)。
  693. x-resource-type: bos.auth
  694. x-action: view
  695. x-version: v1
  696. x-permission-visibility: catalog
  697. responses:
  698. "200":
  699. description: 成功。统一信封 code/message/data
  700. /account/notify_pref/save@v1:
  701. post:
  702. summary: 保存通知投递开关
  703. description: AC-06;仅限本人(user_id 取登录上下文)。站内投递不可关闭(KLT-A004/60092);未绑定手机号不能开启短信(KLT-A005/60093)。关闭是合法动作、不发码。
  704. operationId: account_notify_pref_save
  705. tags:
  706. - 账号管理
  707. x-require-auth: true
  708. # AC-06:任何已登录角色且仅限本人 ⇒ 登录即可,不挂业务权限键。
  709. x-resource-type: bos.auth
  710. x-action: view
  711. x-version: v1
  712. x-permission-visibility: catalog
  713. requestBody:
  714. required: true
  715. description: JSON 请求体,业务字段置于 data
  716. content:
  717. application/json:
  718. schema:
  719. type: object
  720. description: 统一信封请求体,业务字段放在 data 内
  721. properties:
  722. data:
  723. type: object
  724. description: 业务参数
  725. properties:
  726. inapp_enabled:
  727. type: boolean
  728. description: 站内投递开关;只接受 true/缺省,false ⇒ KLT-A004
  729. mail_enabled:
  730. type: boolean
  731. description: 邮箱投递开关
  732. sms_enabled:
  733. type: boolean
  734. description: 短信投递开关;无绑定手机号时 true ⇒ KLT-A005
  735. required:
  736. - mail_enabled
  737. - sms_enabled
  738. required:
  739. - data
  740. responses:
  741. "200":
  742. description: 成功。统一信封 code/message/data
  743. /account/notify_email@v1:
  744. post:
  745. summary: 本人维护通知投递邮箱
  746. description: AC-06;仅限本人。空串=清空登记(合法动作);格式或长度不符 ⇒ KLT-A006/60094。不要求全站唯一。
  747. operationId: account_notify_email
  748. tags:
  749. - 账号管理
  750. x-require-auth: true
  751. # AC-06:任何已登录角色且仅限本人 ⇒ 登录即可,不挂业务权限键。
  752. x-resource-type: bos.auth
  753. x-action: view
  754. x-version: v1
  755. x-permission-visibility: catalog
  756. requestBody:
  757. required: true
  758. description: JSON 请求体,业务字段置于 data
  759. content:
  760. application/json:
  761. schema:
  762. type: object
  763. description: 统一信封请求体,业务字段放在 data 内
  764. properties:
  765. data:
  766. type: object
  767. description: 业务参数
  768. properties:
  769. email:
  770. type: string
  771. maxLength: 254
  772. description: 通知投递邮箱;空串或 null=清空登记
  773. required:
  774. - data
  775. responses:
  776. "200":
  777. description: 成功。统一信封 code/message/data
  778. /account/notify_email/set@v1:
  779. post:
  780. summary: 运营代办维护通知投递邮箱
  781. description: AC-06;admin 全域、opsMain 负责范围内(opsSub 只读)。与本人自助口同一套格式校验(KLT-A006/60094),范围外按 11104 语义拒绝。
  782. operationId: account_notify_email_set
  783. tags:
  784. - 账号管理
  785. x-require-auth: true
  786. x-resource-type: bos.account
  787. x-action: manage
  788. x-version: v1
  789. x-permission-visibility: catalog
  790. requestBody:
  791. required: true
  792. description: JSON 请求体,业务字段置于 data
  793. content:
  794. application/json:
  795. schema:
  796. type: object
  797. description: 统一信封请求体,业务字段放在 data 内
  798. properties:
  799. data:
  800. type: object
  801. description: 业务参数
  802. properties:
  803. user_id:
  804. type: string
  805. description: 目标账号 ID
  806. email:
  807. type: string
  808. maxLength: 254
  809. description: 通知投递邮箱;空串或 null=清空登记
  810. required:
  811. - user_id
  812. required:
  813. - data
  814. responses:
  815. "200":
  816. description: 成功。统一信封 code/message/data
  817. /activation/verify@v1:
  818. post:
  819. summary: 激活并设置密码
  820. description: 免登录豁免接口。校验激活码后设置新密码;按来源 IP+码窗口限流,不设失败计数锁死。
  821. operationId: activation_verify
  822. tags:
  823. - 认证与激活
  824. x-require-auth: false
  825. x-resource-type: bos.activation
  826. x-action: manage
  827. x-version: v1
  828. x-permission-visibility: catalog
  829. requestBody:
  830. required: true
  831. description: JSON 请求体,业务字段置于 data
  832. content:
  833. application/json:
  834. schema:
  835. type: object
  836. description: 统一信封请求体,业务字段放在 data 内
  837. properties:
  838. data:
  839. type: object
  840. description: 业务参数
  841. properties:
  842. code:
  843. type: string
  844. description: 激活码
  845. new_password:
  846. type: string
  847. description: 新密码(建议不少于 8 位)
  848. minLength: 8
  849. required:
  850. - code
  851. - new_password
  852. required:
  853. - data
  854. responses:
  855. "200":
  856. description: 成功。统一信封 code/message/data
  857. /activation/precheck@v1:
  858. post:
  859. summary: 激活第 1 步预校验(登录名与激活状态)
  860. description: 免登录豁免接口。在设密步之前按登录名校验账号侧前置:已激活/已停用/未发码/已过期四类在第 1 步拦下;激活码明文仍由平台 bootstrap/consume 核销。
  861. operationId: activation_precheck
  862. tags:
  863. - 认证与激活
  864. x-require-auth: false
  865. x-resource-type: bos.activation
  866. x-action: manage
  867. x-version: v1
  868. x-permission-visibility: catalog
  869. requestBody:
  870. required: true
  871. description: JSON 请求体,业务字段置于 data
  872. content:
  873. application/json:
  874. schema:
  875. type: object
  876. description: 统一信封请求体,业务字段放在 data 内
  877. properties:
  878. data:
  879. type: object
  880. description: 业务参数
  881. properties:
  882. login_name:
  883. type: string
  884. description: 登录名(平台定位账号的必填参数)
  885. code:
  886. type: string
  887. description: 激活码(仅作限流隔离键;码值由平台核销)
  888. required:
  889. - login_name
  890. required:
  891. - data
  892. x-error-codes: [60006, 60052, 60076, 60088]
  893. responses:
  894. "200":
  895. description: 成功。统一信封 code/message/data
  896. /operator/create@v1:
  897. post:
  898. summary: 新建运营商
  899. description: 运营商建档。所属区域必须是省级节点;同省份×品牌唯一;可写结算口径。
  900. operationId: operator_create
  901. tags:
  902. - 运营商
  903. x-require-auth: true
  904. x-resource-type: bos.operator
  905. x-action: create
  906. x-version: v1
  907. x-permission-visibility: catalog
  908. requestBody:
  909. required: true
  910. description: JSON 请求体,业务字段置于 data
  911. content:
  912. application/json:
  913. schema:
  914. type: object
  915. description: 统一信封请求体,业务字段放在 data 内
  916. properties:
  917. data:
  918. type: object
  919. description: 业务参数
  920. properties:
  921. name:
  922. type: string
  923. description: 运营商名称
  924. brand:
  925. type: string
  926. description: 品牌:移动/联通/电信
  927. region_node_id:
  928. type: string
  929. description: 建档区域节点 ID(必须省级)
  930. is_province_node:
  931. type: boolean
  932. description: 是否省级节点标记(服务端校验用,可选)
  933. settle_mode:
  934. type: string
  935. description: 结算方式:ratio=比例;amount=固定金额;per_account=每账号
  936. enum:
  937. - ratio
  938. - amount
  939. - per_account
  940. settle_value:
  941. type: number
  942. description: 结算值:比例时 0<x≤100;金额/每账号时为分且 >0
  943. required:
  944. - name
  945. - brand
  946. - region_node_id
  947. required:
  948. - data
  949. responses:
  950. "200":
  951. description: 成功。统一信封 code/message/data
  952. /operator/update@v1:
  953. post:
  954. summary: 编辑运营商
  955. description: 编辑运营商档案;改品牌/省份不得绕过省份×品牌唯一与省级节点校验。
  956. operationId: operator_update
  957. tags:
  958. - 运营商
  959. x-require-auth: true
  960. x-resource-type: bos.operator
  961. x-action: update
  962. x-version: v1
  963. x-permission-visibility: catalog
  964. requestBody:
  965. required: true
  966. description: JSON 请求体,业务字段置于 data
  967. content:
  968. application/json:
  969. schema:
  970. type: object
  971. description: 统一信封请求体,业务字段放在 data 内
  972. properties:
  973. data:
  974. type: object
  975. description: 业务参数
  976. properties:
  977. operator_id:
  978. type: string
  979. description: 运营商 ID
  980. name:
  981. type: string
  982. description: 运营商名称
  983. brand:
  984. type: string
  985. description: 品牌:移动/联通/电信
  986. region_node_id:
  987. type: string
  988. description: 建档区域节点 ID(必须省级)
  989. is_province_node:
  990. type: boolean
  991. description: 是否省级节点标记(可选)
  992. settle_mode:
  993. type: string
  994. description: 结算方式:ratio/amount/per_account
  995. settle_value:
  996. type: number
  997. description: 结算值
  998. row_version:
  999. type: integer
  1000. description: 乐观锁版本(若启用)
  1001. required:
  1002. - operator_id
  1003. - name
  1004. - brand
  1005. - region_node_id
  1006. required:
  1007. - data
  1008. responses:
  1009. "200":
  1010. description: 成功。统一信封 code/message/data
  1011. /operator/delete@v1:
  1012. post:
  1013. summary: 删除运营商
  1014. description: 删除前六项检查并级联注销对账账号。
  1015. operationId: operator_delete
  1016. tags:
  1017. - 运营商
  1018. x-require-auth: true
  1019. x-resource-type: bos.operator
  1020. x-action: delete
  1021. x-version: v1
  1022. x-permission-visibility: catalog
  1023. requestBody:
  1024. required: true
  1025. description: JSON 请求体,业务字段置于 data
  1026. content:
  1027. application/json:
  1028. schema:
  1029. type: object
  1030. description: 统一信封请求体,业务字段放在 data 内
  1031. properties:
  1032. data:
  1033. type: object
  1034. description: 业务参数
  1035. properties:
  1036. operator_id:
  1037. type: string
  1038. description: 运营商 ID
  1039. required:
  1040. - operator_id
  1041. required:
  1042. - data
  1043. responses:
  1044. "200":
  1045. description: 成功。统一信封 code/message/data
  1046. /operator/get_list@v1:
  1047. post:
  1048. summary: 运营商列表
  1049. description: 卡片口径:建档区域或下挂客户落在本可见范围。
  1050. operationId: operator_get_list
  1051. tags:
  1052. - 运营商
  1053. x-require-auth: true
  1054. x-resource-type: bos.operator
  1055. x-action: list
  1056. x-version: v1
  1057. x-permission-visibility: catalog
  1058. requestBody:
  1059. required: true
  1060. description: JSON 请求体,业务字段置于 data
  1061. content:
  1062. application/json:
  1063. schema:
  1064. type: object
  1065. description: 统一信封请求体,业务字段放在 data 内
  1066. properties:
  1067. data:
  1068. type: object
  1069. description: 列表筛选参数
  1070. properties:
  1071. page:
  1072. type: integer
  1073. description: 页码(0 基索引,默认 0)
  1074. minimum: 0
  1075. default: 0
  1076. page_size:
  1077. type: integer
  1078. description: 每页条数(默认 20,上限 200)
  1079. minimum: 1
  1080. maximum: 200
  1081. default: 20
  1082. keyword:
  1083. type: string
  1084. description: 关键字筛选(可选)
  1085. brand:
  1086. type: string
  1087. description: 品牌筛选(可选)
  1088. required:
  1089. - data
  1090. responses:
  1091. "200":
  1092. description: 成功。统一信封 code/message/data
  1093. /operator/recon_account/create@v1:
  1094. post:
  1095. summary: 创建对账账号
  1096. description: 一家运营商至多一个对账账号;初始密码仅当次显示。
  1097. operationId: operator_recon_account_create
  1098. tags:
  1099. - 运营商
  1100. x-require-auth: true
  1101. x-resource-type: bos.operator.recon_account
  1102. x-action: create
  1103. x-version: v1
  1104. x-permission-visibility: catalog
  1105. requestBody:
  1106. required: true
  1107. description: JSON 请求体,业务字段置于 data
  1108. content:
  1109. application/json:
  1110. schema:
  1111. type: object
  1112. description: 统一信封请求体,业务字段放在 data 内
  1113. properties:
  1114. data:
  1115. type: object
  1116. description: 业务参数
  1117. properties:
  1118. operator_id:
  1119. type: string
  1120. description: 运营商 ID
  1121. username:
  1122. type: string
  1123. description: 对账账号登录名
  1124. mobile:
  1125. type: string
  1126. description: 手机号(可选)
  1127. required:
  1128. - operator_id
  1129. - username
  1130. required:
  1131. - data
  1132. responses:
  1133. "200":
  1134. description: 成功。统一信封 code/message/data
  1135. /operator/recon_account/get@v1:
  1136. post:
  1137. summary: 查询对账账号
  1138. description: 只回状态提示(如「未发送,线下告知本人」),不回密码。
  1139. operationId: operator_recon_account_get
  1140. tags:
  1141. - 运营商
  1142. x-require-auth: true
  1143. x-resource-type: bos.operator.recon_account
  1144. x-action: view
  1145. x-version: v1
  1146. x-permission-visibility: catalog
  1147. requestBody:
  1148. required: true
  1149. description: JSON 请求体,业务字段置于 data
  1150. content:
  1151. application/json:
  1152. schema:
  1153. type: object
  1154. description: 统一信封请求体,业务字段放在 data 内
  1155. properties:
  1156. data:
  1157. type: object
  1158. description: 业务参数
  1159. properties:
  1160. operator_id:
  1161. type: string
  1162. description: 运营商 ID
  1163. required:
  1164. - operator_id
  1165. required:
  1166. - data
  1167. responses:
  1168. "200":
  1169. description: 成功。统一信封 code/message/data
  1170. /partner/create@v1:
  1171. post:
  1172. summary: 新建合伙人
  1173. description: 合伙人建档并同步开通账号;名称全站唯一;结算字段仅 admin 可写。
  1174. operationId: partner_create
  1175. tags:
  1176. - 合伙人
  1177. x-require-auth: true
  1178. x-resource-type: bos.partner
  1179. x-action: create
  1180. x-version: v1
  1181. x-permission-visibility: catalog
  1182. requestBody:
  1183. required: true
  1184. description: JSON 请求体,业务字段置于 data
  1185. content:
  1186. application/json:
  1187. schema:
  1188. type: object
  1189. description: 统一信封请求体,业务字段放在 data 内
  1190. properties:
  1191. data:
  1192. type: object
  1193. description: 业务参数
  1194. properties:
  1195. name:
  1196. type: string
  1197. description: 合伙人名称(全站唯一)
  1198. duty_desc:
  1199. type: string
  1200. description: 职务说明(可选)
  1201. region_node_id:
  1202. type: string
  1203. description: 建档区域节点 ID
  1204. mobile:
  1205. type: string
  1206. description: 手机号(可选)
  1207. username:
  1208. type: string
  1209. description: 登录名(开通账号用)
  1210. settle_mode:
  1211. type: string
  1212. description: 结算方式(仅 admin 可写,可选)
  1213. settle_value:
  1214. type: number
  1215. description: 结算值(仅 admin 可写,可选)
  1216. required:
  1217. - name
  1218. - region_node_id
  1219. - username
  1220. required:
  1221. - data
  1222. responses:
  1223. "200":
  1224. description: 成功。统一信封 code/message/data
  1225. /partner/update@v1:
  1226. post:
  1227. summary: 编辑合伙人
  1228. description: 编辑合伙人资料;登录名不可改。
  1229. operationId: partner_update
  1230. tags:
  1231. - 合伙人
  1232. x-require-auth: true
  1233. x-resource-type: bos.partner
  1234. x-action: update
  1235. x-version: v1
  1236. x-permission-visibility: catalog
  1237. requestBody:
  1238. required: true
  1239. description: JSON 请求体,业务字段置于 data
  1240. content:
  1241. application/json:
  1242. schema:
  1243. type: object
  1244. description: 统一信封请求体,业务字段放在 data 内
  1245. properties:
  1246. data:
  1247. type: object
  1248. description: 业务参数
  1249. properties:
  1250. partner_id:
  1251. type: string
  1252. description: 合伙人 ID
  1253. name:
  1254. type: string
  1255. description: 合伙人名称(全站唯一)
  1256. duty_desc:
  1257. type: string
  1258. description: 职务说明(可选)
  1259. region_node_id:
  1260. type: string
  1261. description: 建档区域节点 ID
  1262. mobile:
  1263. type: string
  1264. description: 手机号(可选)
  1265. settle_mode:
  1266. type: string
  1267. description: 结算方式(仅 admin 可写,可选)
  1268. settle_value:
  1269. type: number
  1270. description: 结算值(仅 admin 可写,可选)
  1271. row_version:
  1272. type: integer
  1273. description: 乐观锁版本(若启用)
  1274. required:
  1275. - partner_id
  1276. - name
  1277. - region_node_id
  1278. required:
  1279. - data
  1280. responses:
  1281. "200":
  1282. description: 成功。统一信封 code/message/data
  1283. /partner/delete@v1:
  1284. post:
  1285. summary: 删除合伙人
  1286. description: 删除合伙人档案及相关授权。
  1287. operationId: partner_delete
  1288. tags:
  1289. - 合伙人
  1290. x-require-auth: true
  1291. x-resource-type: bos.partner
  1292. x-action: delete
  1293. x-version: v1
  1294. x-permission-visibility: catalog
  1295. requestBody:
  1296. required: true
  1297. description: JSON 请求体,业务字段置于 data
  1298. content:
  1299. application/json:
  1300. schema:
  1301. type: object
  1302. description: 统一信封请求体,业务字段放在 data 内
  1303. properties:
  1304. data:
  1305. type: object
  1306. description: 业务参数
  1307. properties:
  1308. partner_id:
  1309. type: string
  1310. description: 合伙人 ID
  1311. required:
  1312. - partner_id
  1313. required:
  1314. - data
  1315. responses:
  1316. "200":
  1317. description: 成功。统一信封 code/message/data
  1318. /partner/get_list@v1:
  1319. post:
  1320. summary: 合伙人列表
  1321. description: 卡片口径:建档区域落在本范围(含下级)。
  1322. operationId: partner_get_list
  1323. tags:
  1324. - 合伙人
  1325. x-require-auth: true
  1326. x-resource-type: bos.partner
  1327. x-action: list
  1328. x-version: v1
  1329. x-permission-visibility: catalog
  1330. requestBody:
  1331. required: true
  1332. description: JSON 请求体,业务字段置于 data
  1333. content:
  1334. application/json:
  1335. schema:
  1336. type: object
  1337. description: 统一信封请求体,业务字段放在 data 内
  1338. properties:
  1339. data:
  1340. type: object
  1341. description: 列表筛选参数
  1342. properties:
  1343. page:
  1344. type: integer
  1345. description: 页码(0 基索引,默认 0)
  1346. minimum: 0
  1347. default: 0
  1348. page_size:
  1349. type: integer
  1350. description: 每页条数(默认 20,上限 200)
  1351. minimum: 1
  1352. maximum: 200
  1353. default: 20
  1354. keyword:
  1355. type: string
  1356. description: 关键字筛选(可选)
  1357. required:
  1358. - data
  1359. responses:
  1360. "200":
  1361. description: 成功。统一信封 code/message/data
  1362. /partner/scope/get@v1:
  1363. post:
  1364. summary: 读取合伙人负责范围
  1365. description: 返回该合伙人的 region/customer 两类 bos_data_scope。注意:2026-11-08 由 GET 改 POST(R-5,统一方法;本接口读 scope 表本身,不消费授权上界,故不标 x-enumeration-kind)。
  1366. operationId: partner_scope_get
  1367. tags:
  1368. - 合伙人
  1369. x-require-auth: true
  1370. x-resource-type: bos.partner.scope
  1371. x-action: view
  1372. x-version: v1
  1373. x-permission-visibility: catalog
  1374. requestBody:
  1375. required: true
  1376. description: 统一信封请求体(无业务参数)
  1377. content:
  1378. application/json:
  1379. schema:
  1380. type: object
  1381. properties:
  1382. data:
  1383. type: object
  1384. description: 无业务参数
  1385. required:
  1386. - data
  1387. responses:
  1388. "200":
  1389. description: 成功。统一信封 code/message/data
  1390. /partner/scope/save@v1:
  1391. post:
  1392. summary: 保存合伙人负责范围
  1393. description: 写入 bos_data_scope(holder_type=partner);允许保存为空;保存即 bump epoch。
  1394. operationId: partner_scope_save
  1395. tags:
  1396. - 合伙人
  1397. x-require-auth: true
  1398. x-resource-type: bos.partner.scope
  1399. x-action: manage
  1400. x-version: v1
  1401. x-permission-visibility: catalog
  1402. requestBody:
  1403. required: true
  1404. description: JSON 请求体,业务字段置于 data
  1405. content:
  1406. application/json:
  1407. schema:
  1408. type: object
  1409. description: 统一信封请求体,业务字段放在 data 内
  1410. properties:
  1411. data:
  1412. type: object
  1413. description: 业务参数
  1414. properties:
  1415. partner_id:
  1416. type: string
  1417. description: 合伙人 ID
  1418. region_node_ids:
  1419. type: array
  1420. description: 负责区域节点 ID 列表(可空)
  1421. items:
  1422. type: string
  1423. description: 区域节点 ID
  1424. customer_ids:
  1425. type: array
  1426. description: 负责客户 ID 列表(可空)
  1427. items:
  1428. type: string
  1429. description: 客户 ID
  1430. required:
  1431. - partner_id
  1432. required:
  1433. - data
  1434. responses:
  1435. "200":
  1436. description: 成功。统一信封 code/message/data
  1437. /ent_team/create@v1:
  1438. post:
  1439. summary: 新建运营团队
  1440. description: 仅 admin。新建运营团队,负责范围初始为空。
  1441. operationId: ent_team_create
  1442. tags:
  1443. - 运营团队
  1444. x-require-auth: true
  1445. x-resource-type: bos.ent_team
  1446. x-action: create
  1447. x-version: v1
  1448. x-permission-visibility: catalog
  1449. requestBody:
  1450. required: true
  1451. description: JSON 请求体,业务字段置于 data
  1452. content:
  1453. application/json:
  1454. schema:
  1455. type: object
  1456. description: 统一信封请求体,业务字段放在 data 内
  1457. properties:
  1458. data:
  1459. type: object
  1460. description: 业务参数
  1461. properties:
  1462. team_name:
  1463. type: string
  1464. description: 团队名称
  1465. primary_username:
  1466. type: string
  1467. description: 主账号登录名(可选)
  1468. primary_mobile:
  1469. type: string
  1470. description: 主账号手机号(可选)
  1471. primary_name:
  1472. type: string
  1473. maxLength: 64
  1474. description: 主账号姓名(可选,落 `bos_account_ext.display_name`;下拉框按姓名选人,前端必填,未带=回落登录名)
  1475. remark:
  1476. type: string
  1477. maxLength: 200
  1478. description: 备注(可选,去空白后 ≤200 字符;`ent_team.remark VARCHAR(200) NULL`,缺省=落 NULL)。不参与唯一键、不参与算账与判权谓词
  1479. required:
  1480. - team_name
  1481. required:
  1482. - data
  1483. responses:
  1484. "200":
  1485. description: 成功。统一信封 code/message/data
  1486. /ent_team/update@v1:
  1487. post:
  1488. summary: 编辑运营团队
  1489. description: 仅 admin。编辑团队资料(改名/备注)。注意:请求体与出参不含 `settle_mode`/`settle_value`(运营团队不是分成方,第 4 册§5.1/§5.2,总则§18.3 `PG-7` 路线 A)。备注变更须写审计前后值(记文字)。
  1490. operationId: ent_team_update
  1491. tags:
  1492. - 运营团队
  1493. x-require-auth: true
  1494. x-resource-type: bos.ent_team
  1495. x-action: update
  1496. x-version: v1
  1497. x-permission-visibility: catalog
  1498. requestBody:
  1499. required: true
  1500. description: JSON 请求体,业务字段置于 data
  1501. content:
  1502. application/json:
  1503. schema:
  1504. type: object
  1505. description: 统一信封请求体,业务字段放在 data 内
  1506. properties:
  1507. data:
  1508. type: object
  1509. description: 业务参数
  1510. properties:
  1511. team_id:
  1512. type: string
  1513. description: 团队 ID
  1514. team_name:
  1515. type: string
  1516. description: 团队名称
  1517. remark:
  1518. type: string
  1519. maxLength: 200
  1520. description: 备注(`ent_team.remark VARCHAR(200) NULL`)。三态语义:不带本键=不改本列;带空白串=清空为 NULL;带文本=设值(去空白后 ≤200 字符)。变更写审计前后值
  1521. row_version:
  1522. type: integer
  1523. description: 乐观锁版本(若启用)
  1524. required:
  1525. - team_id
  1526. - team_name
  1527. required:
  1528. - data
  1529. responses:
  1530. "200":
  1531. description: 成功。统一信封 code/message/data
  1532. /ent_team/delete@v1:
  1533. post:
  1534. summary: 删除运营团队
  1535. description: 仅 admin。内置「总部·不限区域」团队不可删。
  1536. operationId: ent_team_delete
  1537. tags:
  1538. - 运营团队
  1539. x-require-auth: true
  1540. x-resource-type: bos.ent_team
  1541. x-action: delete
  1542. x-version: v1
  1543. x-permission-visibility: catalog
  1544. requestBody:
  1545. required: true
  1546. description: JSON 请求体,业务字段置于 data
  1547. content:
  1548. application/json:
  1549. schema:
  1550. type: object
  1551. description: 统一信封请求体,业务字段放在 data 内
  1552. properties:
  1553. data:
  1554. type: object
  1555. description: 业务参数
  1556. properties:
  1557. team_id:
  1558. type: string
  1559. description: 团队 ID
  1560. required:
  1561. - team_id
  1562. required:
  1563. - data
  1564. responses:
  1565. "200":
  1566. description: 成功。统一信封 code/message/data
  1567. /ent_team/member_add@v1:
  1568. post:
  1569. summary: 添加运营团队成员
  1570. description: 每团队有且仅有一个主账号;首个成员即主账号;成员姓名(`name`)落 `bos_account_ext.display_name`(未带=回落登录名)。不可删除当前登录账号。
  1571. operationId: ent_team_member_add
  1572. tags:
  1573. - 运营团队
  1574. x-require-auth: true
  1575. x-resource-type: bos.ent_team
  1576. x-action: manage
  1577. x-version: v1
  1578. x-permission-visibility: catalog
  1579. requestBody:
  1580. required: true
  1581. description: JSON 请求体,业务字段置于 data
  1582. content:
  1583. application/json:
  1584. schema:
  1585. type: object
  1586. description: 统一信封请求体,业务字段放在 data 内
  1587. properties:
  1588. data:
  1589. type: object
  1590. description: 业务参数
  1591. properties:
  1592. team_id:
  1593. type: string
  1594. description: 团队 ID
  1595. username:
  1596. type: string
  1597. description: 成员登录名
  1598. name:
  1599. type: string
  1600. maxLength: 64
  1601. description: 成员姓名(落 `bos_account_ext.display_name`;前端必填,未带=回落登录名)
  1602. mobile:
  1603. type: string
  1604. description: 手机号(可选)
  1605. is_primary:
  1606. type: boolean
  1607. description: 是否设为主账号(可选)
  1608. required:
  1609. - team_id
  1610. - username
  1611. required:
  1612. - data
  1613. responses:
  1614. "200":
  1615. description: 成功。统一信封 code/message/data
  1616. /ent_team/member_update@v1:
  1617. post:
  1618. summary: 编辑运营团队成员资料
  1619. description: 仅 admin。改姓名(`bos_account_ext.display_name`)、手机号与运营账号可承接工单类型清单(`ticket_types`);登录名与本/子身份不变(改名办 `ent_team/transfer_primary@v1`)。
  1620. operationId: ent_team_member_update
  1621. tags:
  1622. - 运营团队
  1623. x-require-auth: true
  1624. x-resource-type: bos.ent_team
  1625. x-action: manage
  1626. x-version: v1
  1627. x-permission-visibility: catalog
  1628. requestBody:
  1629. required: true
  1630. description: JSON 请求体,业务字段置于 data
  1631. content:
  1632. application/json:
  1633. schema:
  1634. type: object
  1635. description: 统一信封请求体,业务字段放在 data 内
  1636. properties:
  1637. data:
  1638. type: object
  1639. description: 业务参数
  1640. properties:
  1641. team_id:
  1642. type: string
  1643. description: 团队 ID
  1644. user_id:
  1645. type: string
  1646. description: 成员用户 ID
  1647. name:
  1648. type: string
  1649. maxLength: 64
  1650. description: 姓名(可选;缺省=不改;空白串=拒绝,姓名是下拉框选人的展示值)
  1651. mobile:
  1652. type: string
  1653. description: 手机号(可选;缺省/空串=不改;全站唯一)
  1654. ticket_types:
  1655. type: array
  1656. items:
  1657. type: string
  1658. 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`
  1659. required:
  1660. - team_id
  1661. - user_id
  1662. required:
  1663. - data
  1664. responses:
  1665. "200":
  1666. description: 成功。统一信封 code/message/data
  1667. /ent_team/member_remove@v1:
  1668. post:
  1669. summary: 移除运营团队成员
  1670. description: 内置主账号不可删不可转交;不可删除当前登录账号。
  1671. operationId: ent_team_member_remove
  1672. tags:
  1673. - 运营团队
  1674. x-require-auth: true
  1675. x-resource-type: bos.ent_team
  1676. x-action: manage
  1677. x-version: v1
  1678. x-permission-visibility: catalog
  1679. requestBody:
  1680. required: true
  1681. description: JSON 请求体,业务字段置于 data
  1682. content:
  1683. application/json:
  1684. schema:
  1685. type: object
  1686. description: 统一信封请求体,业务字段放在 data 内
  1687. properties:
  1688. data:
  1689. type: object
  1690. description: 业务参数
  1691. properties:
  1692. team_id:
  1693. type: string
  1694. description: 团队 ID
  1695. user_id:
  1696. type: string
  1697. description: 成员用户 ID
  1698. required:
  1699. - team_id
  1700. - user_id
  1701. required:
  1702. - data
  1703. responses:
  1704. "200":
  1705. description: 成功。统一信封 code/message/data
  1706. /ent_team/transfer_primary@v1:
  1707. post:
  1708. summary: 转交运营团队主账号
  1709. description: 总运营可办理任意团队;运营主账号(opsMain)只能转交本团队(限本人所属团队)。同事务切换两人的 is_primary 标记并同步 role_code(opsMain↔opsSub),登录名与负责范围不变;内置总运营团队不可转交,跨团队接收方直接拒。审计记转出与转入账号名。
  1710. operationId: ent_team_transfer_primary
  1711. tags:
  1712. - 运营团队
  1713. x-require-auth: true
  1714. x-resource-type: bos.ent_team
  1715. x-action: manage
  1716. x-version: v1
  1717. x-permission-visibility: catalog
  1718. requestBody:
  1719. required: true
  1720. description: JSON 请求体,业务字段置于 data
  1721. content:
  1722. application/json:
  1723. schema:
  1724. type: object
  1725. description: 统一信封请求体,业务字段放在 data 内
  1726. properties:
  1727. data:
  1728. type: object
  1729. description: 业务参数
  1730. properties:
  1731. team_id:
  1732. type: string
  1733. description: 团队 ID
  1734. from_user_id:
  1735. type: string
  1736. description: 原主账号用户 ID
  1737. to_user_id:
  1738. type: string
  1739. description: 新主账号用户 ID
  1740. required:
  1741. - team_id
  1742. - from_user_id
  1743. - to_user_id
  1744. required:
  1745. - data
  1746. responses:
  1747. "200":
  1748. description: 成功。统一信封 code/message/data
  1749. /ent_team/scope/get@v1:
  1750. post:
  1751. summary: 读取运营团队负责范围
  1752. description: 仅 admin。返回团队区域负责范围。注意:2026-11-08 由 GET 改 POST(R-5,统一方法;本接口读 scope 表本身,不消费授权上界,故不标 x-enumeration-kind)。
  1753. operationId: ent_team_scope_get
  1754. tags:
  1755. - 运营团队
  1756. x-require-auth: true
  1757. x-resource-type: bos.ent_team.scope
  1758. x-action: view
  1759. x-version: v1
  1760. x-permission-visibility: catalog
  1761. requestBody:
  1762. required: true
  1763. description: 统一信封请求体(无业务参数)
  1764. content:
  1765. application/json:
  1766. schema:
  1767. type: object
  1768. properties:
  1769. data:
  1770. type: object
  1771. description: 无业务参数
  1772. required:
  1773. - data
  1774. responses:
  1775. "200":
  1776. description: 成功。统一信封 code/message/data
  1777. /ent_team/scope/save@v1:
  1778. post:
  1779. summary: 保存运营团队负责范围
  1780. description: 仅 admin。勾选区域写入 bos_data_scope(holder=ent_team),成为区域删除的引用来源。
  1781. operationId: ent_team_scope_save
  1782. tags:
  1783. - 运营团队
  1784. x-require-auth: true
  1785. x-resource-type: bos.ent_team.scope
  1786. x-action: manage
  1787. x-version: v1
  1788. x-permission-visibility: catalog
  1789. requestBody:
  1790. required: true
  1791. description: JSON 请求体,业务字段置于 data
  1792. content:
  1793. application/json:
  1794. schema:
  1795. type: object
  1796. description: 统一信封请求体,业务字段放在 data 内
  1797. properties:
  1798. data:
  1799. type: object
  1800. description: 业务参数
  1801. properties:
  1802. team_id:
  1803. type: string
  1804. description: 团队 ID
  1805. region_node_ids:
  1806. type: array
  1807. description: 负责区域节点 ID 列表
  1808. items:
  1809. type: string
  1810. description: 区域节点 ID
  1811. required:
  1812. - team_id
  1813. - region_node_ids
  1814. required:
  1815. - data
  1816. responses:
  1817. "200":
  1818. description: 成功。统一信封 code/message/data
  1819. /ops_team/create@v1:
  1820. post:
  1821. summary: 新建运维团队
  1822. description: 须指定所属区域、可派工单类型≥1、分派方式与结算口径。注意:2026-11-05 起团队不分类型(无 team_type 键)。
  1823. operationId: ops_team_create
  1824. tags:
  1825. - 运维团队与成员
  1826. x-require-auth: true
  1827. x-resource-type: bos.ops_team
  1828. x-action: create
  1829. x-version: v1
  1830. x-permission-visibility: catalog
  1831. requestBody:
  1832. required: true
  1833. description: JSON 请求体,业务字段置于 data
  1834. content:
  1835. application/json:
  1836. schema:
  1837. type: object
  1838. description: 统一信封请求体,业务字段放在 data 内
  1839. properties:
  1840. data:
  1841. type: object
  1842. description: 业务参数
  1843. properties:
  1844. team_name:
  1845. type: string
  1846. description: 团队名称
  1847. region_node_id:
  1848. type: string
  1849. description: 所属区域节点 ID
  1850. ticket_types:
  1851. type: array
  1852. description: 可派工单类型列表(至少 1 项;⛔ 含 `renewal`——续签单只由运营账号受理,业主 2026-11-17)
  1853. items:
  1854. type: string
  1855. description: 工单类型码
  1856. dispatch_mode:
  1857. type: string
  1858. description: 分派方式:manual=手工;auto_avg=自动均分
  1859. enum:
  1860. - manual
  1861. - auto_avg
  1862. settle_mode:
  1863. type: string
  1864. description: 结算方式
  1865. settle_value:
  1866. type: number
  1867. description: 结算值
  1868. primary_username:
  1869. type: string
  1870. description: 主账号登录名(空则默认「{团队名}主账号」)
  1871. primary_name:
  1872. type: string
  1873. description: 主账号姓名(档案名,1~64 字符;空=未填,列表回落显示登录名)
  1874. primary_mobile:
  1875. type: string
  1876. description: 主账号手机号(可选)
  1877. required:
  1878. - team_name
  1879. - region_node_id
  1880. - ticket_types
  1881. - dispatch_mode
  1882. required:
  1883. - data
  1884. responses:
  1885. "200":
  1886. description: 成功。统一信封 code/message/data
  1887. /ops_team/update@v1:
  1888. post:
  1889. summary: 编辑运维团队
  1890. description: 编辑团队资料。注意:2026-11-05 起团队不分类型,请求体无 team_type 键。
  1891. operationId: ops_team_update
  1892. tags:
  1893. - 运维团队与成员
  1894. x-require-auth: true
  1895. x-resource-type: bos.ops_team
  1896. x-action: update
  1897. x-version: v1
  1898. x-permission-visibility: catalog
  1899. requestBody:
  1900. required: true
  1901. description: JSON 请求体,业务字段置于 data
  1902. content:
  1903. application/json:
  1904. schema:
  1905. type: object
  1906. description: 统一信封请求体,业务字段放在 data 内
  1907. properties:
  1908. data:
  1909. type: object
  1910. description: 业务参数
  1911. properties:
  1912. team_id:
  1913. type: string
  1914. description: 团队 ID
  1915. team_name:
  1916. type: string
  1917. description: 团队名称
  1918. region_node_id:
  1919. type: string
  1920. description: 所属区域节点 ID
  1921. ticket_types:
  1922. type: array
  1923. description: 可派工单类型列表(整体替换,至少 1 项;⛔ 含 `renewal`——续签单只由运营账号受理)
  1924. items:
  1925. type: string
  1926. description: 工单类型码
  1927. settle_mode:
  1928. type: string
  1929. description: 结算方式
  1930. settle_value:
  1931. type: number
  1932. description: 结算值
  1933. row_version:
  1934. type: integer
  1935. description: 乐观锁版本(若启用)
  1936. required:
  1937. - team_id
  1938. required:
  1939. - data
  1940. responses:
  1941. "200":
  1942. description: 成功。统一信封 code/message/data
  1943. /ops_team/delete@v1:
  1944. post:
  1945. summary: 删除运维团队
  1946. description: 删除前校验引用与未办完工单等守卫。
  1947. operationId: ops_team_delete
  1948. tags:
  1949. - 运维团队与成员
  1950. x-require-auth: true
  1951. x-resource-type: bos.ops_team
  1952. x-action: delete
  1953. x-version: v1
  1954. x-permission-visibility: catalog
  1955. requestBody:
  1956. required: true
  1957. description: JSON 请求体,业务字段置于 data
  1958. content:
  1959. application/json:
  1960. schema:
  1961. type: object
  1962. description: 统一信封请求体,业务字段放在 data 内
  1963. properties:
  1964. data:
  1965. type: object
  1966. description: 业务参数
  1967. properties:
  1968. team_id:
  1969. type: string
  1970. description: 团队 ID
  1971. required:
  1972. - team_id
  1973. required:
  1974. - data
  1975. responses:
  1976. "200":
  1977. description: 成功。统一信封 code/message/data
  1978. /ops_team/scope/save@v1:
  1979. post:
  1980. summary: 保存运维团队负责范围
  1981. description: 三个范围写入口之一。同事务校验范围包含关系与未办完工单守卫;失败两侧都不落库。
  1982. operationId: ops_team_scope_save
  1983. tags:
  1984. - 运维团队与成员
  1985. x-require-auth: true
  1986. x-resource-type: bos.ops_team.scope
  1987. x-action: manage
  1988. x-version: v1
  1989. x-permission-visibility: catalog
  1990. requestBody:
  1991. required: true
  1992. description: JSON 请求体,业务字段置于 data
  1993. content:
  1994. application/json:
  1995. schema:
  1996. type: object
  1997. description: 统一信封请求体,业务字段放在 data 内
  1998. properties:
  1999. data:
  2000. type: object
  2001. description: 业务参数
  2002. properties:
  2003. team_id:
  2004. type: string
  2005. description: 团队 ID
  2006. region_node_ids:
  2007. type: array
  2008. description: 负责区域节点 ID 列表
  2009. items:
  2010. type: string
  2011. description: 区域节点 ID
  2012. customer_ids:
  2013. type: array
  2014. description: 负责客户 ID 列表(可空)
  2015. items:
  2016. type: string
  2017. description: 客户 ID
  2018. required:
  2019. - team_id
  2020. required:
  2021. - data
  2022. responses:
  2023. "200":
  2024. description: 成功。统一信封 code/message/data
  2025. /ops_team/member_add@v1:
  2026. post:
  2027. summary: 添加运维成员
  2028. description: 新建成员档案(含成员姓名)并开通运维子账号(`role_code=ops`)。注意:2026-11-05 起成员不分类型,服务侧只校验 `ticket_types` 是团队可分配类型的子集(`KLT-I105`,可为空=不接单)。注意:2026-11-16 起 `ticket_mode` 与负责范围同构:`follow_team`=随团队(成员级零行),`custom`=勾选子集。注意:`renewal` 不属于运维可承接类型(续签单只由运营账号受理,业主 2026-11-17),传入即拒。
  2029. operationId: ops_team_member_add
  2030. tags:
  2031. - 运维团队与成员
  2032. x-require-auth: true
  2033. x-resource-type: bos.ops_team
  2034. x-action: manage
  2035. x-version: v1
  2036. x-permission-visibility: catalog
  2037. requestBody:
  2038. required: true
  2039. description: JSON 请求体,业务字段置于 data
  2040. content:
  2041. application/json:
  2042. schema:
  2043. type: object
  2044. description: 统一信封请求体,业务字段放在 data 内
  2045. properties:
  2046. data:
  2047. type: object
  2048. description: 业务参数
  2049. properties:
  2050. team_id:
  2051. type: string
  2052. description: 团队 ID
  2053. ticket_types:
  2054. type: array
  2055. description: 该成员可处理的工单类型(须为团队可分配类型的子集;空数组=不接单,如录入人员;⛔ 含 `renewal`——续签单只由运营账号受理)。`ticket_mode=follow_team` 时不得传本键
  2056. items:
  2057. type: string
  2058. description: 工单类型码
  2059. ticket_mode:
  2060. type: string
  2061. description: 可处理类型形态:follow_team=随团队可分配类型(成员级零行,团队改类型自动跟随);custom=勾选子集。缺省=custom(不带 ticket_mode 时按 ticket_types 落子集,不带=不接单)
  2062. enum:
  2063. - follow_team
  2064. - custom
  2065. username:
  2066. type: string
  2067. description: 登录名
  2068. display_name:
  2069. type: string
  2070. description: 成员姓名(必填;1~64 字符、不含控制字符)。与登录名分列,列表「成员」列显示该值
  2071. mobile:
  2072. type: string
  2073. description: 手机号(可选)
  2074. required:
  2075. - team_id
  2076. - username
  2077. - display_name
  2078. required:
  2079. - data
  2080. responses:
  2081. "200":
  2082. description: 成功。统一信封 code/message/data
  2083. /ops_team/member_update@v1:
  2084. post:
  2085. summary: 更新运维成员
  2086. description: 可改成员姓名、手机号与可处理工单类型(形态+子集,各字段缺省=不改)。注意:2026-11-05 起成员不分类型,不因类型变更改写 role_code;`custom` 时子集落 ops_member_ticket_type,`follow_team` 时清空该成员行并随团队类型。
  2087. operationId: ops_team_member_update
  2088. tags:
  2089. - 运维团队与成员
  2090. x-require-auth: true
  2091. x-resource-type: bos.ops_team
  2092. x-action: manage
  2093. x-version: v1
  2094. x-permission-visibility: catalog
  2095. requestBody:
  2096. required: true
  2097. description: JSON 请求体,业务字段置于 data
  2098. content:
  2099. application/json:
  2100. schema:
  2101. type: object
  2102. description: 统一信封请求体,业务字段放在 data 内
  2103. properties:
  2104. data:
  2105. type: object
  2106. description: 业务参数
  2107. properties:
  2108. team_id:
  2109. type: string
  2110. description: 团队 ID
  2111. ticket_types:
  2112. type: array
  2113. description: 该成员可处理的工单类型(整体替换;须为团队可分配类型的子集;空数组=不接单;⛔ 含 `renewal`——续签单只由运营账号受理)。`ticket_mode=follow_team` 时不得传本键
  2114. items:
  2115. type: string
  2116. description: 工单类型码
  2117. ticket_mode:
  2118. type: string
  2119. description: 可处理类型形态:follow_team=随团队(清空该成员的类型行);custom=按 ticket_types 整体替换。缺省且带 ticket_types ⇒ 按 custom;都不带 ⇒ 不动类型
  2120. enum:
  2121. - follow_team
  2122. - custom
  2123. member_id:
  2124. type: string
  2125. description: 成员 ID
  2126. display_name:
  2127. type: string
  2128. description: 成员姓名新值;1~64 字符、不含控制字符;缺省=不改,空串非法
  2129. mobile:
  2130. type: string
  2131. description: 手机号(可选)
  2132. required:
  2133. - team_id
  2134. - member_id
  2135. required:
  2136. - data
  2137. responses:
  2138. "200":
  2139. description: 成功。统一信封 code/message/data
  2140. /ops_team/member_remove@v1:
  2141. post:
  2142. summary: 移除运维成员
  2143. description: 删除前五项检查并注销账号。
  2144. operationId: ops_team_member_remove
  2145. tags:
  2146. - 运维团队与成员
  2147. x-require-auth: true
  2148. x-resource-type: bos.ops_team
  2149. x-action: manage
  2150. x-version: v1
  2151. x-permission-visibility: catalog
  2152. requestBody:
  2153. required: true
  2154. description: JSON 请求体,业务字段置于 data
  2155. content:
  2156. application/json:
  2157. schema:
  2158. type: object
  2159. description: 统一信封请求体,业务字段放在 data 内
  2160. properties:
  2161. data:
  2162. type: object
  2163. description: 业务参数
  2164. properties:
  2165. team_id:
  2166. type: string
  2167. description: 团队 ID
  2168. member_id:
  2169. type: string
  2170. description: 成员 ID
  2171. required:
  2172. - team_id
  2173. - member_id
  2174. required:
  2175. - data
  2176. responses:
  2177. "200":
  2178. description: 成功。统一信封 code/message/data
  2179. /ops_member/scope/save@v1:
  2180. post:
  2181. summary: 保存运维成员负责范围
  2182. description: 三个范围写入口之二。scope_mode∈follow_team/region/customer;越界报错不保存。
  2183. operationId: ops_member_scope_save
  2184. tags:
  2185. - 运维团队与成员
  2186. x-require-auth: true
  2187. x-resource-type: bos.ops_member.scope
  2188. x-action: manage
  2189. x-version: v1
  2190. x-permission-visibility: catalog
  2191. requestBody:
  2192. required: true
  2193. description: JSON 请求体,业务字段置于 data
  2194. content:
  2195. application/json:
  2196. schema:
  2197. type: object
  2198. description: 统一信封请求体,业务字段放在 data 内
  2199. properties:
  2200. data:
  2201. type: object
  2202. description: 业务参数
  2203. properties:
  2204. member_id:
  2205. type: string
  2206. description: 成员 ID
  2207. scope_mode:
  2208. type: string
  2209. description: 范围模式:follow_team=跟随团队;region=按区域;customer=按客户
  2210. enum:
  2211. - follow_team
  2212. - region
  2213. - customer
  2214. targets:
  2215. type: array
  2216. description: region/customer 模式下的目标 ID 列表
  2217. items:
  2218. type: string
  2219. description: 目标 ID
  2220. required:
  2221. - member_id
  2222. - scope_mode
  2223. required:
  2224. - data
  2225. responses:
  2226. "200":
  2227. description: 成功。统一信封 code/message/data
  2228. /ops_team/dispatch_mode/update@v1:
  2229. post:
  2230. summary: 更新分派方式
  2231. description: 与运营侧改同一字段,后写入者生效;默认补记审计。
  2232. operationId: ops_team_dispatch_mode_update
  2233. tags:
  2234. - 运维团队与成员
  2235. x-require-auth: true
  2236. x-resource-type: bos.ops_team.dispatch_mode
  2237. x-action: update
  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. dispatch_mode:
  2257. type: string
  2258. description: 分派方式:manual=手工;auto_avg=自动均分
  2259. enum:
  2260. - manual
  2261. - auto_avg
  2262. required:
  2263. - team_id
  2264. - dispatch_mode
  2265. required:
  2266. - data
  2267. responses:
  2268. "200":
  2269. description: 成功。统一信封 code/message/data
  2270. /ops_team/coverage/get@v1:
  2271. post:
  2272. summary: 运维团队覆盖客户
  2273. description: 覆盖客户=团队区域范围(Tree) ∩ 本类型归属(Owner),与列表分页同源。注意:2026-11-08 由 GET 改 POST(R-5)。
  2274. operationId: ops_team_coverage_get
  2275. tags:
  2276. - 运维团队与成员
  2277. x-require-auth: true
  2278. x-resource-type: bos.ops_team.coverage
  2279. x-action: view
  2280. x-version: v1
  2281. x-permission-visibility: catalog
  2282. x-enumeration-kind: list
  2283. requestBody:
  2284. required: true
  2285. description: 统一信封请求体(无业务参数,data 传空对象以使网关注入授权上界)
  2286. content:
  2287. application/json:
  2288. schema:
  2289. type: object
  2290. properties:
  2291. data:
  2292. type: object
  2293. description: 无业务参数
  2294. required:
  2295. - data
  2296. responses:
  2297. "200":
  2298. description: 成功。统一信封 code/message/data
  2299. /customer/create@v1:
  2300. post:
  2301. summary: 新建客户
  2302. description: 客户建档(Opt-11 先挂树后建档)。`mount_request_id` 与 `parent_node_id` 至少给一个:给 `parent_node_id` 时由本接口完成「发号 → 平台资源树注册客户实例 → 回填挂载事实」;给 `mount_request_id` 时就近认领已存在的挂载申请。同时按 组织§4.5 为客户开通主账号(`primary_username` 留空=按主体号自动派生)。完整弹窗字段还可含识别号、联系人、地址、运维团队等。
  2303. operationId: customer_create
  2304. tags:
  2305. - 客户管理
  2306. x-require-auth: true
  2307. x-resource-type: bos.customer
  2308. x-action: create
  2309. x-version: v1
  2310. x-permission-visibility: catalog
  2311. requestBody:
  2312. required: true
  2313. description: JSON 请求体,业务字段置于 data
  2314. content:
  2315. application/json:
  2316. schema:
  2317. type: object
  2318. description: 统一信封请求体,业务字段放在 data 内
  2319. properties:
  2320. data:
  2321. type: object
  2322. description: 业务参数
  2323. properties:
  2324. customer_name:
  2325. type: string
  2326. description: 客户名称
  2327. subject_type:
  2328. type: string
  2329. description: 主体类型
  2330. operator_id:
  2331. type: string
  2332. description: 归属运营商 ID
  2333. partner_id:
  2334. type: string
  2335. description: 归属合伙人 ID(可选)
  2336. mount_request_id:
  2337. type: string
  2338. description: 挂载申请 ID(与 parent_node_id 二选一;有值=认领已有的挂载事实)
  2339. parent_node_id:
  2340. type: string
  2341. description: 所挂区域父节点 ID(与 mount_request_id 二选一;有值=由本接口完成平台挂树并回填挂载事实)
  2342. id_code:
  2343. type: string
  2344. description: 识别号(可选)
  2345. contact_name:
  2346. type: string
  2347. description: 联系人(可选)
  2348. contact_mobile:
  2349. type: string
  2350. description: 联系电话(可选)
  2351. address:
  2352. type: string
  2353. description: 地址(可选)
  2354. ops_team_ids:
  2355. type: array
  2356. description: 所挂运维团队 ID(**单支定案** 2026-11-12:建档必填**恰好 1 支**,数组形态仅兼容调用方;缺支/空数组/>1 支一律拒绝,且须在操作人负责范围内)
  2357. items:
  2358. type: string
  2359. description: 运维团队 ID
  2360. primary_username:
  2361. type: string
  2362. description: 客户主账号登录名(可选;留空=按主体号自动派生)。本接口自行调平台 iam-user/user/create@v1 建号
  2363. primary_mobile:
  2364. type: string
  2365. description: 客户主账号手机号(可选)
  2366. license:
  2367. type: object
  2368. description: 登记材料(营业执照影像,客户§2.1/§3.5;`U-97` 2026-11-03 定案)。影像本体由浏览器持自身账号票直传平台 `unified-oss`(本服务不收字节流、不开上传接口),建档只回报落库用的对象键+原始文件名。`object_key` 必须落在 `klt/customer/license/` 前缀下
  2369. properties:
  2370. object_key:
  2371. type: string
  2372. description: 平台 unified-oss 逻辑键(1–512 字符,须以 klt/customer/license/ 开头;不得是 URL/签名链接)
  2373. file_name:
  2374. type: string
  2375. description: 原始文件名(1–128 字符,不含路径分隔符;仅供页面展示)
  2376. required:
  2377. - object_key
  2378. - file_name
  2379. required:
  2380. - customer_name
  2381. - subject_type
  2382. - operator_id
  2383. required:
  2384. - data
  2385. responses:
  2386. "200":
  2387. description: 成功。统一信封 code/message/data
  2388. /customer/get_list@v1:
  2389. post:
  2390. summary: 客户列表
  2391. description: 按可见范围返回客户列表,支持筛选与分页。
  2392. operationId: customer_get_list
  2393. tags:
  2394. - 客户管理
  2395. x-require-auth: true
  2396. x-resource-type: bos.customer
  2397. x-action: list
  2398. x-version: v1
  2399. x-permission-visibility: catalog
  2400. requestBody:
  2401. required: true
  2402. description: JSON 请求体,业务字段置于 data
  2403. content:
  2404. application/json:
  2405. schema:
  2406. type: object
  2407. description: 统一信封请求体,业务字段放在 data 内
  2408. properties:
  2409. data:
  2410. type: object
  2411. description: 列表筛选参数
  2412. properties:
  2413. page:
  2414. type: integer
  2415. description: 页码(0 基索引,默认 0)
  2416. minimum: 0
  2417. default: 0
  2418. page_size:
  2419. type: integer
  2420. description: 每页条数(默认 20,上限 200)
  2421. minimum: 1
  2422. maximum: 200
  2423. default: 20
  2424. keyword:
  2425. type: string
  2426. description: 关键字筛选(可选)
  2427. region_node_id:
  2428. type: string
  2429. description: 区域筛选(可选)
  2430. operator_id:
  2431. type: string
  2432. description: 运营商筛选(可选)
  2433. partner_id:
  2434. type: string
  2435. description: 合伙人筛选(可选)
  2436. status:
  2437. type: string
  2438. description: 状态筛选(可选)
  2439. required:
  2440. - data
  2441. responses:
  2442. "200":
  2443. description: 成功。统一信封 code/message/data
  2444. /customer/get@v1:
  2445. post:
  2446. summary: 客户详情
  2447. 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 天,起算点=建档日、重新上传不重置)⇒ 两格为 `null`。注意:对象键不上响应体、签名不落库。
  2448. operationId: customer_get
  2449. tags:
  2450. - 客户管理
  2451. x-require-auth: true
  2452. x-resource-type: bos.customer
  2453. x-action: view
  2454. x-version: v1
  2455. x-permission-visibility: catalog
  2456. requestBody:
  2457. required: true
  2458. description: JSON 请求体,业务字段置于 data
  2459. content:
  2460. application/json:
  2461. schema:
  2462. type: object
  2463. description: 统一信封请求体,业务字段放在 data 内
  2464. properties:
  2465. data:
  2466. type: object
  2467. description: 业务参数
  2468. properties:
  2469. customer_id:
  2470. type: string
  2471. description: 客户 ID
  2472. required:
  2473. - customer_id
  2474. required:
  2475. - data
  2476. responses:
  2477. "200":
  2478. description: 成功。统一信封 code/message/data
  2479. /customer/update@v1:
  2480. post:
  2481. summary: 编辑客户
  2482. description: 编辑客户资料。拒收改写 customer_id/region_node_id/operator_id/partner_id;改识别号须带 change_basis。
  2483. operationId: customer_update
  2484. tags:
  2485. - 客户管理
  2486. x-require-auth: true
  2487. x-resource-type: bos.customer
  2488. x-action: update
  2489. x-version: v1
  2490. x-permission-visibility: catalog
  2491. requestBody:
  2492. required: true
  2493. description: JSON 请求体,业务字段置于 data
  2494. content:
  2495. application/json:
  2496. schema:
  2497. type: object
  2498. description: 统一信封请求体,业务字段放在 data 内
  2499. properties:
  2500. data:
  2501. type: object
  2502. description: 业务参数
  2503. properties:
  2504. customer_id:
  2505. type: string
  2506. description: 客户 ID
  2507. customer_name:
  2508. type: string
  2509. description: 客户名称
  2510. subject_type:
  2511. type: string
  2512. description: 主体类型
  2513. id_code:
  2514. type: string
  2515. description: 识别号
  2516. change_basis:
  2517. type: string
  2518. description: 改识别号时的变更依据
  2519. contact_name:
  2520. type: string
  2521. description: 联系人
  2522. contact_mobile:
  2523. type: string
  2524. description: 联系电话
  2525. address:
  2526. type: string
  2527. description: 地址
  2528. ops_team_ids:
  2529. type: array
  2530. description: 改派运维团队(整体替换当前归属;**单支定案**:最多 1 支——空数组=清空归属⇒拒绝,>1 支⇒拒绝;不提交=不改动)
  2531. items:
  2532. type: string
  2533. description: 运维团队 ID
  2534. row_version:
  2535. type: integer
  2536. description: 乐观锁版本(若启用)
  2537. license:
  2538. type: object
  2539. description: 登记材料(营业执照影像)**整对替换**(客户§3.5 补传/替换,写入口只在本分区)。不提交=本次不动影像(不清空);**唯一例外**:本次把 `subject_type` 改为非企业(`individual`/`sole_proprietor`)且库内有影像 ⇒ 影像随本笔**同批撤销**(两列置 `NULL`+`license_file_name` 变更留痕,见 2026-11-15 死锁修复);企业→企业不带 `license` 一律不动影像;企业客户库内无影像且本次也不提交 ⇒ 按企业条件必填拒绝(`11103` 口径)。`object_key` 须落在 `klt/customer/license/` 下
  2540. properties:
  2541. object_key:
  2542. type: string
  2543. description: 平台 unified-oss 逻辑键(1–512 字符,须以 klt/customer/license/ 开头)
  2544. file_name:
  2545. type: string
  2546. description: 原始文件名(1–128 字符,不含路径分隔符)
  2547. required:
  2548. - object_key
  2549. - file_name
  2550. required:
  2551. - customer_id
  2552. required:
  2553. - data
  2554. responses:
  2555. "200":
  2556. description: 成功。统一信封 code/message/data
  2557. /customer/delete_precheck@v1:
  2558. post:
  2559. summary: 客户删除前置检查
  2560. description: 返回 can_delete 与 reasons,供删除确认弹窗使用。
  2561. operationId: customer_delete_precheck
  2562. tags:
  2563. - 客户管理
  2564. x-require-auth: true
  2565. x-resource-type: bos.customer
  2566. x-action: view
  2567. x-version: v1
  2568. x-permission-visibility: catalog
  2569. requestBody:
  2570. required: true
  2571. description: JSON 请求体,业务字段置于 data
  2572. content:
  2573. application/json:
  2574. schema:
  2575. type: object
  2576. description: 统一信封请求体,业务字段放在 data 内
  2577. properties:
  2578. data:
  2579. type: object
  2580. description: 业务参数
  2581. properties:
  2582. customer_id:
  2583. type: string
  2584. description: 客户 ID
  2585. required:
  2586. - customer_id
  2587. required:
  2588. - data
  2589. responses:
  2590. "200":
  2591. description: 成功。统一信封 code/message/data
  2592. /customer/delete@v1:
  2593. post:
  2594. summary: 删除客户
  2595. description: 删除客户;须携带删除前置检查时的阻塞快照版本。
  2596. operationId: customer_delete
  2597. tags:
  2598. - 客户管理
  2599. x-require-auth: true
  2600. x-resource-type: bos.customer
  2601. x-action: delete
  2602. x-version: v1
  2603. x-permission-visibility: catalog
  2604. requestBody:
  2605. required: true
  2606. description: JSON 请求体,业务字段置于 data
  2607. content:
  2608. application/json:
  2609. schema:
  2610. type: object
  2611. description: 统一信封请求体,业务字段放在 data 内
  2612. properties:
  2613. data:
  2614. type: object
  2615. description: 业务参数
  2616. properties:
  2617. customer_id:
  2618. type: string
  2619. description: 客户 ID
  2620. precheck_version:
  2621. type: string
  2622. description: 删除前置检查快照版本
  2623. required:
  2624. - customer_id
  2625. required:
  2626. - data
  2627. responses:
  2628. "200":
  2629. description: 成功。统一信封 code/message/data
  2630. /customer/history@v1:
  2631. post:
  2632. summary: 客户变更历史
  2633. description: 查询客户档案变更流水。
  2634. operationId: customer_history
  2635. tags:
  2636. - 客户管理
  2637. x-require-auth: true
  2638. x-resource-type: bos.customer
  2639. x-action: view
  2640. x-version: v1
  2641. x-permission-visibility: catalog
  2642. requestBody:
  2643. required: true
  2644. description: JSON 请求体,业务字段置于 data
  2645. content:
  2646. application/json:
  2647. schema:
  2648. type: object
  2649. description: 统一信封请求体,业务字段放在 data 内
  2650. properties:
  2651. data:
  2652. type: object
  2653. description: 业务参数
  2654. properties:
  2655. customer_id:
  2656. type: string
  2657. description: 客户 ID
  2658. page:
  2659. type: integer
  2660. description: 页码(0 基索引,默认 0)
  2661. minimum: 0
  2662. default: 0
  2663. page_size:
  2664. type: integer
  2665. description: 每页条数(默认 20,上限 200)
  2666. minimum: 1
  2667. maximum: 200
  2668. default: 20
  2669. keyword:
  2670. type: string
  2671. description: 关键字筛选(可选)
  2672. required:
  2673. - customer_id
  2674. required:
  2675. - data
  2676. responses:
  2677. "200":
  2678. description: 成功。统一信封 code/message/data
  2679. /customer/mount_candidates@v1:
  2680. post:
  2681. summary: 改挂候选客户
  2682. description: 返回操作人可见范围内可作为改挂目标的候选客户列表。注意:2026-11-08 由 GET 改 POST(R-5)。
  2683. operationId: customer_mount_candidates
  2684. tags:
  2685. - 客户管理
  2686. x-require-auth: true
  2687. x-resource-type: bos.customer
  2688. x-action: view
  2689. x-version: v1
  2690. x-permission-visibility: catalog
  2691. x-enumeration-kind: list
  2692. requestBody:
  2693. required: true
  2694. description: 统一信封请求体(无业务参数,data 传空对象以使网关注入授权上界)
  2695. content:
  2696. application/json:
  2697. schema:
  2698. type: object
  2699. properties:
  2700. data:
  2701. type: object
  2702. description: 无业务参数
  2703. required:
  2704. - data
  2705. responses:
  2706. "200":
  2707. description: 成功。统一信封 code/message/data
  2708. /customer/influence@v1:
  2709. post:
  2710. summary: 改挂影响面
  2711. description: 改挂前必做前置:未办完工单数、当前责任人与团队、当期是否已出账等。
  2712. operationId: customer_influence
  2713. tags:
  2714. - 客户管理
  2715. x-require-auth: true
  2716. x-resource-type: bos.customer
  2717. x-action: view
  2718. x-version: v1
  2719. x-permission-visibility: catalog
  2720. requestBody:
  2721. required: true
  2722. description: JSON 请求体,业务字段置于 data
  2723. content:
  2724. application/json:
  2725. schema:
  2726. type: object
  2727. description: 统一信封请求体,业务字段放在 data 内
  2728. properties:
  2729. data:
  2730. type: object
  2731. description: 业务参数
  2732. properties:
  2733. customer_id:
  2734. type: string
  2735. description: 客户 ID
  2736. required:
  2737. - customer_id
  2738. required:
  2739. - data
  2740. responses:
  2741. "200":
  2742. description: 成功。统一信封 code/message/data
  2743. /customer/move_region@v1:
  2744. post:
  2745. summary: 客户改挂区域
  2746. description: 复合事务改挂区域;新区域省份须等于归属运营商档案省份。
  2747. operationId: customer_move_region
  2748. tags:
  2749. - 客户管理
  2750. x-require-auth: true
  2751. x-resource-type: bos.customer
  2752. x-action: update
  2753. x-version: v1
  2754. x-permission-visibility: catalog
  2755. requestBody:
  2756. required: true
  2757. description: JSON 请求体,业务字段置于 data
  2758. content:
  2759. application/json:
  2760. schema:
  2761. type: object
  2762. description: 统一信封请求体,业务字段放在 data 内
  2763. properties:
  2764. data:
  2765. type: object
  2766. description: 业务参数
  2767. properties:
  2768. customer_id:
  2769. type: string
  2770. description: 客户 ID
  2771. new_region_node_id:
  2772. type: string
  2773. description: 新挂载区域节点 ID
  2774. ops_team_ids:
  2775. type: array
  2776. description: 随改挂重绑的运维团队(**单支定案**:最多 1 支;不提交=不改动)
  2777. items:
  2778. type: string
  2779. description: 运维团队 ID
  2780. required:
  2781. - customer_id
  2782. - new_region_node_id
  2783. required:
  2784. - data
  2785. responses:
  2786. "200":
  2787. description: 成功。统一信封 code/message/data
  2788. /customer/attribution/update@v1:
  2789. post:
  2790. summary: 更新客户归属
  2791. description: 改归属运营商/合伙人;改运营商时档案省份须等于客户所挂区域省份。
  2792. operationId: customer_attribution_update
  2793. tags:
  2794. - 客户管理
  2795. x-require-auth: true
  2796. x-resource-type: bos.customer.attribution
  2797. x-action: update
  2798. x-version: v1
  2799. x-permission-visibility: catalog
  2800. requestBody:
  2801. required: true
  2802. description: JSON 请求体,业务字段置于 data
  2803. content:
  2804. application/json:
  2805. schema:
  2806. type: object
  2807. description: 统一信封请求体,业务字段放在 data 内
  2808. properties:
  2809. data:
  2810. type: object
  2811. description: 业务参数
  2812. properties:
  2813. customer_id:
  2814. type: string
  2815. description: 客户 ID
  2816. operator_id:
  2817. type: string
  2818. description: 新归属运营商 ID(可选)
  2819. partner_id:
  2820. type: string
  2821. description: 新归属合伙人 ID(可选,可清空)
  2822. required:
  2823. - customer_id
  2824. required:
  2825. - data
  2826. responses:
  2827. "200":
  2828. description: 成功。统一信封 code/message/data
  2829. /import_batch/template_download@v1:
  2830. get:
  2831. summary: 下载导入模板
  2832. description: 返回 14 列 xlsx 模板说明(format/columns/max_rows)。
  2833. operationId: import_batch_template_download
  2834. tags:
  2835. - 批量导入
  2836. x-require-auth: true
  2837. x-resource-type: bos.import_batch
  2838. x-action: export
  2839. x-version: v1
  2840. x-permission-visibility: catalog
  2841. responses:
  2842. "200":
  2843. description: 成功。统一信封 code/message/data
  2844. /import_batch/submit@v1:
  2845. post:
  2846. summary: 提交客户批量导入
  2847. description: 提交导入行对象列表,单批上限 500 行。列含客户名称、识别号、主体类型、联系人、电话、地址、区域、运营商、合伙人、运维团队、主账号等。
  2848. operationId: import_batch_submit
  2849. tags:
  2850. - 批量导入
  2851. x-require-auth: true
  2852. x-resource-type: bos.import_batch
  2853. x-action: create
  2854. x-version: v1
  2855. x-permission-visibility: catalog
  2856. requestBody:
  2857. required: true
  2858. description: JSON 请求体,业务字段置于 data
  2859. content:
  2860. application/json:
  2861. schema:
  2862. type: object
  2863. description: 统一信封请求体,业务字段放在 data 内
  2864. properties:
  2865. data:
  2866. type: object
  2867. description: 业务参数
  2868. properties:
  2869. rows:
  2870. type: array
  2871. description: 导入行对象列表(≤500)
  2872. maxItems: 500
  2873. items:
  2874. type: object
  2875. description: 单行导入字段(14 列)
  2876. properties:
  2877. row_no:
  2878. type: integer
  2879. description: 行编号
  2880. customer_name:
  2881. type: string
  2882. description: 客户名称
  2883. id_code:
  2884. type: string
  2885. description: 识别号
  2886. subject_type:
  2887. type: string
  2888. description: 主体类型
  2889. contact_name:
  2890. type: string
  2891. description: 联系人
  2892. contact_mobile:
  2893. type: string
  2894. description: 联系电话
  2895. address:
  2896. type: string
  2897. description: 地址
  2898. region_name:
  2899. type: string
  2900. description: 所挂区域
  2901. operator_name:
  2902. type: string
  2903. description: 运营商
  2904. partner_name:
  2905. type: string
  2906. description: 合伙人
  2907. ops_team_names:
  2908. type: array
  2909. description: 所挂运维团队名称(**单支定案** 2026-11-12:建档必填**恰好 1 支**——一格只填一支名称,不得用「;」分隔多支;留空或多支=该行校验失败)
  2910. items:
  2911. type: string
  2912. description: 运维团队名称
  2913. primary_username:
  2914. type: string
  2915. description: 主账号登录名
  2916. primary_mobile:
  2917. type: string
  2918. description: 主账号手机号
  2919. required:
  2920. - rows
  2921. required:
  2922. - data
  2923. responses:
  2924. "200":
  2925. description: 成功。统一信封 code/message/data
  2926. /import_batch/get_list@v1:
  2927. post:
  2928. summary: 导入批次列表
  2929. description: 查询本人可见范围内的导入批次。
  2930. operationId: import_batch_get_list
  2931. tags:
  2932. - 批量导入
  2933. x-require-auth: true
  2934. x-resource-type: bos.import_batch
  2935. x-action: list
  2936. x-version: v1
  2937. x-permission-visibility: catalog
  2938. requestBody:
  2939. required: true
  2940. description: JSON 请求体,业务字段置于 data
  2941. content:
  2942. application/json:
  2943. schema:
  2944. type: object
  2945. description: 统一信封请求体,业务字段放在 data 内
  2946. properties:
  2947. data:
  2948. type: object
  2949. description: 列表筛选参数
  2950. properties:
  2951. page:
  2952. type: integer
  2953. description: 页码(0 基索引,默认 0)
  2954. minimum: 0
  2955. default: 0
  2956. page_size:
  2957. type: integer
  2958. description: 每页条数(默认 20,上限 200)
  2959. minimum: 1
  2960. maximum: 200
  2961. default: 20
  2962. keyword:
  2963. type: string
  2964. description: 关键字筛选(可选)
  2965. required:
  2966. - data
  2967. responses:
  2968. "200":
  2969. description: 成功。统一信封 code/message/data
  2970. /import_batch/get@v1:
  2971. post:
  2972. summary: 导入批次详情
  2973. description: 按批次 ID/编号查询详情与行状态。
  2974. operationId: import_batch_get
  2975. tags:
  2976. - 批量导入
  2977. x-require-auth: true
  2978. x-resource-type: bos.import_batch
  2979. x-action: view
  2980. x-version: v1
  2981. x-permission-visibility: catalog
  2982. requestBody:
  2983. required: true
  2984. description: JSON 请求体,业务字段置于 data
  2985. content:
  2986. application/json:
  2987. schema:
  2988. type: object
  2989. description: 统一信封请求体,业务字段放在 data 内
  2990. properties:
  2991. data:
  2992. type: object
  2993. description: 业务参数
  2994. properties:
  2995. batch_id:
  2996. type: string
  2997. description: 批次 ID(与 batch_no 二选一)
  2998. batch_no:
  2999. type: string
  3000. description: 批次编号(与 batch_id 二选一)
  3001. required:
  3002. - data
  3003. responses:
  3004. "200":
  3005. description: 成功。统一信封 code/message/data
  3006. /import_batch/resume@v1:
  3007. post:
  3008. summary: 失败行续传
  3009. description: 针对失败行提交续传数据,行号对应原 row_no。
  3010. operationId: import_batch_resume
  3011. tags:
  3012. - 批量导入
  3013. x-require-auth: true
  3014. x-resource-type: bos.import_batch
  3015. x-action: update
  3016. x-version: v1
  3017. x-permission-visibility: catalog
  3018. requestBody:
  3019. required: true
  3020. description: JSON 请求体,业务字段置于 data
  3021. content:
  3022. application/json:
  3023. schema:
  3024. type: object
  3025. description: 统一信封请求体,业务字段放在 data 内
  3026. properties:
  3027. data:
  3028. type: object
  3029. description: 业务参数
  3030. properties:
  3031. batch_id:
  3032. type: string
  3033. description: 批次 ID
  3034. rows:
  3035. type: array
  3036. description: 续传行列表(含原 row_no)
  3037. items:
  3038. type: object
  3039. required:
  3040. - batch_id
  3041. - rows
  3042. required:
  3043. - data
  3044. responses:
  3045. "200":
  3046. description: 成功。统一信封 code/message/data
  3047. /import_batch/export_codes@v1:
  3048. post:
  3049. summary: 按批次导出激活码
  3050. description: 语义同账号导出(与 `/account/export_codes@v1` 共用分片/翻页/审计/出参);须传批次与按本人可见范围收窄后的 user_ids(不可传空列表:空值=项目内全量);scope 服务端派生,不收 scope_type/scope_id;validity 默认 `valid`,不接受 `active`。出参含 `batch_id`/`batch_no` 与 `items[].plaintext`(只回显一次,逐次审计);批次可见性先过第一道收窄。D-84 口径(产品 2026-11-15 确认):「按批次」只是取数入口,交付范围=本人可见账号集(`user_ids` 已与本人可见范围求交),不再与 `import_batch_row` 的批次行账号求交;调用方因此不得把该接口理解为「只导出该批次产生的账号」。
  3051. operationId: import_batch_export_codes
  3052. tags:
  3053. - 批量导入
  3054. x-require-auth: true
  3055. x-resource-type: bos.import_batch
  3056. x-action: export
  3057. x-version: v1
  3058. x-permission-visibility: catalog
  3059. requestBody:
  3060. required: true
  3061. description: JSON 请求体,业务字段置于 data
  3062. content:
  3063. application/json:
  3064. schema:
  3065. type: object
  3066. description: 统一信封请求体,业务字段放在 data 内
  3067. properties:
  3068. data:
  3069. type: object
  3070. description: 业务参数
  3071. properties:
  3072. batch_id:
  3073. type: string
  3074. description: 批次 ID
  3075. user_ids:
  3076. type: array
  3077. description: 按本人可见范围收窄后的用户 ID 列表(不可传空列表:平台侧空值=项目内全量导出)
  3078. minItems: 1
  3079. items:
  3080. type: string
  3081. description: 用户 ID
  3082. validity:
  3083. type: string
  3084. description: 导出口径(平台取值域):valid=仍有效(只读,缺省);expired=已过期(写);all=全部(写)。不接受 active
  3085. default: valid
  3086. enum:
  3087. - valid
  3088. - expired
  3089. - all
  3090. required:
  3091. - batch_id
  3092. - user_ids
  3093. required:
  3094. - data
  3095. responses:
  3096. "200":
  3097. description: 成功。统一信封 code/message/data
  3098. /import_batch/export_customers@v1:
  3099. post:
  3100. summary: 按批次导出客户
  3101. description: 按导入批次导出客户 15 列结果。
  3102. operationId: import_batch_export_customers
  3103. tags:
  3104. - 批量导入
  3105. x-require-auth: true
  3106. x-resource-type: bos.import_batch
  3107. x-action: export
  3108. x-version: v1
  3109. x-permission-visibility: catalog
  3110. requestBody:
  3111. required: true
  3112. description: JSON 请求体,业务字段置于 data
  3113. content:
  3114. application/json:
  3115. schema:
  3116. type: object
  3117. description: 统一信封请求体,业务字段放在 data 内
  3118. properties:
  3119. data:
  3120. type: object
  3121. description: 业务参数
  3122. properties:
  3123. batch_id:
  3124. type: string
  3125. description: 批次 ID
  3126. required:
  3127. - batch_id
  3128. required:
  3129. - data
  3130. responses:
  3131. "200":
  3132. description: 成功。统一信封 code/message/data
  3133. /sub_account/get_list@v1:
  3134. post:
  3135. summary: 分账号列表
  3136. description: 查询客户下属分账号列表。
  3137. operationId: sub_account_get_list
  3138. tags:
  3139. - 账号管理
  3140. x-require-auth: true
  3141. x-resource-type: bos.sub_account
  3142. x-action: list
  3143. x-version: v1
  3144. x-permission-visibility: catalog
  3145. requestBody:
  3146. required: true
  3147. description: JSON 请求体,业务字段置于 data
  3148. content:
  3149. application/json:
  3150. schema:
  3151. type: object
  3152. description: 统一信封请求体,业务字段放在 data 内
  3153. properties:
  3154. data:
  3155. type: object
  3156. description: 业务参数
  3157. properties:
  3158. customer_id:
  3159. type: string
  3160. description: 客户 ID
  3161. page:
  3162. type: integer
  3163. description: 页码(0 基索引,默认 0)
  3164. minimum: 0
  3165. default: 0
  3166. page_size:
  3167. type: integer
  3168. description: 每页条数(默认 20,上限 200)
  3169. minimum: 1
  3170. maximum: 200
  3171. default: 20
  3172. keyword:
  3173. type: string
  3174. description: 关键字筛选(可选)
  3175. required:
  3176. - customer_id
  3177. required:
  3178. - data
  3179. responses:
  3180. "200":
  3181. description: 成功。统一信封 code/message/data
  3182. /sub_account/update@v1:
  3183. post:
  3184. summary: 更新分账号
  3185. description: 运营可改 display_name 与 network_account_name;客户主账号只许改 display_name。
  3186. operationId: sub_account_update
  3187. tags:
  3188. - 账号管理
  3189. x-require-auth: true
  3190. x-resource-type: bos.sub_account
  3191. x-action: update
  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. sub_account_id:
  3208. type: string
  3209. description: 分账号 ID
  3210. display_name:
  3211. type: string
  3212. description: 显示名称/用途说明
  3213. network_account_name:
  3214. type: string
  3215. description: 网络侧账号名(运营可改)
  3216. required:
  3217. - sub_account_id
  3218. required:
  3219. - data
  3220. responses:
  3221. "200":
  3222. description: 成功。统一信封 code/message/data
  3223. /line_exit/get_list@v1:
  3224. post:
  3225. summary: 线路出口目录列表
  3226. description: 套餐配置统一维护的线路出口(去空白+小写去重)。合同条目等页面只从这里选择;任何登录角色可读。每条带 ref_count/ref_summary(被合同条目、存量 IP 备案、派生档、订阅引用的合计与构成;IP 备案表自 2026-11-17 起停写,只计入历史行),>0 即目录侧不允许删除。
  3227. operationId: line_exit_get_list
  3228. tags:
  3229. - 套餐档位
  3230. x-require-auth: true
  3231. x-resource-type: bos.catalog
  3232. x-action: list
  3233. x-version: v1
  3234. x-permission-visibility: catalog
  3235. responses:
  3236. "200":
  3237. description: 成功。统一信封 code/message/data(data.items[]=exit_name/exit_key/sort_no/ref_count/ref_summary)
  3238. /line_exit/save@v1:
  3239. post:
  3240. summary: 线路出口目录整段全量替换
  3241. description: 总运营/运营主账号可写;数组顺序即展示顺序。被合同条目、IP 备案、派生档或订阅引用的出口不可删除(整单拒绝并点名引用数)。
  3242. operationId: line_exit_save
  3243. tags:
  3244. - 套餐档位
  3245. x-require-auth: true
  3246. x-resource-type: bos.catalog
  3247. x-action: update
  3248. x-version: v1
  3249. x-permission-visibility: catalog
  3250. requestBody:
  3251. required: true
  3252. description: JSON 请求体,业务字段置于 data
  3253. content:
  3254. application/json:
  3255. schema:
  3256. type: object
  3257. description: 统一信封请求体,业务字段放在 data 内
  3258. properties:
  3259. data:
  3260. type: object
  3261. description: 业务参数
  3262. properties:
  3263. items:
  3264. type: array
  3265. description: 线路出口整段(全量替换,上限 200 条)
  3266. maxItems: 200
  3267. items:
  3268. type: object
  3269. description: 单个出口
  3270. properties:
  3271. exit_name:
  3272. type: string
  3273. description: 国家/地区名称原文(1~64 字;去空白+小写后不可重复)
  3274. required:
  3275. - exit_name
  3276. required:
  3277. - items
  3278. required:
  3279. - data
  3280. responses:
  3281. "200":
  3282. description: 成功。统一信封 code/message/data
  3283. /ip_bandwidth_tier/get_list@v1:
  3284. post:
  3285. summary: 带宽档位目录列表
  3286. description: 套餐配置「线路出口」tab 内统一维护的带宽档位。✅ 2026-11-17 改用途:主要作为**固定套餐/自定义套餐配置中带宽权益录入的快捷预设**(档位编辑器「03 带宽与权益」点一条即带出上/下行同值),另兼存量 IP 备案的历史引用;⛔ 与工单回填的 5/10/30 封闭三值互不约束。任何登录角色可读。每条带 ref_count/ref_summary(被存量 IP 备案引用的条数;该表自 2026-11-17 起停写),>0 即目录侧不允许删除。
  3287. operationId: ip_bandwidth_tier_get_list
  3288. tags:
  3289. - 套餐档位
  3290. x-require-auth: true
  3291. x-resource-type: bos.catalog
  3292. x-action: list
  3293. x-version: v1
  3294. x-permission-visibility: catalog
  3295. responses:
  3296. "200":
  3297. description: 成功。统一信封 code/message/data(data.items[]=tier_key/tier_name/bandwidth_tier_mbps/bandwidth_committed/sort_no/ref_count/ref_summary)
  3298. /ip_bandwidth_tier/save@v1:
  3299. post:
  3300. summary: 带宽档位目录整段全量替换
  3301. description: 总运营/运营主账号可写;数组顺序即展示顺序(也是套餐编辑器里预设胶囊的顺序);同一兆数只允许一条,「不承诺带宽」(bandwidth_tier_mbps 缺省或 null)全表唯一。被存量 IP 备案引用的档位不可删除(整单拒绝并点名引用条数)。⚠️ 本清单是套餐带宽权益的**快捷预设**,⛔ 反向约束套餐上手填的兆数。
  3302. operationId: ip_bandwidth_tier_save
  3303. tags:
  3304. - 套餐档位
  3305. x-require-auth: true
  3306. x-resource-type: bos.catalog
  3307. x-action: update
  3308. x-version: v1
  3309. x-permission-visibility: catalog
  3310. requestBody:
  3311. required: true
  3312. description: JSON 请求体,业务字段置于 data
  3313. content:
  3314. application/json:
  3315. schema:
  3316. type: object
  3317. description: 统一信封请求体,业务字段放在 data 内
  3318. properties:
  3319. data:
  3320. type: object
  3321. description: 业务参数
  3322. properties:
  3323. items:
  3324. type: array
  3325. description: 带宽档位整段(全量替换,上限 50 条)
  3326. maxItems: 50
  3327. items:
  3328. type: object
  3329. description: 单个档位
  3330. properties:
  3331. tier_name:
  3332. type: string
  3333. description: 展示名称(1~64 字,如「10 兆」「不承诺带宽」)
  3334. bandwidth_tier_mbps:
  3335. type: integer
  3336. nullable: true
  3337. description: 带宽兆数(1~10000);缺省或 null=「不承诺带宽」
  3338. required:
  3339. - tier_name
  3340. required:
  3341. - items
  3342. required:
  3343. - data
  3344. responses:
  3345. "200":
  3346. description: 成功。统一信封 code/message/data
  3347. /catalog/create@v1:
  3348. post:
  3349. summary: 新建套餐档位
  3350. description: 新建固定/自定义档位。拒收 monthly_settle_cents、sub_mode、first_referred_at。自定义档必填 customer_id。
  3351. operationId: catalog_create
  3352. tags:
  3353. - 套餐档位
  3354. x-require-auth: true
  3355. x-resource-type: bos.catalog
  3356. x-action: create
  3357. x-version: v1
  3358. x-permission-visibility: catalog
  3359. requestBody:
  3360. required: true
  3361. description: JSON 请求体,业务字段置于 data
  3362. content:
  3363. application/json:
  3364. schema:
  3365. type: object
  3366. description: 统一信封请求体,业务字段放在 data 内
  3367. properties:
  3368. data:
  3369. type: object
  3370. description: 业务参数
  3371. properties:
  3372. plan_kind:
  3373. type: string
  3374. description: 档位类型:fixed=固定;custom=自定义
  3375. enum:
  3376. - fixed
  3377. - custom
  3378. plan_name:
  3379. type: string
  3380. description: 档位名称
  3381. plan_desc:
  3382. type: string
  3383. description: 套餐说明(报价单权益口径,可空;去首尾空白后 ≤512 字符,超长报 11103)。引用冻结后仍可改(与名称、随附成本项同档)
  3384. use_category:
  3385. type: string
  3386. description: 用途分类:office/live/ai/value_add/customized
  3387. annual_price_cents:
  3388. type: integer
  3389. description: 年价(分)
  3390. sub_account_quota:
  3391. type: integer
  3392. description: 分账号配额
  3393. bandwidth_committed:
  3394. type: boolean
  3395. description: 是否承诺带宽(界面「是否承诺带宽」开关):true=承诺(缺省,同列 DEFAULT TRUE);false=该档「不承诺带宽」,此时上行/下行两字段一律不传
  3396. bandwidth_up_mbps:
  3397. type: integer
  3398. description: 上行带宽(Mbps,整数 1~1000);bandwidth_committed=true 时必填。不再有单值 total_bandwidth_mbps(2026-11-05 D8 关闭=该列退役,「总带宽」只是显示列名)
  3399. bandwidth_down_mbps:
  3400. type: integer
  3401. description: 下行带宽(Mbps,整数 1~1000);bandwidth_committed=true 时必填;与上行同值时界面并显「上下行 N 兆」,不等显「下行 X 兆 / 上行 Y 兆」
  3402. customer_id:
  3403. type: string
  3404. description: 自定义档所属客户 ID(custom 必填)
  3405. required:
  3406. - plan_kind
  3407. - plan_name
  3408. - use_category
  3409. - annual_price_cents
  3410. required:
  3411. - data
  3412. responses:
  3413. "200":
  3414. description: 成功。统一信封 code/message/data
  3415. /catalog/update@v1:
  3416. post:
  3417. summary: 编辑套餐档位
  3418. description: 编辑档位;use_category 建后不可改;被订阅引用冻结后多数字段只读。
  3419. operationId: catalog_update
  3420. tags:
  3421. - 套餐档位
  3422. x-require-auth: true
  3423. x-resource-type: bos.catalog
  3424. x-action: update
  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. plan_id:
  3441. type: string
  3442. description: 档位 ID
  3443. plan_name:
  3444. type: string
  3445. description: 档位名称
  3446. plan_desc:
  3447. type: string
  3448. description: 套餐说明(可空;传空串=清空成 null;≤512 字符)。引用冻结后仍可改
  3449. annual_price_cents:
  3450. type: integer
  3451. description: 年价(分)
  3452. sub_account_quota:
  3453. type: integer
  3454. description: 分账号配额
  3455. bandwidth_committed:
  3456. type: boolean
  3457. description: 是否承诺带宽:true=承诺(缺省);false=该档「不承诺带宽」,上下行两字段一律不传
  3458. bandwidth_up_mbps:
  3459. type: integer
  3460. description: 上行带宽(Mbps,整数 1~1000);bandwidth_committed=true 时必填,关闭「是否承诺带宽」时必不传(档位被订阅引用后随整单只读,K204)
  3461. bandwidth_down_mbps:
  3462. type: integer
  3463. description: 下行带宽(Mbps,整数 1~1000);必填规则同上,两值不折算为单值
  3464. row_version:
  3465. type: integer
  3466. description: 乐观锁版本(若启用)
  3467. required:
  3468. - plan_id
  3469. required:
  3470. - data
  3471. responses:
  3472. "200":
  3473. description: 成功。统一信封 code/message/data
  3474. /catalog/get_list@v1:
  3475. post:
  3476. summary: 套餐档位列表
  3477. description: 按 plan_kind 等条件筛选档位列表。
  3478. operationId: catalog_get_list
  3479. tags:
  3480. - 套餐档位
  3481. x-require-auth: true
  3482. x-resource-type: bos.catalog
  3483. x-action: list
  3484. x-version: v1
  3485. x-permission-visibility: catalog
  3486. requestBody:
  3487. required: true
  3488. description: JSON 请求体,业务字段置于 data
  3489. content:
  3490. application/json:
  3491. schema:
  3492. type: object
  3493. description: 统一信封请求体,业务字段放在 data 内
  3494. properties:
  3495. data:
  3496. type: object
  3497. description: 列表筛选参数
  3498. properties:
  3499. page:
  3500. type: integer
  3501. description: 页码(0 基索引,默认 0)
  3502. minimum: 0
  3503. default: 0
  3504. page_size:
  3505. type: integer
  3506. description: 每页条数(默认 20,上限 200)
  3507. minimum: 1
  3508. maximum: 200
  3509. default: 20
  3510. keyword:
  3511. type: string
  3512. description: 关键字筛选(可选)
  3513. plan_kind:
  3514. type: string
  3515. description: 档位类型筛选:fixed/custom
  3516. use_category:
  3517. type: string
  3518. description: 用途分类筛选
  3519. customer_id:
  3520. type: string
  3521. description: 自定义档客户筛选
  3522. required:
  3523. - data
  3524. responses:
  3525. "200":
  3526. description: 成功。统一信封 code/message/data
  3527. /catalog/get@v1:
  3528. post:
  3529. summary: 套餐档位详情
  3530. description: 按档位 ID 查询详情。
  3531. operationId: catalog_get
  3532. tags:
  3533. - 套餐档位
  3534. x-require-auth: true
  3535. x-resource-type: bos.catalog
  3536. x-action: view
  3537. x-version: v1
  3538. x-permission-visibility: catalog
  3539. requestBody:
  3540. required: true
  3541. description: JSON 请求体,业务字段置于 data
  3542. content:
  3543. application/json:
  3544. schema:
  3545. type: object
  3546. description: 统一信封请求体,业务字段放在 data 内
  3547. properties:
  3548. data:
  3549. type: object
  3550. description: 业务参数
  3551. properties:
  3552. plan_id:
  3553. type: string
  3554. description: 档位 ID
  3555. required:
  3556. - plan_id
  3557. required:
  3558. - data
  3559. responses:
  3560. "200":
  3561. description: 成功。统一信封 code/message/data
  3562. /catalog/delete@v1:
  3563. post:
  3564. summary: 套餐档位条件删除
  3565. description: 按档位 ID 条件删除(第3册§3.7):引用份数+两栏阻塞清单(subscriptions/items),在用⇒KLT-K205;固定档仅 Admin。
  3566. operationId: catalog_delete
  3567. tags:
  3568. - 套餐档位
  3569. x-require-auth: true
  3570. x-resource-type: bos.catalog
  3571. x-action: delete
  3572. x-version: v1
  3573. x-permission-visibility: catalog
  3574. requestBody:
  3575. required: true
  3576. description: JSON 请求体,业务字段置于 data
  3577. content:
  3578. application/json:
  3579. schema:
  3580. type: object
  3581. description: 统一信封请求体,业务字段放在 data 内
  3582. properties:
  3583. data:
  3584. type: object
  3585. description: 业务参数
  3586. properties:
  3587. plan_id:
  3588. type: string
  3589. description: 档位 ID
  3590. required:
  3591. - plan_id
  3592. required:
  3593. - data
  3594. responses:
  3595. "200":
  3596. description: 成功。统一信封 code/message/data
  3597. /catalog/customer_options@v1:
  3598. post:
  3599. summary: 归属客户下拉
  3600. description: 只列操作人可见客户(自定义档归属客户下拉,第3册§3.2);硬上限 500 行⇒truncated。
  3601. operationId: catalog_customer_options
  3602. tags:
  3603. - 套餐档位
  3604. x-require-auth: true
  3605. x-resource-type: bos.catalog
  3606. x-action: list
  3607. x-version: v1
  3608. x-permission-visibility: catalog
  3609. requestBody:
  3610. required: true
  3611. description: JSON 请求体,业务字段置于 data
  3612. content:
  3613. application/json:
  3614. schema:
  3615. type: object
  3616. description: 统一信封请求体,业务字段放在 data 内
  3617. properties:
  3618. data:
  3619. type: object
  3620. description: 列表筛选参数
  3621. properties:
  3622. keyword:
  3623. type: string
  3624. description: 客户名称关键字(可选)
  3625. required:
  3626. - data
  3627. responses:
  3628. "200":
  3629. description: 成功。统一信封 code/message/data
  3630. /plan_cost_item/get_list@v1:
  3631. post:
  3632. summary: 档位随附成本项列表
  3633. description: 按档位读取随附成本项(第3册§3.5):名称是弱引用,不校验是否在全局清单;frozen 仅供前端提示。
  3634. operationId: plan_cost_item_get_list
  3635. tags:
  3636. - 套餐档位
  3637. x-require-auth: true
  3638. x-resource-type: bos.plan_cost_item
  3639. x-action: list
  3640. x-version: v1
  3641. x-permission-visibility: catalog
  3642. requestBody:
  3643. required: true
  3644. description: JSON 请求体,业务字段置于 data
  3645. content:
  3646. application/json:
  3647. schema:
  3648. type: object
  3649. description: 统一信封请求体,业务字段放在 data 内
  3650. properties:
  3651. data:
  3652. type: object
  3653. description: 业务参数
  3654. properties:
  3655. plan_id:
  3656. type: string
  3657. description: 档位 ID
  3658. required:
  3659. - plan_id
  3660. required:
  3661. - data
  3662. responses:
  3663. "200":
  3664. description: 成功。统一信封 code/message/data
  3665. /plan_cost_item/save@v1:
  3666. post:
  3667. summary: 档位随附成本项整段全量替换
  3668. description: 一次提交该档位全部成本项(先按 plan_id 删净再逐条插,第3册§3.5);同档位名称重复⇒KLT-K206。
  3669. operationId: plan_cost_item_save
  3670. tags:
  3671. - 套餐档位
  3672. x-require-auth: true
  3673. x-resource-type: bos.plan_cost_item
  3674. x-action: update
  3675. x-version: v1
  3676. x-permission-visibility: catalog
  3677. requestBody:
  3678. required: true
  3679. description: JSON 请求体,业务字段置于 data
  3680. content:
  3681. application/json:
  3682. schema:
  3683. type: object
  3684. description: 统一信封请求体,业务字段放在 data 内
  3685. properties:
  3686. data:
  3687. type: object
  3688. description: 业务参数
  3689. properties:
  3690. plan_id:
  3691. type: string
  3692. description: 档位 ID
  3693. items:
  3694. type: array
  3695. description: 成本项整段(全量替换,上限 50 条)
  3696. maxItems: 50
  3697. items:
  3698. type: object
  3699. description: 成本项条目
  3700. properties:
  3701. item_name:
  3702. type: string
  3703. description: 成本项名称(弱引用,1~128 字)
  3704. amount_cents:
  3705. type: integer
  3706. description: 金额(分,≥0)
  3707. minimum: 0
  3708. billing_unit:
  3709. type: string
  3710. description: 计费单位(可选)
  3711. enum:
  3712. - per_customer
  3713. - per_account
  3714. - per_copy
  3715. category:
  3716. type: string
  3717. description: 成本项分类(可选)
  3718. enum:
  3719. - intl_resource
  3720. - device_purchase
  3721. - project_fee
  3722. remark:
  3723. type: string
  3724. description: 备注(可选,上限 512 字)
  3725. sort_no:
  3726. type: integer
  3727. description: 排序号(≥0)
  3728. minimum: 0
  3729. required:
  3730. - item_name
  3731. - amount_cents
  3732. required:
  3733. - plan_id
  3734. required:
  3735. - data
  3736. responses:
  3737. "200":
  3738. description: 成功。统一信封 code/message/data
  3739. /contract/create@v1:
  3740. post:
  3741. summary: 新建合同
  3742. 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_* 是运营商交接单上的经办人(姓名/电话/交接日期必填、机构选填)。2026-11-17 起服务构成条目可带 service_items[].succession(契约内逐条替换=升降配):合同、条目、派生档、IP、截原、新订阅、额度写入同一条 dml_batch(任一条 0 行即整批回滚),应答新增 data.replacements[](item_index/mode/subscription_id/replaces_subscription_id/ticket_type/ticket_no/note/audit_written)回执,供页面提示「已建订阅与工单类型」。2026-11-17 二轮:① 替换判据加入「期间相交」——原订阅在新订阅开始前已到期 ⇒ 不是替换而是到期续签,该条目的 succession 被忽略、按续签新开(mode=renewed、不截原、不出 updown);② 新增 data.renew_from_contract_id 显式续签(每个条目各生成一份不带替换边的订阅),与 succession 互斥;③ 新订阅开始日改取**合同生效日**(不再取业务当天);④ 合同新建页补跑 I6 最终行集复检。2026-11-17 四轮:续签(renew_from_contract_id)时逐条比对续签源合同的条目「服务内容」(形式/套餐式 plan_id/份数/自定义式分类+席位+上下行带宽/归一化线路出口;⛔ 比价格与 item_id/derived_plan_id)——逐条一致 ∧ 客户在用 ⇒ **不生成开通工单**(应答 replacements[].ticket_type=null、note 说明,顶层 renewal_service_unchanged=true),并把该新订阅的 actual_opened_at 写为**订阅开始日**(actual_opened_at 的第二写入方,第一仍是工单回填);客户停用/未开通仍按原判据出 open/service_open。有工单时 replacements[] 行内 ticket_type 取 updown/open/service_open。
  3743. operationId: contract_create
  3744. tags:
  3745. - 合同
  3746. x-require-auth: true
  3747. x-resource-type: bos.contract
  3748. x-action: create
  3749. x-version: v1
  3750. x-permission-visibility: catalog
  3751. requestBody:
  3752. required: true
  3753. description: JSON 请求体,业务字段置于 data
  3754. content:
  3755. application/json:
  3756. schema:
  3757. type: object
  3758. description: 统一信封请求体,业务字段放在 data 内
  3759. properties:
  3760. data:
  3761. type: object
  3762. description: 业务参数
  3763. properties:
  3764. customer_id:
  3765. type: string
  3766. description: 签约客户 ID。与 customer_inline **只可二选一**:命中已有客户填本项;未命中改用内联建档段
  3767. customer_inline:
  3768. type: object
  3769. description: >-
  3770. 客户未命中时的内联建档段(需求 §5.3 CU-13;业主 2026-11-16 定案关闭 CU-41)。
  3771. 本段先按 `/customer/create@v1` 的同一套规则建档(两个事务:建档 → 合同,不合并),
  3772. 再签本合同;建档含客户主账号(未设初始口令 ⇒ 待激活、发激活码,明文不在本响应内下发)。
  3773. 注意:唯一与页面建档不同的判据=企业营业执照影像**可留空**(本通道例外),
  3774. 建档后到客户档案「登记材料」格补传/替换。主体类型非企业时不收 license。
  3775. properties:
  3776. customer_name:
  3777. type: string
  3778. description: 客户名称(必填;允许重名,查重靠识别号)
  3779. subject_type:
  3780. type: string
  3781. description: 主体类型(必填):enterprise/individual/sole_proprietor
  3782. enum:
  3783. - enterprise
  3784. - individual
  3785. - sole_proprietor
  3786. id_code:
  3787. type: string
  3788. description: 客户识别号(必填):既是安全存储载体,也是合同事务失败后重试的幂等键(不得省略)
  3789. contact_name:
  3790. type: string
  3791. description: 客户经办联系人
  3792. contact_mobile:
  3793. type: string
  3794. description: 联系电话
  3795. address:
  3796. type: string
  3797. description: 客户地址
  3798. parent_node_id:
  3799. type: string
  3800. description: 挂载区域(必填;区域树节点 ID,与 /customer/create@v1 的 parent_node_id 同义)
  3801. operator_id:
  3802. type: string
  3803. description: 归属运营商(必填;候选=所挂区域省份下可见的运营商档案,须同省)
  3804. ops_team_ids:
  3805. type: array
  3806. description: 运维团队(必填且**恰好 1 支**,单支定案;不得为空数组/不得传多支)
  3807. items:
  3808. type: string
  3809. description: 团队 ID
  3810. license:
  3811. type: object
  3812. description: 营业执照影像(本通道**可留空**;非企业主体不收)。两键成对
  3813. properties:
  3814. object_key:
  3815. type: string
  3816. description: 平台对象存储对象键(浏览器直传后回报,须在客户影像前缀下)
  3817. file_name:
  3818. type: string
  3819. description: 原始文件名(仅展示)
  3820. required:
  3821. - object_key
  3822. - file_name
  3823. primary_username:
  3824. type: string
  3825. description: 客户主账号登录名(选填;留空按主体号派生)
  3826. primary_mobile:
  3827. type: string
  3828. description: 主账号绑定手机号(选填,11 位)
  3829. required:
  3830. - customer_name
  3831. - subject_type
  3832. - id_code
  3833. - parent_node_id
  3834. - operator_id
  3835. - ops_team_ids
  3836. contract_no:
  3837. type: string
  3838. description: 合同编号(空则服务端发号)
  3839. external_no:
  3840. type: string
  3841. description: 外部合同号(可选)
  3842. contract_amount_cents:
  3843. type: integer
  3844. description: 合同金额(分,可选)
  3845. pay_cycle:
  3846. type: string
  3847. description: 付款周期:yearly/quarterly/monthly
  3848. enum:
  3849. - yearly
  3850. - quarterly
  3851. - monthly
  3852. start_date:
  3853. type: string
  3854. description: 合同开始日期(YYYY-MM-DD)
  3855. format: date
  3856. end_date:
  3857. type: string
  3858. description: >-
  3859. 合同结束日期(YYYY-MM-DD)。**可省略**(2026-11-17 定案):省略时服务端按
  3860. 「生效日+付款周期」推算=年付 12/季付 3/月付 1 个月再减一天,该月无对应日先取月末
  3861. (录入页面已把它锁成只读推算值)。显式给出则按显式值落库(运营商同步可表达跨多个付款周期的合同)。
  3862. format: date
  3863. agent_name:
  3864. type: string
  3865. description: 运营商经办人姓名(交接单三段之二,必填;不是录入账号 created_by)
  3866. agent_mobile:
  3867. type: string
  3868. description: 运营商经办人联系方式(交接单三段之三,必填)
  3869. agent_handover_on:
  3870. type: string
  3871. description: >-
  3872. 经办交接日期(交接日期,**必填**;录入页面默认取录入当日=Asia/Shanghai 业务日,
  3873. 接口须显式给出,服务端不代填)
  3874. format: date
  3875. agent_org:
  3876. type: string
  3877. description: 运营商经办人机构(交接单三段之一,选填)
  3878. attachment_url:
  3879. type: string
  3880. maxLength: 512
  3881. description: >-
  3882. 合同附件(单值,可选):外部 http(s) 链接,或浏览器直传平台对象存储
  3883. (seoh-unified-oss 两段式)成功后回报的对象键,前缀必须为
  3884. klt/contract/attachment/。空串=清空。对象键不得当作可直接打开的链接,
  3885. 详情读口另下发 attachment_view_url(短时效现签)。
  3886. service_items:
  3887. type: array
  3888. description: 服务构成条目列表
  3889. items:
  3890. type: object
  3891. description: 服务条目
  3892. properties:
  3893. item_kind:
  3894. type: string
  3895. description: 条目类型:plan_based/custom_spec
  3896. plan_id:
  3897. type: string
  3898. description: 档位 ID(plan_based)
  3899. quantity:
  3900. type: integer
  3901. description: 数量
  3902. account_count:
  3903. type: integer
  3904. description: 账号数(custom_spec)
  3905. bandwidth_up_mbps:
  3906. type: integer
  3907. description: 上行带宽(Mbps,整数 1~1000,custom_spec);与下行至少填一侧,只填一侧时按上下行对称填同一值
  3908. bandwidth_down_mbps:
  3909. type: integer
  3910. description: 下行带宽(Mbps,整数 1~1000,custom_spec);两值原样投影到派生自定义档,不折算(2026-11-05 D8 关闭)
  3911. line_exits:
  3912. type: array
  3913. maxItems: 1
  3914. description: >-
  3915. 线路出口(2026-11-17 起**单选**:长度必须为 1)。新建/修改条目出现
  3916. 2 个以上由服务端回 KLT-L222;存量多出口条目**不迁移**(编辑合同须原样回传,
  3917. 否则该条目视为改动而触发上述校验)。
  3918. items:
  3919. type: string
  3920. description: 出口标识
  3921. succession:
  3922. type: object
  3923. description: >-
  3924. 契约内逐条替换(升降配,2026-11-17):本条目的新订阅顶替哪份原订阅。
  3925. **仅在新建合同受理**,编辑合同出现即 KLT-L222。只接受三键;
  3926. 价格、状态、row_version 等只读派生列出现即 KLT-L222 点名。
  3927. 校验:原订阅属本客户、status ∈ active/pending、use_category 与条目一致、
  3928. line_exit_key 相等、非 value_add、未被替换过(已被指向 ⇒ KLT-M226);
  3929. 同一 replaces_subscription_id 在本请求内至多一次;plan_based 条目 quantity 须为 1。
  3930. **期间必须与原订阅相交**(2026-11-17 定案):原订阅在新订阅开始前已到期
  3931. ⇒ 不是替换而是到期续签,服务端**忽略本键**、按续签新开(不截原、不挂替换边、
  3932. 不出第七类工单),回执行 mode=renewed。
  3933. 替换写入与合同写入同一条 dml_batch(任一条失败=整批回滚,含合同本身)。
  3934. properties:
  3935. replaces_subscription_id:
  3936. type: string
  3937. description: 被替换的原订阅号(必填)
  3938. start_date:
  3939. type: string
  3940. format: date
  3941. description: >-
  3942. 新订阅起日,缺省=**合同生效日**(2026-11-17 定案:订阅跟着合同起算,
  3943. 不再取业务当天);须 ≤ 合同止期,且不晚于原订阅结束日(否则按续签处理)。
  3944. **结束日恒取合同止期**(2026-11-17 口径统一,登记总则 §18)。
  3945. term:
  3946. type: string
  3947. description: 订阅方式(yearly/quarterly/monthly);缺省按档位与用途分类派生
  3948. required:
  3949. - replaces_subscription_id
  3950. renew_from_contract_id:
  3951. type: string
  3952. description: >-
  3953. 续签自哪份旧合同(2026-11-17 定案,可选)。给出时服务端校验它属**同一客户**,
  3954. 并为本合同的**每个服务条目**各生成一份订阅:不带 replaces_subscription_id、
  3955. 不截任何原订阅、不出第七类 updown 工单(订阅开始日=合同生效日、结束日=合同结束日)。
  3956. 用于「到期续签」:旧订阅自然到期即止,新合同接着生效。
  3957. 与 service_items[].succession **互斥**(同时出现即 KLT-L222)。
  3958. 应答仍走 data.replacements[],其中 mode=renewed、replaces_subscription_id=null。
  3959. required:
  3960. - pay_cycle
  3961. - start_date
  3962. required:
  3963. - data
  3964. responses:
  3965. "200":
  3966. description: 成功。统一信封 code/message/data
  3967. /contract/update@v1:
  3968. post:
  3969. summary: 编辑合同
  3970. 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:service_items[].succession 与 renew_from_contract_id 都只在新建合同时受理,编辑载荷出现任一 ⇒ KLT-L222(替换/续签是一次性动作,改合同不得反向动订阅);⛔ 静默忽略。保存形态=只提交变了的字段(键缺席=保持现值);审计 INSERT 与业务语句同批提交。⚠️ 2026-11-17:结束日锁定为「生效日+付款周期」推算值 ⇒ 生效日/付款周期确实被改而载荷未给出 `end_date` 时,服务端按同一式重算(⛔ 留一个与期间对不上的旧止期);三项都没动则沿用库里现值。
  3971. operationId: contract_update
  3972. tags:
  3973. - 合同
  3974. x-require-auth: true
  3975. x-resource-type: bos.contract
  3976. x-action: update
  3977. x-version: v1
  3978. x-permission-visibility: catalog
  3979. requestBody:
  3980. required: true
  3981. description: JSON 请求体,业务字段置于 data
  3982. content:
  3983. application/json:
  3984. schema:
  3985. type: object
  3986. description: 统一信封请求体,业务字段放在 data 内
  3987. properties:
  3988. data:
  3989. type: object
  3990. description: 业务参数
  3991. properties:
  3992. contract_id:
  3993. type: string
  3994. description: 合同 ID
  3995. row_version:
  3996. type: integer
  3997. description: 乐观锁版本
  3998. external_no:
  3999. type: string
  4000. description: 外部合同号
  4001. contract_amount_cents:
  4002. type: integer
  4003. description: 合同金额(分)
  4004. pay_cycle:
  4005. type: string
  4006. description: 付款周期
  4007. start_date:
  4008. type: string
  4009. description: 开始日期
  4010. format: date
  4011. end_date:
  4012. type: string
  4013. description: 结束日期
  4014. format: date
  4015. agent_name:
  4016. type: string
  4017. description: 运营商经办人姓名(交接单口径,不是录入账号 created_by);受 billing/archive 轴约束,冻结时提交改动值 ⇒ KLT-L219/L220
  4018. agent_mobile:
  4019. type: string
  4020. description: 运营商经办人联系方式(交接单三段之三;archive 轴)
  4021. agent_handover_on:
  4022. type: string
  4023. description: 交接日期(archive 轴)
  4024. agent_org:
  4025. type: string
  4026. description: 运营商经办人机构(交接单三段之一;选填,archive 轴)
  4027. attachment_url:
  4028. type: string
  4029. maxLength: 512
  4030. description: >-
  4031. 合同附件(单值,archive 轴):外部 http(s) 链接,或前缀为
  4032. klt/contract/attachment/ 的对象键;空串=清空附件。
  4033. source:
  4034. type: string
  4035. description: 合同来源枚举 manual|import|operator_sync(04 册§4.2:写入时由服务端定、之后只读,不取入参;一期只有 manual 真产生值)
  4036. source_label:
  4037. type: string
  4038. description: 合同来源中文口径(界面录入/批量导入/运营商同步;04 册§4.7 列表与详情按来源标注)
  4039. service_items:
  4040. type: array
  4041. description: >-
  4042. 服务构成条目(含 item_id 的增删改)。⚠️ 编辑合同⛔ 受理 succession(替换只在新建
  4043. 合同时发生,出现即 KLT-L222);条目 line_exits 为单选(长度 1),存量多出口条目须
  4044. 原样回传,改成 1 个或其它值即按改动判定。
  4045. items:
  4046. type: object
  4047. required:
  4048. - contract_id
  4049. - row_version
  4050. required:
  4051. - data
  4052. responses:
  4053. "200":
  4054. description: 成功。统一信封 code/message/data
  4055. /contract/get_list@v1:
  4056. post:
  4057. summary: 合同列表
  4058. description: >-
  4059. 按客户/状态等筛选合同列表。每行随 `attachment_kind`(none/link/object/other)说明附件形态;
  4060. `attachment_view_url` 在列表口恒 null(签名只在详情读口现签,不按行 N 次调平台)。
  4061. operationId: contract_get_list
  4062. tags:
  4063. - 合同
  4064. x-require-auth: true
  4065. x-resource-type: bos.contract
  4066. x-action: list
  4067. x-version: v1
  4068. x-permission-visibility: catalog
  4069. requestBody:
  4070. required: true
  4071. description: JSON 请求体,业务字段置于 data
  4072. content:
  4073. application/json:
  4074. schema:
  4075. type: object
  4076. description: 统一信封请求体,业务字段放在 data 内
  4077. properties:
  4078. data:
  4079. type: object
  4080. description: 列表筛选参数
  4081. properties:
  4082. page:
  4083. type: integer
  4084. description: 页码(0 基索引,默认 0)
  4085. minimum: 0
  4086. default: 0
  4087. page_size:
  4088. type: integer
  4089. description: 每页条数(默认 20,上限 200)
  4090. minimum: 1
  4091. maximum: 200
  4092. default: 20
  4093. keyword:
  4094. type: string
  4095. description: 关键字筛选(可选)
  4096. customer_id:
  4097. type: string
  4098. description: 客户 ID 筛选
  4099. status:
  4100. type: string
  4101. description: 状态筛选
  4102. opened:
  4103. type: boolean
  4104. description: 是否已开通筛选(三态:true/false/缺省不筛)
  4105. required:
  4106. - data
  4107. responses:
  4108. "200":
  4109. description: 成功。统一信封 code/message/data
  4110. /contract/get@v1:
  4111. post:
  4112. summary: 合同详情
  4113. description: >-
  4114. 按合同 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 掩码)。
  4115. 附件(单值):`attachment_url` 原值照回(外部链接或 klt/contract/attachment/ 下的对象键),
  4116. `attachment_kind` 说明形态,`attachment_view_url`/`attachment_view_url_expires_at`
  4117. 为读口现签的短时效下载地址(`link` 形态=原链接);对象键不得当作可直接打开的链接。
  4118. operationId: contract_get
  4119. tags:
  4120. - 合同
  4121. x-require-auth: true
  4122. x-resource-type: bos.contract
  4123. x-action: view
  4124. x-version: v1
  4125. x-permission-visibility: catalog
  4126. requestBody:
  4127. required: true
  4128. description: JSON 请求体,业务字段置于 data
  4129. content:
  4130. application/json:
  4131. schema:
  4132. type: object
  4133. description: 统一信封请求体,业务字段放在 data 内
  4134. properties:
  4135. data:
  4136. type: object
  4137. description: 业务参数
  4138. properties:
  4139. contract_id:
  4140. type: string
  4141. description: 合同 ID
  4142. required:
  4143. - contract_id
  4144. required:
  4145. - data
  4146. responses:
  4147. "200":
  4148. description: 成功。统一信封 code/message/data
  4149. /contract/change_log@v1:
  4150. post:
  4151. summary: 合同修改记录
  4152. 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 条目已下线)。
  4153. operationId: contract_change_log
  4154. tags:
  4155. - 合同
  4156. x-require-auth: true
  4157. x-resource-type: bos.contract
  4158. x-action: list
  4159. x-version: v1
  4160. x-permission-visibility: catalog
  4161. requestBody:
  4162. required: true
  4163. description: JSON 请求体,业务字段置于 data
  4164. content:
  4165. application/json:
  4166. schema:
  4167. type: object
  4168. description: 统一信封请求体,业务字段放在 data 内
  4169. properties:
  4170. data:
  4171. type: object
  4172. description: 业务参数
  4173. properties:
  4174. contract_id:
  4175. type: string
  4176. description: 合同 ID
  4177. page_size:
  4178. type: integer
  4179. description: 每页条数(默认 20,夹在 1~50)
  4180. minimum: 1
  4181. maximum: 50
  4182. default: 20
  4183. cursor:
  4184. type: string
  4185. description: 游标,形态 occurred_at|id(与审计页同形态);由上一页响应的 next_cursor 原样带回
  4186. required:
  4187. - contract_id
  4188. required:
  4189. - data
  4190. responses:
  4191. "200":
  4192. description: 成功。统一信封 code/message/data(items/page_size/next_cursor/cursor_usable)
  4193. /contract/customer_lookup@v1:
  4194. post:
  4195. summary: 合同客户身份解析
  4196. description: 第3册§4.2 第 1 步:query_type=credit_code 主体号精确点查/identity 归一化精确点查/keyword 客户名称模糊联想;未命中=matched:false 成功响应(不报错),越权读单客户=11104。
  4197. operationId: contract_customer_lookup
  4198. tags:
  4199. - 合同
  4200. x-require-auth: true
  4201. x-resource-type: bos.contract
  4202. x-action: list
  4203. x-version: v1
  4204. x-permission-visibility: catalog
  4205. requestBody:
  4206. required: true
  4207. description: JSON 请求体,业务字段置于 data
  4208. content:
  4209. application/json:
  4210. schema:
  4211. type: object
  4212. description: 统一信封请求体,业务字段放在 data 内
  4213. properties:
  4214. data:
  4215. type: object
  4216. description: 业务参数
  4217. properties:
  4218. query_type:
  4219. type: string
  4220. description: 查询通道
  4221. enum:
  4222. - credit_code
  4223. - identity
  4224. - keyword
  4225. value:
  4226. type: string
  4227. description: 查询值(主体号/识别号/客户名称关键字)
  4228. required:
  4229. - query_type
  4230. - value
  4231. required:
  4232. - data
  4233. responses:
  4234. "200":
  4235. description: 成功。统一信封 code/message/data
  4236. /contract/delete@v1:
  4237. post:
  4238. summary: 合同条件删除
  4239. description: 第3册§4.8:两类阻塞分栏(subscriptions/tickets),有阻塞⇒KLT-L213;工单取数失败⇒KLT-S406(不得中途放行)。
  4240. operationId: contract_delete
  4241. tags:
  4242. - 合同
  4243. x-require-auth: true
  4244. x-resource-type: bos.contract
  4245. x-action: delete
  4246. x-version: v1
  4247. x-permission-visibility: catalog
  4248. requestBody:
  4249. required: true
  4250. description: JSON 请求体,业务字段置于 data
  4251. content:
  4252. application/json:
  4253. schema:
  4254. type: object
  4255. description: 统一信封请求体,业务字段放在 data 内
  4256. properties:
  4257. data:
  4258. type: object
  4259. description: 业务参数
  4260. properties:
  4261. contract_id:
  4262. type: string
  4263. description: 合同 ID
  4264. required:
  4265. - contract_id
  4266. required:
  4267. - data
  4268. responses:
  4269. "200":
  4270. description: 成功。统一信封 code/message/data
  4271. /contract/attachment_discard@v1:
  4272. post:
  4273. summary: 回收无人引用的上传附件(孤儿对象)
  4274. description: >-
  4275. 还原 2026-11-16 定案的孤儿附件回收:浏览器直传是「先上传、后落库」,用户换文件/移除/
  4276. 取消编辑/保存被拦时会在桶里留下无引用对象。平台 unified-oss 明确「不做后台遍历删对象、
  4277. 不按业务字段回收」,只有即时删除一条通道(object/delete@v1),故回收由本服务在引用面判定后发起。
  4278. 三条安全线:object_key 必须是本服务前缀下无路径穿越的对象键;查库确认没有任何合同仍指向它;
  4279. 角色限 Admin/OpsMain(与合同写口同一道闸)。referenced=true 与「对象已不在」都不算失败(幂等)。
  4280. operationId: contract_attachment_discard
  4281. tags:
  4282. - 合同
  4283. x-require-auth: true
  4284. x-resource-type: bos.contract_attachment
  4285. x-action: delete
  4286. x-version: v1
  4287. x-permission-visibility: catalog
  4288. requestBody:
  4289. required: true
  4290. description: JSON 请求体,业务字段置于 data
  4291. content:
  4292. application/json:
  4293. schema:
  4294. type: object
  4295. description: 统一信封请求体,业务字段放在 data 内
  4296. properties:
  4297. data:
  4298. type: object
  4299. description: 业务参数
  4300. properties:
  4301. object_key:
  4302. type: string
  4303. description: 直传回报的对象键(klt/contract/attachment/ 前缀下)
  4304. required:
  4305. - object_key
  4306. required:
  4307. - data
  4308. responses:
  4309. "200":
  4310. description: 成功。统一信封 code/message/data
  4311. /subscription/create@v1:
  4312. post:
  4313. summary: 新建订阅
  4314. description: 拒收 line_exits、sub_mode、order_no、新建时的 end_date、opened_at。
  4315. operationId: subscription_create
  4316. tags:
  4317. - 订阅
  4318. x-require-auth: true
  4319. x-resource-type: bos.subscription
  4320. x-action: create
  4321. x-version: v1
  4322. x-permission-visibility: catalog
  4323. requestBody:
  4324. required: true
  4325. description: JSON 请求体,业务字段置于 data
  4326. content:
  4327. application/json:
  4328. schema:
  4329. type: object
  4330. description: 统一信封请求体,业务字段放在 data 内
  4331. properties:
  4332. data:
  4333. type: object
  4334. description: 业务参数
  4335. properties:
  4336. customer_id:
  4337. type: string
  4338. description: 客户 ID
  4339. plan_id:
  4340. type: string
  4341. description: 档位 ID
  4342. contract_id:
  4343. type: string
  4344. description: 合同 ID
  4345. contract_item_id:
  4346. type: string
  4347. description: 合同服务条目 ID
  4348. start_date:
  4349. type: string
  4350. description: 订阅开始日期
  4351. format: date
  4352. annual_price_cents:
  4353. type: integer
  4354. description: 年价(分)
  4355. monthly_settle_cents:
  4356. type: integer
  4357. description: 月结算金额(分)
  4358. use_category:
  4359. type: string
  4360. description: 派生档用途分类(需要时填写)
  4361. term:
  4362. type: string
  4363. description: 账期(三态:yearly/quarterly/monthly)
  4364. enum:
  4365. - yearly
  4366. - quarterly
  4367. - monthly
  4368. trial_months:
  4369. type: integer
  4370. description: 试用月数(默认 0,≥0)
  4371. minimum: 0
  4372. discount_monthly_cents:
  4373. type: integer
  4374. description: 每月优惠金额(分,默认 0,≥0)
  4375. minimum: 0
  4376. required:
  4377. - customer_id
  4378. - plan_id
  4379. - contract_id
  4380. - contract_item_id
  4381. - start_date
  4382. - annual_price_cents
  4383. - monthly_settle_cents
  4384. required:
  4385. - data
  4386. responses:
  4387. "200":
  4388. description: 成功。统一信封 code/message/data
  4389. /subscription/change@v1:
  4390. post:
  4391. summary: 订阅升降配
  4392. description: >-
  4393. 升降配须填 replaces_subscription_id,且须使用新的 contract_id(不得沿用原合同)。
  4394. 2026-11-17 起该入口保留为「单订阅快捷通道」;常规路径是在合同新建页逐条带
  4395. service_items[].succession 一次性完成(见 /contract/create@v1)。两条路径共用
  4396. succession.rs 的计划层与截原谓词(已被替换过的原订阅 ⇒ KLT-M226)。工单类型由交付态决定:
  4397. 原订阅已交付且客户在用 ⇒ 一张 updown(新档交付+原档回收);未交付 ⇒ open/service_open。
  4398. operationId: subscription_change
  4399. tags:
  4400. - 订阅
  4401. x-require-auth: true
  4402. x-resource-type: bos.subscription
  4403. x-action: update
  4404. x-version: v1
  4405. x-permission-visibility: catalog
  4406. requestBody:
  4407. required: true
  4408. description: JSON 请求体,业务字段置于 data
  4409. content:
  4410. application/json:
  4411. schema:
  4412. type: object
  4413. description: 统一信封请求体,业务字段放在 data 内
  4414. properties:
  4415. data:
  4416. type: object
  4417. description: 业务参数
  4418. properties:
  4419. replaces_subscription_id:
  4420. type: string
  4421. description: 被替换的原订阅 ID
  4422. customer_id:
  4423. type: string
  4424. description: 客户 ID
  4425. plan_id:
  4426. type: string
  4427. description: 新档位 ID
  4428. contract_id:
  4429. type: string
  4430. description: 新合同 ID(不得沿用原合同)
  4431. contract_item_id:
  4432. type: string
  4433. description: 新合同服务条目 ID
  4434. start_date:
  4435. type: string
  4436. description: 新订阅开始日期
  4437. format: date
  4438. annual_price_cents:
  4439. type: integer
  4440. description: 年价(分)
  4441. monthly_settle_cents:
  4442. type: integer
  4443. description: 月结算金额(分)
  4444. use_category:
  4445. type: string
  4446. description: 派生档用途分类(需要时填写)
  4447. term:
  4448. type: string
  4449. description: 账期(三态:yearly/quarterly/monthly)
  4450. enum:
  4451. - yearly
  4452. - quarterly
  4453. - monthly
  4454. trial_months:
  4455. type: integer
  4456. description: 试用月数(默认 0,≥0)
  4457. minimum: 0
  4458. discount_monthly_cents:
  4459. type: integer
  4460. description: 每月优惠金额(分,默认 0,≥0)
  4461. minimum: 0
  4462. row_version:
  4463. type: integer
  4464. description: 乐观锁版本号(可选,缺省不校验)
  4465. required:
  4466. - replaces_subscription_id
  4467. - customer_id
  4468. - plan_id
  4469. - contract_id
  4470. - contract_item_id
  4471. - start_date
  4472. - annual_price_cents
  4473. - monthly_settle_cents
  4474. required:
  4475. - data
  4476. responses:
  4477. "200":
  4478. description: 成功。统一信封 code/message/data
  4479. /subscription/replacement_candidates@v1:
  4480. post:
  4481. summary: 替换候选探测(只读)
  4482. description: >-
  4483. 合同新建页逐条判定「是否已有可替换的原订阅」(契约内逐条替换=升降配,2026-11-17)。
  4484. 后端统一解析用途分类(use_category 优先,否则取档位)、按「同客户 × 同分类 × 同出口 × **期间相交**」过滤
  4485. (status ∈ active/pending、排除 value_add、排除已被指过的 replaces_subscription_id),
  4486. 与 `/contract/create@v1` 的保存期校验是**同一份函数**(succession::candidate_filter),
  4487. 前端⛔ 自造候选范围。index 与 service_items 的 0 基下标对齐。
  4488. 2026-11-17 二轮:期间判据入候选——原订阅在新订阅开始前已到期(新合同 2027 起、旧订阅 2026-12-31 止)
  4489. ⇒ 属**到期续签**,不进 candidates,单列进 skipped[] 供页面解释「按新订阅开通」。
  4490. operationId: subscription_replacement_candidates
  4491. tags:
  4492. - 订阅
  4493. x-require-auth: true
  4494. x-resource-type: bos.subscription
  4495. x-action: read
  4496. x-version: v1
  4497. x-permission-visibility: catalog
  4498. requestBody:
  4499. required: true
  4500. description: JSON 请求体,业务字段置于 data
  4501. content:
  4502. application/json:
  4503. schema:
  4504. type: object
  4505. description: 统一信封请求体,业务字段放在 data 内
  4506. properties:
  4507. data:
  4508. type: object
  4509. description: 业务参数
  4510. properties:
  4511. customer_id:
  4512. type: string
  4513. description: 签约客户 ID(候选范围限本客户)
  4514. start_date:
  4515. type: string
  4516. format: date
  4517. description: 新合同生效日(缺省=业务当天)。与 candidates/skipped 的期间判据同源
  4518. end_date:
  4519. type: string
  4520. format: date
  4521. description: 新合同结束日(可空)。给了才能判「原订阅排在本合同之后才生效」
  4522. probes:
  4523. type: array
  4524. description: 探测项(至少 1 项;每项对应一个服务构成条目)
  4525. items:
  4526. type: object
  4527. properties:
  4528. index:
  4529. type: integer
  4530. description: 0 基条目下标(缺省=数组位置)
  4531. item_kind:
  4532. type: string
  4533. description: 条目类型:plan_based/custom_spec
  4534. plan_id:
  4535. type: string
  4536. description: 档位 ID(plan_based;用途分类可由档位带出)
  4537. use_category:
  4538. type: string
  4539. description: 用途分类(custom_spec;缺省时回落档位的 use_category)
  4540. line_exits:
  4541. type: array
  4542. maxItems: 1
  4543. description: 线路出口(须恰 1 个;缺省时回落档位上的出口集合)
  4544. items:
  4545. type: string
  4546. required:
  4547. - line_exits
  4548. required:
  4549. - customer_id
  4550. - probes
  4551. required:
  4552. - data
  4553. responses:
  4554. "200":
  4555. description: >-
  4556. 成功。data.probes[] 每项回 index/item_kind/plan_id/use_category(后端解析结果)/
  4557. line_exit_key/line_exits/start_date/end_date/candidates[]/skipped[];候选行含
  4558. subscription_id/plan_id/plan_name/plan_kind/contract_id/contract_no/start_date/
  4559. end_date/status/annual_price_cents/monthly_settle_cents/customized(true=定制档,
  4560. 须用户显式勾选确认后才允许替换)。skipped[] 是同客户同分类同出口但**期间不相交**的行
  4561. (subscription_id/plan_name/contract_no/start_date/end_date/status/reason,
  4562. reason=ended_before_start=到期续签、starts_after_contract_end=本合同结束后才生效),
  4563. 只用于解释、⛔ 可被选为替换对象。
  4564. 用途分类或出口判定不出 ⇒ KLT-L222 点名 probes[i]。
  4565. /subscription/stack@v1:
  4566. post:
  4567. summary: 订阅叠加或白名单更新
  4568. description: 叠加开通或更新白名单字段(两金额+end_date);其余只读键拒绝。
  4569. operationId: subscription_stack
  4570. tags:
  4571. - 订阅
  4572. x-require-auth: true
  4573. x-resource-type: bos.subscription
  4574. x-action: create
  4575. x-version: v1
  4576. x-permission-visibility: catalog
  4577. requestBody:
  4578. required: true
  4579. description: JSON 请求体,业务字段置于 data
  4580. content:
  4581. application/json:
  4582. schema:
  4583. type: object
  4584. description: 统一信封请求体,业务字段放在 data 内
  4585. properties:
  4586. data:
  4587. type: object
  4588. description: 业务参数
  4589. properties:
  4590. subscription_id:
  4591. type: string
  4592. description: 订阅 ID(更新场景)
  4593. customer_id:
  4594. type: string
  4595. description: 客户 ID(叠加新建时)
  4596. plan_id:
  4597. type: string
  4598. description: 档位 ID(叠加新建时)
  4599. contract_id:
  4600. type: string
  4601. description: 合同 ID
  4602. contract_item_id:
  4603. type: string
  4604. description: 合同服务条目 ID
  4605. annual_price_cents:
  4606. type: integer
  4607. description: 年价(分,可改)
  4608. monthly_settle_cents:
  4609. type: integer
  4610. description: 月结算金额(分,可改)
  4611. end_date:
  4612. type: string
  4613. description: 结束日期(可改)
  4614. format: date
  4615. start_date:
  4616. type: string
  4617. description: 开始日期(叠加新建时)
  4618. format: date
  4619. row_version:
  4620. type: integer
  4621. description: 乐观锁版本号(可选,缺省不校验)
  4622. required:
  4623. - data
  4624. responses:
  4625. "200":
  4626. description: 成功。统一信封 code/message/data
  4627. /subscription/get_list@v1:
  4628. post:
  4629. summary: 订阅列表
  4630. description: 按客户等维度筛选订阅列表。
  4631. operationId: subscription_get_list
  4632. tags:
  4633. - 订阅
  4634. x-require-auth: true
  4635. x-resource-type: bos.subscription
  4636. x-action: list
  4637. x-version: v1
  4638. x-permission-visibility: catalog
  4639. requestBody:
  4640. required: true
  4641. description: JSON 请求体,业务字段置于 data
  4642. content:
  4643. application/json:
  4644. schema:
  4645. type: object
  4646. description: 统一信封请求体,业务字段放在 data 内
  4647. properties:
  4648. data:
  4649. type: object
  4650. description: 列表筛选参数
  4651. properties:
  4652. customer_id:
  4653. type: string
  4654. description: 客户 ID(常必填)
  4655. page:
  4656. type: integer
  4657. description: 页码(0 基索引,默认 0)
  4658. minimum: 0
  4659. default: 0
  4660. page_size:
  4661. type: integer
  4662. description: 每页条数(默认 20,上限 200)
  4663. minimum: 1
  4664. maximum: 200
  4665. default: 20
  4666. keyword:
  4667. type: string
  4668. description: 关键字筛选(可选)
  4669. status:
  4670. type: string
  4671. description: 状态筛选
  4672. contract_id:
  4673. type: string
  4674. description: 合同 ID 筛选
  4675. region_ids:
  4676. type: array
  4677. description: 区域 ID 集合(经客户挂载区域展开)
  4678. items:
  4679. type: string
  4680. description: 区域 ID
  4681. required:
  4682. - data
  4683. responses:
  4684. "200":
  4685. description: 成功。统一信封 code/message/data
  4686. /subscription/get@v1:
  4687. post:
  4688. summary: 订阅详情
  4689. description: 按订阅 ID 查询详情。
  4690. operationId: subscription_get
  4691. tags:
  4692. - 订阅
  4693. x-require-auth: true
  4694. x-resource-type: bos.subscription
  4695. x-action: view
  4696. x-version: v1
  4697. x-permission-visibility: catalog
  4698. requestBody:
  4699. required: true
  4700. description: JSON 请求体,业务字段置于 data
  4701. content:
  4702. application/json:
  4703. schema:
  4704. type: object
  4705. description: 统一信封请求体,业务字段放在 data 内
  4706. properties:
  4707. data:
  4708. type: object
  4709. description: 业务参数
  4710. properties:
  4711. subscription_id:
  4712. type: string
  4713. description: 订阅 ID
  4714. required:
  4715. - subscription_id
  4716. required:
  4717. - data
  4718. responses:
  4719. "200":
  4720. description: 成功。统一信封 code/message/data
  4721. /subscription/plan_options@v1:
  4722. post:
  4723. summary: 订阅档位候选
  4724. description: 第3册§5.2 第 3 步:本客户自定义档(含合同条目派生档)+全部固定档,不含他客户自定义档;行内带只读 sub_mode 与 available/unavailable_reason。
  4725. operationId: subscription_plan_options
  4726. tags:
  4727. - 订阅
  4728. x-require-auth: true
  4729. x-resource-type: bos.subscription
  4730. x-action: list
  4731. x-version: v1
  4732. x-permission-visibility: catalog
  4733. requestBody:
  4734. required: true
  4735. description: JSON 请求体,业务字段置于 data
  4736. content:
  4737. application/json:
  4738. schema:
  4739. type: object
  4740. description: 统一信封请求体,业务字段放在 data 内
  4741. properties:
  4742. data:
  4743. type: object
  4744. description: 业务参数
  4745. properties:
  4746. customer_id:
  4747. type: string
  4748. description: 客户 ID(必填)
  4749. keyword:
  4750. type: string
  4751. description: 套餐名称关键字(仅本口有)
  4752. required:
  4753. - customer_id
  4754. required:
  4755. - data
  4756. responses:
  4757. "200":
  4758. description: 成功。统一信封 code/message/data
  4759. /subscription/contract_options@v1:
  4760. post:
  4761. summary: 未开通合同与服务条目候选
  4762. description: 第3册§5.2 第 2 步:只出「未开通」合同及其尚未被订阅引用的条目;开通态取数失败⇒KLT-S406;无可选合同⇒KLT-M222。
  4763. operationId: subscription_contract_options
  4764. tags:
  4765. - 订阅
  4766. x-require-auth: true
  4767. x-resource-type: bos.subscription
  4768. x-action: list
  4769. x-version: v1
  4770. x-permission-visibility: catalog
  4771. requestBody:
  4772. required: true
  4773. description: JSON 请求体,业务字段置于 data
  4774. content:
  4775. application/json:
  4776. schema:
  4777. type: object
  4778. description: 统一信封请求体,业务字段放在 data 内
  4779. properties:
  4780. data:
  4781. type: object
  4782. description: 业务参数
  4783. properties:
  4784. customer_id:
  4785. type: string
  4786. description: 客户 ID(必填)
  4787. keyword:
  4788. type: string
  4789. description: 合同名称关键字(仅本口有)
  4790. required:
  4791. - customer_id
  4792. required:
  4793. - data
  4794. responses:
  4795. "200":
  4796. description: 成功。统一信封 code/message/data
  4797. /subscription/update@v1:
  4798. post:
  4799. summary: 订阅修改(白名单)
  4800. description: 第3册§5.6:可改字段只有 trial_months/discount_monthly_cents;row_version 必填,落空⇒KLT-S407;换套餐/换合同⇒KLT-M229。
  4801. operationId: subscription_update
  4802. tags:
  4803. - 订阅
  4804. x-require-auth: true
  4805. x-resource-type: bos.subscription
  4806. x-action: update
  4807. x-version: v1
  4808. x-permission-visibility: catalog
  4809. requestBody:
  4810. required: true
  4811. description: JSON 请求体,业务字段置于 data
  4812. content:
  4813. application/json:
  4814. schema:
  4815. type: object
  4816. description: 统一信封请求体,业务字段放在 data 内
  4817. properties:
  4818. data:
  4819. type: object
  4820. description: 业务参数
  4821. properties:
  4822. subscription_id:
  4823. type: string
  4824. description: 订阅 ID
  4825. row_version:
  4826. type: integer
  4827. description: 乐观锁版本号(必填,落空⇒KLT-S407)
  4828. trial_months:
  4829. type: integer
  4830. description: 试用月数(白名单可改)
  4831. minimum: 0
  4832. discount_monthly_cents:
  4833. type: integer
  4834. description: 每月优惠金额(分,白名单可改)
  4835. minimum: 0
  4836. required:
  4837. - subscription_id
  4838. - row_version
  4839. required:
  4840. - data
  4841. responses:
  4842. "200":
  4843. description: 成功。统一信封 code/message/data
  4844. /subscription/delete_check@v1:
  4845. post:
  4846. summary: 订阅删除前阻塞检查
  4847. description: 第3册§5.6:两栏阻塞分列(账单明细⇒KLT-M227、升降配链原订阅⇒KLT-M230);账单只读口未接线⇒billing_state=unconfigured。
  4848. operationId: subscription_delete_check
  4849. tags:
  4850. - 订阅
  4851. x-require-auth: true
  4852. x-resource-type: bos.subscription
  4853. x-action: view
  4854. x-version: v1
  4855. x-permission-visibility: catalog
  4856. requestBody:
  4857. required: true
  4858. description: JSON 请求体,业务字段置于 data
  4859. content:
  4860. application/json:
  4861. schema:
  4862. type: object
  4863. description: 统一信封请求体,业务字段放在 data 内
  4864. properties:
  4865. data:
  4866. type: object
  4867. description: 业务参数
  4868. properties:
  4869. subscription_id:
  4870. type: string
  4871. description: 订阅 ID
  4872. required:
  4873. - subscription_id
  4874. required:
  4875. - data
  4876. responses:
  4877. "200":
  4878. description: 成功。统一信封 code/message/data
  4879. /subscription/delete@v1:
  4880. post:
  4881. summary: 删除订阅并回退额度
  4882. description: 第3册§5.6:删除前复算阻塞;终态⇒11103;同事务回退 customer.quota_cents,档位 first_referred_at 打点不回滚。
  4883. operationId: subscription_delete
  4884. tags:
  4885. - 订阅
  4886. x-require-auth: true
  4887. x-resource-type: bos.subscription
  4888. x-action: delete
  4889. x-version: v1
  4890. x-permission-visibility: catalog
  4891. requestBody:
  4892. required: true
  4893. description: JSON 请求体,业务字段置于 data
  4894. content:
  4895. application/json:
  4896. schema:
  4897. type: object
  4898. description: 统一信封请求体,业务字段放在 data 内
  4899. properties:
  4900. data:
  4901. type: object
  4902. description: 业务参数
  4903. properties:
  4904. subscription_id:
  4905. type: string
  4906. description: 订阅 ID
  4907. required:
  4908. - subscription_id
  4909. required:
  4910. - data
  4911. responses:
  4912. "200":
  4913. description: 成功。统一信封 code/message/data
  4914. /subscription/list_all@v1:
  4915. post:
  4916. summary: 全部订阅(跨客户)
  4917. description: 第3册§5.8:跨客户订阅列表,customer_id 可选;region_ids 经客户挂载区域展开;不按客户名称/合同编号检索。
  4918. operationId: subscription_list_all
  4919. tags:
  4920. - 订阅
  4921. x-require-auth: true
  4922. x-resource-type: bos.subscription
  4923. x-action: list
  4924. x-version: v1
  4925. x-permission-visibility: catalog
  4926. requestBody:
  4927. required: true
  4928. description: JSON 请求体,业务字段置于 data
  4929. content:
  4930. application/json:
  4931. schema:
  4932. type: object
  4933. description: 统一信封请求体,业务字段放在 data 内
  4934. properties:
  4935. data:
  4936. type: object
  4937. description: 列表筛选参数
  4938. properties:
  4939. page:
  4940. type: integer
  4941. description: 页码
  4942. minimum: 1
  4943. page_size:
  4944. type: integer
  4945. description: 每页条数
  4946. minimum: 1
  4947. maximum: 500
  4948. keyword:
  4949. type: string
  4950. description: 关键字筛选
  4951. customer_id:
  4952. type: string
  4953. description: 客户 ID 筛选(跨客户列表下可选)
  4954. contract_id:
  4955. type: string
  4956. description: 合同 ID 筛选
  4957. status:
  4958. type: string
  4959. description: 状态筛选
  4960. region_ids:
  4961. type: array
  4962. description: 区域 ID 集合(经客户挂载区域展开)
  4963. items:
  4964. type: string
  4965. description: 区域 ID
  4966. required:
  4967. - data
  4968. responses:
  4969. "200":
  4970. description: 成功。统一信封 code/message/data
  4971. /cost_item/save@v1:
  4972. post:
  4973. summary: 保存成本项定义
  4974. description: 仅 admin。增改成本项定义。拒收金额、客户、运营商、省份、cycle、is_system。
  4975. operationId: cost_item_save
  4976. tags:
  4977. - 成本与分成
  4978. x-require-auth: true
  4979. x-resource-type: bos.cost_item
  4980. x-action: manage
  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. cost_item_id:
  4997. type: string
  4998. description: 成本项 ID(更新时必填)
  4999. category:
  5000. type: string
  5001. description: 类别:intl_resource/device_purchase/project_fee
  5002. enum:
  5003. - intl_resource
  5004. - device_purchase
  5005. - project_fee
  5006. item_name:
  5007. type: string
  5008. description: 成本项名称
  5009. billing_unit:
  5010. type: string
  5011. description: 计费单位:per_customer/per_account/per_copy
  5012. enum:
  5013. - per_customer
  5014. - per_account
  5015. - per_copy
  5016. is_amortized:
  5017. type: boolean
  5018. description: 是否摊销
  5019. amortization_months:
  5020. type: integer
  5021. description: 摊销月数(勾选摊销时可空=每月摊销不结束)
  5022. deduct_from_base:
  5023. type: boolean
  5024. description: 是否从基数扣除
  5025. remark:
  5026. type: string
  5027. description: 备注
  5028. row_version:
  5029. type: integer
  5030. description: 乐观锁版本(更新时)
  5031. required:
  5032. - category
  5033. - item_name
  5034. - billing_unit
  5035. - is_amortized
  5036. - deduct_from_base
  5037. required:
  5038. - data
  5039. responses:
  5040. "200":
  5041. description: 成功。统一信封 code/message/data
  5042. /cost_item/get_list@v1:
  5043. post:
  5044. summary: 成本项列表
  5045. description: 全局成本项目录;可选类别/名称关键字;无客户过滤。
  5046. operationId: cost_item_get_list
  5047. tags:
  5048. - 成本与分成
  5049. x-require-auth: true
  5050. x-resource-type: bos.cost_item
  5051. x-action: list
  5052. x-version: v1
  5053. x-permission-visibility: catalog
  5054. requestBody:
  5055. required: true
  5056. description: JSON 请求体,业务字段置于 data
  5057. content:
  5058. application/json:
  5059. schema:
  5060. type: object
  5061. description: 统一信封请求体,业务字段放在 data 内
  5062. properties:
  5063. data:
  5064. type: object
  5065. description: 列表筛选参数
  5066. properties:
  5067. page:
  5068. type: integer
  5069. description: 页码(0 基索引,默认 0)
  5070. minimum: 0
  5071. default: 0
  5072. page_size:
  5073. type: integer
  5074. description: 每页条数(默认 20,上限 200)
  5075. minimum: 1
  5076. maximum: 200
  5077. default: 20
  5078. keyword:
  5079. type: string
  5080. description: 关键字筛选(可选)
  5081. category:
  5082. type: string
  5083. description: 类别筛选
  5084. required:
  5085. - data
  5086. responses:
  5087. "200":
  5088. description: 成功。统一信封 code/message/data
  5089. /cost_amount/save@v1:
  5090. post:
  5091. summary: 保存成本金额
  5092. description: 按「省份×运营商×成本项」只写差异金额;留空项表示删除该差异。
  5093. operationId: cost_amount_save
  5094. tags:
  5095. - 成本与分成
  5096. x-require-auth: true
  5097. x-resource-type: bos.cost_amount
  5098. x-action: manage
  5099. x-version: v1
  5100. x-permission-visibility: catalog
  5101. requestBody:
  5102. required: true
  5103. description: JSON 请求体,业务字段置于 data
  5104. content:
  5105. application/json:
  5106. schema:
  5107. type: object
  5108. description: 统一信封请求体,业务字段放在 data 内
  5109. properties:
  5110. data:
  5111. type: object
  5112. description: 业务参数
  5113. properties:
  5114. province_node_id:
  5115. type: string
  5116. description: 省份节点 ID
  5117. operator_id:
  5118. type: string
  5119. description: 运营商 ID
  5120. items:
  5121. type: array
  5122. description: 变更项列表;留空金额表示删除该差异行
  5123. items:
  5124. type: object
  5125. properties:
  5126. cost_item_id:
  5127. type: string
  5128. description: 成本项 ID
  5129. amount_cents:
  5130. type: integer
  5131. description: 金额(分);空/省略表示删除
  5132. row_version:
  5133. type: integer
  5134. description: 乐观锁版本
  5135. required:
  5136. - cost_item_id
  5137. required:
  5138. - province_node_id
  5139. - operator_id
  5140. - items
  5141. required:
  5142. - data
  5143. responses:
  5144. "200":
  5145. description: 成功。统一信封 code/message/data
  5146. /cost_amount/get_list@v1:
  5147. post:
  5148. summary: 成本金额一览
  5149. description: 透视表;admin 全量,区域运营按可见省/运营商收窄。
  5150. operationId: cost_amount_get_list
  5151. tags:
  5152. - 成本与分成
  5153. x-require-auth: true
  5154. x-resource-type: bos.cost_amount
  5155. x-action: list
  5156. x-version: v1
  5157. x-permission-visibility: catalog
  5158. requestBody:
  5159. required: true
  5160. description: JSON 请求体,业务字段置于 data
  5161. content:
  5162. application/json:
  5163. schema:
  5164. type: object
  5165. description: 统一信封请求体,业务字段放在 data 内
  5166. properties:
  5167. data:
  5168. type: object
  5169. description: 列表筛选参数
  5170. properties:
  5171. province_node_id:
  5172. type: string
  5173. description: 省份筛选
  5174. operator_id:
  5175. type: string
  5176. description: 运营商筛选
  5177. page:
  5178. type: integer
  5179. description: 页码(0 基索引,默认 0)
  5180. minimum: 0
  5181. default: 0
  5182. page_size:
  5183. type: integer
  5184. description: 每页条数(默认 20,上限 200)
  5185. minimum: 1
  5186. maximum: 200
  5187. default: 20
  5188. keyword:
  5189. type: string
  5190. description: 关键字筛选(可选)
  5191. required:
  5192. - data
  5193. responses:
  5194. "200":
  5195. description: 成功。统一信封 code/message/data
  5196. /share_rule/save@v1:
  5197. post:
  5198. summary: 保存分成规则
  5199. description: holder_type 仅 operator/ops_team(无 partner)。share_value 填 0/负表示删除该行。
  5200. operationId: share_rule_save
  5201. tags:
  5202. - 成本与分成
  5203. x-require-auth: true
  5204. x-resource-type: bos.share_rule
  5205. x-action: manage
  5206. x-version: v1
  5207. x-permission-visibility: catalog
  5208. requestBody:
  5209. required: true
  5210. description: JSON 请求体,业务字段置于 data
  5211. content:
  5212. application/json:
  5213. schema:
  5214. type: object
  5215. description: 统一信封请求体,业务字段放在 data 内
  5216. properties:
  5217. data:
  5218. type: object
  5219. description: 业务参数
  5220. properties:
  5221. holder_type:
  5222. type: string
  5223. description: 持有方类型:operator/ops_team
  5224. enum:
  5225. - operator
  5226. - ops_team
  5227. holder_id:
  5228. type: string
  5229. description: 持有方 ID
  5230. rules:
  5231. type: array
  5232. description: 规则行列表
  5233. items:
  5234. type: object
  5235. properties:
  5236. rule_id:
  5237. type: string
  5238. description: 规则 ID(更新/删除时)
  5239. customer_id:
  5240. type: string
  5241. description: 客户 ID
  5242. rule_level:
  5243. type: string
  5244. description: 规则层级:contract_addon/region_regular
  5245. enum:
  5246. - contract_addon
  5247. - region_regular
  5248. share_mode:
  5249. type: string
  5250. description: 分成方式:ratio_total/per_account/fixed_amount
  5251. enum:
  5252. - ratio_total
  5253. - per_account
  5254. - fixed_amount
  5255. share_value:
  5256. type: number
  5257. description: 分成值:比例 (0,1];金额/每账号>0 分;0/负=删除该行
  5258. remark:
  5259. type: string
  5260. description: 备注
  5261. required:
  5262. - holder_type
  5263. - holder_id
  5264. - rules
  5265. required:
  5266. - data
  5267. responses:
  5268. "200":
  5269. description: 成功。统一信封 code/message/data
  5270. /share_rule/get_list@v1:
  5271. post:
  5272. summary: 分成规则列表
  5273. description: 按持有方等条件列出分成规则。
  5274. operationId: share_rule_get_list
  5275. tags:
  5276. - 成本与分成
  5277. x-require-auth: true
  5278. x-resource-type: bos.share_rule
  5279. x-action: list
  5280. x-version: v1
  5281. x-permission-visibility: catalog
  5282. requestBody:
  5283. required: true
  5284. description: JSON 请求体,业务字段置于 data
  5285. content:
  5286. application/json:
  5287. schema:
  5288. type: object
  5289. description: 统一信封请求体,业务字段放在 data 内
  5290. properties:
  5291. data:
  5292. type: object
  5293. description: 列表筛选参数
  5294. properties:
  5295. holder_type:
  5296. type: string
  5297. description: 持有方类型
  5298. holder_id:
  5299. type: string
  5300. description: 持有方 ID
  5301. page:
  5302. type: integer
  5303. description: 页码(0 基索引,默认 0)
  5304. minimum: 0
  5305. default: 0
  5306. page_size:
  5307. type: integer
  5308. description: 每页条数(默认 20,上限 200)
  5309. minimum: 1
  5310. maximum: 200
  5311. default: 20
  5312. keyword:
  5313. type: string
  5314. description: 关键字筛选(可选)
  5315. required:
  5316. - data
  5317. responses:
  5318. "200":
  5319. description: 成功。统一信封 code/message/data
  5320. /share_rule/get@v1:
  5321. post:
  5322. summary: 分成规则详情
  5323. description: 按持有方一次返回四卡摘要与规则表。
  5324. operationId: share_rule_get
  5325. tags:
  5326. - 成本与分成
  5327. x-require-auth: true
  5328. x-resource-type: bos.share_rule
  5329. x-action: view
  5330. x-version: v1
  5331. x-permission-visibility: catalog
  5332. requestBody:
  5333. required: true
  5334. description: JSON 请求体,业务字段置于 data
  5335. content:
  5336. application/json:
  5337. schema:
  5338. type: object
  5339. description: 统一信封请求体,业务字段放在 data 内
  5340. properties:
  5341. data:
  5342. type: object
  5343. description: 业务参数
  5344. properties:
  5345. holder_type:
  5346. type: string
  5347. description: 持有方类型:operator/ops_team
  5348. holder_id:
  5349. type: string
  5350. description: 持有方 ID
  5351. required:
  5352. - holder_type
  5353. - holder_id
  5354. required:
  5355. - data
  5356. responses:
  5357. "200":
  5358. description: 成功。统一信封 code/message/data
  5359. /share_rule/delete@v1:
  5360. post:
  5361. summary: 删除分成规则
  5362. description: 按 rule_id 删除单条分成规则(亦可在 save 内以 0/负值删除)。
  5363. operationId: share_rule_delete
  5364. tags:
  5365. - 成本与分成
  5366. x-require-auth: true
  5367. x-resource-type: bos.share_rule
  5368. x-action: delete
  5369. x-version: v1
  5370. x-permission-visibility: catalog
  5371. requestBody:
  5372. required: true
  5373. description: JSON 请求体,业务字段置于 data
  5374. content:
  5375. application/json:
  5376. schema:
  5377. type: object
  5378. description: 统一信封请求体,业务字段放在 data 内
  5379. properties:
  5380. data:
  5381. type: object
  5382. description: 业务参数
  5383. properties:
  5384. rule_id:
  5385. type: string
  5386. description: 规则 ID
  5387. required:
  5388. - rule_id
  5389. required:
  5390. - data
  5391. responses:
  5392. "200":
  5393. description: 成功。统一信封 code/message/data
  5394. /opsview/home@v1:
  5395. get:
  5396. summary: 运维只读首页
  5397. description: 运维侧只读首页(U-60),返回工单/逾期等概览数据。
  5398. operationId: opsview_home
  5399. tags:
  5400. - 运维视图
  5401. x-require-auth: true
  5402. x-resource-type: bos.opsview
  5403. x-action: view
  5404. x-version: v1
  5405. x-permission-visibility: catalog
  5406. responses:
  5407. "200":
  5408. description: 成功。统一信封 code/message/data
  5409. /jobs/get_list@v1:
  5410. get:
  5411. summary: 定时作业清单
  5412. description: 返回第 10 册 13 行清单(注册位 11 +标注行 2)及运行态:启用态、可操作性位、最近执行、五格计数、累计轮次、KPI 五卡与待补跑轮次。运行态取数失败时仍返回 13 行,runtime_available=false。
  5413. operationId: jobs_get_list
  5414. tags:
  5415. - 定时作业
  5416. x-require-auth: true
  5417. x-resource-type: bos.jobs
  5418. x-action: list
  5419. x-version: v1
  5420. x-permission-visibility: catalog
  5421. responses:
  5422. "200":
  5423. description: 成功。统一信封 code/message/data
  5424. /jobs/toggle@v1:
  5425. post:
  5426. summary: 启停定时作业
  5427. description: 仅 admin。按作业 key 启停并写 bos_audit_log(bos.job.toggle);重复点击幂等不写第二条。标注行/无页面开关的作业返回 KLT-R20902(detail.reason_code=no_switch);CAS 不匹配返回 KLT-S407;审计失败返回 KLT-S405(启停已生效)。
  5428. operationId: jobs_toggle
  5429. tags:
  5430. - 定时作业
  5431. x-require-auth: true
  5432. x-resource-type: bos.jobs
  5433. x-action: manage
  5434. x-version: v1
  5435. x-permission-visibility: catalog
  5436. requestBody:
  5437. required: true
  5438. description: JSON 请求体,业务字段置于 data
  5439. content:
  5440. application/json:
  5441. schema:
  5442. type: object
  5443. description: 统一信封请求体,业务字段放在 data 内
  5444. properties:
  5445. data:
  5446. type: object
  5447. description: 业务参数
  5448. properties:
  5449. key:
  5450. type: string
  5451. description: 作业键(兼容旧字段名;与 job_key 二选一)
  5452. job_key:
  5453. type: string
  5454. description: 作业键(契约字段名)
  5455. enabled:
  5456. type: boolean
  5457. description: 目标状态
  5458. expect_enabled:
  5459. type: boolean
  5460. description: CAS 校验值=页面读到的当前状态;缺省不做并发校验
  5461. request_id:
  5462. type: string
  5463. description: 幂等请求号(客户端生成)
  5464. required:
  5465. - enabled
  5466. required:
  5467. - data
  5468. responses:
  5469. "200":
  5470. description: 成功。统一信封 code/message/data
  5471. /jobs/runs@v1:
  5472. post:
  5473. summary: 作业执行记录
  5474. description: 查询执行记录,支持任务、关键字(执行编号/任务/结果说明,不检索对象级明细)、触发方式、执行结果与日期区间筛选;分页 page 0 基、page_size 默认 50。标注行返回空流水并标记 annotation=true。
  5475. operationId: jobs_runs
  5476. tags:
  5477. - 定时作业
  5478. x-require-auth: true
  5479. x-resource-type: bos.jobs
  5480. x-action: view
  5481. x-version: v1
  5482. x-permission-visibility: catalog
  5483. requestBody:
  5484. required: true
  5485. description: JSON 请求体,业务字段置于 data
  5486. content:
  5487. application/json:
  5488. schema:
  5489. type: object
  5490. description: 统一信封请求体,业务字段放在 data 内
  5491. properties:
  5492. data:
  5493. type: object
  5494. description: 业务参数
  5495. properties:
  5496. key:
  5497. type: string
  5498. description: 作业键(可省略=全部任务)
  5499. job_key:
  5500. type: string
  5501. description: 作业键(契约字段名,可省略)
  5502. keyword:
  5503. type: string
  5504. description: 关键字(执行编号/任务/结果说明;不检索对象级明细)
  5505. trigger:
  5506. type: string
  5507. description: 触发方式
  5508. enum:
  5509. - 定时
  5510. - 事件
  5511. - 人工
  5512. result:
  5513. type: string
  5514. description: 执行结果
  5515. enum:
  5516. - 成功
  5517. - 部分成功
  5518. - 失败
  5519. - 异常
  5520. date_from:
  5521. type: string
  5522. description: 开始日期(YYYY-MM-DD,Asia/Shanghai 日界)
  5523. pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2}$'
  5524. date_to:
  5525. type: string
  5526. description: 结束日期(YYYY-MM-DD,含当日)
  5527. pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2}$'
  5528. page:
  5529. type: integer
  5530. description: 页码(0 基,默认 0)
  5531. minimum: 0
  5532. default: 0
  5533. page_size:
  5534. type: integer
  5535. description: 每页条数(默认 50,上限 200)
  5536. minimum: 1
  5537. maximum: 200
  5538. default: 50
  5539. required:
  5540. - data
  5541. responses:
  5542. "200":
  5543. description: 成功。统一信封 code/message/data
  5544. /jobs/run_once@v1:
  5545. post:
  5546. summary: 补跑作业一次
  5547. description: 触发一次指定作业。prod 环境仅总运营可补跑。可选 key:SUB-EFF/SNAPSHOT-FREEZE/DELEG-SYNC/STOP-GEN/OVERDUE/AUTO-CLOSE/RECON/ORPHAN-CLEAN/REGION-WARM/ONEDIR-CHECK/OSS-ORPHAN-CLEAN。执行轮次落 bos_job_run,返回本轮五格计数与对象级明细。
  5548. operationId: jobs_run_once
  5549. tags:
  5550. - 定时作业
  5551. x-require-auth: true
  5552. x-resource-type: bos.jobs
  5553. x-action: manage
  5554. x-version: v1
  5555. x-permission-visibility: catalog
  5556. requestBody:
  5557. required: true
  5558. description: JSON 请求体,业务字段置于 data
  5559. content:
  5560. application/json:
  5561. schema:
  5562. type: object
  5563. description: 统一信封请求体,业务字段放在 data 内
  5564. properties:
  5565. data:
  5566. type: object
  5567. description: 业务参数
  5568. properties:
  5569. key:
  5570. type: string
  5571. description: 作业键
  5572. enum:
  5573. - SUB-EFF
  5574. - SNAPSHOT-FREEZE
  5575. - DELEG-SYNC
  5576. - STOP-GEN
  5577. - OVERDUE
  5578. - AUTO-CLOSE
  5579. - RECON
  5580. - ORPHAN-CLEAN
  5581. - REGION-WARM
  5582. - ONEDIR-CHECK
  5583. - OSS-ORPHAN-CLEAN
  5584. required:
  5585. - key
  5586. required:
  5587. - data
  5588. responses:
  5589. "200":
  5590. description: 成功。统一信封 code/message/data
  5591. components:
  5592. schemas:
  5593. ApiEnvelope:
  5594. type: object
  5595. description: 统一响应信封
  5596. properties:
  5597. code:
  5598. type: integer
  5599. description: 业务/协议码,0 表示成功
  5600. message:
  5601. type: string
  5602. description: 提示信息
  5603. error_code:
  5604. type: string
  5605. description: 稳定错误码(失败时)
  5606. data:
  5607. description: 业务数据载荷
  5608. required:
  5609. - code
  5610. - message
  5611. PageQuery:
  5612. type: object
  5613. description: 分页查询(0 基)
  5614. properties:
  5615. page:
  5616. type: integer
  5617. description: 页码(0 基索引,默认 0)
  5618. minimum: 0
  5619. default: 0
  5620. page_size:
  5621. type: integer
  5622. description: 每页条数(默认 20,上限 200)
  5623. minimum: 1
  5624. maximum: 200
  5625. default: 20
  5626. keyword:
  5627. type: string
  5628. description: 关键字筛选(可选)