|
6 | 6 | //
|
7 | 7 |
|
8 | 8 | public protocol FavoriteServiceProtocol: Sendable {
|
| 9 | + /// Asynchronously retrieves a list of favorite groups from the server. |
| 10 | + /// - Returns: An array of `FavoriteGroup` objects. |
9 | 11 | func listFavoriteGroups() async throws -> [FavoriteGroup]
|
| 12 | + |
| 13 | + /// Lists a user's all favorites with the specified parameters. |
| 14 | + /// - Parameter type: The type of favorite (e.g., friend, world). |
| 15 | + /// - Returns: An array of `Favorite` objects. |
10 | 16 | func listFavorites(type: FavoriteType) async throws -> [Favorite]
|
| 17 | + |
| 18 | + /// Lists a user's favorites with the specified parameters. |
| 19 | + /// - Parameters: |
| 20 | + /// - n: The number of favorites to retrieve. Default is `60`. |
| 21 | + /// - offset: Offset value of favorites to retrive. Default is `0`. |
| 22 | + /// - type: The type of favorite (e.g., friend, world). |
| 23 | + /// - tag: An optional tag to filter favorites. |
| 24 | + /// - Returns: An array of `Favorite` objects. |
| 25 | + func listFavorites(n: Int, offset: Int, type: FavoriteType, tag: String?) async throws -> [Favorite] |
| 26 | + |
| 27 | + /// Fetches details of favorite groups asynchronously. |
| 28 | + /// - Parameters: |
| 29 | + /// - favoriteGroups: An array of `FavoriteGroup` objects. |
| 30 | + /// - type: The type of favorite (e.g., friend, world). |
| 31 | + /// - Returns: An array of `FavoriteList` objects containing detailed information about the favorite groups. |
11 | 32 | func fetchFavoriteList(favoriteGroups: [FavoriteGroup], type: FavoriteType) async throws -> [FavoriteList]
|
| 33 | + |
| 34 | + /// Adds a new favorite to a specific group. |
| 35 | + /// - Parameters: |
| 36 | + /// - type: The type of favorite (e.g., friend, world). |
| 37 | + /// - favoriteId: The ID of the item to favorite. |
| 38 | + /// - tag: The tag to associate with the favorite. |
| 39 | + /// - Returns: The newly added `Favorite` object. |
12 | 40 | func addFavorite(type: FavoriteType, favoriteId: String, tag: String) async throws -> Favorite
|
| 41 | + |
| 42 | + /// Updates a favorite group with the given parameters, display name, and visibility. |
| 43 | + /// - Parameters: |
| 44 | + /// - source: An object containing the favorite group's details. |
| 45 | + /// - displayName: The new display name to update the favorite group with. |
| 46 | + /// - visibility: The new visibility setting for the favorite group. |
13 | 47 | func updateFavoriteGroup(
|
14 | 48 | source: FavoriteGroup,
|
15 | 49 | displayName: String,
|
16 | 50 | visibility: FavoriteGroup.Visibility
|
17 | 51 | ) async throws
|
| 52 | + |
| 53 | + /// Asynchronously remove favorite. |
| 54 | + /// - Parameter favoriteId: The ID of the favorite to remove. |
| 55 | + /// - Returns: A `SuccessResponse` objects. |
18 | 56 | func removeFavorite(favoriteId: String) async throws -> SuccessResponse
|
19 | 57 | }
|
0 commit comments