openapi.yaml 228 KB

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