医梦AI中台开放平台接口-v1.2.openapi.yaml 103 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896
  1. openapi: 3.0.3
  2. info:
  3. title: EMOON AI OpenPlatform External API
  4. version: 1.2.3
  5. description: 医梦 AI 中台对外接口契约 v1.2.3,正式联调基准版。P0/P1 为厂商联调主基线;P2 为受控规划接口。FHIR 映射从主 YAML 移出,避免误解为当前交付承诺。统一入口客户端调用 Agent 时可不传 agentId,由后端 AgentRouter 结合设备、场景、感知上下文和服务端推导的动线阶段决定最终智能体。
  6. servers:
  7. - url: https://api.{hospital}.emoon.local/api/v1
  8. variables:
  9. hospital:
  10. default: demo
  11. - url: https://sandbox-api.emoon-ai.com/api/v1
  12. security:
  13. - BearerAuth: []
  14. - HmacAuth: []
  15. tags:
  16. - name: Auth
  17. - name: Platform
  18. - name: Agent
  19. - name: Conversation
  20. - name: File
  21. - name: Device
  22. - name: Card
  23. - name: MCP Tool
  24. - name: Webhook
  25. - name: Event
  26. - name: Usage
  27. - name: License
  28. - name: Partner
  29. - name: Contract
  30. - name: Credit
  31. - name: Billing
  32. - name: Operation
  33. - name: Audit
  34. paths:
  35. /auth/token:
  36. post:
  37. summary: 获取短期访问 Token
  38. tags:
  39. - Auth
  40. x-emoon-priority: P0
  41. description: client_credentials 模式。
  42. requestBody:
  43. required: true
  44. content:
  45. application/json:
  46. schema:
  47. $ref: '#/components/schemas/TokenRequest'
  48. responses:
  49. '200':
  50. description: OK
  51. content:
  52. application/json:
  53. schema:
  54. $ref: '#/components/schemas/ApiResponseToken'
  55. '400':
  56. description: Error
  57. content:
  58. application/json:
  59. schema:
  60. $ref: '#/components/schemas/ErrorResponse'
  61. '401':
  62. description: Error
  63. content:
  64. application/json:
  65. schema:
  66. $ref: '#/components/schemas/ErrorResponse'
  67. '403':
  68. description: Error
  69. content:
  70. application/json:
  71. schema:
  72. $ref: '#/components/schemas/ErrorResponse'
  73. '429':
  74. description: Error
  75. content:
  76. application/json:
  77. schema:
  78. $ref: '#/components/schemas/ErrorResponse'
  79. '500':
  80. description: Error
  81. content:
  82. application/json:
  83. schema:
  84. $ref: '#/components/schemas/ErrorResponse'
  85. /health:
  86. get:
  87. summary: 平台健康检查
  88. tags:
  89. - Platform
  90. x-emoon-priority: P0
  91. responses:
  92. '200':
  93. description: OK
  94. content:
  95. application/json:
  96. schema:
  97. $ref: '#/components/schemas/ApiResponseHealth'
  98. '400':
  99. description: Error
  100. content:
  101. application/json:
  102. schema:
  103. $ref: '#/components/schemas/ErrorResponse'
  104. '401':
  105. description: Error
  106. content:
  107. application/json:
  108. schema:
  109. $ref: '#/components/schemas/ErrorResponse'
  110. '403':
  111. description: Error
  112. content:
  113. application/json:
  114. schema:
  115. $ref: '#/components/schemas/ErrorResponse'
  116. '429':
  117. description: Error
  118. content:
  119. application/json:
  120. schema:
  121. $ref: '#/components/schemas/ErrorResponse'
  122. '500':
  123. description: Error
  124. content:
  125. application/json:
  126. schema:
  127. $ref: '#/components/schemas/ErrorResponse'
  128. /capabilities:
  129. get:
  130. summary: 查询项目已开通能力
  131. tags:
  132. - Platform
  133. x-emoon-priority: P0
  134. parameters: &id005
  135. - &id001
  136. $ref: '#/components/parameters/ProjectId'
  137. - &id002
  138. $ref: '#/components/parameters/PartnerId'
  139. - &id003
  140. $ref: '#/components/parameters/TraceId'
  141. responses:
  142. '200':
  143. description: OK
  144. content:
  145. application/json:
  146. schema:
  147. $ref: '#/components/schemas/ApiResponseCapabilities'
  148. '400':
  149. description: Error
  150. content:
  151. application/json:
  152. schema:
  153. $ref: '#/components/schemas/ErrorResponse'
  154. '401':
  155. description: Error
  156. content:
  157. application/json:
  158. schema:
  159. $ref: '#/components/schemas/ErrorResponse'
  160. '403':
  161. description: Error
  162. content:
  163. application/json:
  164. schema:
  165. $ref: '#/components/schemas/ErrorResponse'
  166. '429':
  167. description: Error
  168. content:
  169. application/json:
  170. schema:
  171. $ref: '#/components/schemas/ErrorResponse'
  172. '500':
  173. description: Error
  174. content:
  175. application/json:
  176. schema:
  177. $ref: '#/components/schemas/ErrorResponse'
  178. /agent/chat:
  179. post:
  180. summary: 智能体同步对话
  181. tags:
  182. - Agent
  183. x-emoon-priority: P0
  184. description: 首轮 conversationId 可为空,平台自动创建会话并返回。支持 Bearer Token;HMAC 模式需携带 X-Emoon-Timestamp、X-Emoon-Nonce、X-Emoon-Signature。
  185. parameters: &id004
  186. - *id001
  187. - *id002
  188. - *id003
  189. - &id006
  190. $ref: '#/components/parameters/IdempotencyKey'
  191. requestBody:
  192. required: true
  193. content:
  194. application/json:
  195. schema:
  196. $ref: '#/components/schemas/AgentChatRequest'
  197. responses:
  198. '200':
  199. description: OK
  200. content:
  201. application/json:
  202. schema:
  203. $ref: '#/components/schemas/ApiResponseAgentChat'
  204. '400':
  205. description: Error
  206. content:
  207. application/json:
  208. schema:
  209. $ref: '#/components/schemas/ErrorResponse'
  210. '401':
  211. description: Error
  212. content:
  213. application/json:
  214. schema:
  215. $ref: '#/components/schemas/ErrorResponse'
  216. '403':
  217. description: Error
  218. content:
  219. application/json:
  220. schema:
  221. $ref: '#/components/schemas/ErrorResponse'
  222. '429':
  223. description: Error
  224. content:
  225. application/json:
  226. schema:
  227. $ref: '#/components/schemas/ErrorResponse'
  228. '500':
  229. description: Error
  230. content:
  231. application/json:
  232. schema:
  233. $ref: '#/components/schemas/ErrorResponse'
  234. /agent/chat/stream:
  235. post:
  236. summary: 智能体流式对话 SSE
  237. tags:
  238. - Agent
  239. x-emoon-priority: P0
  240. description: POST + text/event-stream。断线后使用 conversationId 查询最终消息。
  241. parameters: *id004
  242. requestBody:
  243. required: true
  244. content:
  245. application/json:
  246. schema:
  247. $ref: '#/components/schemas/AgentChatRequest'
  248. responses:
  249. '200':
  250. description: SSE stream
  251. content:
  252. text/event-stream:
  253. schema:
  254. type: string
  255. '400':
  256. description: Error
  257. content:
  258. application/json:
  259. schema:
  260. $ref: '#/components/schemas/ErrorResponse'
  261. '401':
  262. description: Error
  263. content:
  264. application/json:
  265. schema:
  266. $ref: '#/components/schemas/ErrorResponse'
  267. '403':
  268. description: Error
  269. content:
  270. application/json:
  271. schema:
  272. $ref: '#/components/schemas/ErrorResponse'
  273. '429':
  274. description: Error
  275. content:
  276. application/json:
  277. schema:
  278. $ref: '#/components/schemas/ErrorResponse'
  279. '500':
  280. description: Error
  281. content:
  282. application/json:
  283. schema:
  284. $ref: '#/components/schemas/ErrorResponse'
  285. /conversations:
  286. post:
  287. summary: 创建会话
  288. tags:
  289. - Conversation
  290. x-emoon-priority: P0
  291. parameters: *id005
  292. requestBody:
  293. required: true
  294. content:
  295. application/json:
  296. schema:
  297. $ref: '#/components/schemas/ConversationCreateRequest'
  298. responses:
  299. '200':
  300. description: OK
  301. content:
  302. application/json:
  303. schema:
  304. $ref: '#/components/schemas/ApiResponseConversation'
  305. '400':
  306. description: Error
  307. content:
  308. application/json:
  309. schema:
  310. $ref: '#/components/schemas/ErrorResponse'
  311. '401':
  312. description: Error
  313. content:
  314. application/json:
  315. schema:
  316. $ref: '#/components/schemas/ErrorResponse'
  317. '403':
  318. description: Error
  319. content:
  320. application/json:
  321. schema:
  322. $ref: '#/components/schemas/ErrorResponse'
  323. '429':
  324. description: Error
  325. content:
  326. application/json:
  327. schema:
  328. $ref: '#/components/schemas/ErrorResponse'
  329. '500':
  330. description: Error
  331. content:
  332. application/json:
  333. schema:
  334. $ref: '#/components/schemas/ErrorResponse'
  335. get:
  336. summary: 查询会话列表
  337. tags:
  338. - Conversation
  339. x-emoon-priority: P1
  340. parameters:
  341. - *id001
  342. - *id002
  343. - *id003
  344. - $ref: '#/components/parameters/Page'
  345. - $ref: '#/components/parameters/PageSize'
  346. responses:
  347. '200':
  348. description: OK
  349. content:
  350. application/json:
  351. schema:
  352. $ref: '#/components/schemas/ApiResponseConversationList'
  353. '400':
  354. description: Error
  355. content:
  356. application/json:
  357. schema:
  358. $ref: '#/components/schemas/ErrorResponse'
  359. '401':
  360. description: Error
  361. content:
  362. application/json:
  363. schema:
  364. $ref: '#/components/schemas/ErrorResponse'
  365. '403':
  366. description: Error
  367. content:
  368. application/json:
  369. schema:
  370. $ref: '#/components/schemas/ErrorResponse'
  371. '429':
  372. description: Error
  373. content:
  374. application/json:
  375. schema:
  376. $ref: '#/components/schemas/ErrorResponse'
  377. '500':
  378. description: Error
  379. content:
  380. application/json:
  381. schema:
  382. $ref: '#/components/schemas/ErrorResponse'
  383. /conversations/{conversationId}:
  384. get:
  385. summary: 查询会话详情
  386. tags:
  387. - Conversation
  388. x-emoon-priority: P0
  389. parameters:
  390. - $ref: '#/components/parameters/ConversationIdPath'
  391. - *id001
  392. - *id002
  393. - *id003
  394. responses:
  395. '200':
  396. description: OK
  397. content:
  398. application/json:
  399. schema:
  400. $ref: '#/components/schemas/ApiResponseConversation'
  401. '400':
  402. description: Error
  403. content:
  404. application/json:
  405. schema:
  406. $ref: '#/components/schemas/ErrorResponse'
  407. '401':
  408. description: Error
  409. content:
  410. application/json:
  411. schema:
  412. $ref: '#/components/schemas/ErrorResponse'
  413. '403':
  414. description: Error
  415. content:
  416. application/json:
  417. schema:
  418. $ref: '#/components/schemas/ErrorResponse'
  419. '429':
  420. description: Error
  421. content:
  422. application/json:
  423. schema:
  424. $ref: '#/components/schemas/ErrorResponse'
  425. '500':
  426. description: Error
  427. content:
  428. application/json:
  429. schema:
  430. $ref: '#/components/schemas/ErrorResponse'
  431. /conversations/{conversationId}/messages:
  432. get:
  433. summary: 查询会话消息
  434. tags:
  435. - Conversation
  436. x-emoon-priority: P0
  437. parameters:
  438. - $ref: '#/components/parameters/ConversationIdPath'
  439. - *id001
  440. - *id002
  441. - *id003
  442. - $ref: '#/components/parameters/Page'
  443. - $ref: '#/components/parameters/PageSize'
  444. responses:
  445. '200':
  446. description: OK
  447. content:
  448. application/json:
  449. schema:
  450. $ref: '#/components/schemas/ApiResponseMessageList'
  451. '400':
  452. description: Error
  453. content:
  454. application/json:
  455. schema:
  456. $ref: '#/components/schemas/ErrorResponse'
  457. '401':
  458. description: Error
  459. content:
  460. application/json:
  461. schema:
  462. $ref: '#/components/schemas/ErrorResponse'
  463. '403':
  464. description: Error
  465. content:
  466. application/json:
  467. schema:
  468. $ref: '#/components/schemas/ErrorResponse'
  469. '429':
  470. description: Error
  471. content:
  472. application/json:
  473. schema:
  474. $ref: '#/components/schemas/ErrorResponse'
  475. '500':
  476. description: Error
  477. content:
  478. application/json:
  479. schema:
  480. $ref: '#/components/schemas/ErrorResponse'
  481. /files/upload:
  482. post:
  483. summary: 上传图片/音频/文档
  484. tags:
  485. - File
  486. x-emoon-priority: P0
  487. description: multipart/form-data 上传,返回 fileId;后续 Agent 调用只传 fileId。
  488. parameters: *id004
  489. responses:
  490. '200':
  491. description: OK
  492. content:
  493. application/json:
  494. schema:
  495. $ref: '#/components/schemas/ApiResponseFileUpload'
  496. '400':
  497. description: Error
  498. content:
  499. application/json:
  500. schema:
  501. $ref: '#/components/schemas/ErrorResponse'
  502. '401':
  503. description: Error
  504. content:
  505. application/json:
  506. schema:
  507. $ref: '#/components/schemas/ErrorResponse'
  508. '403':
  509. description: Error
  510. content:
  511. application/json:
  512. schema:
  513. $ref: '#/components/schemas/ErrorResponse'
  514. '429':
  515. description: Error
  516. content:
  517. application/json:
  518. schema:
  519. $ref: '#/components/schemas/ErrorResponse'
  520. '500':
  521. description: Error
  522. content:
  523. application/json:
  524. schema:
  525. $ref: '#/components/schemas/ErrorResponse'
  526. requestBody:
  527. required: true
  528. content:
  529. multipart/form-data:
  530. schema:
  531. $ref: '#/components/schemas/FileUploadRequest'
  532. /files/{fileId}:
  533. get:
  534. summary: 查询文件元数据
  535. tags:
  536. - File
  537. x-emoon-priority: P0
  538. parameters:
  539. - $ref: '#/components/parameters/FileIdPath'
  540. - *id001
  541. - *id002
  542. - *id003
  543. responses:
  544. '200':
  545. description: OK
  546. content:
  547. application/json:
  548. schema:
  549. $ref: '#/components/schemas/ApiResponseFileMeta'
  550. '400':
  551. description: Error
  552. content:
  553. application/json:
  554. schema:
  555. $ref: '#/components/schemas/ErrorResponse'
  556. '401':
  557. description: Error
  558. content:
  559. application/json:
  560. schema:
  561. $ref: '#/components/schemas/ErrorResponse'
  562. '403':
  563. description: Error
  564. content:
  565. application/json:
  566. schema:
  567. $ref: '#/components/schemas/ErrorResponse'
  568. '429':
  569. description: Error
  570. content:
  571. application/json:
  572. schema:
  573. $ref: '#/components/schemas/ErrorResponse'
  574. '500':
  575. description: Error
  576. content:
  577. application/json:
  578. schema:
  579. $ref: '#/components/schemas/ErrorResponse'
  580. delete:
  581. summary: 删除或作废文件
  582. tags:
  583. - File
  584. x-emoon-priority: P1
  585. description: 删除或作废授权范围内未被锁定的文件。DELETE 本身应保持幂等;正式厂商联调要求传 X-Emoon-Idempotency-Key。同一文件重复删除返回首次处理结果或当前已删除状态。
  586. parameters:
  587. - $ref: '#/components/parameters/FileIdPath'
  588. - *id001
  589. - *id002
  590. - *id003
  591. - $ref: '#/components/parameters/IdempotencyKey'
  592. responses:
  593. '200':
  594. description: OK
  595. content:
  596. application/json:
  597. schema:
  598. $ref: '#/components/schemas/ApiResponse'
  599. '400':
  600. description: Error
  601. content:
  602. application/json:
  603. schema:
  604. $ref: '#/components/schemas/ErrorResponse'
  605. '401':
  606. description: Error
  607. content:
  608. application/json:
  609. schema:
  610. $ref: '#/components/schemas/ErrorResponse'
  611. '403':
  612. description: Error
  613. content:
  614. application/json:
  615. schema:
  616. $ref: '#/components/schemas/ErrorResponse'
  617. '429':
  618. description: Error
  619. content:
  620. application/json:
  621. schema:
  622. $ref: '#/components/schemas/ErrorResponse'
  623. '500':
  624. description: Error
  625. content:
  626. application/json:
  627. schema:
  628. $ref: '#/components/schemas/ErrorResponse'
  629. /devices/register:
  630. post:
  631. summary: 设备注册或激活
  632. tags:
  633. - Device
  634. x-emoon-priority: P0
  635. parameters: *id005
  636. requestBody:
  637. required: true
  638. content:
  639. application/json:
  640. schema:
  641. $ref: '#/components/schemas/DeviceRegisterRequest'
  642. responses:
  643. '200':
  644. description: OK
  645. content:
  646. application/json:
  647. schema:
  648. $ref: '#/components/schemas/ApiResponseDeviceRegister'
  649. '400':
  650. description: Error
  651. content:
  652. application/json:
  653. schema:
  654. $ref: '#/components/schemas/ErrorResponse'
  655. '401':
  656. description: Error
  657. content:
  658. application/json:
  659. schema:
  660. $ref: '#/components/schemas/ErrorResponse'
  661. '403':
  662. description: Error
  663. content:
  664. application/json:
  665. schema:
  666. $ref: '#/components/schemas/ErrorResponse'
  667. '429':
  668. description: Error
  669. content:
  670. application/json:
  671. schema:
  672. $ref: '#/components/schemas/ErrorResponse'
  673. '500':
  674. description: Error
  675. content:
  676. application/json:
  677. schema:
  678. $ref: '#/components/schemas/ErrorResponse'
  679. /devices/{deviceId}/heartbeat:
  680. post:
  681. summary: 设备心跳
  682. tags:
  683. - Device
  684. x-emoon-priority: P0
  685. parameters:
  686. - $ref: '#/components/parameters/DeviceIdPath'
  687. - *id001
  688. - *id002
  689. - *id003
  690. requestBody:
  691. required: true
  692. content:
  693. application/json:
  694. schema:
  695. $ref: '#/components/schemas/DeviceHeartbeatRequest'
  696. responses:
  697. '200':
  698. description: OK
  699. content:
  700. application/json:
  701. schema:
  702. $ref: '#/components/schemas/ApiResponseDeviceHeartbeat'
  703. '400':
  704. description: Error
  705. content:
  706. application/json:
  707. schema:
  708. $ref: '#/components/schemas/ErrorResponse'
  709. '401':
  710. description: Error
  711. content:
  712. application/json:
  713. schema:
  714. $ref: '#/components/schemas/ErrorResponse'
  715. '403':
  716. description: Error
  717. content:
  718. application/json:
  719. schema:
  720. $ref: '#/components/schemas/ErrorResponse'
  721. '429':
  722. description: Error
  723. content:
  724. application/json:
  725. schema:
  726. $ref: '#/components/schemas/ErrorResponse'
  727. '500':
  728. description: Error
  729. content:
  730. application/json:
  731. schema:
  732. $ref: '#/components/schemas/ErrorResponse'
  733. /devices/{deviceId}/scene:
  734. get:
  735. summary: 获取设备当前场景配置
  736. tags:
  737. - Device
  738. x-emoon-priority: P0
  739. parameters:
  740. - $ref: '#/components/parameters/DeviceIdPath'
  741. - *id001
  742. - *id002
  743. - *id003
  744. responses:
  745. '200':
  746. description: OK
  747. content:
  748. application/json:
  749. schema:
  750. $ref: '#/components/schemas/ApiResponseDeviceScene'
  751. '400':
  752. description: Error
  753. content:
  754. application/json:
  755. schema:
  756. $ref: '#/components/schemas/ErrorResponse'
  757. '401':
  758. description: Error
  759. content:
  760. application/json:
  761. schema:
  762. $ref: '#/components/schemas/ErrorResponse'
  763. '403':
  764. description: Error
  765. content:
  766. application/json:
  767. schema:
  768. $ref: '#/components/schemas/ErrorResponse'
  769. '429':
  770. description: Error
  771. content:
  772. application/json:
  773. schema:
  774. $ref: '#/components/schemas/ErrorResponse'
  775. '500':
  776. description: Error
  777. content:
  778. application/json:
  779. schema:
  780. $ref: '#/components/schemas/ErrorResponse'
  781. patch:
  782. summary: 更新设备场景绑定
  783. tags:
  784. - Device
  785. x-emoon-priority: P1
  786. parameters:
  787. - $ref: '#/components/parameters/DeviceIdPath'
  788. - *id001
  789. - *id002
  790. - *id003
  791. requestBody:
  792. required: true
  793. content:
  794. application/json:
  795. schema:
  796. $ref: '#/components/schemas/DeviceSceneUpdateRequest'
  797. responses:
  798. '200':
  799. description: OK
  800. content:
  801. application/json:
  802. schema:
  803. $ref: '#/components/schemas/ApiResponseDeviceScene'
  804. '400':
  805. description: Error
  806. content:
  807. application/json:
  808. schema:
  809. $ref: '#/components/schemas/ErrorResponse'
  810. '401':
  811. description: Error
  812. content:
  813. application/json:
  814. schema:
  815. $ref: '#/components/schemas/ErrorResponse'
  816. '403':
  817. description: Error
  818. content:
  819. application/json:
  820. schema:
  821. $ref: '#/components/schemas/ErrorResponse'
  822. '429':
  823. description: Error
  824. content:
  825. application/json:
  826. schema:
  827. $ref: '#/components/schemas/ErrorResponse'
  828. '500':
  829. description: Error
  830. content:
  831. application/json:
  832. schema:
  833. $ref: '#/components/schemas/ErrorResponse'
  834. /devices/{deviceId}/events:
  835. post:
  836. summary: 上报设备事件
  837. tags:
  838. - Device
  839. x-emoon-priority: P0
  840. description: 异步事件,正常返回 202 Accepted。
  841. parameters:
  842. - $ref: '#/components/parameters/DeviceIdPath'
  843. - *id001
  844. - *id002
  845. - *id003
  846. - *id006
  847. requestBody:
  848. required: true
  849. content:
  850. application/json:
  851. schema:
  852. $ref: '#/components/schemas/DeviceEventRequest'
  853. responses:
  854. '202':
  855. description: OK
  856. content:
  857. application/json:
  858. schema:
  859. $ref: '#/components/schemas/ApiResponseAccepted'
  860. '400':
  861. description: Error
  862. content:
  863. application/json:
  864. schema:
  865. $ref: '#/components/schemas/ErrorResponse'
  866. '401':
  867. description: Error
  868. content:
  869. application/json:
  870. schema:
  871. $ref: '#/components/schemas/ErrorResponse'
  872. '403':
  873. description: Error
  874. content:
  875. application/json:
  876. schema:
  877. $ref: '#/components/schemas/ErrorResponse'
  878. '429':
  879. description: Error
  880. content:
  881. application/json:
  882. schema:
  883. $ref: '#/components/schemas/ErrorResponse'
  884. '500':
  885. description: Error
  886. content:
  887. application/json:
  888. schema:
  889. $ref: '#/components/schemas/ErrorResponse'
  890. get:
  891. summary: 查询设备事件
  892. tags:
  893. - Device
  894. x-emoon-priority: P1
  895. parameters:
  896. - $ref: '#/components/parameters/DeviceIdPath'
  897. - *id001
  898. - *id002
  899. - *id003
  900. - $ref: '#/components/parameters/Page'
  901. - $ref: '#/components/parameters/PageSize'
  902. responses:
  903. '200':
  904. description: OK
  905. content:
  906. application/json:
  907. schema:
  908. $ref: '#/components/schemas/ApiResponseDeviceEventList'
  909. '400':
  910. description: Error
  911. content:
  912. application/json:
  913. schema:
  914. $ref: '#/components/schemas/ErrorResponse'
  915. '401':
  916. description: Error
  917. content:
  918. application/json:
  919. schema:
  920. $ref: '#/components/schemas/ErrorResponse'
  921. '403':
  922. description: Error
  923. content:
  924. application/json:
  925. schema:
  926. $ref: '#/components/schemas/ErrorResponse'
  927. '429':
  928. description: Error
  929. content:
  930. application/json:
  931. schema:
  932. $ref: '#/components/schemas/ErrorResponse'
  933. '500':
  934. description: Error
  935. content:
  936. application/json:
  937. schema:
  938. $ref: '#/components/schemas/ErrorResponse'
  939. /devices/{deviceId}/commands/poll:
  940. get:
  941. summary: 设备轮询待执行命令
  942. tags:
  943. - Device
  944. x-emoon-priority: P0
  945. parameters:
  946. - $ref: '#/components/parameters/DeviceIdPath'
  947. - *id001
  948. - *id002
  949. - *id003
  950. responses:
  951. '200':
  952. description: OK
  953. content:
  954. application/json:
  955. schema:
  956. $ref: '#/components/schemas/ApiResponseDeviceCommands'
  957. '400':
  958. description: Error
  959. content:
  960. application/json:
  961. schema:
  962. $ref: '#/components/schemas/ErrorResponse'
  963. '401':
  964. description: Error
  965. content:
  966. application/json:
  967. schema:
  968. $ref: '#/components/schemas/ErrorResponse'
  969. '403':
  970. description: Error
  971. content:
  972. application/json:
  973. schema:
  974. $ref: '#/components/schemas/ErrorResponse'
  975. '429':
  976. description: Error
  977. content:
  978. application/json:
  979. schema:
  980. $ref: '#/components/schemas/ErrorResponse'
  981. '500':
  982. description: Error
  983. content:
  984. application/json:
  985. schema:
  986. $ref: '#/components/schemas/ErrorResponse'
  987. /devices/{deviceId}/commands/{commandId}/ack:
  988. post:
  989. summary: 设备命令执行回执
  990. tags:
  991. - Device
  992. x-emoon-priority: P0
  993. parameters:
  994. - $ref: '#/components/parameters/DeviceIdPath'
  995. - $ref: '#/components/parameters/CommandIdPath'
  996. - *id001
  997. - *id002
  998. - *id003
  999. - *id006
  1000. requestBody:
  1001. required: true
  1002. content:
  1003. application/json:
  1004. schema:
  1005. $ref: '#/components/schemas/DeviceCommandAckRequest'
  1006. responses:
  1007. '200':
  1008. description: OK
  1009. content:
  1010. application/json:
  1011. schema:
  1012. $ref: '#/components/schemas/ApiResponse'
  1013. '400':
  1014. description: Error
  1015. content:
  1016. application/json:
  1017. schema:
  1018. $ref: '#/components/schemas/ErrorResponse'
  1019. '401':
  1020. description: Error
  1021. content:
  1022. application/json:
  1023. schema:
  1024. $ref: '#/components/schemas/ErrorResponse'
  1025. '403':
  1026. description: Error
  1027. content:
  1028. application/json:
  1029. schema:
  1030. $ref: '#/components/schemas/ErrorResponse'
  1031. '429':
  1032. description: Error
  1033. content:
  1034. application/json:
  1035. schema:
  1036. $ref: '#/components/schemas/ErrorResponse'
  1037. '500':
  1038. description: Error
  1039. content:
  1040. application/json:
  1041. schema:
  1042. $ref: '#/components/schemas/ErrorResponse'
  1043. /cards/{cardInstanceId}:
  1044. get:
  1045. summary: 查询卡片实例
  1046. tags:
  1047. - Card
  1048. x-emoon-priority: P0
  1049. parameters:
  1050. - $ref: '#/components/parameters/CardInstanceIdPath'
  1051. - *id001
  1052. - *id002
  1053. - *id003
  1054. responses:
  1055. '200':
  1056. description: OK
  1057. content:
  1058. application/json:
  1059. schema:
  1060. $ref: '#/components/schemas/ApiResponseCardInstance'
  1061. '400':
  1062. description: Error
  1063. content:
  1064. application/json:
  1065. schema:
  1066. $ref: '#/components/schemas/ErrorResponse'
  1067. '401':
  1068. description: Error
  1069. content:
  1070. application/json:
  1071. schema:
  1072. $ref: '#/components/schemas/ErrorResponse'
  1073. '403':
  1074. description: Error
  1075. content:
  1076. application/json:
  1077. schema:
  1078. $ref: '#/components/schemas/ErrorResponse'
  1079. '429':
  1080. description: Error
  1081. content:
  1082. application/json:
  1083. schema:
  1084. $ref: '#/components/schemas/ErrorResponse'
  1085. '500':
  1086. description: Error
  1087. content:
  1088. application/json:
  1089. schema:
  1090. $ref: '#/components/schemas/ErrorResponse'
  1091. /cards/{cardInstanceId}/actions/{actionName}:
  1092. post:
  1093. summary: 执行卡片动作
  1094. tags:
  1095. - Card
  1096. x-emoon-priority: P0
  1097. description: 所有产生业务后果的卡片动作必须幂等,且必须携带 operator 与 deviceContext。
  1098. parameters:
  1099. - $ref: '#/components/parameters/CardInstanceIdPath'
  1100. - $ref: '#/components/parameters/ActionNamePath'
  1101. - *id001
  1102. - *id002
  1103. - *id003
  1104. - *id006
  1105. requestBody:
  1106. required: true
  1107. content:
  1108. application/json:
  1109. schema:
  1110. $ref: '#/components/schemas/CardActionRequest'
  1111. responses:
  1112. '200':
  1113. description: OK
  1114. content:
  1115. application/json:
  1116. schema:
  1117. $ref: '#/components/schemas/ApiResponseCardAction'
  1118. '400':
  1119. description: Error
  1120. content:
  1121. application/json:
  1122. schema:
  1123. $ref: '#/components/schemas/ErrorResponse'
  1124. '401':
  1125. description: Error
  1126. content:
  1127. application/json:
  1128. schema:
  1129. $ref: '#/components/schemas/ErrorResponse'
  1130. '403':
  1131. description: Error
  1132. content:
  1133. application/json:
  1134. schema:
  1135. $ref: '#/components/schemas/ErrorResponse'
  1136. '429':
  1137. description: Error
  1138. content:
  1139. application/json:
  1140. schema:
  1141. $ref: '#/components/schemas/ErrorResponse'
  1142. '500':
  1143. description: Error
  1144. content:
  1145. application/json:
  1146. schema:
  1147. $ref: '#/components/schemas/ErrorResponse'
  1148. /tools/{toolName}/invoke:
  1149. post:
  1150. summary: 调用院内系统工具,面向受控适配方
  1151. tags:
  1152. - MCP Tool
  1153. x-emoon-priority: P0
  1154. description: 需要 tool:read 或 tool:write scope。普通设备厂商默认不开放。
  1155. parameters:
  1156. - $ref: '#/components/parameters/ToolNamePath'
  1157. - *id001
  1158. - *id002
  1159. - *id003
  1160. - *id006
  1161. requestBody:
  1162. required: true
  1163. content:
  1164. application/json:
  1165. schema:
  1166. $ref: '#/components/schemas/ToolInvokeRequest'
  1167. responses:
  1168. '200':
  1169. description: OK
  1170. content:
  1171. application/json:
  1172. schema:
  1173. $ref: '#/components/schemas/ApiResponseToolInvoke'
  1174. '400':
  1175. description: Error
  1176. content:
  1177. application/json:
  1178. schema:
  1179. $ref: '#/components/schemas/ErrorResponse'
  1180. '401':
  1181. description: Error
  1182. content:
  1183. application/json:
  1184. schema:
  1185. $ref: '#/components/schemas/ErrorResponse'
  1186. '403':
  1187. description: Error
  1188. content:
  1189. application/json:
  1190. schema:
  1191. $ref: '#/components/schemas/ErrorResponse'
  1192. '429':
  1193. description: Error
  1194. content:
  1195. application/json:
  1196. schema:
  1197. $ref: '#/components/schemas/ErrorResponse'
  1198. '500':
  1199. description: Error
  1200. content:
  1201. application/json:
  1202. schema:
  1203. $ref: '#/components/schemas/ErrorResponse'
  1204. x-emoon-required-scopes:
  1205. - tool:read
  1206. - tool:write
  1207. x-emoon-partner-level:
  1208. - trusted_system_adapter
  1209. - his_vendor
  1210. - emoon_internal
  1211. /usage/summary:
  1212. get:
  1213. summary: 查询用量汇总
  1214. tags:
  1215. - Usage
  1216. x-emoon-priority: P0
  1217. parameters:
  1218. - *id001
  1219. - *id002
  1220. - *id003
  1221. - $ref: '#/components/parameters/FromDate'
  1222. - $ref: '#/components/parameters/ToDate'
  1223. - $ref: '#/components/parameters/GroupBy'
  1224. responses:
  1225. '200':
  1226. description: OK
  1227. content:
  1228. application/json:
  1229. schema:
  1230. $ref: '#/components/schemas/ApiResponseUsageSummary'
  1231. '400':
  1232. description: Error
  1233. content:
  1234. application/json:
  1235. schema:
  1236. $ref: '#/components/schemas/ErrorResponse'
  1237. '401':
  1238. description: Error
  1239. content:
  1240. application/json:
  1241. schema:
  1242. $ref: '#/components/schemas/ErrorResponse'
  1243. '403':
  1244. description: Error
  1245. content:
  1246. application/json:
  1247. schema:
  1248. $ref: '#/components/schemas/ErrorResponse'
  1249. '429':
  1250. description: Error
  1251. content:
  1252. application/json:
  1253. schema:
  1254. $ref: '#/components/schemas/ErrorResponse'
  1255. '500':
  1256. description: Error
  1257. content:
  1258. application/json:
  1259. schema:
  1260. $ref: '#/components/schemas/ErrorResponse'
  1261. /meter/events:
  1262. get:
  1263. summary: 查询计量事件
  1264. tags:
  1265. - Usage
  1266. x-emoon-priority: P0
  1267. parameters:
  1268. - *id001
  1269. - *id002
  1270. - *id003
  1271. - $ref: '#/components/parameters/BillingEpisodeId'
  1272. - $ref: '#/components/parameters/Page'
  1273. - $ref: '#/components/parameters/PageSize'
  1274. - $ref: '#/components/parameters/QueryTraceId'
  1275. responses:
  1276. '200':
  1277. description: OK
  1278. content:
  1279. application/json:
  1280. schema:
  1281. $ref: '#/components/schemas/ApiResponseMeterEvents'
  1282. '400':
  1283. description: Error
  1284. content:
  1285. application/json:
  1286. schema:
  1287. $ref: '#/components/schemas/ErrorResponse'
  1288. '401':
  1289. description: Error
  1290. content:
  1291. application/json:
  1292. schema:
  1293. $ref: '#/components/schemas/ErrorResponse'
  1294. '403':
  1295. description: Error
  1296. content:
  1297. application/json:
  1298. schema:
  1299. $ref: '#/components/schemas/ErrorResponse'
  1300. '429':
  1301. description: Error
  1302. content:
  1303. application/json:
  1304. schema:
  1305. $ref: '#/components/schemas/ErrorResponse'
  1306. '500':
  1307. description: Error
  1308. content:
  1309. application/json:
  1310. schema:
  1311. $ref: '#/components/schemas/ErrorResponse'
  1312. description: 查询计量事件。P0 阶段仅支持按 billingEpisodeId 或 traceId 做精确查询,用于联调排障和计量核验;不作为正式账单查询接口,不开放项目级、设备级、时间范围复杂过滤给普通厂商。
  1313. /agents:
  1314. get:
  1315. summary: 查询可用智能体列表
  1316. tags:
  1317. - Agent
  1318. x-emoon-priority: P1
  1319. parameters:
  1320. - *id001
  1321. - *id002
  1322. - *id003
  1323. - $ref: '#/components/parameters/ScenarioCode'
  1324. responses:
  1325. '200':
  1326. description: OK
  1327. content:
  1328. application/json:
  1329. schema:
  1330. $ref: '#/components/schemas/ApiResponseAgentList'
  1331. '400':
  1332. description: Error
  1333. content:
  1334. application/json:
  1335. schema:
  1336. $ref: '#/components/schemas/ErrorResponse'
  1337. '401':
  1338. description: Error
  1339. content:
  1340. application/json:
  1341. schema:
  1342. $ref: '#/components/schemas/ErrorResponse'
  1343. '403':
  1344. description: Error
  1345. content:
  1346. application/json:
  1347. schema:
  1348. $ref: '#/components/schemas/ErrorResponse'
  1349. '429':
  1350. description: Error
  1351. content:
  1352. application/json:
  1353. schema:
  1354. $ref: '#/components/schemas/ErrorResponse'
  1355. '500':
  1356. description: Error
  1357. content:
  1358. application/json:
  1359. schema:
  1360. $ref: '#/components/schemas/ErrorResponse'
  1361. /agents/{agentId}:
  1362. get:
  1363. summary: 查询智能体详情
  1364. tags:
  1365. - Agent
  1366. x-emoon-priority: P1
  1367. parameters:
  1368. - $ref: '#/components/parameters/AgentIdPath'
  1369. - *id001
  1370. - *id002
  1371. - *id003
  1372. responses:
  1373. '200':
  1374. description: OK
  1375. content:
  1376. application/json:
  1377. schema:
  1378. $ref: '#/components/schemas/ApiResponseAgentDetail'
  1379. '400':
  1380. description: Error
  1381. content:
  1382. application/json:
  1383. schema:
  1384. $ref: '#/components/schemas/ErrorResponse'
  1385. '401':
  1386. description: Error
  1387. content:
  1388. application/json:
  1389. schema:
  1390. $ref: '#/components/schemas/ErrorResponse'
  1391. '403':
  1392. description: Error
  1393. content:
  1394. application/json:
  1395. schema:
  1396. $ref: '#/components/schemas/ErrorResponse'
  1397. '429':
  1398. description: Error
  1399. content:
  1400. application/json:
  1401. schema:
  1402. $ref: '#/components/schemas/ErrorResponse'
  1403. '500':
  1404. description: Error
  1405. content:
  1406. application/json:
  1407. schema:
  1408. $ref: '#/components/schemas/ErrorResponse'
  1409. /devices:
  1410. get:
  1411. summary: 查询设备列表
  1412. tags:
  1413. - Device
  1414. x-emoon-priority: P1
  1415. parameters:
  1416. - *id001
  1417. - *id002
  1418. - *id003
  1419. - $ref: '#/components/parameters/Page'
  1420. - $ref: '#/components/parameters/PageSize'
  1421. responses:
  1422. '200':
  1423. description: OK
  1424. content:
  1425. application/json:
  1426. schema:
  1427. $ref: '#/components/schemas/ApiResponseDeviceList'
  1428. '400':
  1429. description: Error
  1430. content:
  1431. application/json:
  1432. schema:
  1433. $ref: '#/components/schemas/ErrorResponse'
  1434. '401':
  1435. description: Error
  1436. content:
  1437. application/json:
  1438. schema:
  1439. $ref: '#/components/schemas/ErrorResponse'
  1440. '403':
  1441. description: Error
  1442. content:
  1443. application/json:
  1444. schema:
  1445. $ref: '#/components/schemas/ErrorResponse'
  1446. '429':
  1447. description: Error
  1448. content:
  1449. application/json:
  1450. schema:
  1451. $ref: '#/components/schemas/ErrorResponse'
  1452. '500':
  1453. description: Error
  1454. content:
  1455. application/json:
  1456. schema:
  1457. $ref: '#/components/schemas/ErrorResponse'
  1458. /devices/{deviceId}:
  1459. get:
  1460. summary: 查询设备详情
  1461. tags:
  1462. - Device
  1463. x-emoon-priority: P1
  1464. parameters:
  1465. - $ref: '#/components/parameters/DeviceIdPath'
  1466. - *id001
  1467. - *id002
  1468. - *id003
  1469. responses:
  1470. '200':
  1471. description: OK
  1472. content:
  1473. application/json:
  1474. schema:
  1475. $ref: '#/components/schemas/ApiResponseDeviceDetail'
  1476. '400':
  1477. description: Error
  1478. content:
  1479. application/json:
  1480. schema:
  1481. $ref: '#/components/schemas/ErrorResponse'
  1482. '401':
  1483. description: Error
  1484. content:
  1485. application/json:
  1486. schema:
  1487. $ref: '#/components/schemas/ErrorResponse'
  1488. '403':
  1489. description: Error
  1490. content:
  1491. application/json:
  1492. schema:
  1493. $ref: '#/components/schemas/ErrorResponse'
  1494. '429':
  1495. description: Error
  1496. content:
  1497. application/json:
  1498. schema:
  1499. $ref: '#/components/schemas/ErrorResponse'
  1500. '500':
  1501. description: Error
  1502. content:
  1503. application/json:
  1504. schema:
  1505. $ref: '#/components/schemas/ErrorResponse'
  1506. /webhooks:
  1507. post:
  1508. summary: 注册 Webhook
  1509. tags:
  1510. - Webhook
  1511. x-emoon-priority: P1
  1512. parameters: *id005
  1513. requestBody:
  1514. required: true
  1515. content:
  1516. application/json:
  1517. schema:
  1518. $ref: '#/components/schemas/WebhookRegisterRequest'
  1519. responses:
  1520. '200':
  1521. description: OK
  1522. content:
  1523. application/json:
  1524. schema:
  1525. $ref: '#/components/schemas/ApiResponseWebhook'
  1526. '400':
  1527. description: Error
  1528. content:
  1529. application/json:
  1530. schema:
  1531. $ref: '#/components/schemas/ErrorResponse'
  1532. '401':
  1533. description: Error
  1534. content:
  1535. application/json:
  1536. schema:
  1537. $ref: '#/components/schemas/ErrorResponse'
  1538. '403':
  1539. description: Error
  1540. content:
  1541. application/json:
  1542. schema:
  1543. $ref: '#/components/schemas/ErrorResponse'
  1544. '429':
  1545. description: Error
  1546. content:
  1547. application/json:
  1548. schema:
  1549. $ref: '#/components/schemas/ErrorResponse'
  1550. '500':
  1551. description: Error
  1552. content:
  1553. application/json:
  1554. schema:
  1555. $ref: '#/components/schemas/ErrorResponse'
  1556. get:
  1557. summary: 查询 Webhook 列表
  1558. tags:
  1559. - Webhook
  1560. x-emoon-priority: P1
  1561. parameters:
  1562. - *id001
  1563. - *id002
  1564. - *id003
  1565. - $ref: '#/components/parameters/Page'
  1566. - $ref: '#/components/parameters/PageSize'
  1567. responses:
  1568. '200':
  1569. description: OK
  1570. content:
  1571. application/json:
  1572. schema:
  1573. $ref: '#/components/schemas/ApiResponseWebhookList'
  1574. '400':
  1575. description: Error
  1576. content:
  1577. application/json:
  1578. schema:
  1579. $ref: '#/components/schemas/ErrorResponse'
  1580. '401':
  1581. description: Error
  1582. content:
  1583. application/json:
  1584. schema:
  1585. $ref: '#/components/schemas/ErrorResponse'
  1586. '403':
  1587. description: Error
  1588. content:
  1589. application/json:
  1590. schema:
  1591. $ref: '#/components/schemas/ErrorResponse'
  1592. '429':
  1593. description: Error
  1594. content:
  1595. application/json:
  1596. schema:
  1597. $ref: '#/components/schemas/ErrorResponse'
  1598. '500':
  1599. description: Error
  1600. content:
  1601. application/json:
  1602. schema:
  1603. $ref: '#/components/schemas/ErrorResponse'
  1604. /webhooks/{webhookId}:
  1605. delete:
  1606. summary: 删除 Webhook
  1607. tags:
  1608. - Webhook
  1609. x-emoon-priority: P1
  1610. parameters:
  1611. - $ref: '#/components/parameters/WebhookIdPath'
  1612. - *id001
  1613. - *id002
  1614. - *id003
  1615. responses:
  1616. '200':
  1617. description: OK
  1618. content:
  1619. application/json:
  1620. schema:
  1621. $ref: '#/components/schemas/ApiResponse'
  1622. '400':
  1623. description: Error
  1624. content:
  1625. application/json:
  1626. schema:
  1627. $ref: '#/components/schemas/ErrorResponse'
  1628. '401':
  1629. description: Error
  1630. content:
  1631. application/json:
  1632. schema:
  1633. $ref: '#/components/schemas/ErrorResponse'
  1634. '403':
  1635. description: Error
  1636. content:
  1637. application/json:
  1638. schema:
  1639. $ref: '#/components/schemas/ErrorResponse'
  1640. '429':
  1641. description: Error
  1642. content:
  1643. application/json:
  1644. schema:
  1645. $ref: '#/components/schemas/ErrorResponse'
  1646. '500':
  1647. description: Error
  1648. content:
  1649. application/json:
  1650. schema:
  1651. $ref: '#/components/schemas/ErrorResponse'
  1652. /events/ingest:
  1653. post:
  1654. summary: 接收外部系统业务事件
  1655. tags:
  1656. - Event
  1657. x-emoon-priority: P1
  1658. description: 用于 HIS、叫号、迪耐克/病房系统向医梦上报事件。
  1659. parameters: *id004
  1660. requestBody:
  1661. required: true
  1662. content:
  1663. application/json:
  1664. schema:
  1665. $ref: '#/components/schemas/ExternalEventRequest'
  1666. responses:
  1667. '202':
  1668. description: OK
  1669. content:
  1670. application/json:
  1671. schema:
  1672. $ref: '#/components/schemas/ApiResponseAccepted'
  1673. '400':
  1674. description: Error
  1675. content:
  1676. application/json:
  1677. schema:
  1678. $ref: '#/components/schemas/ErrorResponse'
  1679. '401':
  1680. description: Error
  1681. content:
  1682. application/json:
  1683. schema:
  1684. $ref: '#/components/schemas/ErrorResponse'
  1685. '403':
  1686. description: Error
  1687. content:
  1688. application/json:
  1689. schema:
  1690. $ref: '#/components/schemas/ErrorResponse'
  1691. '429':
  1692. description: Error
  1693. content:
  1694. application/json:
  1695. schema:
  1696. $ref: '#/components/schemas/ErrorResponse'
  1697. '500':
  1698. description: Error
  1699. content:
  1700. application/json:
  1701. schema:
  1702. $ref: '#/components/schemas/ErrorResponse'
  1703. /tools/catalog:
  1704. get:
  1705. summary: 查询授权工具目录
  1706. tags:
  1707. - MCP Tool
  1708. x-emoon-priority: P1
  1709. parameters: *id005
  1710. responses:
  1711. '200':
  1712. description: OK
  1713. content:
  1714. application/json:
  1715. schema:
  1716. $ref: '#/components/schemas/ApiResponseToolCatalog'
  1717. '400':
  1718. description: Error
  1719. content:
  1720. application/json:
  1721. schema:
  1722. $ref: '#/components/schemas/ErrorResponse'
  1723. '401':
  1724. description: Error
  1725. content:
  1726. application/json:
  1727. schema:
  1728. $ref: '#/components/schemas/ErrorResponse'
  1729. '403':
  1730. description: Error
  1731. content:
  1732. application/json:
  1733. schema:
  1734. $ref: '#/components/schemas/ErrorResponse'
  1735. '429':
  1736. description: Error
  1737. content:
  1738. application/json:
  1739. schema:
  1740. $ref: '#/components/schemas/ErrorResponse'
  1741. '500':
  1742. description: Error
  1743. content:
  1744. application/json:
  1745. schema:
  1746. $ref: '#/components/schemas/ErrorResponse'
  1747. x-emoon-required-scopes:
  1748. - tool:read
  1749. /licenses/devices:
  1750. get:
  1751. summary: 查询设备授权状态
  1752. tags:
  1753. - License
  1754. x-emoon-priority: P1
  1755. parameters:
  1756. - *id001
  1757. - *id002
  1758. - *id003
  1759. - $ref: '#/components/parameters/Page'
  1760. - $ref: '#/components/parameters/PageSize'
  1761. responses:
  1762. '200':
  1763. description: OK
  1764. content:
  1765. application/json:
  1766. schema:
  1767. $ref: '#/components/schemas/ApiResponseDeviceLicenses'
  1768. '400':
  1769. description: Error
  1770. content:
  1771. application/json:
  1772. schema:
  1773. $ref: '#/components/schemas/ErrorResponse'
  1774. '401':
  1775. description: Error
  1776. content:
  1777. application/json:
  1778. schema:
  1779. $ref: '#/components/schemas/ErrorResponse'
  1780. '403':
  1781. description: Error
  1782. content:
  1783. application/json:
  1784. schema:
  1785. $ref: '#/components/schemas/ErrorResponse'
  1786. '429':
  1787. description: Error
  1788. content:
  1789. application/json:
  1790. schema:
  1791. $ref: '#/components/schemas/ErrorResponse'
  1792. '500':
  1793. description: Error
  1794. content:
  1795. application/json:
  1796. schema:
  1797. $ref: '#/components/schemas/ErrorResponse'
  1798. /partners:
  1799. post:
  1800. summary: 创建合作方接入档案
  1801. tags:
  1802. - Partner
  1803. x-emoon-priority: P2
  1804. description: P2 规划接口,不建议进入春节前 MVP。
  1805. parameters: *id005
  1806. requestBody:
  1807. required: true
  1808. content:
  1809. application/json:
  1810. schema:
  1811. $ref: '#/components/schemas/PartnerCreateRequest'
  1812. responses:
  1813. '200':
  1814. description: OK
  1815. content:
  1816. application/json:
  1817. schema:
  1818. $ref: '#/components/schemas/ApiResponse'
  1819. '400':
  1820. description: Error
  1821. content:
  1822. application/json:
  1823. schema:
  1824. $ref: '#/components/schemas/ErrorResponse'
  1825. '401':
  1826. description: Error
  1827. content:
  1828. application/json:
  1829. schema:
  1830. $ref: '#/components/schemas/ErrorResponse'
  1831. '403':
  1832. description: Error
  1833. content:
  1834. application/json:
  1835. schema:
  1836. $ref: '#/components/schemas/ErrorResponse'
  1837. '429':
  1838. description: Error
  1839. content:
  1840. application/json:
  1841. schema:
  1842. $ref: '#/components/schemas/ErrorResponse'
  1843. '500':
  1844. description: Error
  1845. content:
  1846. application/json:
  1847. schema:
  1848. $ref: '#/components/schemas/ErrorResponse'
  1849. /contracts:
  1850. get:
  1851. summary: 查询合同与套餐
  1852. tags:
  1853. - Contract
  1854. x-emoon-priority: P2
  1855. description: P2 规划接口,不建议进入春节前 MVP。
  1856. parameters: *id005
  1857. responses:
  1858. '200':
  1859. description: OK
  1860. content:
  1861. application/json:
  1862. schema:
  1863. $ref: '#/components/schemas/ApiResponse'
  1864. '400':
  1865. description: Error
  1866. content:
  1867. application/json:
  1868. schema:
  1869. $ref: '#/components/schemas/ErrorResponse'
  1870. '401':
  1871. description: Error
  1872. content:
  1873. application/json:
  1874. schema:
  1875. $ref: '#/components/schemas/ErrorResponse'
  1876. '403':
  1877. description: Error
  1878. content:
  1879. application/json:
  1880. schema:
  1881. $ref: '#/components/schemas/ErrorResponse'
  1882. '429':
  1883. description: Error
  1884. content:
  1885. application/json:
  1886. schema:
  1887. $ref: '#/components/schemas/ErrorResponse'
  1888. '500':
  1889. description: Error
  1890. content:
  1891. application/json:
  1892. schema:
  1893. $ref: '#/components/schemas/ErrorResponse'
  1894. /credit/accounts:
  1895. get:
  1896. summary: 查询能力值账户
  1897. tags:
  1898. - Credit
  1899. x-emoon-priority: P2
  1900. description: P2 规划接口,不建议进入春节前 MVP。
  1901. parameters: *id005
  1902. responses:
  1903. '200':
  1904. description: OK
  1905. content:
  1906. application/json:
  1907. schema:
  1908. $ref: '#/components/schemas/ApiResponse'
  1909. '400':
  1910. description: Error
  1911. content:
  1912. application/json:
  1913. schema:
  1914. $ref: '#/components/schemas/ErrorResponse'
  1915. '401':
  1916. description: Error
  1917. content:
  1918. application/json:
  1919. schema:
  1920. $ref: '#/components/schemas/ErrorResponse'
  1921. '403':
  1922. description: Error
  1923. content:
  1924. application/json:
  1925. schema:
  1926. $ref: '#/components/schemas/ErrorResponse'
  1927. '429':
  1928. description: Error
  1929. content:
  1930. application/json:
  1931. schema:
  1932. $ref: '#/components/schemas/ErrorResponse'
  1933. '500':
  1934. description: Error
  1935. content:
  1936. application/json:
  1937. schema:
  1938. $ref: '#/components/schemas/ErrorResponse'
  1939. /billing/invoices:
  1940. get:
  1941. summary: 查询账单
  1942. tags:
  1943. - Billing
  1944. x-emoon-priority: P2
  1945. description: P2 规划接口,不建议进入春节前 MVP。
  1946. parameters: *id005
  1947. responses:
  1948. '200':
  1949. description: OK
  1950. content:
  1951. application/json:
  1952. schema:
  1953. $ref: '#/components/schemas/ApiResponse'
  1954. '400':
  1955. description: Error
  1956. content:
  1957. application/json:
  1958. schema:
  1959. $ref: '#/components/schemas/ErrorResponse'
  1960. '401':
  1961. description: Error
  1962. content:
  1963. application/json:
  1964. schema:
  1965. $ref: '#/components/schemas/ErrorResponse'
  1966. '403':
  1967. description: Error
  1968. content:
  1969. application/json:
  1970. schema:
  1971. $ref: '#/components/schemas/ErrorResponse'
  1972. '429':
  1973. description: Error
  1974. content:
  1975. application/json:
  1976. schema:
  1977. $ref: '#/components/schemas/ErrorResponse'
  1978. '500':
  1979. description: Error
  1980. content:
  1981. application/json:
  1982. schema:
  1983. $ref: '#/components/schemas/ErrorResponse'
  1984. /operation/reports:
  1985. get:
  1986. summary: 查询运营报告
  1987. tags:
  1988. - Operation
  1989. x-emoon-priority: P2
  1990. description: P2 规划接口,不建议进入春节前 MVP。
  1991. parameters: *id005
  1992. responses:
  1993. '200':
  1994. description: OK
  1995. content:
  1996. application/json:
  1997. schema:
  1998. $ref: '#/components/schemas/ApiResponse'
  1999. '400':
  2000. description: Error
  2001. content:
  2002. application/json:
  2003. schema:
  2004. $ref: '#/components/schemas/ErrorResponse'
  2005. '401':
  2006. description: Error
  2007. content:
  2008. application/json:
  2009. schema:
  2010. $ref: '#/components/schemas/ErrorResponse'
  2011. '403':
  2012. description: Error
  2013. content:
  2014. application/json:
  2015. schema:
  2016. $ref: '#/components/schemas/ErrorResponse'
  2017. '429':
  2018. description: Error
  2019. content:
  2020. application/json:
  2021. schema:
  2022. $ref: '#/components/schemas/ErrorResponse'
  2023. '500':
  2024. description: Error
  2025. content:
  2026. application/json:
  2027. schema:
  2028. $ref: '#/components/schemas/ErrorResponse'
  2029. /audit/logs:
  2030. get:
  2031. summary: 查询审计日志
  2032. tags:
  2033. - Audit
  2034. x-emoon-priority: P2
  2035. description: P2 规划接口,不建议进入春节前 MVP。
  2036. parameters: *id005
  2037. responses:
  2038. '200':
  2039. description: OK
  2040. content:
  2041. application/json:
  2042. schema:
  2043. $ref: '#/components/schemas/ApiResponse'
  2044. '400':
  2045. description: Error
  2046. content:
  2047. application/json:
  2048. schema:
  2049. $ref: '#/components/schemas/ErrorResponse'
  2050. '401':
  2051. description: Error
  2052. content:
  2053. application/json:
  2054. schema:
  2055. $ref: '#/components/schemas/ErrorResponse'
  2056. '403':
  2057. description: Error
  2058. content:
  2059. application/json:
  2060. schema:
  2061. $ref: '#/components/schemas/ErrorResponse'
  2062. '429':
  2063. description: Error
  2064. content:
  2065. application/json:
  2066. schema:
  2067. $ref: '#/components/schemas/ErrorResponse'
  2068. '500':
  2069. description: Error
  2070. content:
  2071. application/json:
  2072. schema:
  2073. $ref: '#/components/schemas/ErrorResponse'
  2074. /partners/{partnerId}:
  2075. get:
  2076. summary: 查询合作方档案
  2077. tags:
  2078. - Partner
  2079. x-emoon-priority: P2
  2080. parameters:
  2081. - $ref: '#/components/parameters/PartnerIdPath'
  2082. - *id001
  2083. - *id002
  2084. - *id003
  2085. responses:
  2086. '200':
  2087. description: OK
  2088. content:
  2089. application/json:
  2090. schema:
  2091. $ref: '#/components/schemas/ApiResponse'
  2092. '400':
  2093. description: Error
  2094. content:
  2095. application/json:
  2096. schema:
  2097. $ref: '#/components/schemas/ErrorResponse'
  2098. '401':
  2099. description: Error
  2100. content:
  2101. application/json:
  2102. schema:
  2103. $ref: '#/components/schemas/ErrorResponse'
  2104. '403':
  2105. description: Error
  2106. content:
  2107. application/json:
  2108. schema:
  2109. $ref: '#/components/schemas/ErrorResponse'
  2110. '429':
  2111. description: Error
  2112. content:
  2113. application/json:
  2114. schema:
  2115. $ref: '#/components/schemas/ErrorResponse'
  2116. '500':
  2117. description: Error
  2118. content:
  2119. application/json:
  2120. schema:
  2121. $ref: '#/components/schemas/ErrorResponse'
  2122. /credit/accounts/{accountId}/freeze:
  2123. post:
  2124. summary: 冻结能力值
  2125. tags:
  2126. - Credit
  2127. x-emoon-priority: P2
  2128. description: 内部高风险接口,通常不对外开放。
  2129. parameters:
  2130. - $ref: '#/components/parameters/AccountIdPath'
  2131. - *id001
  2132. - *id002
  2133. - *id003
  2134. - *id006
  2135. requestBody:
  2136. required: true
  2137. content:
  2138. application/json:
  2139. schema:
  2140. $ref: '#/components/schemas/CreditFreezeRequest'
  2141. responses:
  2142. '200':
  2143. description: OK
  2144. content:
  2145. application/json:
  2146. schema:
  2147. $ref: '#/components/schemas/ApiResponse'
  2148. '400':
  2149. description: Error
  2150. content:
  2151. application/json:
  2152. schema:
  2153. $ref: '#/components/schemas/ErrorResponse'
  2154. '401':
  2155. description: Error
  2156. content:
  2157. application/json:
  2158. schema:
  2159. $ref: '#/components/schemas/ErrorResponse'
  2160. '403':
  2161. description: Error
  2162. content:
  2163. application/json:
  2164. schema:
  2165. $ref: '#/components/schemas/ErrorResponse'
  2166. '429':
  2167. description: Error
  2168. content:
  2169. application/json:
  2170. schema:
  2171. $ref: '#/components/schemas/ErrorResponse'
  2172. '500':
  2173. description: Error
  2174. content:
  2175. application/json:
  2176. schema:
  2177. $ref: '#/components/schemas/ErrorResponse'
  2178. /credit/accounts/{accountId}/settle:
  2179. post:
  2180. summary: 结算能力值
  2181. tags:
  2182. - Credit
  2183. x-emoon-priority: P2
  2184. description: 内部高风险接口,通常不对外开放。
  2185. parameters:
  2186. - $ref: '#/components/parameters/AccountIdPath'
  2187. - *id001
  2188. - *id002
  2189. - *id003
  2190. - *id006
  2191. requestBody:
  2192. required: true
  2193. content:
  2194. application/json:
  2195. schema:
  2196. $ref: '#/components/schemas/CreditSettleRequest'
  2197. responses:
  2198. '200':
  2199. description: OK
  2200. content:
  2201. application/json:
  2202. schema:
  2203. $ref: '#/components/schemas/ApiResponse'
  2204. '400':
  2205. description: Error
  2206. content:
  2207. application/json:
  2208. schema:
  2209. $ref: '#/components/schemas/ErrorResponse'
  2210. '401':
  2211. description: Error
  2212. content:
  2213. application/json:
  2214. schema:
  2215. $ref: '#/components/schemas/ErrorResponse'
  2216. '403':
  2217. description: Error
  2218. content:
  2219. application/json:
  2220. schema:
  2221. $ref: '#/components/schemas/ErrorResponse'
  2222. '429':
  2223. description: Error
  2224. content:
  2225. application/json:
  2226. schema:
  2227. $ref: '#/components/schemas/ErrorResponse'
  2228. '500':
  2229. description: Error
  2230. content:
  2231. application/json:
  2232. schema:
  2233. $ref: '#/components/schemas/ErrorResponse'
  2234. components:
  2235. securitySchemes:
  2236. BearerAuth:
  2237. type: http
  2238. scheme: bearer
  2239. bearerFormat: JWT
  2240. HmacAuth:
  2241. type: apiKey
  2242. in: header
  2243. name: X-Emoon-Access-Key
  2244. description: 项目 Access Key。同时必须携带 X-Emoon-Timestamp(Unix 毫秒)、X-Emoon-Nonce(随机 UUID)、X-Emoon-Signature(Base64(HMAC-SHA256))。
  2245. parameters:
  2246. ProjectId:
  2247. name: X-Emoon-Project-Id
  2248. in: header
  2249. required: true
  2250. schema:
  2251. type: string
  2252. description: 项目/医院标识。
  2253. PartnerId:
  2254. name: X-Emoon-Partner-Id
  2255. in: header
  2256. required: true
  2257. schema:
  2258. type: string
  2259. description: 合作厂商标识。
  2260. TraceId:
  2261. name: X-Emoon-Trace-Id
  2262. in: header
  2263. required: false
  2264. schema:
  2265. type: string
  2266. description: 链路追踪 ID;不传则平台生成。
  2267. IdempotencyKey:
  2268. name: X-Emoon-Idempotency-Key
  2269. in: header
  2270. required: false
  2271. schema:
  2272. type: string
  2273. description: 写操作和产生业务事实的请求必须传。
  2274. Timestamp:
  2275. name: X-Emoon-Timestamp
  2276. in: header
  2277. required: false
  2278. schema:
  2279. type: string
  2280. description: HMAC 模式必填,Unix 毫秒时间戳。
  2281. Nonce:
  2282. name: X-Emoon-Nonce
  2283. in: header
  2284. required: false
  2285. schema:
  2286. type: string
  2287. description: HMAC 模式必填,防重放随机串。
  2288. Signature:
  2289. name: X-Emoon-Signature
  2290. in: header
  2291. required: false
  2292. schema:
  2293. type: string
  2294. description: HMAC 模式必填,HMAC-SHA256 签名。
  2295. DeviceIdHeader:
  2296. name: X-Emoon-Device-Id
  2297. in: header
  2298. required: false
  2299. schema:
  2300. type: string
  2301. description: 设备调用建议传,作为 deviceContext 兜底。
  2302. DeviceIdPath:
  2303. name: deviceId
  2304. in: path
  2305. required: true
  2306. schema:
  2307. type: string
  2308. ConversationIdPath:
  2309. name: conversationId
  2310. in: path
  2311. required: true
  2312. schema:
  2313. type: string
  2314. FileIdPath:
  2315. name: fileId
  2316. in: path
  2317. required: true
  2318. schema:
  2319. type: string
  2320. CardInstanceIdPath:
  2321. name: cardInstanceId
  2322. in: path
  2323. required: true
  2324. schema:
  2325. type: string
  2326. ActionNamePath:
  2327. name: actionName
  2328. in: path
  2329. required: true
  2330. schema:
  2331. type: string
  2332. CommandIdPath:
  2333. name: commandId
  2334. in: path
  2335. required: true
  2336. schema:
  2337. type: string
  2338. ToolNamePath:
  2339. name: toolName
  2340. in: path
  2341. required: true
  2342. schema:
  2343. type: string
  2344. WebhookIdPath:
  2345. name: webhookId
  2346. in: path
  2347. required: true
  2348. schema:
  2349. type: string
  2350. PartnerIdPath:
  2351. name: partnerId
  2352. in: path
  2353. required: true
  2354. schema:
  2355. type: string
  2356. AccountIdPath:
  2357. name: accountId
  2358. in: path
  2359. required: true
  2360. schema:
  2361. type: string
  2362. AgentIdPath:
  2363. name: agentId
  2364. in: path
  2365. required: true
  2366. schema:
  2367. type: string
  2368. Page:
  2369. name: page
  2370. in: query
  2371. required: false
  2372. schema:
  2373. type: integer
  2374. default: 1
  2375. PageSize:
  2376. name: pageSize
  2377. in: query
  2378. required: false
  2379. schema:
  2380. type: integer
  2381. default: 20
  2382. maximum: 200
  2383. FromDate:
  2384. name: from
  2385. in: query
  2386. required: true
  2387. schema:
  2388. type: string
  2389. format: date
  2390. ToDate:
  2391. name: to
  2392. in: query
  2393. required: true
  2394. schema:
  2395. type: string
  2396. format: date
  2397. GroupBy:
  2398. name: groupBy
  2399. in: query
  2400. required: false
  2401. schema:
  2402. type: string
  2403. enum:
  2404. - project
  2405. - partner
  2406. - agent
  2407. - device
  2408. - scenario
  2409. - department
  2410. - day
  2411. BillingEpisodeId:
  2412. name: billingEpisodeId
  2413. in: query
  2414. required: false
  2415. schema:
  2416. type: string
  2417. description: 按 billingEpisodeId 查询同一业务 episode 下的计量事件。P0 阶段 /meter/events 仅支持 billingEpisodeId 或 traceId 这类精确查询,不开放项目级、设备级、时间范围复杂过滤。
  2418. ScenarioCode:
  2419. name: scenarioCode
  2420. in: query
  2421. required: false
  2422. schema:
  2423. type: string
  2424. QueryTraceId:
  2425. name: traceId
  2426. in: query
  2427. required: false
  2428. schema:
  2429. type: string
  2430. description: 按 traceId 查询联调排障相关计量事件。P0 仅用于联调排障,不代表完整账单查询。
  2431. schemas:
  2432. ApiResponse:
  2433. type: object
  2434. properties:
  2435. code:
  2436. type: string
  2437. example: OK
  2438. message:
  2439. type: string
  2440. example: success
  2441. traceId:
  2442. type: string
  2443. requestId:
  2444. type: string
  2445. details:
  2446. type: object
  2447. additionalProperties: true
  2448. data:
  2449. type: object
  2450. additionalProperties: true
  2451. ErrorResponse:
  2452. type: object
  2453. properties:
  2454. code:
  2455. type: string
  2456. example: INVALID_PARAM
  2457. message:
  2458. type: string
  2459. details:
  2460. type: object
  2461. additionalProperties: true
  2462. traceId:
  2463. type: string
  2464. requestId:
  2465. type: string
  2466. required:
  2467. - code
  2468. - message
  2469. - traceId
  2470. ApiResponseAccepted:
  2471. allOf:
  2472. - $ref: '#/components/schemas/ApiResponse'
  2473. properties:
  2474. data:
  2475. $ref: '#/components/schemas/AcceptedData'
  2476. AcceptedData:
  2477. type: object
  2478. properties:
  2479. accepted:
  2480. type: boolean
  2481. eventId:
  2482. type: string
  2483. status:
  2484. type: string
  2485. enum:
  2486. - accepted
  2487. - duplicate
  2488. - ignored
  2489. TokenRequest:
  2490. type: object
  2491. required:
  2492. - grantType
  2493. - clientId
  2494. - clientSecret
  2495. - projectId
  2496. properties:
  2497. grantType:
  2498. type: string
  2499. enum:
  2500. - client_credentials
  2501. clientId:
  2502. type: string
  2503. clientSecret:
  2504. type: string
  2505. projectId:
  2506. type: string
  2507. scopes:
  2508. type: array
  2509. items:
  2510. type: string
  2511. TokenData:
  2512. type: object
  2513. properties:
  2514. accessToken:
  2515. type: string
  2516. tokenType:
  2517. type: string
  2518. example: Bearer
  2519. expiresIn:
  2520. type: integer
  2521. example: 7200
  2522. scopes:
  2523. type: array
  2524. items:
  2525. type: string
  2526. ApiResponseToken:
  2527. allOf:
  2528. - $ref: '#/components/schemas/ApiResponse'
  2529. properties:
  2530. data:
  2531. $ref: '#/components/schemas/TokenData'
  2532. HealthData:
  2533. type: object
  2534. properties:
  2535. status:
  2536. type: string
  2537. enum:
  2538. - UP
  2539. - DOWN
  2540. - DEGRADED
  2541. timestamp:
  2542. type: string
  2543. format: date-time
  2544. version:
  2545. type: string
  2546. ApiResponseHealth:
  2547. allOf:
  2548. - $ref: '#/components/schemas/ApiResponse'
  2549. properties:
  2550. data:
  2551. $ref: '#/components/schemas/HealthData'
  2552. CapabilitiesData:
  2553. type: object
  2554. properties:
  2555. projectId:
  2556. type: string
  2557. agents:
  2558. type: array
  2559. items:
  2560. $ref: '#/components/schemas/AgentSummary'
  2561. enabledFeatures:
  2562. type: array
  2563. items:
  2564. type: string
  2565. toolScopes:
  2566. type: array
  2567. items:
  2568. type: string
  2569. rateLimit:
  2570. $ref: '#/components/schemas/RateLimitPolicy'
  2571. ApiResponseCapabilities:
  2572. allOf:
  2573. - $ref: '#/components/schemas/ApiResponse'
  2574. properties:
  2575. data:
  2576. $ref: '#/components/schemas/CapabilitiesData'
  2577. RateLimitPolicy:
  2578. type: object
  2579. properties:
  2580. windowSeconds:
  2581. type: integer
  2582. limit:
  2583. type: integer
  2584. UserContext:
  2585. type: object
  2586. required:
  2587. - externalUserId
  2588. - role
  2589. properties:
  2590. externalUserId:
  2591. type: string
  2592. role:
  2593. type: string
  2594. enum:
  2595. - patient
  2596. - doctor
  2597. - nurse
  2598. - admin
  2599. - system
  2600. - anonymous
  2601. patientId:
  2602. type: string
  2603. description: HIS 患者 ID,第一期可选。
  2604. visitId:
  2605. type: string
  2606. description: 门诊/住院就诊 ID,第一期可选。
  2607. encounterId:
  2608. type: string
  2609. authorizationId:
  2610. type: string
  2611. description: 患者授权记录 ID。
  2612. DeviceContext:
  2613. type: object
  2614. properties:
  2615. deviceId:
  2616. type: string
  2617. deviceType:
  2618. type: string
  2619. enum:
  2620. - mobile_app
  2621. - guide_screen
  2622. - self_service_kiosk
  2623. - robot
  2624. - waiting_screen
  2625. - clinic_door_screen
  2626. - clinic_desktop_screen
  2627. - doctor_station
  2628. - four_diagnosis_device
  2629. - nurse_pda
  2630. - nursing_whiteboard
  2631. - bedside_screen
  2632. - ward_robot
  2633. - unknown
  2634. description: 设备类型。门诊类型可进入医梦统一入口直接管理;住院侧类型仅表示 AI 能力映射对象,不代表医梦接管住院硬件。
  2635. locationCode:
  2636. type: string
  2637. sceneCode:
  2638. type: string
  2639. clientVersion:
  2640. type: string
  2641. managementMode:
  2642. type: string
  2643. enum:
  2644. - emoon_managed
  2645. - partner_managed
  2646. - mapped_external
  2647. description: 设备管理模式。emoon_managed=医梦统一入口客户端和 Device Registry 管理;partner_managed=合作设备厂商管理,医梦通过标准接口接入;mapped_external=迪耐克/鸿蒙病房等外部体系管理,医梦只做映射和事件互通。
  2648. externalSystem:
  2649. type: string
  2650. description: 外部系统标识,例如 dinaike_ward、harmony_ward、his_queue。管理模式为 mapped_external 或 partner_managed 时建议填写。
  2651. externalDeviceId:
  2652. type: string
  2653. description: 外部系统中的设备或终端 ID,用于住院互通和第三方设备映射。
  2654. required:
  2655. - deviceId
  2656. description: 设备上下文。门诊设备原则上由医梦 Device Registry 管理;住院侧类型(nurse_pda / nursing_whiteboard / bedside_screen / ward_robot)通常通过迪耐克/鸿蒙病房体系映射接入,医梦只负责 AI 能力、事件互通和审计,不承担住院硬件基础管理责任。
  2657. PerceptionContext:
  2658. type: object
  2659. description: 感知上下文。用于统一入口客户端上报最近一次身份、空间、业务、设备或风险感知事实;服务端仍以授权、HIS/叫号/任务状态为最终依据。P0 不允许上传连续轨迹。
  2660. properties:
  2661. identityBindingId:
  2662. type: string
  2663. description: 患者身份与终端/设备/会话绑定记录 ID。
  2664. locationLevel:
  2665. type: string
  2666. enum:
  2667. - L0
  2668. - L1
  2669. - L2
  2670. - L3
  2671. description: 感知级别。L0=扫码/人工;L1=NFC/刷卡;L2=BLE/Wi-Fi 区域;L3=星闪/鸿蒙/UWB 等高精度。
  2672. zoneCode:
  2673. type: string
  2674. description: 服务区域编码,如 clinic_room_301_door、outpatient_hall_kiosk。
  2675. source:
  2676. type: string
  2677. enum:
  2678. - QR_SCANNED
  2679. - NFC_TOUCH
  2680. - CARD_READ
  2681. - BLE_ZONE_DETECT
  2682. - WIFI_ZONE_DETECT
  2683. - MANUAL_CONFIRM
  2684. - BUSINESS_STATE
  2685. - DEVICE_EVENT
  2686. - CUSTOM
  2687. occurredAt:
  2688. type: string
  2689. format: date-time
  2690. confidence:
  2691. type: number
  2692. format: double
  2693. minimum: 0
  2694. maximum: 1
  2695. JourneyState:
  2696. type: object
  2697. readOnly: true
  2698. description: 患者当前动线阶段。由服务端根据 VisitTimeline、TaskState、DeviceContext、DeviceEvent、CardAction 和院内系统状态推导;P0 仅用于服务端返回给客户端展示,客户端请求不得传入该对象,也不得据此自行放开高风险能力。
  2699. properties:
  2700. stageCode:
  2701. type: string
  2702. description: 动线阶段编码,如 WAITING_CHECKIN、WAITING_CALL、WAITING_PAYMENT、WAITING_EXAM、REPORT_READY、FOLLOW_UP。
  2703. stageName:
  2704. type: string
  2705. description: 动线阶段中文名。
  2706. nextAction:
  2707. type: string
  2708. description: 推荐下一步动作,如 CHECK_IN、PAYMENT_GUIDE、NAVIGATE_TO_EXAM、REPORT_EXPLAIN。
  2709. source:
  2710. type: string
  2711. enum:
  2712. - SERVER_DERIVED
  2713. - HIS_STATE
  2714. - CARD_ACTION
  2715. - DEVICE_EVENT
  2716. confidence:
  2717. type: number
  2718. format: double
  2719. minimum: 0
  2720. maximum: 1
  2721. requiresConfirm:
  2722. type: boolean
  2723. description: 是否必须患者或医护确认后才能执行。
  2724. BillingContext:
  2725. type: object
  2726. properties:
  2727. scenarioCode:
  2728. type: string
  2729. billingEpisodeId:
  2730. type: string
  2731. chargePolicy:
  2732. type: string
  2733. enum:
  2734. - customer_charge
  2735. - license_covered
  2736. - bundle_included
  2737. - internal_cost
  2738. - no_charge
  2739. ChatMessage:
  2740. type: object
  2741. required:
  2742. - type
  2743. - text
  2744. properties:
  2745. type:
  2746. type: string
  2747. enum:
  2748. - text
  2749. - image
  2750. - audio
  2751. - file
  2752. text:
  2753. type: string
  2754. description: 文本内容(type=text 时必填)。
  2755. fileId:
  2756. type: string
  2757. description: 多模态文件推荐传 fileId(type=image/audio/file 时使用)。
  2758. clientMessageId:
  2759. type: string
  2760. description: 客户端消息幂等 ID。
  2761. AgentChatRequest:
  2762. type: object
  2763. required:
  2764. - message
  2765. properties:
  2766. agentId:
  2767. type: string
  2768. nullable: true
  2769. description: 对外智能体 ID。统一入口客户端可为空,由后端 AgentRouter 根据设备、场景、任务状态和输入内容决定。
  2770. conversationId:
  2771. type: string
  2772. description: 首轮可为空,平台自动创建。
  2773. user:
  2774. $ref: '#/components/schemas/UserContext'
  2775. deviceContext:
  2776. $ref: '#/components/schemas/DeviceContext'
  2777. perceptionContext:
  2778. $ref: '#/components/schemas/PerceptionContext'
  2779. message:
  2780. $ref: '#/components/schemas/ChatMessage'
  2781. inputs:
  2782. type: object
  2783. additionalProperties: true
  2784. billingContext:
  2785. $ref: '#/components/schemas/BillingContext'
  2786. AgentChatData:
  2787. type: object
  2788. properties:
  2789. conversationId:
  2790. type: string
  2791. messageId:
  2792. type: string
  2793. answer:
  2794. type: string
  2795. cards:
  2796. type: array
  2797. items:
  2798. $ref: '#/components/schemas/CardRef'
  2799. journeyState:
  2800. $ref: '#/components/schemas/JourneyState'
  2801. riskLevel:
  2802. type: string
  2803. enum:
  2804. - low
  2805. - medium
  2806. - high
  2807. - critical
  2808. - unknown
  2809. usage:
  2810. $ref: '#/components/schemas/UsageBrief'
  2811. CardRef:
  2812. type: object
  2813. properties:
  2814. cardInstanceId:
  2815. type: string
  2816. cardKey:
  2817. type: string
  2818. status:
  2819. type: string
  2820. UsageBrief:
  2821. type: object
  2822. properties:
  2823. meterEventId:
  2824. type: string
  2825. billingEpisodeId:
  2826. type: string
  2827. chargePolicy:
  2828. type: string
  2829. credits:
  2830. type: number
  2831. ApiResponseAgentChat:
  2832. allOf:
  2833. - $ref: '#/components/schemas/ApiResponse'
  2834. properties:
  2835. data:
  2836. $ref: '#/components/schemas/AgentChatData'
  2837. ConversationCreateRequest:
  2838. type: object
  2839. properties:
  2840. agentId:
  2841. type: string
  2842. user:
  2843. $ref: '#/components/schemas/UserContext'
  2844. deviceContext:
  2845. $ref: '#/components/schemas/DeviceContext'
  2846. title:
  2847. type: string
  2848. metadata:
  2849. type: object
  2850. additionalProperties: true
  2851. Conversation:
  2852. type: object
  2853. properties:
  2854. conversationId:
  2855. type: string
  2856. agentId:
  2857. type: string
  2858. title:
  2859. type: string
  2860. status:
  2861. type: string
  2862. enum:
  2863. - active
  2864. - closed
  2865. - archived
  2866. createdAt:
  2867. type: string
  2868. format: date-time
  2869. updatedAt:
  2870. type: string
  2871. format: date-time
  2872. ApiResponseConversation:
  2873. allOf:
  2874. - $ref: '#/components/schemas/ApiResponse'
  2875. properties:
  2876. data:
  2877. $ref: '#/components/schemas/Conversation'
  2878. ApiResponseConversationList:
  2879. allOf:
  2880. - $ref: '#/components/schemas/ApiResponse'
  2881. properties:
  2882. data:
  2883. type: object
  2884. properties:
  2885. items:
  2886. type: array
  2887. items:
  2888. $ref: '#/components/schemas/Conversation'
  2889. page:
  2890. $ref: '#/components/schemas/PageInfo'
  2891. ConversationMessage:
  2892. type: object
  2893. properties:
  2894. messageId:
  2895. type: string
  2896. role:
  2897. type: string
  2898. enum:
  2899. - user
  2900. - assistant
  2901. - system
  2902. - tool
  2903. content:
  2904. type: string
  2905. cards:
  2906. type: array
  2907. items:
  2908. $ref: '#/components/schemas/CardRef'
  2909. createdAt:
  2910. type: string
  2911. format: date-time
  2912. ApiResponseMessageList:
  2913. allOf:
  2914. - $ref: '#/components/schemas/ApiResponse'
  2915. properties:
  2916. data:
  2917. type: object
  2918. properties:
  2919. items:
  2920. type: array
  2921. items:
  2922. $ref: '#/components/schemas/ConversationMessage'
  2923. page:
  2924. $ref: '#/components/schemas/PageInfo'
  2925. FileUploadRequest:
  2926. type: object
  2927. required:
  2928. - file
  2929. properties:
  2930. file:
  2931. type: string
  2932. format: binary
  2933. purpose:
  2934. type: string
  2935. enum:
  2936. - tongue_diagnosis
  2937. - face_diagnosis
  2938. - report_interpretation
  2939. - medical_record
  2940. - audio_transcription
  2941. - other
  2942. user:
  2943. $ref: '#/components/schemas/UserContext'
  2944. deviceContext:
  2945. $ref: '#/components/schemas/DeviceContext'
  2946. metadata:
  2947. type: object
  2948. additionalProperties: true
  2949. clientFileId:
  2950. type: string
  2951. description: 厂商侧文件唯一 ID。同一文件重试上传时必须保持不变,推荐用于文件上传幂等。
  2952. sha256:
  2953. type: string
  2954. description: 文件 SHA-256 摘要。用于完整性校验、重复文件识别和审计。
  2955. source:
  2956. type: string
  2957. enum:
  2958. - patient_app
  2959. - self_service_kiosk
  2960. - robot
  2961. - four_diagnosis_device
  2962. - doctor_station
  2963. - ward_terminal
  2964. - third_party_system
  2965. description: 文件来源终端或系统。
  2966. retentionPolicy:
  2967. type: string
  2968. enum:
  2969. - transient
  2970. - episode
  2971. - medical_record
  2972. - audit_only
  2973. description: 文件保存策略。transient=临时分析;episode=本次就诊 episode 内保存;medical_record=进入病历或正式医疗材料;audit_only=只保留审计摘要。
  2974. description: 文件上传请求。正式联调推荐幂等键 projectId + partnerId + clientFileId;clientFileId 缺失时可降级使用 projectId + partnerId + sha256 + purpose + user.visitId。
  2975. FileMeta:
  2976. type: object
  2977. properties:
  2978. fileId:
  2979. type: string
  2980. fileType:
  2981. type: string
  2982. enum:
  2983. - image
  2984. - audio
  2985. - document
  2986. - other
  2987. mimeType:
  2988. type: string
  2989. sizeBytes:
  2990. type: integer
  2991. sha256:
  2992. type: string
  2993. status:
  2994. type: string
  2995. enum:
  2996. - uploaded
  2997. - scanning
  2998. - available
  2999. - blocked
  3000. - deleted
  3001. uploadedAt:
  3002. type: string
  3003. format: date-time
  3004. clientFileId:
  3005. type: string
  3006. purpose:
  3007. type: string
  3008. retentionPolicy:
  3009. type: string
  3010. enum:
  3011. - transient
  3012. - episode
  3013. - medical_record
  3014. - audit_only
  3015. source:
  3016. type: string
  3017. ApiResponseFileUpload:
  3018. allOf:
  3019. - $ref: '#/components/schemas/ApiResponse'
  3020. properties:
  3021. data:
  3022. $ref: '#/components/schemas/FileMeta'
  3023. ApiResponseFileMeta:
  3024. allOf:
  3025. - $ref: '#/components/schemas/ApiResponse'
  3026. properties:
  3027. data:
  3028. $ref: '#/components/schemas/FileMeta'
  3029. DeviceRegisterRequest:
  3030. type: object
  3031. required:
  3032. - deviceCode
  3033. - deviceType
  3034. - vendor
  3035. - model
  3036. - os
  3037. - clientVersion
  3038. properties:
  3039. deviceCode:
  3040. type: string
  3041. deviceType:
  3042. type: string
  3043. vendor:
  3044. type: string
  3045. model:
  3046. type: string
  3047. os:
  3048. type: string
  3049. enum:
  3050. - android
  3051. - harmony
  3052. - windows
  3053. - linux
  3054. - web
  3055. - unknown
  3056. clientVersion:
  3057. type: string
  3058. capabilities:
  3059. $ref: '#/components/schemas/DeviceCapabilities'
  3060. location:
  3061. $ref: '#/components/schemas/DeviceLocation'
  3062. DeviceCapabilities:
  3063. type: object
  3064. properties:
  3065. touch:
  3066. type: boolean
  3067. screen:
  3068. type: boolean
  3069. voiceInput:
  3070. type: boolean
  3071. voiceOutput:
  3072. type: boolean
  3073. camera:
  3074. type: boolean
  3075. qrScan:
  3076. type: boolean
  3077. idCardReader:
  3078. type: boolean
  3079. medicalCardReader:
  3080. type: boolean
  3081. printer:
  3082. type: boolean
  3083. navigation:
  3084. type: boolean
  3085. nearbyDetect:
  3086. type: boolean
  3087. DeviceLocation:
  3088. type: object
  3089. properties:
  3090. building:
  3091. type: string
  3092. floor:
  3093. type: string
  3094. area:
  3095. type: string
  3096. room:
  3097. type: string
  3098. bed:
  3099. type: string
  3100. locationCode:
  3101. type: string
  3102. DeviceRegisterData:
  3103. type: object
  3104. properties:
  3105. deviceId:
  3106. type: string
  3107. deviceSecret:
  3108. type: string
  3109. activateStatus:
  3110. type: string
  3111. description: 设备准入状态。activated 可进入核心业务,pending 待人工审批,rejected 已拒绝。
  3112. enum:
  3113. - activated
  3114. - pending
  3115. - rejected
  3116. admissionLevel:
  3117. type: string
  3118. description: 设备等级 A/B/C/D。
  3119. enum:
  3120. - A
  3121. - B
  3122. - C
  3123. - D
  3124. reason:
  3125. type: string
  3126. description: 当 activateStatus 为 pending 或 rejected 时,说明原因。
  3127. ApiResponseDeviceRegister:
  3128. allOf:
  3129. - $ref: '#/components/schemas/ApiResponse'
  3130. properties:
  3131. data:
  3132. $ref: '#/components/schemas/DeviceRegisterData'
  3133. DeviceHeartbeatRequest:
  3134. type: object
  3135. required:
  3136. - status
  3137. - clientVersion
  3138. properties:
  3139. status:
  3140. type: string
  3141. enum:
  3142. - online
  3143. - offline
  3144. - error
  3145. - maintenance
  3146. clientVersion:
  3147. type: string
  3148. ip:
  3149. type: string
  3150. currentSceneCode:
  3151. type: string
  3152. metrics:
  3153. type: object
  3154. additionalProperties: true
  3155. errors:
  3156. type: array
  3157. items:
  3158. $ref: '#/components/schemas/DeviceError'
  3159. DeviceError:
  3160. type: object
  3161. properties:
  3162. code:
  3163. type: string
  3164. message:
  3165. type: string
  3166. occurredAt:
  3167. type: string
  3168. format: date-time
  3169. DeviceHeartbeatData:
  3170. type: object
  3171. properties:
  3172. accepted:
  3173. type: boolean
  3174. serverTime:
  3175. type: string
  3176. format: date-time
  3177. nextHeartbeatSeconds:
  3178. type: integer
  3179. ApiResponseDeviceHeartbeat:
  3180. allOf:
  3181. - $ref: '#/components/schemas/ApiResponse'
  3182. properties:
  3183. data:
  3184. $ref: '#/components/schemas/DeviceHeartbeatData'
  3185. DeviceSceneData:
  3186. type: object
  3187. properties:
  3188. deviceId:
  3189. type: string
  3190. deviceType:
  3191. type: string
  3192. description: 设备类型 robot/self_service_kiosk/guide_screen 等。
  3193. sceneCode:
  3194. type: string
  3195. homeTemplate:
  3196. type: string
  3197. description: 首页 UI 模板标识。
  3198. defaultAgent:
  3199. type: string
  3200. description: 默认智能体代码。
  3201. allowedAgents:
  3202. type: array
  3203. items:
  3204. type: string
  3205. description: 该设备在当前场景下允许调用的智能体列表。
  3206. blockedIntents:
  3207. type: array
  3208. items:
  3209. type: string
  3210. description: 该设备在当前场景下被阻止的意图列表。
  3211. capabilities:
  3212. type: array
  3213. items:
  3214. type: string
  3215. description: 设备硬件能力列表(如 touch/camera/id_card_ocr/file_upload)。
  3216. perceptionCapabilities:
  3217. type: array
  3218. items:
  3219. type: string
  3220. enum:
  3221. - QR_IDENTITY_BINDING
  3222. - NFC_TOUCH
  3223. - CARD_READ
  3224. - BLE_ZONE_DETECT
  3225. - WIFI_ZONE_DETECT
  3226. - HARMONY_NEARBY
  3227. - MANUAL_CONFIRM
  3228. description: 该设备支持的感知能力。P0 推荐 QR/NFC/刷卡/人工确认,BLE/鸿蒙近场仅作为可选试点。
  3229. journeyPolicy:
  3230. type: object
  3231. description: 动线服务策略。用于终端决定是否展示动线区和服务找人入口,不能用于绕过后端权限。
  3232. properties:
  3233. mode:
  3234. type: string
  3235. enum:
  3236. - DISABLED
  3237. - MVP_STATIC
  3238. - SERVER_DERIVED
  3239. serviceFindPatientEnabled:
  3240. type: boolean
  3241. requiresPatientConfirm:
  3242. type: boolean
  3243. allowedCards:
  3244. type: array
  3245. items:
  3246. type: string
  3247. description: 该设备在当前场景下允许渲染的卡片类型列表。
  3248. ApiResponseDeviceScene:
  3249. allOf:
  3250. - $ref: '#/components/schemas/ApiResponse'
  3251. properties:
  3252. data:
  3253. $ref: '#/components/schemas/DeviceSceneData'
  3254. DeviceSceneUpdateRequest:
  3255. type: object
  3256. properties:
  3257. sceneCode:
  3258. type: string
  3259. homeTemplate:
  3260. type: string
  3261. description: 首页 UI 模板标识。
  3262. allowedAgents:
  3263. type: array
  3264. items:
  3265. type: string
  3266. description: 允许调用的智能体列表。
  3267. allowedCards:
  3268. type: array
  3269. items:
  3270. type: string
  3271. description: 允许渲染的卡片类型列表。
  3272. blockedIntents:
  3273. type: array
  3274. items:
  3275. type: string
  3276. description: 阻止的意图列表。
  3277. effectiveAt:
  3278. type: string
  3279. format: date-time
  3280. DeviceEventRequest:
  3281. type: object
  3282. required:
  3283. - eventId
  3284. - eventType
  3285. - occurredAt
  3286. properties:
  3287. eventId:
  3288. type: string
  3289. description: 设备端生成的唯一事件 ID。
  3290. eventType:
  3291. type: string
  3292. description: 设备事件类型。
  3293. enum:
  3294. - QR_SCANNED
  3295. - CARD_READ
  3296. - PRINT_COMPLETED
  3297. - PRINT_FAILED
  3298. - NEARBY_DETECTED
  3299. - NAVIGATION_STARTED
  3300. - NAVIGATION_COMPLETED
  3301. - DEVICE_ERROR
  3302. - TOUCH_INTERACTION
  3303. - CUSTOM
  3304. eventPayload:
  3305. type: object
  3306. additionalProperties: true
  3307. description: 事件附加数据。按 eventType 校验必要字段:QR_SCANNED 建议 qrType/visitId;CARD_READ 建议 cardType;NEARBY_DETECTED 建议 zoneCode/level;TOUCH_INTERACTION 建议 screen/action。未识别扩展字段只作为审计摘要,不直接触发高风险业务。
  3308. occurredAt:
  3309. type: string
  3310. format: date-time
  3311. traceId:
  3312. type: string
  3313. description: 可选链路追踪 ID。
  3314. DeviceCommand:
  3315. type: object
  3316. properties:
  3317. commandId:
  3318. type: string
  3319. commandType:
  3320. type: string
  3321. enum:
  3322. - show_page
  3323. - render_card
  3324. - play_tts
  3325. - start_navigation
  3326. - stop_navigation
  3327. - return_dock
  3328. - print_receipt
  3329. - refresh_scene
  3330. - upgrade_client
  3331. - custom
  3332. payload:
  3333. type: object
  3334. additionalProperties: true
  3335. expiresAt:
  3336. type: string
  3337. format: date-time
  3338. ApiResponseDeviceCommands:
  3339. allOf:
  3340. - $ref: '#/components/schemas/ApiResponse'
  3341. properties:
  3342. data:
  3343. type: object
  3344. properties:
  3345. commands:
  3346. type: array
  3347. items:
  3348. $ref: '#/components/schemas/DeviceCommand'
  3349. DeviceCommandAckRequest:
  3350. type: object
  3351. required:
  3352. - status
  3353. properties:
  3354. status:
  3355. type: string
  3356. enum:
  3357. - success
  3358. - failed
  3359. - processing
  3360. - rejected
  3361. message:
  3362. type: string
  3363. result:
  3364. type: object
  3365. additionalProperties: true
  3366. CardInstance:
  3367. type: object
  3368. properties:
  3369. cardInstanceId:
  3370. type: string
  3371. cardKey:
  3372. type: string
  3373. status:
  3374. type: string
  3375. enum:
  3376. - active
  3377. - submitted
  3378. - processing
  3379. - completed
  3380. - failed
  3381. - expired
  3382. - cancelled
  3383. renderPayload:
  3384. type: object
  3385. additionalProperties: true
  3386. actions:
  3387. type: array
  3388. items:
  3389. type: string
  3390. expiresAt:
  3391. type: string
  3392. format: date-time
  3393. ApiResponseCardInstance:
  3394. allOf:
  3395. - $ref: '#/components/schemas/ApiResponse'
  3396. properties:
  3397. data:
  3398. $ref: '#/components/schemas/CardInstance'
  3399. OperatorContext:
  3400. type: object
  3401. required:
  3402. - role
  3403. - externalUserId
  3404. properties:
  3405. role:
  3406. type: string
  3407. enum:
  3408. - patient
  3409. - doctor
  3410. - nurse
  3411. - admin
  3412. - system
  3413. externalUserId:
  3414. type: string
  3415. patientId:
  3416. type: string
  3417. doctorId:
  3418. type: string
  3419. nurseId:
  3420. type: string
  3421. CardActionRequest:
  3422. type: object
  3423. required:
  3424. - clientActionId
  3425. - operator
  3426. - deviceContext
  3427. - payload
  3428. properties:
  3429. clientActionId:
  3430. type: string
  3431. operator:
  3432. $ref: '#/components/schemas/OperatorContext'
  3433. deviceContext:
  3434. $ref: '#/components/schemas/DeviceContext'
  3435. payload:
  3436. type: object
  3437. additionalProperties: true
  3438. confirm:
  3439. type: boolean
  3440. billingContext:
  3441. $ref: '#/components/schemas/BillingContext'
  3442. CardActionData:
  3443. type: object
  3444. properties:
  3445. cardInstanceId:
  3446. type: string
  3447. actionName:
  3448. type: string
  3449. status:
  3450. type: string
  3451. enum:
  3452. - accepted
  3453. - processing
  3454. - completed
  3455. - failed
  3456. - duplicate
  3457. result:
  3458. type: object
  3459. additionalProperties: true
  3460. nextCard:
  3461. $ref: '#/components/schemas/CardRef'
  3462. ApiResponseCardAction:
  3463. allOf:
  3464. - $ref: '#/components/schemas/ApiResponse'
  3465. properties:
  3466. data:
  3467. $ref: '#/components/schemas/CardActionData'
  3468. ToolInvokeRequest:
  3469. type: object
  3470. required:
  3471. - toolCallId
  3472. - context
  3473. - input
  3474. properties:
  3475. toolCallId:
  3476. type: string
  3477. context:
  3478. $ref: '#/components/schemas/ToolContext'
  3479. input:
  3480. type: object
  3481. additionalProperties: true
  3482. billingContext:
  3483. $ref: '#/components/schemas/BillingContext'
  3484. riskLevel:
  3485. $ref: '#/components/schemas/ToolRiskLevel'
  3486. description: 受控工具调用请求。仅开放给医梦 MCP Tool Server、HIS/EMR/LIS/PACS/叫号/支付等受控适配方;普通设备厂商不得直接调用。写操作必须幂等,并按 riskLevel 执行确认、权限和审计策略。
  3487. ToolContext:
  3488. type: object
  3489. properties:
  3490. projectId:
  3491. type: string
  3492. user:
  3493. $ref: '#/components/schemas/UserContext'
  3494. deviceContext:
  3495. $ref: '#/components/schemas/DeviceContext'
  3496. cardInstanceId:
  3497. type: string
  3498. traceId:
  3499. type: string
  3500. ToolInvokeData:
  3501. type: object
  3502. properties:
  3503. toolCallId:
  3504. type: string
  3505. toolName:
  3506. type: string
  3507. status:
  3508. type: string
  3509. enum:
  3510. - success
  3511. - failed
  3512. - timeout
  3513. - forbidden
  3514. result:
  3515. type: object
  3516. additionalProperties: true
  3517. error:
  3518. $ref: '#/components/schemas/ErrorResponse'
  3519. ApiResponseToolInvoke:
  3520. allOf:
  3521. - $ref: '#/components/schemas/ApiResponse'
  3522. properties:
  3523. data:
  3524. $ref: '#/components/schemas/ToolInvokeData'
  3525. WebhookRegisterRequest:
  3526. type: object
  3527. required:
  3528. - url
  3529. - eventTypes
  3530. properties:
  3531. url:
  3532. type: string
  3533. format: uri
  3534. eventTypes:
  3535. type: array
  3536. items:
  3537. type: string
  3538. secret:
  3539. type: string
  3540. description:
  3541. type: string
  3542. WebhookData:
  3543. type: object
  3544. properties:
  3545. webhookId:
  3546. type: string
  3547. url:
  3548. type: string
  3549. eventTypes:
  3550. type: array
  3551. items:
  3552. type: string
  3553. status:
  3554. type: string
  3555. enum:
  3556. - active
  3557. - disabled
  3558. ApiResponseWebhook:
  3559. allOf:
  3560. - $ref: '#/components/schemas/ApiResponse'
  3561. properties:
  3562. data:
  3563. $ref: '#/components/schemas/WebhookData'
  3564. ApiResponseWebhookList:
  3565. allOf:
  3566. - $ref: '#/components/schemas/ApiResponse'
  3567. properties:
  3568. data:
  3569. type: object
  3570. properties:
  3571. items:
  3572. type: array
  3573. items:
  3574. $ref: '#/components/schemas/WebhookData'
  3575. page:
  3576. $ref: '#/components/schemas/PageInfo'
  3577. ExternalEventRequest:
  3578. type: object
  3579. required:
  3580. - eventId
  3581. - eventType
  3582. - occurredAt
  3583. - sourceSystem
  3584. properties:
  3585. eventId:
  3586. type: string
  3587. eventType:
  3588. type: string
  3589. sourceSystem:
  3590. type: string
  3591. occurredAt:
  3592. type: string
  3593. format: date-time
  3594. user:
  3595. $ref: '#/components/schemas/UserContext'
  3596. deviceContext:
  3597. $ref: '#/components/schemas/DeviceContext'
  3598. payload:
  3599. type: object
  3600. additionalProperties: true
  3601. ToolCatalogItem:
  3602. type: object
  3603. properties:
  3604. toolName:
  3605. type: string
  3606. toolType:
  3607. type: string
  3608. enum:
  3609. - read
  3610. - write
  3611. description:
  3612. type: string
  3613. inputSchema:
  3614. type: object
  3615. additionalProperties: true
  3616. outputSchema:
  3617. type: object
  3618. additionalProperties: true
  3619. riskLevel:
  3620. $ref: '#/components/schemas/ToolRiskLevel'
  3621. ApiResponseToolCatalog:
  3622. allOf:
  3623. - $ref: '#/components/schemas/ApiResponse'
  3624. properties:
  3625. data:
  3626. type: object
  3627. properties:
  3628. tools:
  3629. type: array
  3630. items:
  3631. $ref: '#/components/schemas/ToolCatalogItem'
  3632. UsageSummaryData:
  3633. type: object
  3634. properties:
  3635. from:
  3636. type: string
  3637. format: date
  3638. to:
  3639. type: string
  3640. format: date
  3641. groupBy:
  3642. type: string
  3643. items:
  3644. type: array
  3645. items:
  3646. type: object
  3647. additionalProperties: true
  3648. ApiResponseUsageSummary:
  3649. allOf:
  3650. - $ref: '#/components/schemas/ApiResponse'
  3651. properties:
  3652. data:
  3653. $ref: '#/components/schemas/UsageSummaryData'
  3654. MeterEvent:
  3655. type: object
  3656. properties:
  3657. meterEventId:
  3658. type: string
  3659. billingEpisodeId:
  3660. type: string
  3661. projectId:
  3662. type: string
  3663. partnerId:
  3664. type: string
  3665. agentId:
  3666. type: string
  3667. deviceId:
  3668. type: string
  3669. scenarioCode:
  3670. type: string
  3671. sourceType:
  3672. type: string
  3673. enum:
  3674. - openplatform
  3675. - dify
  3676. - mcp
  3677. - card
  3678. - device
  3679. - file
  3680. - webhook
  3681. sourceId:
  3682. type: string
  3683. meterItem:
  3684. type: string
  3685. rawQuantity:
  3686. type: number
  3687. credits:
  3688. type: number
  3689. chargePolicy:
  3690. type: string
  3691. enum:
  3692. - customer_charge
  3693. - license_covered
  3694. - bundle_included
  3695. - internal_cost
  3696. - no_charge
  3697. status:
  3698. type: string
  3699. enum:
  3700. - pending
  3701. - settled
  3702. - reversed
  3703. - failed
  3704. occurredAt:
  3705. type: string
  3706. format: date-time
  3707. ApiResponseMeterEvents:
  3708. allOf:
  3709. - $ref: '#/components/schemas/ApiResponse'
  3710. properties:
  3711. data:
  3712. type: object
  3713. properties:
  3714. items:
  3715. type: array
  3716. items:
  3717. $ref: '#/components/schemas/MeterEvent'
  3718. page:
  3719. $ref: '#/components/schemas/PageInfo'
  3720. DeviceLicense:
  3721. type: object
  3722. properties:
  3723. deviceId:
  3724. type: string
  3725. licenseStatus:
  3726. type: string
  3727. enum:
  3728. - active
  3729. - expired
  3730. - suspended
  3731. - not_bound
  3732. licenseType:
  3733. type: string
  3734. validTo:
  3735. type: string
  3736. format: date
  3737. ApiResponseDeviceLicenses:
  3738. allOf:
  3739. - $ref: '#/components/schemas/ApiResponse'
  3740. properties:
  3741. data:
  3742. type: object
  3743. properties:
  3744. items:
  3745. type: array
  3746. items:
  3747. $ref: '#/components/schemas/DeviceLicense'
  3748. page:
  3749. $ref: '#/components/schemas/PageInfo'
  3750. AgentSummary:
  3751. type: object
  3752. properties:
  3753. agentId:
  3754. type: string
  3755. name:
  3756. type: string
  3757. scenarioCode:
  3758. type: string
  3759. status:
  3760. type: string
  3761. ApiResponseAgentList:
  3762. allOf:
  3763. - $ref: '#/components/schemas/ApiResponse'
  3764. properties:
  3765. data:
  3766. type: object
  3767. properties:
  3768. items:
  3769. type: array
  3770. items:
  3771. $ref: '#/components/schemas/AgentSummary'
  3772. AgentDetail:
  3773. allOf:
  3774. - $ref: '#/components/schemas/AgentSummary'
  3775. properties:
  3776. description:
  3777. type: string
  3778. supportedMessageTypes:
  3779. type: array
  3780. items:
  3781. type: string
  3782. supportedCards:
  3783. type: array
  3784. items:
  3785. type: string
  3786. ApiResponseAgentDetail:
  3787. allOf:
  3788. - $ref: '#/components/schemas/ApiResponse'
  3789. properties:
  3790. data:
  3791. $ref: '#/components/schemas/AgentDetail'
  3792. DeviceDetail:
  3793. type: object
  3794. properties:
  3795. deviceId:
  3796. type: string
  3797. deviceCode:
  3798. type: string
  3799. deviceType:
  3800. type: string
  3801. vendor:
  3802. type: string
  3803. model:
  3804. type: string
  3805. location:
  3806. $ref: '#/components/schemas/DeviceLocation'
  3807. capabilities:
  3808. $ref: '#/components/schemas/DeviceCapabilities'
  3809. status:
  3810. type: string
  3811. clientVersion:
  3812. type: string
  3813. lastHeartbeat:
  3814. type: string
  3815. format: date-time
  3816. ApiResponseDeviceDetail:
  3817. allOf:
  3818. - $ref: '#/components/schemas/ApiResponse'
  3819. properties:
  3820. data:
  3821. $ref: '#/components/schemas/DeviceDetail'
  3822. ApiResponseDeviceList:
  3823. allOf:
  3824. - $ref: '#/components/schemas/ApiResponse'
  3825. properties:
  3826. data:
  3827. type: object
  3828. properties:
  3829. items:
  3830. type: array
  3831. items:
  3832. $ref: '#/components/schemas/DeviceDetail'
  3833. page:
  3834. $ref: '#/components/schemas/PageInfo'
  3835. ApiResponseDeviceEventList:
  3836. allOf:
  3837. - $ref: '#/components/schemas/ApiResponse'
  3838. properties:
  3839. data:
  3840. type: object
  3841. properties:
  3842. items:
  3843. type: array
  3844. items:
  3845. $ref: '#/components/schemas/DeviceEventRequest'
  3846. page:
  3847. $ref: '#/components/schemas/PageInfo'
  3848. PageInfo:
  3849. type: object
  3850. properties:
  3851. page:
  3852. type: integer
  3853. pageSize:
  3854. type: integer
  3855. total:
  3856. type: integer
  3857. PartnerCreateRequest:
  3858. type: object
  3859. properties:
  3860. partnerName:
  3861. type: string
  3862. partnerType:
  3863. type: string
  3864. scopes:
  3865. type: array
  3866. items:
  3867. type: string
  3868. CreditFreezeRequest:
  3869. type: object
  3870. properties:
  3871. sourceEventId:
  3872. type: string
  3873. credits:
  3874. type: number
  3875. reason:
  3876. type: string
  3877. CreditSettleRequest:
  3878. type: object
  3879. properties:
  3880. freezeId:
  3881. type: string
  3882. meterEventId:
  3883. type: string
  3884. actualCredits:
  3885. type: number
  3886. ToolRiskLevel:
  3887. type: string
  3888. enum:
  3889. - L1_QUERY
  3890. - L2_SENSITIVE_READ
  3891. - L3_BUSINESS_WRITE
  3892. - L4_FINANCIAL_ACTION
  3893. - L5_MEDICAL_WRITE
  3894. description: 工具风险等级。L1 查询、L2 敏感查询、L3 业务写入、L4 财务动作、L5 医疗正式写入。
  3895. x-emoon-api-version: 2026-05-29-v1.2
  3896. x-emoon-document-status: 正式联调基准版