-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser.proto
More file actions
75 lines (55 loc) · 1.64 KB
/
Copy pathuser.proto
File metadata and controls
75 lines (55 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
syntax = "proto3";
service UserService {
// Metodo per la registrazione dell'utente
rpc RegisterUser(RegisterUserRequest) returns (UserResponse);
// Metodo per l'aggiornamento del ticker
rpc UpdateUserTicker (UserRequest) returns (UserResponse);
// Metodo per cancellare un utente
rpc DeleteUser(DeleteUserRequest) returns (UserResponse);
// Metodo per ottenere l'ultimo valore del ticker
rpc GetLatestValue(EmailRequest) returns (UserResponse);
// Metodo per il calcolo della media
rpc CalculateAverage(AverageRequest) returns (AverageResponse);
// Metodo per soglia
rpc UpdateThreshold(UpdateThresholdRequest) returns (UserResponse);
}
message RegisterUserRequest {
string email = 1;
string ticker = 2;
float high_value = 3;
float low_value = 4;
}
// Messaggio di richiesta per cancellare un utente
message DeleteUserRequest {
string email = 1;
}
// Messaggio di richiesta per ottenere l'ultimo valore del ticker
message EmailRequest { // Nuovo messaggio per GetLatestValue
string email = 1;
}
// Richiesta per calcolare la media
message AverageRequest {
string email = 1;
int32 count = 2;
}
// Risposta per calcolare la media
message AverageResponse {
bool success = 1;
string message = 2;
float average = 3;
}
message UserResponse {
bool success = 1;
string message = 2;
string timestamp = 3;
float value = 4;
}
message UserRequest {
string email = 1;
string ticker = 2;
}
message UpdateThresholdRequest {
string email = 1;
float high_value = 2;
float low_value = 3;
}