mirror of
https://github.com/He4eT/simple-spaceapi.git
synced 2026-05-04 17:37:24 +00:00
Sensors: Wind
This commit is contained in:
parent
27d259b31c
commit
95d6a5f4ac
10 changed files with 254 additions and 0 deletions
35
src/api/wind-sensor/content-types/wind-sensor/schema.json
Normal file
35
src/api/wind-sensor/content-types/wind-sensor/schema.json
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
{
|
||||||
|
"kind": "collectionType",
|
||||||
|
"collectionName": "wind_sensors",
|
||||||
|
"info": {
|
||||||
|
"singularName": "wind-sensor",
|
||||||
|
"pluralName": "wind-sensors",
|
||||||
|
"displayName": "Sensor: Wind",
|
||||||
|
"description": ""
|
||||||
|
},
|
||||||
|
"options": {
|
||||||
|
"draftAndPublish": false
|
||||||
|
},
|
||||||
|
"attributes": {
|
||||||
|
"location": {
|
||||||
|
"type": "string",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"description": {
|
||||||
|
"type": "text"
|
||||||
|
},
|
||||||
|
"lastchange": {
|
||||||
|
"type": "biginteger"
|
||||||
|
},
|
||||||
|
"properties": {
|
||||||
|
"displayName": "Properties",
|
||||||
|
"type": "component",
|
||||||
|
"repeatable": false,
|
||||||
|
"component": "wind.properties",
|
||||||
|
"required": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
7
src/api/wind-sensor/controllers/wind-sensor.ts
Normal file
7
src/api/wind-sensor/controllers/wind-sensor.ts
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
/**
|
||||||
|
* wind-sensor controller
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { factories } from '@strapi/strapi'
|
||||||
|
|
||||||
|
export default factories.createCoreController('api::wind-sensor.wind-sensor');
|
||||||
7
src/api/wind-sensor/routes/wind-sensor.ts
Normal file
7
src/api/wind-sensor/routes/wind-sensor.ts
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
/**
|
||||||
|
* wind-sensor router
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { factories } from '@strapi/strapi';
|
||||||
|
|
||||||
|
export default factories.createCoreRouter('api::wind-sensor.wind-sensor');
|
||||||
7
src/api/wind-sensor/services/wind-sensor.ts
Normal file
7
src/api/wind-sensor/services/wind-sensor.ts
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
/**
|
||||||
|
* wind-sensor service
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { factories } from '@strapi/strapi';
|
||||||
|
|
||||||
|
export default factories.createCoreService('api::wind-sensor.wind-sensor');
|
||||||
21
src/components/wind/direction.json
Normal file
21
src/components/wind/direction.json
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
{
|
||||||
|
"collectionName": "components_wind_directions",
|
||||||
|
"info": {
|
||||||
|
"displayName": "Direction",
|
||||||
|
"icon": "feather"
|
||||||
|
},
|
||||||
|
"options": {},
|
||||||
|
"attributes": {
|
||||||
|
"value": {
|
||||||
|
"type": "decimal",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
"unit": {
|
||||||
|
"type": "enumeration",
|
||||||
|
"enum": [
|
||||||
|
"Degree"
|
||||||
|
],
|
||||||
|
"required": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
21
src/components/wind/elevation.json
Normal file
21
src/components/wind/elevation.json
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
{
|
||||||
|
"collectionName": "components_wind_elevations",
|
||||||
|
"info": {
|
||||||
|
"displayName": "Elevation",
|
||||||
|
"icon": "feather"
|
||||||
|
},
|
||||||
|
"options": {},
|
||||||
|
"attributes": {
|
||||||
|
"value": {
|
||||||
|
"type": "decimal",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
"unit": {
|
||||||
|
"type": "enumeration",
|
||||||
|
"enum": [
|
||||||
|
"m"
|
||||||
|
],
|
||||||
|
"required": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
38
src/components/wind/properties.json
Normal file
38
src/components/wind/properties.json
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
{
|
||||||
|
"collectionName": "components_wind_properties",
|
||||||
|
"info": {
|
||||||
|
"displayName": "Properties",
|
||||||
|
"icon": "feather",
|
||||||
|
"description": ""
|
||||||
|
},
|
||||||
|
"options": {},
|
||||||
|
"attributes": {
|
||||||
|
"speed": {
|
||||||
|
"displayName": "Speed",
|
||||||
|
"type": "component",
|
||||||
|
"repeatable": false,
|
||||||
|
"component": "wind.speed",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
"gust": {
|
||||||
|
"type": "component",
|
||||||
|
"repeatable": false,
|
||||||
|
"component": "wind.speed",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
"direction": {
|
||||||
|
"displayName": "Direction",
|
||||||
|
"type": "component",
|
||||||
|
"repeatable": false,
|
||||||
|
"component": "wind.direction",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
"elevation": {
|
||||||
|
"displayName": "Elevation",
|
||||||
|
"type": "component",
|
||||||
|
"repeatable": false,
|
||||||
|
"component": "wind.elevation",
|
||||||
|
"required": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
23
src/components/wind/speed.json
Normal file
23
src/components/wind/speed.json
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
{
|
||||||
|
"collectionName": "components_wind_speeds",
|
||||||
|
"info": {
|
||||||
|
"displayName": "Speed",
|
||||||
|
"icon": "cursor"
|
||||||
|
},
|
||||||
|
"options": {},
|
||||||
|
"attributes": {
|
||||||
|
"value": {
|
||||||
|
"type": "decimal",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
"unit": {
|
||||||
|
"type": "enumeration",
|
||||||
|
"enum": [
|
||||||
|
"m/s",
|
||||||
|
"km/h",
|
||||||
|
"kn"
|
||||||
|
],
|
||||||
|
"required": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
60
types/generated/components.d.ts
vendored
60
types/generated/components.d.ts
vendored
|
|
@ -199,6 +199,62 @@ export interface StateStateIcon extends Struct.ComponentSchema {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface WindDirection extends Struct.ComponentSchema {
|
||||||
|
collectionName: 'components_wind_directions';
|
||||||
|
info: {
|
||||||
|
displayName: 'Direction';
|
||||||
|
icon: 'feather';
|
||||||
|
};
|
||||||
|
attributes: {
|
||||||
|
unit: Schema.Attribute.Enumeration<['Degree']> & Schema.Attribute.Required;
|
||||||
|
value: Schema.Attribute.Decimal & Schema.Attribute.Required;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface WindElevation extends Struct.ComponentSchema {
|
||||||
|
collectionName: 'components_wind_elevations';
|
||||||
|
info: {
|
||||||
|
displayName: 'Elevation';
|
||||||
|
icon: 'feather';
|
||||||
|
};
|
||||||
|
attributes: {
|
||||||
|
unit: Schema.Attribute.Enumeration<['m']> & Schema.Attribute.Required;
|
||||||
|
value: Schema.Attribute.Decimal & Schema.Attribute.Required;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface WindProperties extends Struct.ComponentSchema {
|
||||||
|
collectionName: 'components_wind_properties';
|
||||||
|
info: {
|
||||||
|
description: '';
|
||||||
|
displayName: 'Properties';
|
||||||
|
icon: 'feather';
|
||||||
|
};
|
||||||
|
attributes: {
|
||||||
|
direction: Schema.Attribute.Component<'wind.direction', false> &
|
||||||
|
Schema.Attribute.Required;
|
||||||
|
elevation: Schema.Attribute.Component<'wind.elevation', false> &
|
||||||
|
Schema.Attribute.Required;
|
||||||
|
gust: Schema.Attribute.Component<'wind.speed', false> &
|
||||||
|
Schema.Attribute.Required;
|
||||||
|
speed: Schema.Attribute.Component<'wind.speed', false> &
|
||||||
|
Schema.Attribute.Required;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface WindSpeed extends Struct.ComponentSchema {
|
||||||
|
collectionName: 'components_wind_speeds';
|
||||||
|
info: {
|
||||||
|
displayName: 'Speed';
|
||||||
|
icon: 'cursor';
|
||||||
|
};
|
||||||
|
attributes: {
|
||||||
|
unit: Schema.Attribute.Enumeration<['m/s', 'km/h', 'kn']> &
|
||||||
|
Schema.Attribute.Required;
|
||||||
|
value: Schema.Attribute.Decimal & Schema.Attribute.Required;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
declare module '@strapi/strapi' {
|
declare module '@strapi/strapi' {
|
||||||
export module Public {
|
export module Public {
|
||||||
export interface ComponentSchemas {
|
export interface ComponentSchemas {
|
||||||
|
|
@ -215,6 +271,10 @@ declare module '@strapi/strapi' {
|
||||||
'location.area': LocationArea;
|
'location.area': LocationArea;
|
||||||
'membership.plans': MembershipPlans;
|
'membership.plans': MembershipPlans;
|
||||||
'state.state-icon': StateStateIcon;
|
'state.state-icon': StateStateIcon;
|
||||||
|
'wind.direction': WindDirection;
|
||||||
|
'wind.elevation': WindElevation;
|
||||||
|
'wind.properties': WindProperties;
|
||||||
|
'wind.speed': WindSpeed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
35
types/generated/contentTypes.d.ts
vendored
35
types/generated/contentTypes.d.ts
vendored
|
|
@ -798,6 +798,40 @@ export interface ApiTemperatureSensorTemperatureSensor
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface ApiWindSensorWindSensor extends Struct.CollectionTypeSchema {
|
||||||
|
collectionName: 'wind_sensors';
|
||||||
|
info: {
|
||||||
|
description: '';
|
||||||
|
displayName: 'Sensor: Wind';
|
||||||
|
pluralName: 'wind-sensors';
|
||||||
|
singularName: 'wind-sensor';
|
||||||
|
};
|
||||||
|
options: {
|
||||||
|
draftAndPublish: false;
|
||||||
|
};
|
||||||
|
attributes: {
|
||||||
|
createdAt: Schema.Attribute.DateTime;
|
||||||
|
createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
|
||||||
|
Schema.Attribute.Private;
|
||||||
|
description: Schema.Attribute.Text;
|
||||||
|
lastchange: Schema.Attribute.BigInteger;
|
||||||
|
locale: Schema.Attribute.String & Schema.Attribute.Private;
|
||||||
|
localizations: Schema.Attribute.Relation<
|
||||||
|
'oneToMany',
|
||||||
|
'api::wind-sensor.wind-sensor'
|
||||||
|
> &
|
||||||
|
Schema.Attribute.Private;
|
||||||
|
location: Schema.Attribute.String & Schema.Attribute.Required;
|
||||||
|
name: Schema.Attribute.String;
|
||||||
|
properties: Schema.Attribute.Component<'wind.properties', false> &
|
||||||
|
Schema.Attribute.Required;
|
||||||
|
publishedAt: Schema.Attribute.DateTime;
|
||||||
|
updatedAt: Schema.Attribute.DateTime;
|
||||||
|
updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> &
|
||||||
|
Schema.Attribute.Private;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
export interface PluginContentReleasesRelease
|
export interface PluginContentReleasesRelease
|
||||||
extends Struct.CollectionTypeSchema {
|
extends Struct.CollectionTypeSchema {
|
||||||
collectionName: 'strapi_releases';
|
collectionName: 'strapi_releases';
|
||||||
|
|
@ -1319,6 +1353,7 @@ declare module '@strapi/strapi' {
|
||||||
'api::radiation-sensor.radiation-sensor': ApiRadiationSensorRadiationSensor;
|
'api::radiation-sensor.radiation-sensor': ApiRadiationSensorRadiationSensor;
|
||||||
'api::state.state': ApiStateState;
|
'api::state.state': ApiStateState;
|
||||||
'api::temperature-sensor.temperature-sensor': ApiTemperatureSensorTemperatureSensor;
|
'api::temperature-sensor.temperature-sensor': ApiTemperatureSensorTemperatureSensor;
|
||||||
|
'api::wind-sensor.wind-sensor': ApiWindSensorWindSensor;
|
||||||
'plugin::content-releases.release': PluginContentReleasesRelease;
|
'plugin::content-releases.release': PluginContentReleasesRelease;
|
||||||
'plugin::content-releases.release-action': PluginContentReleasesReleaseAction;
|
'plugin::content-releases.release-action': PluginContentReleasesReleaseAction;
|
||||||
'plugin::i18n.locale': PluginI18NLocale;
|
'plugin::i18n.locale': PluginI18NLocale;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue