wissance/weathercontrol

General description

This project is a tutorial for begginners how to organize your code, build flexible and re-usable code and how to build asp net core web...

General description

WeatherControl

This project is a tutorial for begginners how to organize your code, build flexible and re-usable code and how to build asp net core web api (rest).

Glossary / Domain object

  • Station - weather station that has name, description, coordinates and it can measure one or multiple weather parameters;
  • Measurements - one weather sample measured by station itself.

Application Overview

Web API REST service (.Net Core) that could store weather data from multiple weather station:

  • temperature
  • atmosphere pressure
  • humidity
  • wind speed

Application has 2 resources = Domain objects

Application uses MsSql as Database Server (this could be easily changed, but this required to re-generate migration).

  1. Station
  2. Measurements

Overall scenario

This is a very simple application (demo), if any feature is needed open new issue.

  1. Application client create one or multiple station using Station (/api/station) resource (CRUD)
  2. Client interacts with station, gets it measured data and store it using Measurements (/api/measurements) resource (CRUD)

Example of usage

It should be noted that Postman Requests stored in docs folder

Operations with Station resource
  1. Create Station:

POST http://localhost:8058/api/station

{
	"id": 0,
	"name": "Yekaterinburg main station",
	"description": "Yekaterinburg meteo station (meteo mountain)",
	"longitude": "60°37'55\"E",
	"latitude": "56°49'36\"N"
}

We got a Operation result response:

{
    "success": true,
    "message": null,
    "data": {
        "id": 1,
        "name": "Yekaterinburg main station",
        "description": "Yekaterinburg meteo station (meteo mountain)",
        "longitude": "60°37'55\"E",
        "latitude": null
    }
}
  1. Station data update (could be updated name, description and coordinates):

PUT http://localhost:8058/api/station/1

Body and response are the same as at Create operation:

{
	"id": 0,
	"name": "Yekaterinburg main station",
	"description": "Yekaterinburg meteo station (meteo mountain)",
	"longitude": "60°37'55\"E",
	"latitude": "56°49'36\"N"
}

  1. There are two get operations:
  • 3.1 to get one by id GET http://localhost:8058/api/station/1

  • 3.2 to get collection with paging GET http://localhost:8058/api/station/?page=1&size=10

  1. To delete station with id 1 use endpoint DELETE http://localhost:8058/api/station/1
Operations with measurements resource
  1. Create measurements

POST http://localhost:8058/api/measurements

{
	"id": 0,
	"timestamp": "2022-05-24T10:13:43",
	"temperature": 16.1,
	"pressure": 742.3,
	"humidity": 60.5,
	"windSpeed": 0.5,
	"stationId": 1
}

We got following result in ouptup:

{
    "success": true,
    "message": null,
    "data": {
        "id": 1,
        "timestamp": "2022-05-24T10:13:43",
        "temperature": 16.1,
        "pressure": 742.3,
        "humidity": 60.5,
        "windSpeed": 0.5,
        "stationId": 1
    }
}

  1. Update measurements: one or any number of weather parameters could be changed using PUT http://localhost:8058/api/measurements/1 with same body and result as at create measurements operation.

  1. There are two get operations:
  • 3.1 to get one by id GET http://localhost:8058/api/measurements/1
  • 3.2 to get collection with paging GET http://localhost:8058/api/measurements/?page=1&size=10
  1. To delete measurements with id 1 use endpoint DELETE http://localhost:8058/api/measurements/1
Versions

Quick list of the latest released versions

Library Stats (Sep 19, 2022)

Subscribers: 3
Stars: 1
Forks: 0
Issues: 0

csharp-data-visualization

I've always wanted to learn how to visualize data in C#

csharp-data-visualization

C Sharp Helper Methods

Bu bir Windows Form uygulamas覺d覺r ve i癟erisinde genel olarak ERP projelerinde s覺k癟a kullan覺labilecek baz覺 metotlar覺 ve kullan覺mlar覺n覺 i癟ermektedir

C Sharp Helper Methods

CSharp-Collection

Challenges, projects, educational files

CSharp-Collection

CSharp_Veri_Tipleri

byte, sbyte, short, ushort, int, uint, long, ulong, decimal, bool, char, string, var, object veri tipleri incelenmistir

CSharp_Veri_Tipleri

CSharp-CodeSnippet

Wide variety of sample code snippets from the topics related in C#

CSharp-CodeSnippet

csharp-aspnet-microservices

Course on building microservices on

csharp-aspnet-microservices

CSharp "C#" WAVE "

Parses the audio data and the format chunk info from a WAVE-Format audio file "

CSharp "C#" WAVE "

CSharp_ChromaStreamApp

C# Chroma Stream App for Chroma RGB streaming

CSharp_ChromaStreamApp

CSharp-SMTP-Server

Simple (receive only) SMTP server library for C#

CSharp-SMTP-Server

CSharp To Mindustry Logic

This is a code transpiler that will transpile C# code to mlog

CSharp To Mindustry Logic