openapi.yaml 222 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656
  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: 新建固定/自定义档位。拒收 sub_mode、first_referred_at。自定义档必填 customer_id。Ops 角色只能建自定义档(D-16);created_by=鉴权账号、created_team_id=建档团队快照(D-17)。
  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. plan_family:
  3385. type: string
  3386. description: 交付形态:link=跨境链路(份数恒 1);addon=附加项(份数≥1,不设带宽列)
  3387. enum:
  3388. - link
  3389. - addon
  3390. annual_price_cents:
  3391. type: integer
  3392. description: 年价(分)
  3393. monthly_settle_cents:
  3394. type: integer
  3395. description: 月结算标准(分,可选,1~上限);可录入(2026-11-19 起由只读列改为可写)
  3396. sub_account_quota:
  3397. type: integer
  3398. description: 分账号额度(非负,上限 9999):link 档必须 > 0;addon 档必须为 0(D-15)
  3399. bandwidth_committed:
  3400. type: boolean
  3401. description: 是否承诺带宽:仅 link 档可传(缺省 true);addon 档一律不传(D-18)
  3402. bandwidth_up_mbps:
  3403. type: integer
  3404. description: 上行带宽(Mbps,整数 1~1000);bandwidth_committed=true 时必填。不再有单值 total_bandwidth_mbps(2026-11-05 D8 关闭=该列退役,「总带宽」只是显示列名)
  3405. bandwidth_down_mbps:
  3406. type: integer
  3407. description: 下行带宽(Mbps,整数 1~1000);bandwidth_committed=true 时必填;与上行同值时界面并显「上下行 N 兆」,不等显「下行 X 兆 / 上行 Y 兆」
  3408. customer_id:
  3409. type: string
  3410. description: 自定义档所属客户 ID(custom 必填)
  3411. required:
  3412. - plan_kind
  3413. - plan_name
  3414. - plan_family
  3415. - annual_price_cents
  3416. required:
  3417. - data
  3418. responses:
  3419. "200":
  3420. description: 成功。统一信封 code/message/data
  3421. /catalog/update@v1:
  3422. post:
  3423. summary: 编辑套餐档位
  3424. description: 编辑档位;plan_kind/plan_family 建后不可改(K204);被订阅引用冻结后多数字段只读。
  3425. operationId: catalog_update
  3426. tags:
  3427. - 套餐档位
  3428. x-require-auth: true
  3429. x-resource-type: bos.catalog
  3430. x-action: update
  3431. x-version: v1
  3432. x-permission-visibility: catalog
  3433. requestBody:
  3434. required: true
  3435. description: JSON 请求体,业务字段置于 data
  3436. content:
  3437. application/json:
  3438. schema:
  3439. type: object
  3440. description: 统一信封请求体,业务字段放在 data 内
  3441. properties:
  3442. data:
  3443. type: object
  3444. description: 业务参数
  3445. properties:
  3446. plan_id:
  3447. type: string
  3448. description: 档位 ID
  3449. plan_name:
  3450. type: string
  3451. description: 档位名称
  3452. plan_desc:
  3453. type: string
  3454. description: 套餐说明(可空;传空串=清空成 null;≤512 字符)。引用冻结后仍可改
  3455. annual_price_cents:
  3456. type: integer
  3457. description: 年价(分)
  3458. monthly_settle_cents:
  3459. type: integer
  3460. description: 月结算标准(分,可选,1~上限);可录入(2026-11-19 起由只读列改为可写)
  3461. sub_account_quota:
  3462. type: integer
  3463. description: 分账号额度(非负,上限 9999):link 档必须 > 0;addon 档必须为 0(D-15)
  3464. bandwidth_committed:
  3465. type: boolean
  3466. description: 是否承诺带宽:true=承诺(缺省);false=该档「不承诺带宽」,上下行两字段一律不传
  3467. bandwidth_up_mbps:
  3468. type: integer
  3469. description: 上行带宽(Mbps,整数 1~1000);bandwidth_committed=true 时必填,关闭「是否承诺带宽」时必不传(档位被订阅引用后随整单只读,K204)
  3470. bandwidth_down_mbps:
  3471. type: integer
  3472. description: 下行带宽(Mbps,整数 1~1000);必填规则同上,两值不折算为单值
  3473. row_version:
  3474. type: integer
  3475. description: 乐观锁版本(若启用)
  3476. required:
  3477. - plan_id
  3478. required:
  3479. - data
  3480. responses:
  3481. "200":
  3482. description: 成功。统一信封 code/message/data
  3483. /catalog/get_list@v1:
  3484. post:
  3485. summary: 套餐档位列表
  3486. description: 按 plan_kind/plan_family 等条件筛选档位列表。每行回 plan_family、use_purpose、created_by/created_team_id 及读侧名称 created_by_name/created_team_name(D-17)。
  3487. operationId: catalog_get_list
  3488. tags:
  3489. - 套餐档位
  3490. x-require-auth: true
  3491. x-resource-type: bos.catalog
  3492. x-action: list
  3493. x-version: v1
  3494. x-permission-visibility: catalog
  3495. requestBody:
  3496. required: true
  3497. description: JSON 请求体,业务字段置于 data
  3498. content:
  3499. application/json:
  3500. schema:
  3501. type: object
  3502. description: 统一信封请求体,业务字段放在 data 内
  3503. properties:
  3504. data:
  3505. type: object
  3506. description: 列表筛选参数
  3507. properties:
  3508. page:
  3509. type: integer
  3510. description: 页码(0 基索引,默认 0)
  3511. minimum: 0
  3512. default: 0
  3513. page_size:
  3514. type: integer
  3515. description: 每页条数(默认 20,上限 200)
  3516. minimum: 1
  3517. maximum: 200
  3518. default: 20
  3519. keyword:
  3520. type: string
  3521. description: 关键字筛选(可选)
  3522. plan_kind:
  3523. type: string
  3524. description: 档位类型筛选:fixed/custom
  3525. plan_family:
  3526. type: string
  3527. description: 交付形态筛选:link/addon(仅自定义档可筛,固定档带此参报错)
  3528. enum:
  3529. - link
  3530. - addon
  3531. customer_id:
  3532. type: string
  3533. description: 自定义档客户筛选
  3534. required:
  3535. - data
  3536. responses:
  3537. "200":
  3538. description: 成功。统一信封 code/message/data
  3539. /catalog/get@v1:
  3540. post:
  3541. summary: 套餐档位详情
  3542. description: 按档位 ID 查询详情。
  3543. operationId: catalog_get
  3544. tags:
  3545. - 套餐档位
  3546. x-require-auth: true
  3547. x-resource-type: bos.catalog
  3548. x-action: view
  3549. x-version: v1
  3550. x-permission-visibility: catalog
  3551. requestBody:
  3552. required: true
  3553. description: JSON 请求体,业务字段置于 data
  3554. content:
  3555. application/json:
  3556. schema:
  3557. type: object
  3558. description: 统一信封请求体,业务字段放在 data 内
  3559. properties:
  3560. data:
  3561. type: object
  3562. description: 业务参数
  3563. properties:
  3564. plan_id:
  3565. type: string
  3566. description: 档位 ID
  3567. required:
  3568. - plan_id
  3569. required:
  3570. - data
  3571. responses:
  3572. "200":
  3573. description: 成功。统一信封 code/message/data
  3574. /catalog/delete@v1:
  3575. post:
  3576. summary: 套餐档位条件删除
  3577. description: 按档位 ID 条件删除(第3册§3.7):引用份数+两栏阻塞清单(subscriptions/items),在用⇒KLT-K205;固定档仅 Admin。
  3578. operationId: catalog_delete
  3579. tags:
  3580. - 套餐档位
  3581. x-require-auth: true
  3582. x-resource-type: bos.catalog
  3583. x-action: delete
  3584. x-version: v1
  3585. x-permission-visibility: catalog
  3586. requestBody:
  3587. required: true
  3588. description: JSON 请求体,业务字段置于 data
  3589. content:
  3590. application/json:
  3591. schema:
  3592. type: object
  3593. description: 统一信封请求体,业务字段放在 data 内
  3594. properties:
  3595. data:
  3596. type: object
  3597. description: 业务参数
  3598. properties:
  3599. plan_id:
  3600. type: string
  3601. description: 档位 ID
  3602. required:
  3603. - plan_id
  3604. required:
  3605. - data
  3606. responses:
  3607. "200":
  3608. description: 成功。统一信封 code/message/data
  3609. /catalog/customer_options@v1:
  3610. post:
  3611. summary: 归属客户下拉
  3612. description: 只列操作人可见客户(自定义档归属客户下拉,第3册§3.2);硬上限 500 行⇒truncated。
  3613. operationId: catalog_customer_options
  3614. tags:
  3615. - 套餐档位
  3616. x-require-auth: true
  3617. x-resource-type: bos.catalog
  3618. x-action: list
  3619. x-version: v1
  3620. x-permission-visibility: catalog
  3621. requestBody:
  3622. required: true
  3623. description: JSON 请求体,业务字段置于 data
  3624. content:
  3625. application/json:
  3626. schema:
  3627. type: object
  3628. description: 统一信封请求体,业务字段放在 data 内
  3629. properties:
  3630. data:
  3631. type: object
  3632. description: 列表筛选参数
  3633. properties:
  3634. keyword:
  3635. type: string
  3636. description: 客户名称关键字(可选)
  3637. required:
  3638. - data
  3639. responses:
  3640. "200":
  3641. description: 成功。统一信封 code/message/data
  3642. /plan_cost_item/get_list@v1:
  3643. post:
  3644. summary: 档位随附成本项列表
  3645. description: 按档位读取随附成本项(第3册§3.5):名称是弱引用,不校验是否在全局清单;frozen 仅供前端提示。
  3646. operationId: plan_cost_item_get_list
  3647. tags:
  3648. - 套餐档位
  3649. x-require-auth: true
  3650. x-resource-type: bos.plan_cost_item
  3651. x-action: list
  3652. x-version: v1
  3653. x-permission-visibility: catalog
  3654. requestBody:
  3655. required: true
  3656. description: JSON 请求体,业务字段置于 data
  3657. content:
  3658. application/json:
  3659. schema:
  3660. type: object
  3661. description: 统一信封请求体,业务字段放在 data 内
  3662. properties:
  3663. data:
  3664. type: object
  3665. description: 业务参数
  3666. properties:
  3667. plan_id:
  3668. type: string
  3669. description: 档位 ID
  3670. required:
  3671. - plan_id
  3672. required:
  3673. - data
  3674. responses:
  3675. "200":
  3676. description: 成功。统一信封 code/message/data
  3677. /plan_cost_item/save@v1:
  3678. post:
  3679. summary: 档位随附成本项整段全量替换
  3680. description: 一次提交该档位全部成本项(先按 plan_id 删净再逐条插,第3册§3.5);同档位名称重复⇒KLT-K206。
  3681. operationId: plan_cost_item_save
  3682. tags:
  3683. - 套餐档位
  3684. x-require-auth: true
  3685. x-resource-type: bos.plan_cost_item
  3686. x-action: update
  3687. x-version: v1
  3688. x-permission-visibility: catalog
  3689. requestBody:
  3690. required: true
  3691. description: JSON 请求体,业务字段置于 data
  3692. content:
  3693. application/json:
  3694. schema:
  3695. type: object
  3696. description: 统一信封请求体,业务字段放在 data 内
  3697. properties:
  3698. data:
  3699. type: object
  3700. description: 业务参数
  3701. properties:
  3702. plan_id:
  3703. type: string
  3704. description: 档位 ID
  3705. items:
  3706. type: array
  3707. description: 成本项整段(全量替换,上限 50 条)
  3708. maxItems: 50
  3709. items:
  3710. type: object
  3711. description: 成本项条目
  3712. properties:
  3713. item_name:
  3714. type: string
  3715. description: 成本项名称(弱引用,1~128 字)
  3716. amount_cents:
  3717. type: integer
  3718. description: 金额(分,≥0)
  3719. minimum: 0
  3720. billing_unit:
  3721. type: string
  3722. description: 计费单位(可选)
  3723. enum:
  3724. - per_customer
  3725. - per_account
  3726. - per_copy
  3727. category:
  3728. type: string
  3729. description: 成本项分类(可选)
  3730. enum:
  3731. - intl_resource
  3732. - device_purchase
  3733. - project_fee
  3734. remark:
  3735. type: string
  3736. description: 备注(可选,上限 512 字)
  3737. sort_no:
  3738. type: integer
  3739. description: 排序号(≥0)
  3740. minimum: 0
  3741. required:
  3742. - item_name
  3743. - amount_cents
  3744. required:
  3745. - plan_id
  3746. required:
  3747. - data
  3748. responses:
  3749. "200":
  3750. description: 成功。统一信封 code/message/data
  3751. /contract/create@v1:
  3752. post:
  3753. summary: 新建合同
  3754. 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。
  3755. operationId: contract_create
  3756. tags:
  3757. - 合同
  3758. x-require-auth: true
  3759. x-resource-type: bos.contract
  3760. x-action: create
  3761. x-version: v1
  3762. x-permission-visibility: catalog
  3763. requestBody:
  3764. required: true
  3765. description: JSON 请求体,业务字段置于 data
  3766. content:
  3767. application/json:
  3768. schema:
  3769. type: object
  3770. description: 统一信封请求体,业务字段放在 data 内
  3771. properties:
  3772. data:
  3773. type: object
  3774. description: 业务参数
  3775. properties:
  3776. customer_id:
  3777. type: string
  3778. description: 签约客户 ID。与 customer_inline **只可二选一**:命中已有客户填本项;未命中改用内联建档段
  3779. customer_inline:
  3780. type: object
  3781. description: >-
  3782. 客户未命中时的内联建档段(需求 §5.3 CU-13;业主 2026-11-16 定案关闭 CU-41)。
  3783. 本段先按 `/customer/create@v1` 的同一套规则建档(两个事务:建档 → 合同,不合并),
  3784. 再签本合同;建档含客户主账号(未设初始口令 ⇒ 待激活、发激活码,明文不在本响应内下发)。
  3785. 注意:唯一与页面建档不同的判据=企业营业执照影像**可留空**(本通道例外),
  3786. 建档后到客户档案「登记材料」格补传/替换。主体类型非企业时不收 license。
  3787. properties:
  3788. customer_name:
  3789. type: string
  3790. description: 客户名称(必填;允许重名,查重靠识别号)
  3791. subject_type:
  3792. type: string
  3793. description: 主体类型(必填):enterprise/individual/sole_proprietor
  3794. enum:
  3795. - enterprise
  3796. - individual
  3797. - sole_proprietor
  3798. id_code:
  3799. type: string
  3800. description: 客户识别号(必填):既是安全存储载体,也是合同事务失败后重试的幂等键(不得省略)
  3801. contact_name:
  3802. type: string
  3803. description: 客户经办联系人
  3804. contact_mobile:
  3805. type: string
  3806. description: 联系电话
  3807. address:
  3808. type: string
  3809. description: 客户地址
  3810. parent_node_id:
  3811. type: string
  3812. description: 挂载区域(必填;区域树节点 ID,与 /customer/create@v1 的 parent_node_id 同义)
  3813. operator_id:
  3814. type: string
  3815. description: 归属运营商(必填;候选=所挂区域省份下可见的运营商档案,须同省)
  3816. ops_team_ids:
  3817. type: array
  3818. description: 运维团队(必填且**恰好 1 支**,单支定案;不得为空数组/不得传多支)
  3819. items:
  3820. type: string
  3821. description: 团队 ID
  3822. license:
  3823. type: object
  3824. description: 营业执照影像(本通道**可留空**;非企业主体不收)。两键成对
  3825. properties:
  3826. object_key:
  3827. type: string
  3828. description: 平台对象存储对象键(浏览器直传后回报,须在客户影像前缀下)
  3829. file_name:
  3830. type: string
  3831. description: 原始文件名(仅展示)
  3832. required:
  3833. - object_key
  3834. - file_name
  3835. primary_username:
  3836. type: string
  3837. description: 客户主账号登录名(选填;留空按主体号派生)
  3838. primary_mobile:
  3839. type: string
  3840. description: 主账号绑定手机号(选填,11 位)
  3841. required:
  3842. - customer_name
  3843. - subject_type
  3844. - id_code
  3845. - parent_node_id
  3846. - operator_id
  3847. - ops_team_ids
  3848. contract_no:
  3849. type: string
  3850. description: 合同编号(空则服务端发号)
  3851. external_no:
  3852. type: string
  3853. description: 外部合同号(可选)
  3854. contract_amount_cents:
  3855. type: integer
  3856. description: 合同金额(分,可选)
  3857. pay_cycle:
  3858. type: string
  3859. description: 付款周期:yearly/quarterly/monthly
  3860. enum:
  3861. - yearly
  3862. - quarterly
  3863. - monthly
  3864. start_date:
  3865. type: string
  3866. description: 合同开始日期(YYYY-MM-DD)
  3867. format: date
  3868. end_date:
  3869. type: string
  3870. description: >-
  3871. 合同结束日期(YYYY-MM-DD)。**可省略**(2026-11-17 定案):省略时服务端按
  3872. 「生效日+付款周期」推算=年付 12/季付 3/月付 1 个月再减一天,该月无对应日先取月末
  3873. (录入页面已把它锁成只读推算值)。显式给出则按显式值落库(运营商同步可表达跨多个付款周期的合同)。
  3874. format: date
  3875. agent_name:
  3876. type: string
  3877. description: 运营商经办人姓名(交接单三段之二,必填;不是录入账号 created_by)
  3878. agent_mobile:
  3879. type: string
  3880. description: 运营商经办人联系方式(交接单三段之三,必填)
  3881. agent_handover_on:
  3882. type: string
  3883. description: >-
  3884. 经办交接日期(交接日期,**必填**;录入页面默认取录入当日=Asia/Shanghai 业务日,
  3885. 接口须显式给出,服务端不代填)
  3886. format: date
  3887. agent_org:
  3888. type: string
  3889. description: 运营商经办人机构(交接单三段之一,选填)
  3890. attachment_url:
  3891. type: string
  3892. maxLength: 512
  3893. description: >-
  3894. 合同附件(单值,可选):外部 http(s) 链接,或浏览器直传平台对象存储
  3895. (seoh-unified-oss 两段式)成功后回报的对象键,前缀必须为
  3896. klt/contract/attachment/。空串=清空。对象键不得当作可直接打开的链接,
  3897. 详情读口另下发 attachment_view_url(短时效现签)。
  3898. service_items:
  3899. type: array
  3900. description: 服务构成条目列表
  3901. items:
  3902. type: object
  3903. description: 服务条目
  3904. properties:
  3905. plan_id:
  3906. type: string
  3907. description: 档位 ID(必填;2026-11-19 D-15 起条目只能引用目录档位)
  3908. quantity:
  3909. type: integer
  3910. description: 份数:link 档恒 1;addon 档≥1
  3911. item_family:
  3912. type: string
  3913. description: 交付形态(只读确认位,可缺省):只能与所引档位的 plan_family 相同,不同即 KLT-L216
  3914. enum:
  3915. - link
  3916. - addon
  3917. line_exits:
  3918. type: array
  3919. maxItems: 1
  3920. description: >-
  3921. 线路出口(2026-11-17 起**单选**:长度必须为 1)。新建/修改条目出现
  3922. 2 个以上由服务端回 KLT-L222;存量多出口条目**不迁移**(编辑合同须原样回传,
  3923. 否则该条目视为改动而触发上述校验)。
  3924. items:
  3925. type: string
  3926. description: 出口标识
  3927. succession:
  3928. type: object
  3929. description: >-
  3930. 契约内逐条替换(升降配,2026-11-17):本条目的新订阅顶替哪份原订阅。
  3931. **仅在新建合同受理**,编辑合同出现即 KLT-L222。只接受三键;
  3932. 价格、状态、row_version 等只读派生列出现即 KLT-L222 点名。
  3933. 校验:原订阅属本客户、status ∈ active/pending、双方均 plan_family=link、
  3934. line_exit_key 相等、未被替换过(已被指向 ⇒ KLT-M226);
  3935. 同一 replaces_subscription_id 在本请求内至多一次;link 条目 quantity 须为 1。
  3936. **期间必须与原订阅相交**(2026-11-17 定案):原订阅在新订阅开始前已到期
  3937. ⇒ 不是替换而是到期续签,服务端**忽略本键**、按续签新开(不截原、不挂替换边、
  3938. 不出第七类工单),回执行 mode=renewed。
  3939. 替换写入与合同写入同一条 dml_batch(任一条失败=整批回滚,含合同本身)。
  3940. properties:
  3941. replaces_subscription_id:
  3942. type: string
  3943. description: 被替换的原订阅号(必填)
  3944. start_date:
  3945. type: string
  3946. format: date
  3947. description: >-
  3948. 新订阅起日,缺省=**合同生效日**(2026-11-17 定案:订阅跟着合同起算,
  3949. 不再取业务当天);须 ≤ 合同止期,且不晚于原订阅结束日(否则按续签处理)。
  3950. **结束日恒取合同止期**(2026-11-17 口径统一,登记总则 §18)。
  3951. term:
  3952. type: string
  3953. description: 订阅方式(yearly/quarterly/monthly);缺省按档位与账期派生
  3954. required:
  3955. - replaces_subscription_id
  3956. renew_from_contract_id:
  3957. type: string
  3958. description: >-
  3959. 续签自哪份旧合同(2026-11-17 定案,可选)。给出时服务端校验它属**同一客户**,
  3960. 并为本合同的**每个服务条目**各生成一份订阅:不带 replaces_subscription_id、
  3961. 不截任何原订阅、不出第七类 updown 工单(订阅开始日=合同生效日、结束日=合同结束日)。
  3962. 用于「到期续签」:旧订阅自然到期即止,新合同接着生效。
  3963. 与 service_items[].succession **互斥**(同时出现即 KLT-L222)。
  3964. 应答仍走 data.replacements[],其中 mode=renewed、replaces_subscription_id=null。
  3965. required:
  3966. - pay_cycle
  3967. - start_date
  3968. required:
  3969. - data
  3970. responses:
  3971. "200":
  3972. description: 成功。统一信封 code/message/data
  3973. /contract/update@v1:
  3974. post:
  3975. summary: 编辑合同
  3976. 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` 时,服务端按同一式重算(⛔ 留一个与期间对不上的旧止期);三项都没动则沿用库里现值。
  3977. operationId: contract_update
  3978. tags:
  3979. - 合同
  3980. x-require-auth: true
  3981. x-resource-type: bos.contract
  3982. x-action: update
  3983. x-version: v1
  3984. x-permission-visibility: catalog
  3985. requestBody:
  3986. required: true
  3987. description: JSON 请求体,业务字段置于 data
  3988. content:
  3989. application/json:
  3990. schema:
  3991. type: object
  3992. description: 统一信封请求体,业务字段放在 data 内
  3993. properties:
  3994. data:
  3995. type: object
  3996. description: 业务参数
  3997. properties:
  3998. contract_id:
  3999. type: string
  4000. description: 合同 ID
  4001. row_version:
  4002. type: integer
  4003. description: 乐观锁版本
  4004. external_no:
  4005. type: string
  4006. description: 外部合同号
  4007. contract_amount_cents:
  4008. type: integer
  4009. description: 合同金额(分)
  4010. pay_cycle:
  4011. type: string
  4012. description: 付款周期
  4013. start_date:
  4014. type: string
  4015. description: 开始日期
  4016. format: date
  4017. end_date:
  4018. type: string
  4019. description: 结束日期
  4020. format: date
  4021. agent_name:
  4022. type: string
  4023. description: 运营商经办人姓名(交接单口径,不是录入账号 created_by);受 billing/archive 轴约束,冻结时提交改动值 ⇒ KLT-L219/L220
  4024. agent_mobile:
  4025. type: string
  4026. description: 运营商经办人联系方式(交接单三段之三;archive 轴)
  4027. agent_handover_on:
  4028. type: string
  4029. description: 交接日期(archive 轴)
  4030. agent_org:
  4031. type: string
  4032. description: 运营商经办人机构(交接单三段之一;选填,archive 轴)
  4033. attachment_url:
  4034. type: string
  4035. maxLength: 512
  4036. description: >-
  4037. 合同附件(单值,archive 轴):外部 http(s) 链接,或前缀为
  4038. klt/contract/attachment/ 的对象键;空串=清空附件。
  4039. source:
  4040. type: string
  4041. description: 合同来源枚举 manual|import|operator_sync(04 册§4.2:写入时由服务端定、之后只读,不取入参;一期只有 manual 真产生值)
  4042. source_label:
  4043. type: string
  4044. description: 合同来源中文口径(界面录入/批量导入/运营商同步;04 册§4.7 列表与详情按来源标注)
  4045. service_items:
  4046. type: array
  4047. description: >-
  4048. 服务构成条目(含 item_id 的增删改)。⚠️ 编辑合同⛔ 受理 succession(替换只在新建
  4049. 合同时发生,出现即 KLT-L222);条目 line_exits 为单选(长度 1),存量多出口条目须
  4050. 原样回传,改成 1 个或其它值即按改动判定。
  4051. items:
  4052. type: object
  4053. properties:
  4054. item_id:
  4055. type: string
  4056. description: 既有条目主键(三向对比:带=UPDATE/不带=INSERT/库有载荷无=DELETE)
  4057. plan_id:
  4058. type: string
  4059. description: 档位 ID
  4060. quantity:
  4061. type: integer
  4062. description: 份数:link 档恒 1;addon 档≥1
  4063. item_family:
  4064. type: string
  4065. description: 交付形态(只读确认位,可缺省):与档位 plan_family 不同即 KLT-L216
  4066. enum:
  4067. - link
  4068. - addon
  4069. line_exits:
  4070. type: array
  4071. maxItems: 1
  4072. description: 线路出口(单选,长度 1)
  4073. items:
  4074. type: string
  4075. required:
  4076. - contract_id
  4077. - row_version
  4078. required:
  4079. - data
  4080. responses:
  4081. "200":
  4082. description: 成功。统一信封 code/message/data
  4083. /contract/get_list@v1:
  4084. post:
  4085. summary: 合同列表
  4086. description: >-
  4087. 按客户/状态等筛选合同列表。每行随 `attachment_kind`(none/link/object/other)说明附件形态;
  4088. `attachment_view_url` 在列表口恒 null(签名只在详情读口现签,不按行 N 次调平台)。
  4089. operationId: contract_get_list
  4090. tags:
  4091. - 合同
  4092. x-require-auth: true
  4093. x-resource-type: bos.contract
  4094. x-action: list
  4095. x-version: v1
  4096. x-permission-visibility: catalog
  4097. requestBody:
  4098. required: true
  4099. description: JSON 请求体,业务字段置于 data
  4100. content:
  4101. application/json:
  4102. schema:
  4103. type: object
  4104. description: 统一信封请求体,业务字段放在 data 内
  4105. properties:
  4106. data:
  4107. type: object
  4108. description: 列表筛选参数
  4109. properties:
  4110. page:
  4111. type: integer
  4112. description: 页码(0 基索引,默认 0)
  4113. minimum: 0
  4114. default: 0
  4115. page_size:
  4116. type: integer
  4117. description: 每页条数(默认 20,上限 200)
  4118. minimum: 1
  4119. maximum: 200
  4120. default: 20
  4121. keyword:
  4122. type: string
  4123. description: 关键字筛选(可选)
  4124. customer_id:
  4125. type: string
  4126. description: 客户 ID 筛选
  4127. status:
  4128. type: string
  4129. description: 状态筛选
  4130. opened:
  4131. type: boolean
  4132. description: 是否已开通筛选(三态:true/false/缺省不筛)
  4133. required:
  4134. - data
  4135. responses:
  4136. "200":
  4137. description: 成功。统一信封 code/message/data
  4138. /contract/get@v1:
  4139. post:
  4140. summary: 合同详情
  4141. description: >-
  4142. 按合同 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 掩码)。
  4143. 附件(单值):`attachment_url` 原值照回(外部链接或 klt/contract/attachment/ 下的对象键),
  4144. `attachment_kind` 说明形态,`attachment_view_url`/`attachment_view_url_expires_at`
  4145. 为读口现签的短时效下载地址(`link` 形态=原链接);对象键不得当作可直接打开的链接。
  4146. operationId: contract_get
  4147. tags:
  4148. - 合同
  4149. x-require-auth: true
  4150. x-resource-type: bos.contract
  4151. x-action: view
  4152. x-version: v1
  4153. x-permission-visibility: catalog
  4154. requestBody:
  4155. required: true
  4156. description: JSON 请求体,业务字段置于 data
  4157. content:
  4158. application/json:
  4159. schema:
  4160. type: object
  4161. description: 统一信封请求体,业务字段放在 data 内
  4162. properties:
  4163. data:
  4164. type: object
  4165. description: 业务参数
  4166. properties:
  4167. contract_id:
  4168. type: string
  4169. description: 合同 ID
  4170. required:
  4171. - contract_id
  4172. required:
  4173. - data
  4174. responses:
  4175. "200":
  4176. description: 成功。统一信封 code/message/data
  4177. /contract/change_log@v1:
  4178. post:
  4179. summary: 合同修改记录
  4180. 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 条目已下线)。
  4181. operationId: contract_change_log
  4182. tags:
  4183. - 合同
  4184. x-require-auth: true
  4185. x-resource-type: bos.contract
  4186. x-action: list
  4187. x-version: v1
  4188. x-permission-visibility: catalog
  4189. requestBody:
  4190. required: true
  4191. description: JSON 请求体,业务字段置于 data
  4192. content:
  4193. application/json:
  4194. schema:
  4195. type: object
  4196. description: 统一信封请求体,业务字段放在 data 内
  4197. properties:
  4198. data:
  4199. type: object
  4200. description: 业务参数
  4201. properties:
  4202. contract_id:
  4203. type: string
  4204. description: 合同 ID
  4205. page_size:
  4206. type: integer
  4207. description: 每页条数(默认 20,夹在 1~50)
  4208. minimum: 1
  4209. maximum: 50
  4210. default: 20
  4211. cursor:
  4212. type: string
  4213. description: 游标,形态 occurred_at|id(与审计页同形态);由上一页响应的 next_cursor 原样带回
  4214. required:
  4215. - contract_id
  4216. required:
  4217. - data
  4218. responses:
  4219. "200":
  4220. description: 成功。统一信封 code/message/data(items/page_size/next_cursor/cursor_usable)
  4221. /contract/customer_lookup@v1:
  4222. post:
  4223. summary: 合同客户身份解析
  4224. description: 第3册§4.2 第 1 步:query_type=credit_code 主体号精确点查/identity 归一化精确点查/keyword 客户名称模糊联想;未命中=matched:false 成功响应(不报错),越权读单客户=11104。
  4225. operationId: contract_customer_lookup
  4226. tags:
  4227. - 合同
  4228. x-require-auth: true
  4229. x-resource-type: bos.contract
  4230. x-action: list
  4231. x-version: v1
  4232. x-permission-visibility: catalog
  4233. requestBody:
  4234. required: true
  4235. description: JSON 请求体,业务字段置于 data
  4236. content:
  4237. application/json:
  4238. schema:
  4239. type: object
  4240. description: 统一信封请求体,业务字段放在 data 内
  4241. properties:
  4242. data:
  4243. type: object
  4244. description: 业务参数
  4245. properties:
  4246. query_type:
  4247. type: string
  4248. description: 查询通道
  4249. enum:
  4250. - credit_code
  4251. - identity
  4252. - keyword
  4253. value:
  4254. type: string
  4255. description: 查询值(主体号/识别号/客户名称关键字)
  4256. required:
  4257. - query_type
  4258. - value
  4259. required:
  4260. - data
  4261. responses:
  4262. "200":
  4263. description: 成功。统一信封 code/message/data
  4264. /contract/delete@v1:
  4265. post:
  4266. summary: 合同条件删除
  4267. description: 第3册§4.8:两类阻塞分栏(subscriptions/tickets),有阻塞⇒KLT-L213;工单取数失败⇒KLT-S406(不得中途放行)。
  4268. operationId: contract_delete
  4269. tags:
  4270. - 合同
  4271. x-require-auth: true
  4272. x-resource-type: bos.contract
  4273. x-action: delete
  4274. x-version: v1
  4275. x-permission-visibility: catalog
  4276. requestBody:
  4277. required: true
  4278. description: JSON 请求体,业务字段置于 data
  4279. content:
  4280. application/json:
  4281. schema:
  4282. type: object
  4283. description: 统一信封请求体,业务字段放在 data 内
  4284. properties:
  4285. data:
  4286. type: object
  4287. description: 业务参数
  4288. properties:
  4289. contract_id:
  4290. type: string
  4291. description: 合同 ID
  4292. required:
  4293. - contract_id
  4294. required:
  4295. - data
  4296. responses:
  4297. "200":
  4298. description: 成功。统一信封 code/message/data
  4299. /contract/attachment_discard@v1:
  4300. post:
  4301. summary: 回收无人引用的上传附件(孤儿对象)
  4302. description: >-
  4303. 还原 2026-11-16 定案的孤儿附件回收:浏览器直传是「先上传、后落库」,用户换文件/移除/
  4304. 取消编辑/保存被拦时会在桶里留下无引用对象。平台 unified-oss 明确「不做后台遍历删对象、
  4305. 不按业务字段回收」,只有即时删除一条通道(object/delete@v1),故回收由本服务在引用面判定后发起。
  4306. 三条安全线:object_key 必须是本服务前缀下无路径穿越的对象键;查库确认没有任何合同仍指向它;
  4307. 角色限 Admin/OpsMain(与合同写口同一道闸)。referenced=true 与「对象已不在」都不算失败(幂等)。
  4308. operationId: contract_attachment_discard
  4309. tags:
  4310. - 合同
  4311. x-require-auth: true
  4312. x-resource-type: bos.contract_attachment
  4313. x-action: delete
  4314. x-version: v1
  4315. x-permission-visibility: catalog
  4316. requestBody:
  4317. required: true
  4318. description: JSON 请求体,业务字段置于 data
  4319. content:
  4320. application/json:
  4321. schema:
  4322. type: object
  4323. description: 统一信封请求体,业务字段放在 data 内
  4324. properties:
  4325. data:
  4326. type: object
  4327. description: 业务参数
  4328. properties:
  4329. object_key:
  4330. type: string
  4331. description: 直传回报的对象键(klt/contract/attachment/ 前缀下)
  4332. required:
  4333. - object_key
  4334. required:
  4335. - data
  4336. responses:
  4337. "200":
  4338. description: 成功。统一信封 code/message/data
  4339. /subscription/create@v1:
  4340. post:
  4341. summary: 新建订阅
  4342. description: 拒收 line_exits、sub_mode、order_no、新建时的 end_date、opened_at。
  4343. operationId: subscription_create
  4344. tags:
  4345. - 订阅
  4346. x-require-auth: true
  4347. x-resource-type: bos.subscription
  4348. x-action: create
  4349. x-version: v1
  4350. x-permission-visibility: catalog
  4351. requestBody:
  4352. required: true
  4353. description: JSON 请求体,业务字段置于 data
  4354. content:
  4355. application/json:
  4356. schema:
  4357. type: object
  4358. description: 统一信封请求体,业务字段放在 data 内
  4359. properties:
  4360. data:
  4361. type: object
  4362. description: 业务参数
  4363. properties:
  4364. customer_id:
  4365. type: string
  4366. description: 客户 ID
  4367. plan_id:
  4368. type: string
  4369. description: 档位 ID
  4370. contract_id:
  4371. type: string
  4372. description: 合同 ID
  4373. contract_item_id:
  4374. type: string
  4375. description: 合同服务条目 ID
  4376. start_date:
  4377. type: string
  4378. description: 订阅开始日期
  4379. format: date
  4380. annual_price_cents:
  4381. type: integer
  4382. description: 年价(分)
  4383. monthly_settle_cents:
  4384. type: integer
  4385. description: 月结算金额(分)
  4386. plan_family:
  4387. type: string
  4388. description: 交付形态(只读确认位,可缺省):只能与所选档位的 plan_family 相同,不同即 11103
  4389. enum:
  4390. - link
  4391. - addon
  4392. term:
  4393. type: string
  4394. description: 账期(三态:yearly/quarterly/monthly)
  4395. enum:
  4396. - yearly
  4397. - quarterly
  4398. - monthly
  4399. trial_months:
  4400. type: integer
  4401. description: 试用月数(默认 0,≥0)
  4402. minimum: 0
  4403. discount_monthly_cents:
  4404. type: integer
  4405. description: 每月优惠金额(分,默认 0,≥0)
  4406. minimum: 0
  4407. required:
  4408. - customer_id
  4409. - plan_id
  4410. - contract_id
  4411. - contract_item_id
  4412. - start_date
  4413. - annual_price_cents
  4414. - monthly_settle_cents
  4415. required:
  4416. - data
  4417. responses:
  4418. "200":
  4419. description: 成功。统一信封 code/message/data
  4420. /subscription/change@v1:
  4421. post:
  4422. summary: 订阅升降配
  4423. description: >-
  4424. 升降配须填 replaces_subscription_id,且须使用新的 contract_id(不得沿用原合同)。
  4425. 2026-11-17 起该入口保留为「单订阅快捷通道」;常规路径是在合同新建页逐条带
  4426. service_items[].succession 一次性完成(见 /contract/create@v1)。两条路径共用
  4427. succession.rs 的计划层与截原谓词(已被替换过的原订阅 ⇒ KLT-M226)。工单类型由交付态决定:
  4428. 原订阅已交付且客户在用 ⇒ 一张 updown(新档交付+原档回收);未交付 ⇒ open/service_open。
  4429. operationId: subscription_change
  4430. tags:
  4431. - 订阅
  4432. x-require-auth: true
  4433. x-resource-type: bos.subscription
  4434. x-action: update
  4435. x-version: v1
  4436. x-permission-visibility: catalog
  4437. requestBody:
  4438. required: true
  4439. description: JSON 请求体,业务字段置于 data
  4440. content:
  4441. application/json:
  4442. schema:
  4443. type: object
  4444. description: 统一信封请求体,业务字段放在 data 内
  4445. properties:
  4446. data:
  4447. type: object
  4448. description: 业务参数
  4449. properties:
  4450. replaces_subscription_id:
  4451. type: string
  4452. description: 被替换的原订阅 ID
  4453. customer_id:
  4454. type: string
  4455. description: 客户 ID
  4456. plan_id:
  4457. type: string
  4458. description: 新档位 ID
  4459. contract_id:
  4460. type: string
  4461. description: 新合同 ID(不得沿用原合同)
  4462. contract_item_id:
  4463. type: string
  4464. description: 新合同服务条目 ID
  4465. start_date:
  4466. type: string
  4467. description: 新订阅开始日期
  4468. format: date
  4469. annual_price_cents:
  4470. type: integer
  4471. description: 年价(分)
  4472. monthly_settle_cents:
  4473. type: integer
  4474. description: 月结算金额(分)
  4475. plan_family:
  4476. type: string
  4477. description: 交付形态(只读确认位,可缺省):只能与所选档位的 plan_family 相同,不同即 11103
  4478. enum:
  4479. - link
  4480. - addon
  4481. term:
  4482. type: string
  4483. description: 账期(三态:yearly/quarterly/monthly)
  4484. enum:
  4485. - yearly
  4486. - quarterly
  4487. - monthly
  4488. trial_months:
  4489. type: integer
  4490. description: 试用月数(默认 0,≥0)
  4491. minimum: 0
  4492. discount_monthly_cents:
  4493. type: integer
  4494. description: 每月优惠金额(分,默认 0,≥0)
  4495. minimum: 0
  4496. row_version:
  4497. type: integer
  4498. description: 乐观锁版本号(可选,缺省不校验)
  4499. required:
  4500. - replaces_subscription_id
  4501. - customer_id
  4502. - plan_id
  4503. - contract_id
  4504. - contract_item_id
  4505. - start_date
  4506. - annual_price_cents
  4507. - monthly_settle_cents
  4508. required:
  4509. - data
  4510. responses:
  4511. "200":
  4512. description: 成功。统一信封 code/message/data
  4513. /subscription/replacement_candidates@v1:
  4514. post:
  4515. summary: 替换候选探测(只读)
  4516. description: >-
  4517. 合同新建页逐条判定「是否已有可替换的原订阅」(契约内逐条替换=升降配,2026-11-17)。
  4518. 交付形态唯一取档位 `plan_family`(D-15)、按「同客户 × 同出口 × 双方均 link × **期间相交**」过滤
  4519. (status ∈ active/pending、排除 addon 档、排除已被指过的 replaces_subscription_id),
  4520. 与 `/contract/create@v1` 的保存期校验是**同一份函数**(succession::candidate_filter),
  4521. 前端⛔ 自造候选范围。index 与 service_items 的 0 基下标对齐。
  4522. 2026-11-17 二轮:期间判据入候选——原订阅在新订阅开始前已到期(新合同 2027 起、旧订阅 2026-12-31 止)
  4523. ⇒ 属**到期续签**,不进 candidates,单列进 skipped[] 供页面解释「按新订阅开通」。
  4524. operationId: subscription_replacement_candidates
  4525. tags:
  4526. - 订阅
  4527. x-require-auth: true
  4528. x-resource-type: bos.subscription
  4529. x-action: read
  4530. x-version: v1
  4531. x-permission-visibility: catalog
  4532. requestBody:
  4533. required: true
  4534. description: JSON 请求体,业务字段置于 data
  4535. content:
  4536. application/json:
  4537. schema:
  4538. type: object
  4539. description: 统一信封请求体,业务字段放在 data 内
  4540. properties:
  4541. data:
  4542. type: object
  4543. description: 业务参数
  4544. properties:
  4545. customer_id:
  4546. type: string
  4547. description: 签约客户 ID(候选范围限本客户)
  4548. start_date:
  4549. type: string
  4550. format: date
  4551. description: 新合同生效日(缺省=业务当天)。与 candidates/skipped 的期间判据同源
  4552. end_date:
  4553. type: string
  4554. format: date
  4555. description: 新合同结束日(可空)。给了才能判「原订阅排在本合同之后才生效」
  4556. probes:
  4557. type: array
  4558. description: 探测项(至少 1 项;每项对应一个服务构成条目)
  4559. items:
  4560. type: object
  4561. properties:
  4562. index:
  4563. type: integer
  4564. description: 0 基条目下标(缺省=数组位置)
  4565. plan_id:
  4566. type: string
  4567. description: 档位 ID(交付形态由档位带出)
  4568. line_exits:
  4569. type: array
  4570. maxItems: 1
  4571. description: 线路出口(须恰 1 个;缺省时回落档位上的出口集合)
  4572. items:
  4573. type: string
  4574. required:
  4575. - line_exits
  4576. required:
  4577. - customer_id
  4578. - probes
  4579. required:
  4580. - data
  4581. responses:
  4582. "200":
  4583. description: >-
  4584. 成功。data.probes[] 每项回 index/plan_id/plan_family(后端按档位解析)/
  4585. line_exit_key/line_exits/start_date/end_date/candidates[]/skipped[];候选行含
  4586. subscription_id/plan_id/plan_name/plan_kind/contract_id/contract_no/start_date/
  4587. end_date/status/annual_price_cents/monthly_settle_cents/customized(true=定制档,
  4588. 须用户显式勾选确认后才允许替换)。skipped[] 是同客户同出口但**期间不相交**的行
  4589. (subscription_id/plan_name/contract_no/start_date/end_date/status/reason,
  4590. reason=ended_before_start=到期续签、starts_after_contract_end=本合同结束后才生效),
  4591. 只用于解释、⛔ 可被选为替换对象。
  4592. 档位或出口判定不出 ⇒ KLT-L222 点名 probes[i]。
  4593. /subscription/stack@v1:
  4594. post:
  4595. summary: 订阅叠加或白名单更新
  4596. description: 叠加开通或更新白名单字段(两金额+end_date);其余只读键拒绝。
  4597. operationId: subscription_stack
  4598. tags:
  4599. - 订阅
  4600. x-require-auth: true
  4601. x-resource-type: bos.subscription
  4602. x-action: create
  4603. x-version: v1
  4604. x-permission-visibility: catalog
  4605. requestBody:
  4606. required: true
  4607. description: JSON 请求体,业务字段置于 data
  4608. content:
  4609. application/json:
  4610. schema:
  4611. type: object
  4612. description: 统一信封请求体,业务字段放在 data 内
  4613. properties:
  4614. data:
  4615. type: object
  4616. description: 业务参数
  4617. properties:
  4618. subscription_id:
  4619. type: string
  4620. description: 订阅 ID(更新场景)
  4621. customer_id:
  4622. type: string
  4623. description: 客户 ID(叠加新建时)
  4624. plan_id:
  4625. type: string
  4626. description: 档位 ID(叠加新建时)
  4627. contract_id:
  4628. type: string
  4629. description: 合同 ID
  4630. contract_item_id:
  4631. type: string
  4632. description: 合同服务条目 ID
  4633. annual_price_cents:
  4634. type: integer
  4635. description: 年价(分,可改)
  4636. monthly_settle_cents:
  4637. type: integer
  4638. description: 月结算金额(分,可改)
  4639. end_date:
  4640. type: string
  4641. description: 结束日期(可改)
  4642. format: date
  4643. start_date:
  4644. type: string
  4645. description: 开始日期(叠加新建时)
  4646. format: date
  4647. row_version:
  4648. type: integer
  4649. description: 乐观锁版本号(可选,缺省不校验)
  4650. required:
  4651. - data
  4652. responses:
  4653. "200":
  4654. description: 成功。统一信封 code/message/data
  4655. /subscription/get_list@v1:
  4656. post:
  4657. summary: 订阅列表
  4658. description: 按客户等维度筛选订阅列表。
  4659. operationId: subscription_get_list
  4660. tags:
  4661. - 订阅
  4662. x-require-auth: true
  4663. x-resource-type: bos.subscription
  4664. x-action: list
  4665. x-version: v1
  4666. x-permission-visibility: catalog
  4667. requestBody:
  4668. required: true
  4669. description: JSON 请求体,业务字段置于 data
  4670. content:
  4671. application/json:
  4672. schema:
  4673. type: object
  4674. description: 统一信封请求体,业务字段放在 data 内
  4675. properties:
  4676. data:
  4677. type: object
  4678. description: 列表筛选参数
  4679. properties:
  4680. customer_id:
  4681. type: string
  4682. description: 客户 ID(常必填)
  4683. page:
  4684. type: integer
  4685. description: 页码(0 基索引,默认 0)
  4686. minimum: 0
  4687. default: 0
  4688. page_size:
  4689. type: integer
  4690. description: 每页条数(默认 20,上限 200)
  4691. minimum: 1
  4692. maximum: 200
  4693. default: 20
  4694. keyword:
  4695. type: string
  4696. description: 关键字筛选(可选)
  4697. status:
  4698. type: string
  4699. description: 状态筛选
  4700. contract_id:
  4701. type: string
  4702. description: 合同 ID 筛选
  4703. region_ids:
  4704. type: array
  4705. description: 区域 ID 集合(经客户挂载区域展开)
  4706. items:
  4707. type: string
  4708. description: 区域 ID
  4709. required:
  4710. - data
  4711. responses:
  4712. "200":
  4713. description: 成功。统一信封 code/message/data
  4714. /subscription/get@v1:
  4715. post:
  4716. summary: 订阅详情
  4717. description: 按订阅 ID 查询详情。
  4718. operationId: subscription_get
  4719. tags:
  4720. - 订阅
  4721. x-require-auth: true
  4722. x-resource-type: bos.subscription
  4723. x-action: view
  4724. x-version: v1
  4725. x-permission-visibility: catalog
  4726. requestBody:
  4727. required: true
  4728. description: JSON 请求体,业务字段置于 data
  4729. content:
  4730. application/json:
  4731. schema:
  4732. type: object
  4733. description: 统一信封请求体,业务字段放在 data 内
  4734. properties:
  4735. data:
  4736. type: object
  4737. description: 业务参数
  4738. properties:
  4739. subscription_id:
  4740. type: string
  4741. description: 订阅 ID
  4742. required:
  4743. - subscription_id
  4744. required:
  4745. - data
  4746. responses:
  4747. "200":
  4748. description: 成功。统一信封 code/message/data
  4749. /subscription/plan_options@v1:
  4750. post:
  4751. summary: 订阅档位候选
  4752. description: 第3册§5.2 第 3 步:本客户自定义档(含合同条目派生档)+全部固定档,不含他客户自定义档;行内带只读 sub_mode 与 available/unavailable_reason。
  4753. operationId: subscription_plan_options
  4754. tags:
  4755. - 订阅
  4756. x-require-auth: true
  4757. x-resource-type: bos.subscription
  4758. x-action: list
  4759. x-version: v1
  4760. x-permission-visibility: catalog
  4761. requestBody:
  4762. required: true
  4763. description: JSON 请求体,业务字段置于 data
  4764. content:
  4765. application/json:
  4766. schema:
  4767. type: object
  4768. description: 统一信封请求体,业务字段放在 data 内
  4769. properties:
  4770. data:
  4771. type: object
  4772. description: 业务参数
  4773. properties:
  4774. customer_id:
  4775. type: string
  4776. description: 客户 ID(必填)
  4777. keyword:
  4778. type: string
  4779. description: 套餐名称关键字(仅本口有)
  4780. required:
  4781. - customer_id
  4782. required:
  4783. - data
  4784. responses:
  4785. "200":
  4786. description: 成功。统一信封 code/message/data
  4787. /subscription/contract_options@v1:
  4788. post:
  4789. summary: 未开通合同与服务条目候选
  4790. description: 第3册§5.2 第 2 步:只出「未开通」合同及其尚未被订阅引用的条目;开通态取数失败⇒KLT-S406;无可选合同⇒KLT-M222。
  4791. operationId: subscription_contract_options
  4792. tags:
  4793. - 订阅
  4794. x-require-auth: true
  4795. x-resource-type: bos.subscription
  4796. x-action: list
  4797. x-version: v1
  4798. x-permission-visibility: catalog
  4799. requestBody:
  4800. required: true
  4801. description: JSON 请求体,业务字段置于 data
  4802. content:
  4803. application/json:
  4804. schema:
  4805. type: object
  4806. description: 统一信封请求体,业务字段放在 data 内
  4807. properties:
  4808. data:
  4809. type: object
  4810. description: 业务参数
  4811. properties:
  4812. customer_id:
  4813. type: string
  4814. description: 客户 ID(必填)
  4815. keyword:
  4816. type: string
  4817. description: 合同名称关键字(仅本口有)
  4818. required:
  4819. - customer_id
  4820. required:
  4821. - data
  4822. responses:
  4823. "200":
  4824. description: 成功。统一信封 code/message/data
  4825. /subscription/update@v1:
  4826. post:
  4827. summary: 订阅修改(白名单)
  4828. description: 第3册§5.6:可改字段只有 trial_months/discount_monthly_cents;row_version 必填,落空⇒KLT-S407;换套餐/换合同⇒KLT-M229。
  4829. operationId: subscription_update
  4830. tags:
  4831. - 订阅
  4832. x-require-auth: true
  4833. x-resource-type: bos.subscription
  4834. x-action: update
  4835. x-version: v1
  4836. x-permission-visibility: catalog
  4837. requestBody:
  4838. required: true
  4839. description: JSON 请求体,业务字段置于 data
  4840. content:
  4841. application/json:
  4842. schema:
  4843. type: object
  4844. description: 统一信封请求体,业务字段放在 data 内
  4845. properties:
  4846. data:
  4847. type: object
  4848. description: 业务参数
  4849. properties:
  4850. subscription_id:
  4851. type: string
  4852. description: 订阅 ID
  4853. row_version:
  4854. type: integer
  4855. description: 乐观锁版本号(必填,落空⇒KLT-S407)
  4856. trial_months:
  4857. type: integer
  4858. description: 试用月数(白名单可改)
  4859. minimum: 0
  4860. discount_monthly_cents:
  4861. type: integer
  4862. description: 每月优惠金额(分,白名单可改)
  4863. minimum: 0
  4864. required:
  4865. - subscription_id
  4866. - row_version
  4867. required:
  4868. - data
  4869. responses:
  4870. "200":
  4871. description: 成功。统一信封 code/message/data
  4872. /subscription/delete_check@v1:
  4873. post:
  4874. summary: 订阅删除前阻塞检查
  4875. description: 第3册§5.6:两栏阻塞分列(账单明细⇒KLT-M227、升降配链原订阅⇒KLT-M230);账单只读口未接线⇒billing_state=unconfigured。
  4876. operationId: subscription_delete_check
  4877. tags:
  4878. - 订阅
  4879. x-require-auth: true
  4880. x-resource-type: bos.subscription
  4881. x-action: view
  4882. x-version: v1
  4883. x-permission-visibility: catalog
  4884. requestBody:
  4885. required: true
  4886. description: JSON 请求体,业务字段置于 data
  4887. content:
  4888. application/json:
  4889. schema:
  4890. type: object
  4891. description: 统一信封请求体,业务字段放在 data 内
  4892. properties:
  4893. data:
  4894. type: object
  4895. description: 业务参数
  4896. properties:
  4897. subscription_id:
  4898. type: string
  4899. description: 订阅 ID
  4900. required:
  4901. - subscription_id
  4902. required:
  4903. - data
  4904. responses:
  4905. "200":
  4906. description: 成功。统一信封 code/message/data
  4907. /subscription/delete@v1:
  4908. post:
  4909. summary: 删除订阅并回退额度
  4910. description: 第3册§5.6:删除前复算阻塞;终态⇒11103;同事务回退 customer.quota_cents,档位 first_referred_at 打点不回滚。
  4911. operationId: subscription_delete
  4912. tags:
  4913. - 订阅
  4914. x-require-auth: true
  4915. x-resource-type: bos.subscription
  4916. x-action: delete
  4917. x-version: v1
  4918. x-permission-visibility: catalog
  4919. requestBody:
  4920. required: true
  4921. description: JSON 请求体,业务字段置于 data
  4922. content:
  4923. application/json:
  4924. schema:
  4925. type: object
  4926. description: 统一信封请求体,业务字段放在 data 内
  4927. properties:
  4928. data:
  4929. type: object
  4930. description: 业务参数
  4931. properties:
  4932. subscription_id:
  4933. type: string
  4934. description: 订阅 ID
  4935. required:
  4936. - subscription_id
  4937. required:
  4938. - data
  4939. responses:
  4940. "200":
  4941. description: 成功。统一信封 code/message/data
  4942. /subscription/list_all@v1:
  4943. post:
  4944. summary: 全部订阅(跨客户)
  4945. description: 第3册§5.8:跨客户订阅列表,customer_id 可选;region_ids 经客户挂载区域展开;不按客户名称/合同编号检索。
  4946. operationId: subscription_list_all
  4947. tags:
  4948. - 订阅
  4949. x-require-auth: true
  4950. x-resource-type: bos.subscription
  4951. x-action: list
  4952. x-version: v1
  4953. x-permission-visibility: catalog
  4954. requestBody:
  4955. required: true
  4956. description: JSON 请求体,业务字段置于 data
  4957. content:
  4958. application/json:
  4959. schema:
  4960. type: object
  4961. description: 统一信封请求体,业务字段放在 data 内
  4962. properties:
  4963. data:
  4964. type: object
  4965. description: 列表筛选参数
  4966. properties:
  4967. page:
  4968. type: integer
  4969. description: 页码
  4970. minimum: 1
  4971. page_size:
  4972. type: integer
  4973. description: 每页条数
  4974. minimum: 1
  4975. maximum: 500
  4976. keyword:
  4977. type: string
  4978. description: 关键字筛选
  4979. customer_id:
  4980. type: string
  4981. description: 客户 ID 筛选(跨客户列表下可选)
  4982. contract_id:
  4983. type: string
  4984. description: 合同 ID 筛选
  4985. status:
  4986. type: string
  4987. description: 状态筛选
  4988. region_ids:
  4989. type: array
  4990. description: 区域 ID 集合(经客户挂载区域展开)
  4991. items:
  4992. type: string
  4993. description: 区域 ID
  4994. required:
  4995. - data
  4996. responses:
  4997. "200":
  4998. description: 成功。统一信封 code/message/data
  4999. /cost_item/save@v1:
  5000. post:
  5001. summary: 保存成本项定义
  5002. description: 仅 admin。增改成本项定义。拒收金额、客户、运营商、省份、cycle、is_system。
  5003. operationId: cost_item_save
  5004. tags:
  5005. - 成本与分成
  5006. x-require-auth: true
  5007. x-resource-type: bos.cost_item
  5008. x-action: manage
  5009. x-version: v1
  5010. x-permission-visibility: catalog
  5011. requestBody:
  5012. required: true
  5013. description: JSON 请求体,业务字段置于 data
  5014. content:
  5015. application/json:
  5016. schema:
  5017. type: object
  5018. description: 统一信封请求体,业务字段放在 data 内
  5019. properties:
  5020. data:
  5021. type: object
  5022. description: 业务参数
  5023. properties:
  5024. cost_item_id:
  5025. type: string
  5026. description: 成本项 ID(更新时必填)
  5027. category:
  5028. type: string
  5029. description: 类别:intl_resource/device_purchase/project_fee
  5030. enum:
  5031. - intl_resource
  5032. - device_purchase
  5033. - project_fee
  5034. item_name:
  5035. type: string
  5036. description: 成本项名称
  5037. billing_unit:
  5038. type: string
  5039. description: 计费单位:per_customer/per_account/per_copy
  5040. enum:
  5041. - per_customer
  5042. - per_account
  5043. - per_copy
  5044. is_amortized:
  5045. type: boolean
  5046. description: 是否摊销
  5047. amortization_months:
  5048. type: integer
  5049. description: 摊销月数(勾选摊销时可空=每月摊销不结束)
  5050. deduct_from_base:
  5051. type: boolean
  5052. description: 是否从基数扣除
  5053. remark:
  5054. type: string
  5055. description: 备注
  5056. row_version:
  5057. type: integer
  5058. description: 乐观锁版本(更新时)
  5059. required:
  5060. - category
  5061. - item_name
  5062. - billing_unit
  5063. - is_amortized
  5064. - deduct_from_base
  5065. required:
  5066. - data
  5067. responses:
  5068. "200":
  5069. description: 成功。统一信封 code/message/data
  5070. /cost_item/get_list@v1:
  5071. post:
  5072. summary: 成本项列表
  5073. description: 全局成本项目录;可选类别/名称关键字;无客户过滤。
  5074. operationId: cost_item_get_list
  5075. tags:
  5076. - 成本与分成
  5077. x-require-auth: true
  5078. x-resource-type: bos.cost_item
  5079. x-action: list
  5080. x-version: v1
  5081. x-permission-visibility: catalog
  5082. requestBody:
  5083. required: true
  5084. description: JSON 请求体,业务字段置于 data
  5085. content:
  5086. application/json:
  5087. schema:
  5088. type: object
  5089. description: 统一信封请求体,业务字段放在 data 内
  5090. properties:
  5091. data:
  5092. type: object
  5093. description: 列表筛选参数
  5094. properties:
  5095. page:
  5096. type: integer
  5097. description: 页码(0 基索引,默认 0)
  5098. minimum: 0
  5099. default: 0
  5100. page_size:
  5101. type: integer
  5102. description: 每页条数(默认 20,上限 200)
  5103. minimum: 1
  5104. maximum: 200
  5105. default: 20
  5106. keyword:
  5107. type: string
  5108. description: 关键字筛选(可选)
  5109. category:
  5110. type: string
  5111. description: 类别筛选
  5112. required:
  5113. - data
  5114. responses:
  5115. "200":
  5116. description: 成功。统一信封 code/message/data
  5117. /cost_amount/save@v1:
  5118. post:
  5119. summary: 保存成本金额
  5120. description: 按「省份×运营商×成本项」只写差异金额;留空项表示删除该差异。
  5121. operationId: cost_amount_save
  5122. tags:
  5123. - 成本与分成
  5124. x-require-auth: true
  5125. x-resource-type: bos.cost_amount
  5126. x-action: manage
  5127. x-version: v1
  5128. x-permission-visibility: catalog
  5129. requestBody:
  5130. required: true
  5131. description: JSON 请求体,业务字段置于 data
  5132. content:
  5133. application/json:
  5134. schema:
  5135. type: object
  5136. description: 统一信封请求体,业务字段放在 data 内
  5137. properties:
  5138. data:
  5139. type: object
  5140. description: 业务参数
  5141. properties:
  5142. province_node_id:
  5143. type: string
  5144. description: 省份节点 ID
  5145. operator_id:
  5146. type: string
  5147. description: 运营商 ID
  5148. items:
  5149. type: array
  5150. description: 变更项列表;留空金额表示删除该差异行
  5151. items:
  5152. type: object
  5153. properties:
  5154. cost_item_id:
  5155. type: string
  5156. description: 成本项 ID
  5157. amount_cents:
  5158. type: integer
  5159. description: 金额(分);空/省略表示删除
  5160. row_version:
  5161. type: integer
  5162. description: 乐观锁版本
  5163. required:
  5164. - cost_item_id
  5165. required:
  5166. - province_node_id
  5167. - operator_id
  5168. - items
  5169. required:
  5170. - data
  5171. responses:
  5172. "200":
  5173. description: 成功。统一信封 code/message/data
  5174. /cost_amount/get_list@v1:
  5175. post:
  5176. summary: 成本金额一览
  5177. description: 透视表;admin 全量,区域运营按可见省/运营商收窄。
  5178. operationId: cost_amount_get_list
  5179. tags:
  5180. - 成本与分成
  5181. x-require-auth: true
  5182. x-resource-type: bos.cost_amount
  5183. x-action: list
  5184. x-version: v1
  5185. x-permission-visibility: catalog
  5186. requestBody:
  5187. required: true
  5188. description: JSON 请求体,业务字段置于 data
  5189. content:
  5190. application/json:
  5191. schema:
  5192. type: object
  5193. description: 统一信封请求体,业务字段放在 data 内
  5194. properties:
  5195. data:
  5196. type: object
  5197. description: 列表筛选参数
  5198. properties:
  5199. province_node_id:
  5200. type: string
  5201. description: 省份筛选
  5202. operator_id:
  5203. type: string
  5204. description: 运营商筛选
  5205. page:
  5206. type: integer
  5207. description: 页码(0 基索引,默认 0)
  5208. minimum: 0
  5209. default: 0
  5210. page_size:
  5211. type: integer
  5212. description: 每页条数(默认 20,上限 200)
  5213. minimum: 1
  5214. maximum: 200
  5215. default: 20
  5216. keyword:
  5217. type: string
  5218. description: 关键字筛选(可选)
  5219. required:
  5220. - data
  5221. responses:
  5222. "200":
  5223. description: 成功。统一信封 code/message/data
  5224. /share_rule/save@v1:
  5225. post:
  5226. summary: 保存分成规则
  5227. description: holder_type 仅 operator/ops_team(无 partner)。share_value 填 0/负表示删除该行。
  5228. operationId: share_rule_save
  5229. tags:
  5230. - 成本与分成
  5231. x-require-auth: true
  5232. x-resource-type: bos.share_rule
  5233. x-action: manage
  5234. x-version: v1
  5235. x-permission-visibility: catalog
  5236. requestBody:
  5237. required: true
  5238. description: JSON 请求体,业务字段置于 data
  5239. content:
  5240. application/json:
  5241. schema:
  5242. type: object
  5243. description: 统一信封请求体,业务字段放在 data 内
  5244. properties:
  5245. data:
  5246. type: object
  5247. description: 业务参数
  5248. properties:
  5249. holder_type:
  5250. type: string
  5251. description: 持有方类型:operator/ops_team
  5252. enum:
  5253. - operator
  5254. - ops_team
  5255. holder_id:
  5256. type: string
  5257. description: 持有方 ID
  5258. rules:
  5259. type: array
  5260. description: 规则行列表
  5261. items:
  5262. type: object
  5263. properties:
  5264. rule_id:
  5265. type: string
  5266. description: 规则 ID(更新/删除时)
  5267. customer_id:
  5268. type: string
  5269. description: 客户 ID
  5270. rule_level:
  5271. type: string
  5272. description: 规则层级:contract_addon/region_regular
  5273. enum:
  5274. - contract_addon
  5275. - region_regular
  5276. share_mode:
  5277. type: string
  5278. description: 分成方式:ratio_total/per_account/fixed_amount
  5279. enum:
  5280. - ratio_total
  5281. - per_account
  5282. - fixed_amount
  5283. share_value:
  5284. type: number
  5285. description: 分成值:比例 (0,1];金额/每账号>0 分;0/负=删除该行
  5286. remark:
  5287. type: string
  5288. description: 备注
  5289. required:
  5290. - holder_type
  5291. - holder_id
  5292. - rules
  5293. required:
  5294. - data
  5295. responses:
  5296. "200":
  5297. description: 成功。统一信封 code/message/data
  5298. /share_rule/get_list@v1:
  5299. post:
  5300. summary: 分成规则列表
  5301. description: 按持有方等条件列出分成规则。
  5302. operationId: share_rule_get_list
  5303. tags:
  5304. - 成本与分成
  5305. x-require-auth: true
  5306. x-resource-type: bos.share_rule
  5307. x-action: list
  5308. x-version: v1
  5309. x-permission-visibility: catalog
  5310. requestBody:
  5311. required: true
  5312. description: JSON 请求体,业务字段置于 data
  5313. content:
  5314. application/json:
  5315. schema:
  5316. type: object
  5317. description: 统一信封请求体,业务字段放在 data 内
  5318. properties:
  5319. data:
  5320. type: object
  5321. description: 列表筛选参数
  5322. properties:
  5323. holder_type:
  5324. type: string
  5325. description: 持有方类型
  5326. holder_id:
  5327. type: string
  5328. description: 持有方 ID
  5329. page:
  5330. type: integer
  5331. description: 页码(0 基索引,默认 0)
  5332. minimum: 0
  5333. default: 0
  5334. page_size:
  5335. type: integer
  5336. description: 每页条数(默认 20,上限 200)
  5337. minimum: 1
  5338. maximum: 200
  5339. default: 20
  5340. keyword:
  5341. type: string
  5342. description: 关键字筛选(可选)
  5343. required:
  5344. - data
  5345. responses:
  5346. "200":
  5347. description: 成功。统一信封 code/message/data
  5348. /share_rule/get@v1:
  5349. post:
  5350. summary: 分成规则详情
  5351. description: 按持有方一次返回四卡摘要与规则表。
  5352. operationId: share_rule_get
  5353. tags:
  5354. - 成本与分成
  5355. x-require-auth: true
  5356. x-resource-type: bos.share_rule
  5357. x-action: view
  5358. x-version: v1
  5359. x-permission-visibility: catalog
  5360. requestBody:
  5361. required: true
  5362. description: JSON 请求体,业务字段置于 data
  5363. content:
  5364. application/json:
  5365. schema:
  5366. type: object
  5367. description: 统一信封请求体,业务字段放在 data 内
  5368. properties:
  5369. data:
  5370. type: object
  5371. description: 业务参数
  5372. properties:
  5373. holder_type:
  5374. type: string
  5375. description: 持有方类型:operator/ops_team
  5376. holder_id:
  5377. type: string
  5378. description: 持有方 ID
  5379. required:
  5380. - holder_type
  5381. - holder_id
  5382. required:
  5383. - data
  5384. responses:
  5385. "200":
  5386. description: 成功。统一信封 code/message/data
  5387. /share_rule/delete@v1:
  5388. post:
  5389. summary: 删除分成规则
  5390. description: 按 rule_id 删除单条分成规则(亦可在 save 内以 0/负值删除)。
  5391. operationId: share_rule_delete
  5392. tags:
  5393. - 成本与分成
  5394. x-require-auth: true
  5395. x-resource-type: bos.share_rule
  5396. x-action: delete
  5397. x-version: v1
  5398. x-permission-visibility: catalog
  5399. requestBody:
  5400. required: true
  5401. description: JSON 请求体,业务字段置于 data
  5402. content:
  5403. application/json:
  5404. schema:
  5405. type: object
  5406. description: 统一信封请求体,业务字段放在 data 内
  5407. properties:
  5408. data:
  5409. type: object
  5410. description: 业务参数
  5411. properties:
  5412. rule_id:
  5413. type: string
  5414. description: 规则 ID
  5415. required:
  5416. - rule_id
  5417. required:
  5418. - data
  5419. responses:
  5420. "200":
  5421. description: 成功。统一信封 code/message/data
  5422. /opsview/home@v1:
  5423. get:
  5424. summary: 运维只读首页
  5425. description: 运维侧只读首页(U-60),返回工单/逾期等概览数据。
  5426. operationId: opsview_home
  5427. tags:
  5428. - 运维视图
  5429. x-require-auth: true
  5430. x-resource-type: bos.opsview
  5431. x-action: view
  5432. x-version: v1
  5433. x-permission-visibility: catalog
  5434. responses:
  5435. "200":
  5436. description: 成功。统一信封 code/message/data
  5437. /jobs/get_list@v1:
  5438. get:
  5439. summary: 定时作业清单
  5440. description: 返回第 10 册 13 行清单(注册位 11 +标注行 2)及运行态:启用态、可操作性位、最近执行、五格计数、累计轮次、KPI 五卡与待补跑轮次。运行态取数失败时仍返回 13 行,runtime_available=false。
  5441. operationId: jobs_get_list
  5442. tags:
  5443. - 定时作业
  5444. x-require-auth: true
  5445. x-resource-type: bos.jobs
  5446. x-action: list
  5447. x-version: v1
  5448. x-permission-visibility: catalog
  5449. responses:
  5450. "200":
  5451. description: 成功。统一信封 code/message/data
  5452. /jobs/toggle@v1:
  5453. post:
  5454. summary: 启停定时作业
  5455. description: 仅 admin。按作业 key 启停并写 bos_audit_log(bos.job.toggle);重复点击幂等不写第二条。标注行/无页面开关的作业返回 KLT-R20902(detail.reason_code=no_switch);CAS 不匹配返回 KLT-S407;审计失败返回 KLT-S405(启停已生效)。
  5456. operationId: jobs_toggle
  5457. tags:
  5458. - 定时作业
  5459. x-require-auth: true
  5460. x-resource-type: bos.jobs
  5461. x-action: manage
  5462. x-version: v1
  5463. x-permission-visibility: catalog
  5464. requestBody:
  5465. required: true
  5466. description: JSON 请求体,业务字段置于 data
  5467. content:
  5468. application/json:
  5469. schema:
  5470. type: object
  5471. description: 统一信封请求体,业务字段放在 data 内
  5472. properties:
  5473. data:
  5474. type: object
  5475. description: 业务参数
  5476. properties:
  5477. key:
  5478. type: string
  5479. description: 作业键(兼容旧字段名;与 job_key 二选一)
  5480. job_key:
  5481. type: string
  5482. description: 作业键(契约字段名)
  5483. enabled:
  5484. type: boolean
  5485. description: 目标状态
  5486. expect_enabled:
  5487. type: boolean
  5488. description: CAS 校验值=页面读到的当前状态;缺省不做并发校验
  5489. request_id:
  5490. type: string
  5491. description: 幂等请求号(客户端生成)
  5492. required:
  5493. - enabled
  5494. required:
  5495. - data
  5496. responses:
  5497. "200":
  5498. description: 成功。统一信封 code/message/data
  5499. /jobs/runs@v1:
  5500. post:
  5501. summary: 作业执行记录
  5502. description: 查询执行记录,支持任务、关键字(执行编号/任务/结果说明,不检索对象级明细)、触发方式、执行结果与日期区间筛选;分页 page 0 基、page_size 默认 50。标注行返回空流水并标记 annotation=true。
  5503. operationId: jobs_runs
  5504. tags:
  5505. - 定时作业
  5506. x-require-auth: true
  5507. x-resource-type: bos.jobs
  5508. x-action: view
  5509. x-version: v1
  5510. x-permission-visibility: catalog
  5511. requestBody:
  5512. required: true
  5513. description: JSON 请求体,业务字段置于 data
  5514. content:
  5515. application/json:
  5516. schema:
  5517. type: object
  5518. description: 统一信封请求体,业务字段放在 data 内
  5519. properties:
  5520. data:
  5521. type: object
  5522. description: 业务参数
  5523. properties:
  5524. key:
  5525. type: string
  5526. description: 作业键(可省略=全部任务)
  5527. job_key:
  5528. type: string
  5529. description: 作业键(契约字段名,可省略)
  5530. keyword:
  5531. type: string
  5532. description: 关键字(执行编号/任务/结果说明;不检索对象级明细)
  5533. trigger:
  5534. type: string
  5535. description: 触发方式
  5536. enum:
  5537. - 定时
  5538. - 事件
  5539. - 人工
  5540. result:
  5541. type: string
  5542. description: 执行结果
  5543. enum:
  5544. - 成功
  5545. - 部分成功
  5546. - 失败
  5547. - 异常
  5548. date_from:
  5549. type: string
  5550. description: 开始日期(YYYY-MM-DD,Asia/Shanghai 日界)
  5551. pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2}$'
  5552. date_to:
  5553. type: string
  5554. description: 结束日期(YYYY-MM-DD,含当日)
  5555. pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2}$'
  5556. page:
  5557. type: integer
  5558. description: 页码(0 基,默认 0)
  5559. minimum: 0
  5560. default: 0
  5561. page_size:
  5562. type: integer
  5563. description: 每页条数(默认 50,上限 200)
  5564. minimum: 1
  5565. maximum: 200
  5566. default: 50
  5567. required:
  5568. - data
  5569. responses:
  5570. "200":
  5571. description: 成功。统一信封 code/message/data
  5572. /jobs/run_once@v1:
  5573. post:
  5574. summary: 补跑作业一次
  5575. 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,返回本轮五格计数与对象级明细。
  5576. operationId: jobs_run_once
  5577. tags:
  5578. - 定时作业
  5579. x-require-auth: true
  5580. x-resource-type: bos.jobs
  5581. x-action: manage
  5582. x-version: v1
  5583. x-permission-visibility: catalog
  5584. requestBody:
  5585. required: true
  5586. description: JSON 请求体,业务字段置于 data
  5587. content:
  5588. application/json:
  5589. schema:
  5590. type: object
  5591. description: 统一信封请求体,业务字段放在 data 内
  5592. properties:
  5593. data:
  5594. type: object
  5595. description: 业务参数
  5596. properties:
  5597. key:
  5598. type: string
  5599. description: 作业键
  5600. enum:
  5601. - SUB-EFF
  5602. - SNAPSHOT-FREEZE
  5603. - DELEG-SYNC
  5604. - STOP-GEN
  5605. - OVERDUE
  5606. - AUTO-CLOSE
  5607. - RECON
  5608. - ORPHAN-CLEAN
  5609. - REGION-WARM
  5610. - ONEDIR-CHECK
  5611. - OSS-ORPHAN-CLEAN
  5612. required:
  5613. - key
  5614. required:
  5615. - data
  5616. responses:
  5617. "200":
  5618. description: 成功。统一信封 code/message/data
  5619. components:
  5620. schemas:
  5621. ApiEnvelope:
  5622. type: object
  5623. description: 统一响应信封
  5624. properties:
  5625. code:
  5626. type: integer
  5627. description: 业务/协议码,0 表示成功
  5628. message:
  5629. type: string
  5630. description: 提示信息
  5631. error_code:
  5632. type: string
  5633. description: 稳定错误码(失败时)
  5634. data:
  5635. description: 业务数据载荷
  5636. required:
  5637. - code
  5638. - message
  5639. PageQuery:
  5640. type: object
  5641. description: 分页查询(0 基)
  5642. properties:
  5643. page:
  5644. type: integer
  5645. description: 页码(0 基索引,默认 0)
  5646. minimum: 0
  5647. default: 0
  5648. page_size:
  5649. type: integer
  5650. description: 每页条数(默认 20,上限 200)
  5651. minimum: 1
  5652. maximum: 200
  5653. default: 20
  5654. keyword:
  5655. type: string
  5656. description: 关键字筛选(可选)