Domain Documentation

Structure Users​Use​Case

public struct UsersUseCase: UseCase  

Use cases for Users.

Initializers

init()

public init()  

Default initializer.

Methods

login(form:​)

public func login( form: LoginUser ) -> Future<UserResponse>  

This use case has work of user login.

Parameters

form Login​User

Please pass the information used for authentication with LoginUser.

Returns

The Future that returns UserResponse.

register(user:​)

public func register(user form: NewUser ) throws -> Future<UserResponse>  

This use case has work of user registration.

Parameters

form New​User

Please pass the information used for user registration with NewUser.

Throws

See JWTWithVaporRepository.issueJWT(id:username:).

Returns

The Future that returns UserResponse.

update(user​Id:​token:​update​User:​)

public func update(userId: Int, token: String, updateUser user: UpdateUser ) -> Future<UserResponse>  

This use case has work of User updating.

Parameters

user​Id Int

Please pass the id of the user to be updated.

token String

Please pass the authenticated JWT used for this session.

user Update​User

Please pass the information used for user updating with UpdateUser.

Returns

The Future that returns UserResponse.