Giter Site home page Giter Site logo

house_administrator's People

Contributors

dependabot[bot] avatar junnetworks avatar

Watchers

 avatar  avatar

house_administrator's Issues

APIのURL設計

一応今考えているのは, APIのURLは api/ で始まる.

そんで, 例えばJUNの部屋のエアコンの気温上げる場合には api/jun_room/air_conditioner みたいな.

しかし, 今までのようなAPIじゃなくて, gRPCを使ってAPI作ってみてもいいかもしれん.

APIのURL設計の修正案

現在基本的にAPIのURLは /rooms/:RoomID/... のような形式で, センサーや測定情報, コントローラー全てがこの部屋のIDから始まっている形式になっている.

しかし, 普通に /sensors/:SensorID などの方が良い気がしてきた.

この形式だと /sensors/ で全センサー取得出来るし, 綺麗にURLが設計出来る気がする.

新しい API URL設計

  • / : 未定

部屋

  • GET /rooms : 部屋一覧
  • POST /rooms : 部屋追加
  • GET /rooms/:roomID: 部屋情報の取得
  • PUT /rooms/:roomID: 部屋情報の更新
  • DELETE /rooms/:roomID: 部屋の削除

センサー

  • GET /sensors: 全てのセンサーの情報を取得. (部屋やセンサータイプなどの条件でフィルター出来るようにする)
  • POST /sensors: センサーを追加 (どの部屋に所属するかなどはHTTPのBodyに載せる)
  • GET /sensors/:sensorID: 特定のセンサーの情報を取得
  • PUT /sensors/:sensorID: 特定のセンサーを更新

計測データ

  • DELETE /rooms/:roomID/sensors/:sensorID: 特定のセンサーを削除
  • GET /sensors/:sensorID/measurements: 特定のセンサーが記録した記録を返す
  • POST /sensors/:sensorID/measurements: 特定のセンサーの記録を記録する
  • GET /sensors/:sensorID/measurements/latest: 特定のセンサーの最新の記録を返す

コントローラー

  • GET /controllers: 全てのコントローラーを取得 (部屋やセンサータイプなどの条件でフィルター出来るようにする)
  • POST /controllers: 新しいコントローラーを登録する
  • GET /controllers/:controllerID: 特定のコントローラーの情報を取得

コマンド

  • GET /controllers/:controllerID/commands: 特定のコントローラーのコマンドを全て取得
  • POST /controllers/:controllerID/commands: 特定のコントローラーにコマンドを追加
  • GET /controllers/:controllerID/commands/:commandID: コマンド情報の取得
  • POST /controllers/:controllerID/commands/:commandID/execute: コマンド実行 (HTTPのボディは基本空)
  • PUT /controllers/:controllerID/commands/:commandID: コマンドを更新
  • DELETE /controllers/:controllerID/commands/:commandID: コマンドを削除

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.