Yottabyte  1.0
An AI powerd app meant to detect polluted beaches and organise clean up events.
Yottabyte.Server.Controllers.UsersController Class Reference

Controler for the user management More...

+ Inheritance diagram for Yottabyte.Server.Controllers.UsersController:
+ Collaboration diagram for Yottabyte.Server.Controllers.UsersController:

Public Member Functions

 UsersController (DataContext context, IConfiguration configuration)
 Constructor for the User Controller More...
 
async Task< ActionResult< IEnumerable< UserVM > > > GetUser ()
 Function to returns all of the users More...
 
async Task< ActionResult< UserVM > > GetUser (int id)
 Functon to get a user with specific id More...
 
async Task< ActionResult< Response > > PutUser (int id, [FromForm] UserIM userIM)
 Funcion for updating the user info More...
 
async Task< ActionResult< Response > > RegisterUser ([FromForm] UserIM userIM)
 Function for registering of event More...
 
async Task< ActionResult< Response > > LoginUser ([FromForm] string Email, [FromForm] string Password)
 Function for generating JWT Token for the user More...
 
async Task< ActionResult< Response > > DeleteUser (int id)
 Function for deleting a user More...
 
IEnumerable< Claim > ExtractClaims (string jwtToken)
 Function for extracting the claims from JWT Token More...
 

Public Attributes

readonly Dictionary< string, string > fileExtToConType
 Dictionary for converting the file extension to connection type More...
 

Detailed Description

Controler for the user management

Definition at line 32 of file UsersController.cs.

Constructor & Destructor Documentation

◆ UsersController()

Yottabyte.Server.Controllers.UsersController.UsersController ( DataContext  context,
IConfiguration  configuration 
)
inline

Constructor for the User Controller

Parameters
contextData Context
configurationConfiguration

Definition at line 60 of file UsersController.cs.

Member Function Documentation

◆ DeleteUser()

async Task< ActionResult< Response > > Yottabyte.Server.Controllers.UsersController.DeleteUser ( int  id)
inline

Function for deleting a user

Parameters
idId of the user
Returns
Was there a problem

Definition at line 374 of file UsersController.cs.

+ Here is the call graph for this function:

◆ ExtractClaims()

IEnumerable< Claim > Yottabyte.Server.Controllers.UsersController.ExtractClaims ( string  jwtToken)
inline

Function for extracting the claims from JWT Token

Parameters
jwtTokenThe JWT Token
Returns
The claims

Definition at line 461 of file UsersController.cs.

+ Here is the caller graph for this function:

◆ GetUser() [1/2]

async Task< ActionResult< IEnumerable< UserVM > > > Yottabyte.Server.Controllers.UsersController.GetUser ( )
inline

Function to returns all of the users

Returns
All of the users

Definition at line 72 of file UsersController.cs.

◆ GetUser() [2/2]

async Task< ActionResult< UserVM > > Yottabyte.Server.Controllers.UsersController.GetUser ( int  id)
inline

Functon to get a user with specific id

Parameters
idId of the user
Returns
The user

Definition at line 90 of file UsersController.cs.

◆ LoginUser()

async Task< ActionResult< Response > > Yottabyte.Server.Controllers.UsersController.LoginUser ( [FromForm] string  Email,
[FromForm] string  Password 
)
inline

Function for generating JWT Token for the user

Parameters
EmailEmail of the user
PasswordPassword of the user
Returns
Was there a problem

Definition at line 320 of file UsersController.cs.

◆ PutUser()

async Task< ActionResult< Response > > Yottabyte.Server.Controllers.UsersController.PutUser ( int  id,
[FromForm] UserIM  userIM 
)
inline

Funcion for updating the user info

Parameters
idId of the user
userIMNew info for the user
Returns
is there a problem

Definition at line 110 of file UsersController.cs.

+ Here is the call graph for this function:

◆ RegisterUser()

async Task< ActionResult< Response > > Yottabyte.Server.Controllers.UsersController.RegisterUser ( [FromForm] UserIM  userIM)
inline

Function for registering of event

Parameters
userIMUser info
Returns
Was there a problem

Definition at line 229 of file UsersController.cs.

Member Data Documentation

◆ fileExtToConType

readonly Dictionary<string, string> Yottabyte.Server.Controllers.UsersController.fileExtToConType
Initial value:
= new()
{
{ ".png", "image/x-png" },
{ ".jpg", "image/jpeg" },
{ ".svg", "image/svg+xml" },
{ ".gif", "image/gif" }
}

Dictionary for converting the file extension to connection type

Definition at line 47 of file UsersController.cs.


The documentation for this class was generated from the following file: