-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #57 from makinosp/develop
Develop
- Loading branch information
Showing
21 changed files
with
440 additions
and
208 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// APIService.swift | ||
// | ||
// | ||
// Created by makinosp on 2024/07/14. | ||
// | ||
|
||
import Foundation | ||
|
||
public class APIService { | ||
let client: APIClient | ||
|
||
public init(client: APIClient) { | ||
self.client = client | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
Sources/VRCKit/PreviewServices/FavoritePreviewService.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// | ||
// FavoritePreviewService.swift | ||
// | ||
// | ||
// Created by makinosp on 2024/07/13. | ||
// | ||
|
||
import Foundation | ||
|
||
public final class FavoritePreviewService: FavoriteService { | ||
override public func listFavoriteGroups() async throws -> [FavoriteGroup] { | ||
[ | ||
FavoriteGroup( | ||
id: "fvgrp_\(UUID().uuidString)", | ||
displayName: "DemoGroup", | ||
name: "group_1", | ||
tags: [], | ||
type: .friend, | ||
visibility: "private" | ||
) | ||
] | ||
} | ||
|
||
override public func listFavorites( | ||
n: Int = 60, | ||
type: FavoriteType, | ||
tag: String? = nil | ||
) async throws -> [Favorite] { | ||
switch type { | ||
case .friend: | ||
PreviewDataProvider.shared.onlineFriends.prefix(5).map { friend in | ||
Favorite(id: UUID().uuidString, favoriteId: friend.id, tags: ["group_1"], type: .friend) | ||
} | ||
default: | ||
[] | ||
} | ||
} | ||
|
||
override public func addFavorite( | ||
type: FavoriteType, | ||
favoriteId: String, | ||
tag: String | ||
) async throws -> Favorite { | ||
Favorite(id: UUID().uuidString, favoriteId: favoriteId, tags: [tag], type: type) | ||
} | ||
|
||
override public func removeFavorite( | ||
favoriteId: String | ||
) async throws -> SuccessResponse { | ||
SuccessResponse(success: ResponseMessage(message: "OK", statusCode: 200)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.