Structure
ProfilesUseCase
public struct ProfilesUseCase: UseCase
Use cases for Profiles
Initializers
Methods
profile(by:readingUserId:)
public func profile(by username: String, readingUserId: Int? ) -> Future<ProfileResponse>
This use case has work of get profile.
Parameters
Name | Type | Description |
---|---|---|
username | String |
Please pass the name of user who is the owner of profile. |
readingUserId | Int? |
Please pass the id of the user reading the profile. |
Returns
The Future
that returns ProfileResponse
.
follow(to:from:)
public func follow(to username: String, from userId: Int ) -> Future<ProfileResponse>
This use case has work of follow user.
Parameters
Name | Type | Description |
---|---|---|
username | String |
Please pass the name of the user who is Followee. |
userId | Int |
Please pass the id of the user who is Follower. |
Returns
The Future
that returns ProfileResponse
.
unfollow(to:from:)
public func unfollow(to username: String, from userId: Int ) -> Future<ProfileResponse>
This use case has work of unfollow user.
Parameters
Name | Type | Description |
---|---|---|
username | String |
Please pass the name of the user who be unfollowed. |
userId | Int |
Please pass the id of the user who is stop following. |
Returns
The Future
that returns ProfileResponse
.