2 Star 9 Fork 4

ThingsPanel/thingspanel-mcp

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
ThingsPanel-1.0.0.openapi.json 109.43 KB
一键复制 编辑 原始数据 按行查看 历史
hezhuozhuo 提交于 2025-03-19 17:38 +08:00 . Fix: mcp v0.1.0
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135
{
"openapi": "3.0.1",
"info": {
"title": "ThingsPanel-1.0.0",
"description": "",
"version": "1.0.0"
},
"tags": [
{
"name": "个人信息管理"
},
{
"name": "看板"
},
{
"name": "设备管理"
},
{
"name": "遥测数据"
},
{
"name": "属性数据"
},
{
"name": "命令下发"
}
],
"paths": {
"/api/v1/user/detail": {
"get": {
"summary": "个人信息查看接口",
"deprecated": true,
"description": "该接口用于查看个人信息。",
"tags": [
"个人信息管理"
],
"parameters": [
{
"name": "x-token",
"in": "header",
"description": "",
"example": "{{x-token}}",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {}
}
}
},
"headers": {},
"x-apifox-name": "查看个人信息成功"
}
},
"security": [],
"x-apifox-folder": "个人信息管理",
"x-apifox-status": "deprecated",
"x-run-in-apifox": "https://app.apifox.com/web/project/3928900/apis/api-142798248-run"
}
},
"/api/v1/user/tenant/id": {
"get": {
"summary": "获取租户ID",
"deprecated": false,
"description": "",
"tags": [],
"parameters": [
{
"name": "x-token",
"in": "header",
"description": "",
"example": "{{x-token}}",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"message": {
"type": "string"
},
"data": {
"type": "string"
}
},
"required": [
"code",
"message",
"data"
],
"x-apifox-ignore-properties": [],
"x-apifox-orders": [
"code",
"message",
"data"
]
},
"examples": {
"1": {
"summary": "成功示例",
"description": "",
"value": {
"code": 200,
"message": "操作成功",
"data": "63a4b529"
}
}
}
}
},
"headers": {},
"x-apifox-name": "成功"
}
},
"security": [],
"x-apifox-folder": "个人信息管理",
"x-apifox-status": "developing",
"x-run-in-apifox": "https://app.apifox.com/web/project/3928900/apis/api-270081060-run"
}
},
"/api/v1/board/tenant": {
"get": {
"summary": "租户信息",
"deprecated": false,
"description": "租户总数&昨日新增&本月新增&月历史数据",
"tags": [
"看板"
],
"parameters": [
{
"name": "x-token",
"in": "header",
"description": "",
"example": "{{x-token}}",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"allOf": [
{
"type": "object",
"properties": {}
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/model.GetTenantRes"
}
},
"x-apifox-orders": [
"data"
],
"x-apifox-ignore-properties": []
}
]
},
"examples": {
"1": {
"summary": "成功示例",
"value": {
"code": 200,
"message": "Get message successfully!",
"data": {
"user_total": 16,
"user_added_yesterday": 0,
"user_added_month": 1,
"user_list_month": [
{
"mon": 2,
"num": 13
},
{
"mon": 3,
"num": 1
}
]
}
}
}
}
}
},
"headers": {},
"x-apifox-name": "获取信息成功"
}
},
"security": [],
"x-apifox-folder": "【租户】可视化/看板/图表接口",
"x-apifox-status": "released",
"x-run-in-apifox": "https://app.apifox.com/web/project/3928900/apis/api-152176494-run"
}
},
"/api/v1/board/tenant/device/info": {
"get": {
"summary": "租户下设备信息",
"deprecated": false,
"description": "租户下设备总数&on",
"tags": [
"看板"
],
"parameters": [
{
"name": "x-token",
"in": "header",
"description": "",
"example": "{{x-token}}",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"allOf": [
{
"type": "object",
"properties": {}
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/model.GetBoardDeviceRes"
}
},
"x-apifox-orders": [
"data"
],
"x-apifox-ignore-properties": []
}
]
},
"examples": {
"1": {
"summary": "成功示例",
"value": {
"code": 200,
"message": "Get board list successfully",
"data": {
"device_total": 34,
"device_on": 0,
"device_activity": 3
}
}
}
}
}
},
"headers": {},
"x-apifox-name": "请求成功"
}
},
"security": [],
"x-apifox-folder": "【租户】可视化/看板/图表接口",
"x-apifox-status": "released",
"x-run-in-apifox": "https://app.apifox.com/web/project/3928900/apis/api-152176495-run"
}
},
"/api/v1/board/tenant/device/activity/info": {
"get": {
"summary": "租户下设备活跃信息",
"deprecated": true,
"description": "",
"tags": [
"看板"
],
"parameters": [
{
"name": "x-token",
"in": "header",
"description": "",
"example": "{{x-token}}",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"message": {
"type": "string"
},
"data": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "id"
},
"device_nums": {
"type": "integer",
"description": "设备总数"
},
"device_on": {
"type": "integer",
"description": "设备在线数"
},
"created_at": {
"type": "string",
"description": "创建时间"
},
"tenant_id": {
"type": "string",
"description": "租户id"
}
},
"required": [
"id",
"device_nums",
"device_on",
"created_at",
"tenant_id"
],
"x-apifox-orders": [
"id",
"device_nums",
"device_on",
"created_at",
"tenant_id"
],
"x-apifox-ignore-properties": []
}
}
},
"required": [
"code",
"message",
"data"
],
"x-apifox-orders": [
"code",
"message",
"data"
],
"x-apifox-ignore-properties": []
}
}
},
"headers": {},
"x-apifox-name": "请求成功"
},
"400": {
"description": "",
"content": {
"application/json": {
"schema": {
"allOf": [
{
"type": "object",
"properties": {}
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/model.GetBoardDeviceRes"
}
},
"x-apifox-orders": [
"data"
],
"x-apifox-ignore-properties": []
}
]
}
}
},
"headers": {},
"x-apifox-name": "无效的请求数据"
},
"500": {
"description": "",
"content": {
"application/json": {
"schema": {
"allOf": [
{
"type": "object",
"properties": {}
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/model.GetBoardDeviceRes"
}
},
"x-apifox-orders": [
"data"
],
"x-apifox-ignore-properties": []
}
]
}
}
},
"headers": {},
"x-apifox-name": "服务器内部错误"
}
},
"security": [],
"x-apifox-folder": "【租户】可视化/看板/图表接口",
"x-apifox-status": "deprecated",
"x-run-in-apifox": "https://app.apifox.com/web/project/3928900/apis/api-159343567-run"
}
},
"/api/v1/telemetry/datas/msg/count": {
"get": {
"summary": "获取租户大致消息数量",
"deprecated": false,
"description": "",
"tags": [],
"parameters": [
{
"name": "x-token",
"in": "header",
"description": "",
"example": "{{x-token}}",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"message": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"msg": {
"type": "integer"
}
},
"required": [
"msg"
],
"x-apifox-ignore-properties": [],
"x-apifox-orders": [
"msg"
]
}
},
"required": [
"code",
"message",
"data"
],
"x-apifox-ignore-properties": [],
"x-apifox-orders": [
"code",
"message",
"data"
]
}
}
},
"headers": {},
"x-apifox-name": "成功"
}
},
"security": [],
"x-apifox-folder": "【租户】可视化/看板/图表接口",
"x-apifox-status": "developing",
"x-run-in-apifox": "https://app.apifox.com/web/project/3928900/apis/api-180626231-run"
}
},
"/api/v1/board/trend": {
"get": {
"summary": "租户下设备在线离线趋势查询",
"deprecated": false,
"description": "租户下已激活设备的24小时在线离线趋势统计",
"tags": [],
"parameters": [
{
"name": "tenant_id",
"in": "query",
"description": "",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "x-token",
"in": "header",
"description": "",
"example": "{{x-token}}",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"message": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"points": {
"type": "array",
"items": {
"type": "object",
"properties": {
"timestamp": {
"type": "string"
},
"device_total": {
"type": "integer"
},
"device_online": {
"type": "integer"
},
"device_offline": {
"type": "integer"
}
},
"required": [
"timestamp",
"device_total",
"device_online",
"device_offline"
],
"x-apifox-ignore-properties": [],
"x-apifox-orders": [
"timestamp",
"device_total",
"device_online",
"device_offline"
]
}
}
},
"required": [
"points"
],
"x-apifox-ignore-properties": [],
"x-apifox-orders": [
"points"
]
}
},
"required": [
"code",
"message",
"data"
],
"x-apifox-ignore-properties": [],
"x-apifox-orders": [
"code",
"message",
"data"
]
},
"examples": {
"1": {
"summary": "成功示例",
"value": {
"code": 200,
"message": "操作成功",
"data": {
"points": [
{
"timestamp": "2025-02-23T11:00:00.003440717+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
},
{
"timestamp": "2025-02-23T12:00:00.004090059+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
},
{
"timestamp": "2025-02-23T13:00:00.00383393+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
},
{
"timestamp": "2025-02-23T14:00:00.00402364+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
},
{
"timestamp": "2025-02-23T15:00:00.004769211+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
},
{
"timestamp": "2025-02-23T16:00:00.004735571+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
},
{
"timestamp": "2025-02-23T17:00:00.004906737+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
},
{
"timestamp": "2025-02-23T18:00:00.005569004+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
},
{
"timestamp": "2025-02-23T19:00:00.007165295+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
},
{
"timestamp": "2025-02-23T20:00:00.004783272+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
},
{
"timestamp": "2025-02-23T21:00:00.011679245+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
},
{
"timestamp": "2025-02-23T22:00:00.004242989+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
},
{
"timestamp": "2025-02-23T23:00:00.005443453+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
},
{
"timestamp": "2025-02-24T00:00:00.006367481+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
},
{
"timestamp": "2025-02-24T01:00:00.004047403+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
},
{
"timestamp": "2025-02-24T02:00:00.004629344+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
},
{
"timestamp": "2025-02-24T03:00:00.003309673+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
},
{
"timestamp": "2025-02-24T04:00:00.004381009+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
},
{
"timestamp": "2025-02-24T05:00:00.005423937+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
},
{
"timestamp": "2025-02-24T06:00:00.004845785+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
},
{
"timestamp": "2025-02-24T07:00:00.003825451+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
},
{
"timestamp": "2025-02-24T08:00:00.004257565+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
},
{
"timestamp": "2025-02-24T09:00:00.003826976+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
},
{
"timestamp": "2025-02-24T10:00:00.003894123+08:00",
"device_total": 84,
"device_online": 3,
"device_offline": 81
}
]
}
}
}
}
}
},
"headers": {},
"x-apifox-name": "成功"
}
},
"security": [],
"x-apifox-folder": "【租户】可视化/看板/图表接口",
"x-apifox-status": "developing",
"x-run-in-apifox": "https://app.apifox.com/web/project/3928900/apis/api-262109784-run"
}
},
"/api/v1/device/detail/{id}": {
"get": {
"summary": "设备详情✅",
"deprecated": false,
"description": "设备详情",
"tags": [
"设备管理"
],
"parameters": [
{
"name": "id",
"in": "path",
"description": "设备ID",
"required": true,
"example": "5fd9b168-9e2a-d91c-a7c3-9c1f4d4b5137",
"schema": {
"type": "string"
}
},
{
"name": "x-token",
"in": "header",
"description": "",
"example": "{{x-token}}",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"message": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"voucher": {
"type": "string",
"title": "凭证"
},
"tenant_id": {
"type": "string"
},
"is_enabled": {
"type": "string",
"title": "启用/禁用",
"description": "enabled-启用 disabled-禁用 默认禁用,激活后默认启用"
},
"activate_flag": {
"type": "string",
"title": "激活标志",
"description": "inactive-未激活 active-已激活"
},
"created_at": {
"type": "string"
},
"update_at": {
"type": "string"
},
"device_number": {
"type": "string",
"title": "设备编号"
},
"product_id": {
"type": "null"
},
"parent_id": {
"type": "null"
},
"label": {
"type": "string",
"title": "标签",
"description": "单标签,英文逗号隔开"
},
"location": {
"type": "null"
},
"sub_device_addr": {
"type": "null"
},
"current_version": {
"type": "null"
},
"additional_info": {
"type": "string",
"title": "附件信息",
"description": "json字符串"
},
"protocol_config": {
"type": "string",
"title": "协议插件设备配置",
"description": "协议插件相关的设备配置"
},
"remark1": {
"type": "null"
},
"remark2": {
"type": "null"
},
"remark3": {
"type": "null"
},
"device_config_id": {
"type": "string",
"title": "设备配置id"
},
"batch_number": {
"type": "null"
},
"activate_at": {
"type": "null",
"title": "激活时间"
},
"is_online": {
"type": "integer",
"description": "1-在线 0-离线",
"title": "是否在线"
},
"device_config_name": {
"type": "string",
"title": "设备配置名称"
},
"access_way": {
"type": "string"
},
"device_config": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"device_template_id": {
"type": "string"
},
"device_type": {
"type": "string"
},
"protocol_type": {
"type": "string"
},
"voucher_type": {
"type": "string"
},
"protocol_config": {
"type": "null"
},
"device_conn_type": {
"type": "null"
},
"additional_info": {
"type": "string"
},
"description": {
"type": "null"
},
"tenant_id": {
"type": "string"
},
"created_at": {
"type": "string"
},
"updated_at": {
"type": "string"
},
"remark": {
"type": "null"
}
},
"required": [
"id",
"name",
"device_template_id",
"device_type",
"protocol_type",
"voucher_type",
"protocol_config",
"device_conn_type",
"additional_info",
"description",
"tenant_id",
"created_at",
"updated_at",
"remark"
],
"x-apifox-orders": [
"id",
"name",
"device_template_id",
"device_type",
"protocol_type",
"voucher_type",
"protocol_config",
"device_conn_type",
"additional_info",
"description",
"tenant_id",
"created_at",
"updated_at",
"remark"
],
"x-apifox-ignore-properties": []
},
"protocol": {
"type": "null"
}
},
"required": [
"access_way",
"activate_at",
"activate_flag",
"additional_info",
"batch_number",
"created_at",
"current_version",
"device_config",
"device_config_id",
"device_config_name",
"device_number",
"id",
"is_enabled",
"is_online",
"label",
"location",
"name",
"parent_id",
"product_id",
"protocol",
"protocol_config",
"remark1",
"remark2",
"remark3",
"sub_device_addr",
"tenant_id",
"update_at",
"voucher"
],
"x-apifox-orders": [
"id",
"name",
"voucher",
"tenant_id",
"is_enabled",
"activate_flag",
"created_at",
"update_at",
"device_number",
"product_id",
"parent_id",
"label",
"location",
"sub_device_addr",
"current_version",
"additional_info",
"protocol_config",
"remark1",
"remark2",
"remark3",
"device_config_id",
"batch_number",
"activate_at",
"is_online",
"device_config_name",
"access_way",
"device_config",
"protocol"
],
"x-apifox-ignore-properties": []
}
},
"required": [
"code",
"message",
"data"
],
"x-apifox-orders": [
"code",
"message",
"data"
],
"x-apifox-ignore-properties": []
},
"examples": {
"1": {
"summary": "成功示例",
"value": {
"code": 200,
"message": "GetDevice successfully",
"data": {
"access_way": "A",
"activate_at": null,
"activate_flag": "",
"additional_info": "{}",
"batch_number": null,
"created_at": "2024-04-01T08:37:39.055041Z",
"current_version": null,
"device_config": {
"id": "e79f54b9-a117-1ce2-734a-3db1f6170d8b",
"name": "sensor1",
"device_template_id": "d670a256-090e-2a7c-fab7-f8e14eebe204",
"device_type": "1",
"protocol_type": "MQTT",
"voucher_type": "ACCESSTOKEN",
"protocol_config": null,
"device_conn_type": null,
"additional_info": "{}",
"description": null,
"tenant_id": "f2c67e1a",
"created_at": "2024-04-01T09:06:59.471498Z",
"updated_at": "2024-04-03T01:15:37.194231Z",
"remark": null
},
"device_config_id": "e79f54b9-a117-1ce2-734a-3db1f6170d8b",
"device_config_name": "sensor1",
"device_number": "5fd9b168-9e2a-d91c-a7c3-9c1f4d4b5137",
"id": "5fd9b168-9e2a-d91c-a7c3-9c1f4d4b5137",
"is_enabled": "",
"is_online": 0,
"label": "",
"location": null,
"name": "sensor1",
"parent_id": null,
"product_id": null,
"protocol": null,
"protocol_config": "{}",
"remark1": null,
"remark2": null,
"remark3": null,
"sub_device_addr": null,
"tenant_id": "f2c67e1a",
"update_at": "2024-04-01T08:37:39.055041Z",
"voucher": "{\"username\":\"sensor1\"}"
}
}
}
}
}
},
"headers": {},
"x-apifox-name": "成功"
}
},
"security": [],
"x-apifox-folder": "设备管理",
"x-apifox-status": "released",
"x-run-in-apifox": "https://app.apifox.com/web/project/3928900/apis/api-152176516-run"
}
},
"/api/v1/device": {
"get": {
"summary": "设备列表分页查询✅",
"deprecated": false,
"description": "分页查询设备\n产品预注册列表查询product_id必输",
"tags": [
"设备管理"
],
"parameters": [
{
"name": "activate_flag",
"in": "query",
"description": "激活状态(inactive-未激活 active-已激活)",
"required": false,
"example": "",
"schema": {
"type": "string"
}
},
{
"name": "current_version",
"in": "query",
"description": "当前版本",
"required": false,
"example": "",
"schema": {
"type": "string"
}
},
{
"name": "device_config_id",
"in": "query",
"description": "设备配置ID",
"required": false,
"example": "",
"schema": {
"type": "string"
}
},
{
"name": "device_number",
"in": "query",
"description": "设备编号",
"required": false,
"example": "",
"schema": {
"type": "string"
}
},
{
"name": "device_type",
"in": "query",
"description": "设备类型 1-直连设备 2-网关设备3-网关子设备",
"required": false,
"example": ",",
"schema": {
"type": "string"
}
},
{
"name": "group_id",
"in": "query",
"description": "组id",
"required": false,
"example": "",
"schema": {
"type": "string"
}
},
{
"name": "is_enabled",
"in": "query",
"description": "是否启用(enabled-启用 disabled-禁用 默认禁用,激活后默认启用)",
"required": false,
"example": "",
"schema": {
"type": "string"
}
},
{
"name": "label",
"in": "query",
"description": "标签",
"required": false,
"example": "",
"schema": {
"type": "string"
}
},
{
"name": "name",
"in": "query",
"description": "设备名称",
"required": false,
"example": "",
"schema": {
"type": "string"
}
},
{
"name": "page",
"in": "query",
"description": "页码",
"required": true,
"example": 0,
"schema": {
"type": "integer"
}
},
{
"name": "page_size",
"in": "query",
"description": "每页数量",
"required": true,
"example": 0,
"schema": {
"type": "integer"
}
},
{
"name": "product_id",
"in": "query",
"description": "产品ID",
"required": false,
"example": "",
"schema": {
"type": "string"
}
},
{
"name": "search",
"in": "query",
"description": "设备名称或编号模糊匹配",
"required": false,
"example": "",
"schema": {
"type": "string"
}
},
{
"name": "warn_status",
"in": "query",
"description": "告警状态 Y-告警 N未告警",
"required": false,
"example": "",
"schema": {
"type": "string"
}
},
{
"name": "is_online",
"in": "query",
"description": "在线状态1-在线 0-在线",
"required": false,
"example": 0,
"schema": {
"type": "integer"
}
},
{
"name": "access_way",
"in": "query",
"description": "接入方式 A-协议接入 B-服务接入",
"required": false,
"example": "",
"schema": {
"type": "string"
}
},
{
"name": "batch_number",
"in": "query",
"description": "批次编号",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "protocol_type",
"in": "query",
"description": "协议类型",
"required": false,
"example": "",
"schema": {
"type": "string"
}
},
{
"name": "service_identifier",
"in": "query",
"description": "服务/协议标识符",
"required": false,
"example": "",
"schema": {
"type": "string"
}
},
{
"name": "service_access_id",
"in": "query",
"description": "服务接入点ID",
"required": false,
"example": "",
"schema": {
"type": "string"
}
},
{
"name": "x-token",
"in": "header",
"description": "",
"example": "{{x-token}}",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"message": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"list": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"device_number": {
"type": "string",
"title": "设备编号"
},
"name": {
"type": "string",
"title": "设备名称"
},
"device_config_id": {
"type": "string",
"title": "设备配置id"
},
"device_config_name": {
"type": "string",
"title": "设备配置名称",
"description": "web端的(通过服务/协议)"
},
"ts": {
"type": "string",
"title": "上次遥测上报时间",
"description": "如:2024-03-05T12:55:48.698934Z"
},
"activate_flag": {
"type": "string",
"title": "激活标志",
"description": "inactive-未激活 active-已激活"
},
"activate_at": {
"type": "string",
"title": "激活日期",
"description": "如:2024-03-05T12:55:48.698934Z"
},
"batch_number": {
"type": "string",
"title": "批次编号"
},
"current_version": {
"type": "string",
"title": "当前固件版本"
},
"created_at": {
"type": "string",
"title": "创建时间",
"description": "如:2024-03-05T12:55:48.698934Z"
},
"is_online": {
"type": "string",
"title": "在线状态",
"description": "1-在线 0-在线"
},
"access_way": {
"type": "string",
"description": "A-通过协议 B通过服",
"title": "接入方式"
},
"warn_status": {
"type": "string",
"title": "告警状态",
"description": "Y-告警 N未告警"
},
"location": {
"type": "string",
"title": "位置(经度在前)",
"description": "119.078597,31.139775"
},
"protocol_type": {
"type": "string",
"title": "协议类型"
}
},
"required": [
"id",
"device_number",
"name",
"device_config_id",
"ts",
"activate_flag",
"activate_at",
"batch_number",
"current_version",
"created_at",
"is_online",
"access_way",
"warn_status",
"location"
],
"x-apifox-orders": [
"id",
"device_number",
"name",
"device_config_id",
"device_config_name",
"ts",
"activate_flag",
"activate_at",
"batch_number",
"current_version",
"created_at",
"is_online",
"access_way",
"warn_status",
"location",
"protocol_type"
],
"x-apifox-ignore-properties": []
}
},
"total": {
"type": "string"
}
},
"required": [
"list",
"total"
],
"x-apifox-orders": [
"list",
"total"
],
"x-apifox-ignore-properties": []
}
},
"required": [
"code",
"message",
"data"
],
"x-apifox-orders": [
"code",
"message",
"data"
],
"x-apifox-ignore-properties": []
},
"examples": {
"1": {
"summary": "成功示例",
"value": {
"code": 200,
"message": "Get product successfully",
"data": {
"list": [
{
"id": "aecde324-a6f7-e70d-c30a-cf3e532fc832",
"device_number": "0001-0002",
"name": "aecde324-a6f7-e70d-c30a-cf3e532fc832",
"device_config_id": "",
"device_config_name": "",
"ts": null,
"activate_flag": "N",
"activate_at": null,
"batch_number": "0001",
"current_version": "0.1",
"created_at": "2024-03-05T15:40:10.019767Z"
},
{
"id": "0528fc8e-c0d7-bfa4-c34f-a75829f753a0",
"device_number": "0001-0001",
"name": "0528fc8e-c0d7-bfa4-c34f-a75829f753a0",
"device_config_id": "",
"device_config_name": "",
"ts": null,
"activate_flag": "N",
"activate_at": null,
"batch_number": "0001",
"current_version": "0.1",
"created_at": "2024-03-05T15:40:10.019767Z"
}
],
"total": 2
}
}
}
}
}
},
"headers": {},
"x-apifox-name": "成功-自动创建"
}
},
"security": [],
"x-apifox-folder": "设备管理",
"x-apifox-status": "released",
"x-run-in-apifox": "https://app.apifox.com/web/project/3928900/apis/api-152176517-run"
}
},
"/api/v1/device/check/{deviceNumber}": {
"get": {
"summary": "编号校验✅",
"deprecated": false,
"description": "编号校验",
"tags": [
"设备管理"
],
"parameters": [
{
"name": "deviceNumber",
"in": "path",
"description": "设备编号",
"required": true,
"example": "",
"schema": {
"type": "string"
}
},
{
"name": "x-token",
"in": "header",
"description": "",
"example": "{{x-token}}",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"message": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"is_available": {
"type": "boolean",
"title": "是否可用",
"description": "true可用"
}
},
"required": [
"is_available"
],
"x-apifox-orders": [
"is_available"
],
"x-apifox-ignore-properties": []
}
},
"required": [
"code",
"message",
"data"
],
"x-apifox-orders": [
"code",
"message",
"data"
],
"x-apifox-ignore-properties": []
},
"examples": {
"1": {
"summary": "成功示例",
"value": {
"code": 200,
"message": "设备编号可用",
"data": {
"is_available": true
}
}
}
}
}
},
"headers": {},
"x-apifox-name": "成功"
}
},
"security": [],
"x-apifox-folder": "设备管理",
"x-apifox-status": "released",
"x-run-in-apifox": "https://app.apifox.com/web/project/3928900/apis/api-152176521-run"
}
},
"/api/v1/device/online/status/{id}": {
"get": {
"summary": "设备在线离线状态查询接口",
"deprecated": false,
"description": "",
"tags": [],
"parameters": [
{
"name": "id",
"in": "path",
"description": "",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "x-token",
"in": "header",
"description": "",
"example": "{{x-token}}",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"message": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"is_online": {
"type": "integer"
},
"device_status": {
"type": "integer",
"title": "1在线 0离线"
}
},
"required": [
"is_online",
"device_status"
],
"x-apifox-orders": [
"is_online",
"device_status"
],
"x-apifox-ignore-properties": []
}
},
"required": [
"code",
"message",
"data"
],
"x-apifox-orders": [
"code",
"message",
"data"
],
"x-apifox-ignore-properties": []
},
"examples": {
"1": {
"summary": "成功示例",
"value": {
"code": 200,
"message": "success",
"data": {
"is_online": 0,
"device_status": 1
}
}
}
}
}
},
"headers": {},
"x-apifox-name": "成功"
}
},
"security": [],
"x-apifox-folder": "设备管理",
"x-apifox-status": "developing",
"x-run-in-apifox": "https://app.apifox.com/web/project/3928900/apis/api-167983829-run"
}
},
"/api/v1/telemetry/datas/pub": {
"post": {
"summary": "下发遥测✅",
"deprecated": false,
"description": "",
"tags": [],
"parameters": [
{
"name": "x-token",
"in": "header",
"description": "",
"example": "{{x-token}}",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"device_id": {
"type": "string",
"description": "设备id"
},
"value": {
"type": "string"
}
},
"x-apifox-orders": [
"device_id",
"value"
],
"required": [
"device_id",
"value"
],
"x-apifox-ignore-properties": []
},
"examples": {
"1": {
"value": {
"device_id": "ca33926c-5ee5-3e9f-147e-94e188fde65b",
"value": {
"switch": false
}
},
"description": ""
}
}
}
}
},
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"x-apifox-ignore-properties": [],
"x-apifox-orders": [
"code",
"message"
]
},
"examples": {
"1": {
"summary": "成功示例",
"value": {
"code": 200,
"message": "Success"
}
}
}
}
},
"headers": {},
"x-apifox-name": "成功"
}
},
"security": [],
"x-apifox-folder": "遥测数据",
"x-apifox-status": "released",
"x-run-in-apifox": "https://app.apifox.com/web/project/3928900/apis/api-154047089-run"
}
},
"/api/v1/telemetry/datas/current/{id}": {
"get": {
"summary": "设备遥测当前值查询✅",
"deprecated": false,
"description": "设备当前值查询,获取设备每个key的最新一条数据",
"tags": [
"遥测数据"
],
"parameters": [
{
"name": "id",
"in": "path",
"description": "设备ID",
"required": true,
"example": "",
"schema": {
"type": "string"
}
},
{
"name": "x-token",
"in": "header",
"description": "",
"example": "{{x-token}}",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"message": {
"type": "string"
},
"data": {
"type": "array",
"items": {
"type": "object",
"properties": {
"device_id": {
"type": "string"
},
"key": {
"type": "string",
"title": "数据名称"
},
"tenant_id": {
"type": "string"
},
"ts": {
"type": "string",
"title": "时间戳",
"description": "如:2024-03-13T00:28:11.039675Z"
},
"value": {
"type": "integer"
},
"label": {
"type": "string"
},
"unit": {
"type": "string"
}
},
"required": [
"device_id",
"key",
"tenant_id",
"ts",
"value"
],
"x-apifox-ignore-properties": [],
"x-apifox-orders": [
"device_id",
"key",
"tenant_id",
"ts",
"value",
"label",
"unit"
]
}
}
},
"required": [
"code",
"message",
"data"
],
"x-apifox-ignore-properties": [],
"x-apifox-orders": [
"code",
"message",
"data"
]
},
"examples": {
"1": {
"summary": "成功示例",
"value": {
"code": 200,
"message": "Get current data successfully",
"data": [
{
"device_id": "5fd9b168-9e2a-d91c-a7c3-9c1f4d4b5137",
"key": "humidity",
"tenant_id": "f2c67e1a",
"ts": "2024-05-20T18:02:21.458+08:00",
"value": 35
},
{
"device_id": "5fd9b168-9e2a-d91c-a7c3-9c1f4d4b5137",
"key": "temperature",
"label": "温度",
"tenant_id": "f2c67e1a",
"ts": "2024-05-20T18:02:21.458+08:00",
"unit": "℃",
"value": -9.4
},
{
"device_id": "5fd9b168-9e2a-d91c-a7c3-9c1f4d4b5137",
"key": "test_data1",
"tenant_id": "f2c67e1a",
"ts": "2024-05-20T14:26:41.135+08:00",
"value": 25.5
},
{
"device_id": "5fd9b168-9e2a-d91c-a7c3-9c1f4d4b5137",
"key": "test_data2",
"tenant_id": "f2c67e1a",
"ts": "2024-05-20T14:26:41.135+08:00",
"value": 60
}
]
}
}
}
}
},
"headers": {},
"x-apifox-name": "成功"
}
},
"security": [],
"x-apifox-folder": "遥测数据",
"x-apifox-status": "released",
"x-run-in-apifox": "https://app.apifox.com/web/project/3928900/apis/api-152176577-run"
}
},
"/api/v1/telemetry/datas/current/keys": {
"get": {
"summary": "根据key查询遥测当前值✅",
"deprecated": false,
"description": "设备当前值查询,获取设备每个key的最新一条数据",
"tags": [
"遥测数据"
],
"parameters": [
{
"name": "device_id",
"in": "query",
"description": "",
"required": true,
"example": "5fd9b168-9e2a-d91c-a7c3-9c1f4d4b5137",
"schema": {
"type": "string"
}
},
{
"name": "keys",
"in": "query",
"description": "",
"required": true,
"example": [
"temperature"
],
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
},
{
"name": "x-token",
"in": "header",
"description": "",
"example": "{{x-token}}",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"message": {
"type": "string"
},
"data": {
"type": "array",
"items": {
"type": "object",
"properties": {
"device_id": {
"type": "string"
},
"key": {
"type": "string",
"title": "数据名称"
},
"label": {
"type": "string"
},
"tenant_id": {
"type": "string"
},
"ts": {
"type": "string",
"title": "时间戳",
"description": "如:2024-03-13T00:28:11.039675Z"
},
"unit": {
"type": "string"
},
"value": {
"type": "number"
}
},
"x-apifox-ignore-properties": [],
"x-apifox-orders": [
"device_id",
"key",
"label",
"tenant_id",
"ts",
"unit",
"value"
]
}
}
},
"required": [
"code",
"message",
"data"
],
"x-apifox-ignore-properties": [],
"x-apifox-orders": [
"code",
"message",
"data"
]
},
"examples": {
"1": {
"summary": "成功示例",
"value": {
"code": 200,
"message": "Get current data successfully",
"data": [
{
"device_id": "5fd9b168-9e2a-d91c-a7c3-9c1f4d4b5137",
"key": "temperature",
"label": "温度",
"tenant_id": "f2c67e1a",
"ts": "2024-05-20T18:04:51.465+08:00",
"unit": "℃",
"value": -9.21
}
]
}
}
}
}
},
"headers": {},
"x-apifox-name": "成功"
}
},
"security": [],
"x-apifox-folder": "遥测数据",
"x-apifox-status": "released",
"x-run-in-apifox": "https://app.apifox.com/web/project/3928900/apis/api-168570121-run"
}
},
"/api/v1/telemetry/datas/statistic": {
"get": {
"summary": "遥测聚合数据查询🔷",
"deprecated": false,
"description": "### 部分参数说明:\n\n#### *time_range [时间范围]\n- 支持的参数:**custom,last_5m,last_15m,last_30m,last_1h,last_3h,last_6h,last_12h,last_24h,last_3d,last_7d,last_15d,last_30d,last_60d,last_90d,last_6m,last_1y**\n- 当选择自定义时,要送start_time和end_time\n- 如果time_range>=3小时,则aggregate_window不能是no_aggregate(不聚合)\n\n#### *aggregate_window [聚合间隔]\n- 支持的参数:\"no_aggregate\",\"30s\",\"1m\",\"2m\",\"5m\",\"10m\",\"30m\",\"1h\",\"3h\",\"6h\",\"1d\",\"7d\",\"1mo\"\n- 不聚合\n \n#### aggregate_function [聚合方法]\n- **avg** 平均数\n- **max** 最大值\n- 当aggregate_window为no_aggregate的时候,前端不显示aggregate_function下拉,接口不送aggregate_function\n- 当aggregate_window不为no_aggregate,aggregate_function必输,前端可默认平均值\n\n### 前端筛选联动规则\n\n#### 页面初始化:\n- **time_range:** \"last_1h\"\n- **aggregate_window:** \"no_aggregate\"\n- **aggregate_function:** 不送\n\n#### time_range不为custom的选择:\n\n- **3小时内的数据 (time_range: last_5m, last_15m, last_30m, last_1h)**:\n - **aggregate_window:** 支持任何选项\n\n- **最近3小时 (time_range: last_3h)**:\n - **aggregate_window:** 不支持\"no_aggregate\",其他都支持\n\n- **最近6小时 (time_range: last_6h)**:\n - **aggregate_window:** 不支持小于等于\"30s\"的选项:不支持\"no_aggregate\", \"30s\",其他都支持\n\n- **最近12小时 (time_range: last_12h)**:\n - **aggregate_window:** 不支持小于等于\"1m\"的选项:不支持\"no_aggregate\", \"30s\", \"1m\",其他都支持\n\n- **最近24小时 (time_range: last_24h)**:\n - **aggregate_window:** 不支持小于等于\"2m\"的选项:\n\n- **最近3天 (time_range: last_3d)**:\n - **aggregate_window:** 不支持小于等于\"5m\"的选项:\n\n- **最近7天 (time_range: last_7d)**:\n - **aggregate_window:** 不支持小于等于\"10m\"的选项:\n\n- **最近15天 (time_range: last_15d)**:\n - **aggregate_window:** 不支持小于等于\"30m\"的选项:\n\n- **最近30天 (time_range: last_30d)**:\n - **aggregate_window:** 不支持小于等于\"1h\"的选项:\n\n- **最近60天 (time_range: last_60d)**:\n - **aggregate_window:** 不支持小于等于\"3h\"的选项:\n\n- **最近90天 (time_range: last_90d)**:\n - **aggregate_window:** 不支持小于等于\"6h\"的选项:\n\n- **最近6个月 (time_range: last_6m)**:\n - **aggregate_window:** 不支持小于等于\"1d\"的选项:\n\n- **最近1年 (time_range: last_1y)**:\n - **aggregate_window:** 不支持小于等于\"7d\"的选项:\n\n#### 当用户选择custom或手动设置时间区间的时候:\n\n- time_range要变成\"custom\"\n- 区间<3小时\n - **aggregate_window:** 支持任何选项\n- 区间>=3小时\n - **aggregate_window:** 不支持小于等于\"30s\"的选项:不支持\"no_aggregate\", \"30s\",其他都支持\n- 其他与上面类推\n\n请求参数示例:\n\n```\n{\n \"device_id\": \"4a5b326c-ba99-9ea2-34a9-1c484d69a1ab\",\n \"key\": \"temperature\",\n \"start_time\": 1711864176268,\n \"end_time\": 1711864177268,\n \"aggregate_window\": \"no_aggregate\",\n \"time_range\": \"custom\"\n}\n```\n\n\n```\n{\n \"device_id\": \"4a5b326c-ba99-9ea2-34a9-1c484d69a1ab\",\n \"key\": \"temperature\",\n \"time_range\": \"last_1h\"\n \"aggregate_window\": \"30s\",\n \"aggregate_function\":\"max\"\n}\n```",
"tags": [
"遥测数据"
],
"parameters": [
{
"name": "aggregate_function",
"in": "query",
"description": "聚合方法 avg-平均数 max-最大值 mix-最小值 sum-求和 diff-最大最小的差值",
"required": false,
"example": "",
"schema": {
"type": "string"
}
},
{
"name": "aggregate_window",
"in": "query",
"description": "聚合间隔 no_aggregate,30s,1m,2m,5m,10m,30m,1h,3h,6h,1d,7d,1mo",
"required": true,
"example": "no_aggregate",
"schema": {
"type": "string"
}
},
{
"name": "device_id",
"in": "query",
"description": "设备ID",
"required": true,
"example": "f3625aae-1283-1afc-259e-f43a58ba7070",
"schema": {
"type": "string"
}
},
{
"name": "end_time",
"in": "query",
"description": "结束时间(time_range为custom时候必输)",
"required": false,
"example": 1711864177268,
"schema": {
"type": "integer"
}
},
{
"name": "key",
"in": "query",
"description": "",
"required": true,
"example": "temp",
"schema": {
"type": "string"
}
},
{
"name": "start_time",
"in": "query",
"description": "开始时间(time_range为custom时候必输)",
"required": false,
"example": 1711864177268,
"schema": {
"type": "integer"
}
},
{
"name": "time_range",
"in": "query",
"description": "时间范围 custom,last_5m,last_15m,last_30m,last_1h,last_3h,last_6h,last_12h,last_24h,last_3d,last_7d,last_15d,last_30d,last_60d,last_90d,last_6m,last_1y",
"required": true,
"example": "custom",
"schema": {
"type": "string"
}
},
{
"name": "is_export",
"in": "query",
"description": "是否导出",
"required": false,
"example": "true",
"schema": {
"type": "boolean"
}
},
{
"name": "x-token",
"in": "header",
"description": "",
"example": "{{x-token}}",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"message": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"time_series": {
"type": "array",
"items": {
"type": "object",
"properties": {
"x": {
"type": "string"
},
"y": {
"type": "number"
}
},
"required": [
"x",
"y"
],
"x-apifox-ignore-properties": [],
"x-apifox-orders": [
"x",
"y"
]
}
},
"x_time_range": {
"type": "object",
"properties": {
"end": {
"type": "string"
},
"start": {
"type": "string"
}
},
"required": [
"end",
"start"
],
"x-apifox-ignore-properties": [],
"x-apifox-orders": [
"end",
"start"
]
}
},
"required": [
"time_series",
"x_time_range"
],
"x-apifox-ignore-properties": [],
"x-apifox-orders": [
"time_series",
"x_time_range"
]
}
},
"required": [
"code",
"message",
"data"
],
"x-apifox-ignore-properties": [],
"x-apifox-orders": [
"code",
"message",
"data"
]
},
"examples": {
"1": {
"summary": "成功示例",
"value": {
"code": 200,
"message": "Get data successfully",
"data": {
"time_series": [
{
"x": "2024-03-20T16:31:10.508174Z",
"y": 25.933
},
{
"x": "2024-03-20T16:31:10.095501Z",
"y": 25.933
},
{
"x": "2024-03-20T16:31:09.924351Z",
"y": 25.933
},
{
"x": "2024-03-20T16:31:09.770282Z",
"y": 25.933
},
{
"x": "2024-03-20T16:31:09.580654Z",
"y": 25.933
},
{
"x": "2024-03-20T16:31:09.42025Z",
"y": 25.933
},
{
"x": "2024-03-20T16:31:09.166655Z",
"y": 25.933
},
{
"x": "2024-03-20T16:31:08.991563Z",
"y": 25.933
},
{
"x": "2024-03-20T16:31:03.970267Z",
"y": 25.933
},
{
"x": "2024-03-20T16:31:03.723987Z",
"y": 25.933
},
{
"x": "2024-03-20T16:31:03.468516Z",
"y": 25.933
}
],
"x_time_range": {
"end": "2024-03-20T17:00:00Z",
"start": "2024-03-20T14:00:00Z"
}
}
}
},
"2": {
"summary": "导出返回示例",
"value": {
"code": 200,
"message": "Get data successfully",
"data": {
"file_name": "fd1f887c-75d2-b793-b04d-f5bd5197ebcc_CSQs_1726550916006_1726554516006.csv",
"file_path": "files\\excel\\telemetry\\fd1f887c-75d2-b793-b04d-f5bd5197ebcc_CSQs_1726550916006_1726554516006.csv"
}
}
}
}
}
},
"headers": {},
"x-apifox-name": "成功"
},
"x-200-2": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"message": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"file_name": {
"type": "string"
},
"file_path": {
"type": "string"
}
},
"required": [
"file_name",
"file_path"
],
"x-apifox-ignore-properties": [],
"x-apifox-orders": [
"file_name",
"file_path"
]
}
},
"required": [
"code",
"message",
"data"
],
"x-apifox-ignore-properties": [],
"x-apifox-orders": [
"code",
"message",
"data"
]
}
}
},
"headers": {},
"x-apifox-name": "导出返回响应定义"
}
},
"security": [],
"x-apifox-folder": "遥测数据",
"x-apifox-status": "released",
"x-run-in-apifox": "https://app.apifox.com/web/project/3928900/apis/api-152269064-run"
}
},
"/api/v1/attribute/datas/{id}": {
"get": {
"summary": "设备属性列表查询✅",
"deprecated": false,
"description": "设备属性列表查询",
"tags": [
"属性数据"
],
"parameters": [
{
"name": "id",
"in": "path",
"description": "设备ID",
"required": true,
"example": "",
"schema": {
"type": "string"
}
},
{
"name": "x-token",
"in": "header",
"description": "",
"example": "{{x-token}}",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"message": {
"type": "string"
},
"data": {
"type": "array",
"items": {
"type": "object",
"properties": {
"data_name": {
"type": "string",
"title": "属性名称",
"nullable": true
},
"device_id": {
"type": "string"
},
"id": {
"type": "string"
},
"key": {
"type": "string",
"title": "属性标识符"
},
"ts": {
"type": "string"
},
"unit": {
"type": "string",
"title": "单位",
"nullable": true
},
"value": {
"type": "number",
"title": "值"
}
},
"required": [
"data_name",
"device_id",
"id",
"key",
"ts",
"unit",
"value"
],
"x-apifox-orders": [
"data_name",
"device_id",
"id",
"key",
"ts",
"unit",
"value"
],
"x-apifox-ignore-properties": []
}
}
},
"required": [
"code",
"message",
"data"
],
"x-apifox-orders": [
"code",
"message",
"data"
],
"x-apifox-ignore-properties": []
},
"examples": {
"1": {
"summary": "成功示例",
"value": {
"code": 200,
"message": "Get data successfully",
"data": [
{
"data_name": "温度",
"device_id": "ca33926c-5ee5-3e9f-147e-94e188fde65b",
"id": "880e5c73-c6cc-3e24-4d57-4600df0036e5",
"key": "temp",
"ts": "2024-03-15T21:07:11.340961Z",
"unit": "℃",
"value": 25.933
},
{
"data_name": null,
"device_id": "ca33926c-5ee5-3e9f-147e-94e188fde65b",
"id": "345cff35-6317-bfaf-4187-fe6fd2a02bb8",
"key": "hum4",
"ts": "2024-03-15T21:07:11.340961Z",
"unit": null,
"value": 44
},
{
"data_name": null,
"device_id": "ca33926c-5ee5-3e9f-147e-94e188fde65b",
"id": "f243f21c-7d30-bfa3-c6ed-fff3c0d8e399",
"key": "hum6",
"ts": "2024-03-15T21:07:11.340961Z",
"unit": null,
"value": 44
},
{
"data_name": null,
"device_id": "ca33926c-5ee5-3e9f-147e-94e188fde65b",
"id": "efdba7f3-6614-ed57-a1e6-51f1025389e2",
"key": "temp2",
"ts": "2024-03-15T21:07:11.340961Z",
"unit": null,
"value": 25.933
},
{
"data_name": null,
"device_id": "ca33926c-5ee5-3e9f-147e-94e188fde65b",
"id": "18205562-904d-df7f-f73f-60a93010a417",
"key": "hum",
"ts": "2024-03-15T21:07:11.340961Z",
"unit": null,
"value": 44
},
{
"data_name": null,
"device_id": "ca33926c-5ee5-3e9f-147e-94e188fde65b",
"id": "10cc4023-31aa-bae5-691c-d0087b455f0c",
"key": "temp5",
"ts": "2024-03-15T21:07:11.340961Z",
"unit": null,
"value": 25.933
},
{
"data_name": null,
"device_id": "ca33926c-5ee5-3e9f-147e-94e188fde65b",
"id": "db7f0ce7-bf44-6c63-86b2-239b580a314b",
"key": "hum1",
"ts": "2024-03-15T21:07:11.340961Z",
"unit": null,
"value": 44
},
{
"data_name": null,
"device_id": "ca33926c-5ee5-3e9f-147e-94e188fde65b",
"id": "7924fbf2-78ee-362d-d801-85a4cc2de499",
"key": "temp3",
"ts": "2024-03-15T21:07:11.340961Z",
"unit": null,
"value": 25.933
},
{
"data_name": null,
"device_id": "ca33926c-5ee5-3e9f-147e-94e188fde65b",
"id": "d4ef7f94-dac2-eab4-2ea3-7e15ca74b0ed",
"key": "hum7",
"ts": "2024-03-15T21:07:11.340961Z",
"unit": null,
"value": 44
},
{
"data_name": null,
"device_id": "ca33926c-5ee5-3e9f-147e-94e188fde65b",
"id": "90ea6359-a77d-9cab-473a-4894a88fa8c9",
"key": "temp4",
"ts": "2024-03-15T21:07:11.340961Z",
"unit": null,
"value": 25.933
},
{
"data_name": null,
"device_id": "ca33926c-5ee5-3e9f-147e-94e188fde65b",
"id": "2ca7a5dd-43eb-3db5-8b9b-4e4b24b1f7c1",
"key": "temp1",
"ts": "2024-03-15T21:07:11.340961Z",
"unit": null,
"value": 25.933
},
{
"data_name": null,
"device_id": "ca33926c-5ee5-3e9f-147e-94e188fde65b",
"id": "cd55395a-320f-c109-f363-35bbfd956e18",
"key": "hum2",
"ts": "2024-03-15T21:07:11.340961Z",
"unit": null,
"value": 44
},
{
"data_name": null,
"device_id": "ca33926c-5ee5-3e9f-147e-94e188fde65b",
"id": "3c37b799-92ba-7c4d-2c39-c5491e7a5ee9",
"key": "hum3",
"ts": "2024-03-15T21:07:11.340961Z",
"unit": null,
"value": 44
},
{
"data_name": null,
"device_id": "ca33926c-5ee5-3e9f-147e-94e188fde65b",
"id": "04b814c1-2c21-b61b-389a-7bb6ed08984c",
"key": "temp7",
"ts": "2024-03-15T21:07:11.340961Z",
"unit": null,
"value": 25.933
},
{
"data_name": null,
"device_id": "ca33926c-5ee5-3e9f-147e-94e188fde65b",
"id": "75f018d4-479f-f800-c2d5-12d99ae29a34",
"key": "hum5",
"ts": "2024-03-15T21:07:11.340961Z",
"unit": null,
"value": 44
},
{
"data_name": null,
"device_id": "ca33926c-5ee5-3e9f-147e-94e188fde65b",
"id": "426a3a88-a877-c607-95f5-8a23c0f4d1d1",
"key": "temp6",
"ts": "2024-03-15T21:07:11.340961Z",
"unit": null,
"value": 25.933
}
]
}
}
}
}
},
"headers": {},
"x-apifox-name": "成功"
}
},
"security": [],
"x-apifox-folder": "属性数据",
"x-apifox-status": "released",
"x-run-in-apifox": "https://app.apifox.com/web/project/3928900/apis/api-152176487-run"
}
},
"/api/v1/command/datas/set/logs": {
"get": {
"summary": "命令下发记录查询(分页)✅",
"deprecated": false,
"description": "命令下发记录查询(分页)",
"tags": [
"命令下发"
],
"parameters": [
{
"name": "device_id",
"in": "query",
"description": "设备ID",
"required": true,
"example": "",
"schema": {
"type": "string"
}
},
{
"name": "identify",
"in": "query",
"description": "数据标识符",
"required": false,
"example": "",
"schema": {
"type": "string"
}
},
{
"name": "page",
"in": "query",
"description": "页码",
"required": true,
"example": 0,
"schema": {
"type": "integer"
}
},
{
"name": "page_size",
"in": "query",
"description": "每页数量",
"required": true,
"example": 0,
"schema": {
"type": "integer"
}
},
{
"name": "status",
"in": "query",
"description": "1-发送成功 2- 发送失败3返回成功 4-返回失败",
"required": false,
"example": "",
"schema": {
"type": "string"
}
},
{
"name": "operation_type",
"in": "query",
"description": "操作类型 1-手动操作 2-自动触发",
"required": false,
"example": "",
"schema": {
"type": "string"
}
},
{
"name": "identify_name",
"in": "query",
"description": "命令名称 模糊匹配",
"required": false,
"schema": {
"type": "string"
}
},
{
"name": "x-token",
"in": "header",
"description": "",
"example": "{{x-token}}",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"message": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"count": {
"type": "integer"
},
"value": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"device_id": {
"type": "string"
},
"operation_type": {
"type": "string",
"description": "1-手动操作 2-自动触发",
"title": "操作类型"
},
"message_id": {
"type": "string"
},
"data": {
"type": "string",
"title": "发送内容"
},
"rsp_data": {
"type": "string"
},
"status": {
"type": "string",
"description": "1-发送成功 2- 发送失败2-返回成功 3-返回失败",
"title": "状态"
},
"error_message": {
"type": "string"
},
"created_at": {
"type": "string"
},
"user_id": {
"type": "string"
},
"description": {
"type": "string"
}
},
"required": [
"id",
"device_id",
"operation_type",
"message_id",
"data",
"rsp_data",
"status",
"error_message",
"created_at",
"user_id",
"description"
],
"x-apifox-orders": [
"id",
"device_id",
"operation_type",
"message_id",
"data",
"rsp_data",
"status",
"error_message",
"created_at",
"user_id",
"description"
],
"x-apifox-ignore-properties": []
}
}
},
"required": [
"count",
"value"
],
"x-apifox-orders": [
"count",
"value"
],
"x-apifox-ignore-properties": []
}
},
"required": [
"code",
"message",
"data"
],
"x-apifox-orders": [
"code",
"message",
"data"
],
"x-apifox-ignore-properties": []
},
"examples": {
"1": {
"summary": "成功示例",
"value": {
"code": 200,
"message": "Get data successfully",
"data": {
"count": 11,
"list": [
{
"id": "46495a51-5946-bdcc-9618-38f2b6c427c2",
"device_id": "66c172a3-f75c-b966-a547-0254f45d8d0d",
"operation_type": "1",
"message_id": "2806102",
"data": "{\"method\":\"DEVICE_CONTROL\",\"params\":{\"switchSprinkling\":1}}",
"rsp_data": null,
"status": "1",
"error_message": "",
"created_at": "2024-04-11T03:28:22.942458Z",
"user_id": "e7cc3359-54f3-e23b-801b-e3b82446378e",
"description": "下发命令日志记录",
"identify": "DEVICE_CONTROL"
},
{
"id": "9032a3e2-6851-c78f-64db-9958c0b21f77",
"device_id": "66c172a3-f75c-b966-a547-0254f45d8d0d",
"operation_type": "1",
"message_id": "2805897",
"data": "{\"method\":\"DEVICE_CONTROL\",\"params\":{\"switchSprinkling\":1}}",
"rsp_data": null,
"status": "1",
"error_message": "",
"created_at": "2024-04-11T03:24:57.83269Z",
"user_id": "e7cc3359-54f3-e23b-801b-e3b82446378e",
"description": "下发命令日志记录",
"identify": "DEVICE_CONTROL"
},
{
"id": "6f047ea7-defa-7cb1-d687-375eff9f72d8",
"device_id": "66c172a3-f75c-b966-a547-0254f45d8d0d",
"operation_type": "1",
"message_id": "2805740",
"data": "{\"method\":\"DEVICE_CONTROL\",\"params\":{\"switchSprinkling\":1}}",
"rsp_data": null,
"status": "1",
"error_message": "",
"created_at": "2024-04-11T03:22:20.703616Z",
"user_id": "e7cc3359-54f3-e23b-801b-e3b82446378e",
"description": "下发命令日志记录",
"identify": "DEVICE_CONTROL"
}
]
}
}
}
}
}
},
"headers": {},
"x-apifox-name": "成功"
}
},
"security": [],
"x-apifox-folder": "命令下发",
"x-apifox-status": "released",
"x-run-in-apifox": "https://app.apifox.com/web/project/3928900/apis/api-152176509-run"
}
}
},
"components": {
"schemas": {
"model.GetBoardDeviceRes": {
"type": "object",
"properties": {
"device_on": {
"type": "integer",
"description": "设备在线数"
},
"device_total": {
"type": "integer",
"description": "设备总数"
},
"device_activity": {
"type": "string",
"description": "激活数"
}
},
"x-apifox-orders": [
"device_on",
"device_total",
"device_activity"
],
"required": [
"device_activity"
],
"x-apifox-ignore-properties": [],
"x-apifox-folder": "Schemas"
},
"model.GetBoardUserListMonth": {
"type": "object",
"properties": {
"mon": {
"type": "integer",
"description": "月份"
},
"num": {
"type": "integer",
"description": "新增数"
}
},
"x-apifox-orders": [
"mon",
"num"
],
"x-apifox-ignore-properties": [],
"x-apifox-folder": "Schemas"
},
"model.GetTenantRes": {
"type": "object",
"properties": {
"user_added_month": {
"type": "integer",
"description": "上月新增数"
},
"user_added_yesterday": {
"type": "integer",
"description": "昨日新增数"
},
"user_list_month": {
"type": "array",
"items": {
"$ref": "#/components/schemas/model.GetBoardUserListMonth"
},
"description": "历史数据"
},
"user_total": {
"type": "integer",
"description": "用户总数"
}
},
"x-apifox-orders": [
"user_added_month",
"user_added_yesterday",
"user_list_month",
"user_total"
],
"x-apifox-ignore-properties": [],
"x-apifox-folder": "Schemas"
}
},
"securitySchemes": {}
},
"servers": [],
"security": []
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/ThingsPanel/thingspanel-mcp.git
git@gitee.com:ThingsPanel/thingspanel-mcp.git
ThingsPanel
thingspanel-mcp
thingspanel-mcp
main

搜索帮助