定制 odboxxx/sens-api 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

odboxxx/sens-api

最新稳定版本:v1.0.0

Composer 安装命令:

composer require odboxxx/sens-api

包简介

API for synchronization sensors data with SPA app

README 文档

README

API для датчиков и SPA-приложения

Download

composer require odboxxx/sens-api

Install

php artisan sensapi:install
php artisan migrate

Usage

request from sensors

GET yourdomain/api?<parameter>=<value>

parameters:

Parameter Type Desc
sensor integer sensor id (required)
T decimal температура (conditional) для датчика 1
P decimal давление (conditional) для датчика 2
v decimal скорость вращения (conditional) для датчика 3

response from API

Content-Type: application/json

Parameter Type Desc
result integer id показателя или 0, если фиксация показателя не удалась

example

{
  "result":1
}

request from SPA

GET yourdomain/api/spa?<parameter>=<value>

parameters:

Parameter Type Desc
sensors array of int массив sensor id (required)
sdate integer дата, время начала отчётного периода (required) Unix timestamp
edate integer дата, время завершения отчётного периода (required) Unix timestamp

response from API

Content-Type: application/json

Parameter Type Desc
cases_quant_total integer количество запросов принятых от датчиков всего
data array массив с данными полученными от датчиков
sensor_id integer id датчика
cases_quant integer количество запросов принятых от определенного датчика
cases array массив с данными полученными от определенного датчика
value decimal значение параметра датчика
time integer дата, время фиксации параметра Unix timestamp

example

{
    "cases_quant_total": 4,
    "data": [
        {
            "sensor_id": 2,
            "cases_quant": 3,
            "cases": [
                {
                    "value": 45,
                    "time": 1742704244
                },
                {
                    "value": 50,
                    "time": 1742704265
                },
                {
                    "value": 55,
                    "time": 1742707457
                }
            ]
        },
        {
            "sensor_id": 1,
            "cases_quant": 1,
            "cases": [
                {
                    "value": 30,
                    "time": 1742707466
                }
            ]
        }
    ]
}

统计信息

  • 总下载量: 5
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-03-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固