File tree 3 files changed +31
-20
lines changed
3 files changed +31
-20
lines changed Original file line number Diff line number Diff line change
1
+ using Microsoft . AspNetCore . Mvc ;
2
+ using StackExchange . Redis ;
3
+
4
+ namespace Database . Controllers ;
5
+
6
+ [ ApiController ]
7
+ [ Route ( "api/EmergencyStop" ) ]
8
+
9
+ // // Name file endpoint name + Controller
10
+ public class EmergencyStopController : ControllerBase
11
+ {
12
+
13
+ [ HttpPost ( Name = "PostEmergencyStop" ) ]
14
+ public async Task PostEmergencyStop ( ) {
15
+ ConnectionMultiplexer redis = ConnectionMultiplexer . Connect ( "local:redis:6379" ) ;
16
+ IDatabase gcs = redis . GetDatabase ( ) ;
17
+ gcs . StringSet ( "EmergencyStop" , "true" ) ;
18
+ }
19
+
20
+
21
+ // [HttpGet]
22
+
23
+ // [HttpPost]
24
+ }
Original file line number Diff line number Diff line change 1
- using NRedisStack ;
2
- using NRedisStack . RedisStackCommands ;
3
- using NRedisStack . Search ;
4
- using NRedisStack . Search . Aggregation ;
5
- using NRedisStack . Search . Literals . Enums ;
6
1
using StackExchange . Redis ;
7
2
8
- ConnectionMultiplexer redis = ConnectionMultiplexer . Connect ( "localhost:6379" ) ;
9
-
10
- var db = redis . GetDatabase ( ) ;
11
- var ft = db . FT ( ) ;
12
- var json = db . JSON ( ) ;
13
-
14
- var UGV_tel = new {
15
- xPos = 69.6969 ,
16
- yPos = 120.473 ,
17
- manual = false ,
18
- misc = "etc"
19
- } ;
20
-
21
3
22
4
//json.Set("UGV_[timestamp]", "$", UGV_tel);
23
5
//Console.WriteLine(json.Get("UGV_[timestamp]")); // prints json
27
9
// Add services to the container.
28
10
29
11
builder . Services . AddControllers ( ) ;
30
- // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
12
+
31
13
builder . Services . AddEndpointsApiExplorer ( ) ;
32
- //builder.Services.AddSwaggerGen();
33
14
34
15
var app = builder . Build ( ) ;
35
16
Original file line number Diff line number Diff line change @@ -22,3 +22,9 @@ This is the primary codebase for the GCS database and its API.
22
22
10 . Open Redis Commander and log in to access DB on the browser
23
23
10a. The Login Information for Redis Commander to see database information is under ` .env `
24
24
11 . You should now see the string with the last number sent using the js script
25
+
26
+ For Docket Setup:
27
+ 1 . create .env file if it doesn't alrady exist.
28
+ 2 . enter the following line into the CLI: docker-compose up --detach
29
+ 3 . dotnet run
30
+ 4 . Open Redis Commander and log in
You can’t perform that action at this time.
0 commit comments