generated from GSM-MSG/MSG-Repository-Generator
-
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 #376 from School-of-Company/374-club-crud-api-setting
🔀 :: [#374] 동아리 CRUD API 추가
- Loading branch information
Showing
15 changed files
with
172 additions
and
2 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
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
13 changes: 13 additions & 0 deletions
13
Service/Sources/Data/UseCase/Club/CreatedClubUseCaseImpl.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,13 @@ | ||
import Foundation | ||
|
||
public struct CreatedClubUseCaseImpl: CreatedClubUseCase { | ||
private let clubRepository: any ClubRepository | ||
|
||
public init(clubRepository: any ClubRepository) { | ||
self.clubRepository = clubRepository | ||
} | ||
|
||
public func callAsFunction(schoolID: String, req: CreatedClubRequestDTO) async throws { | ||
try await clubRepository.createdClub(schoolID: schoolID, req: req) | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
Service/Sources/Data/UseCase/Club/DeleteClubUseCaseImpl.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,13 @@ | ||
import Foundation | ||
|
||
public struct DeleteClubUseCaseImpl: DeleteClubUseCase { | ||
private let clubRepository: any ClubRepository | ||
|
||
public init(clubRepository: any ClubRepository) { | ||
self.clubRepository = clubRepository | ||
} | ||
|
||
public func callAsFunction(clubID: Int) async throws { | ||
try await clubRepository.deleteClub(clubID: clubID) | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
Service/Sources/Data/UseCase/Club/ModifyClubUseCaseImpl.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,13 @@ | ||
import Foundation | ||
|
||
public struct ModifyClubUseCaseImpl: ModifyClubUseCase { | ||
private let clubRepository: any ClubRepository | ||
|
||
public init(clubRepository: any ClubRepository) { | ||
self.clubRepository = clubRepository | ||
} | ||
|
||
public func callAsFunction(clubID: Int, req: ModifyClubRequestDTO) async throws { | ||
try await clubRepository.modifyClub(clubID: clubID, req: req) | ||
} | ||
} |
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
14 changes: 14 additions & 0 deletions
14
Service/Sources/Domain/ClubDomain/DTO/Request/CreatedClubRequestDTO.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,14 @@ | ||
import Foundation | ||
|
||
public struct CreatedClubRequestDTO: Encodable { | ||
public let name: String | ||
public let field: FieldType | ||
|
||
public init( | ||
name: String, | ||
field: FieldType | ||
) { | ||
self.name = name | ||
self.field = field | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
Service/Sources/Domain/ClubDomain/DTO/Request/ModifyClubRequestDTO.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,23 @@ | ||
import Foundation | ||
|
||
public struct ModifyClubRequestDTO: Encodable { | ||
public let name: String | ||
public let field: FieldType | ||
public let schoolID: String | ||
|
||
public init( | ||
name: String, | ||
field: FieldType, | ||
schoolID: String | ||
) { | ||
self.name = name | ||
self.field = field | ||
self.schoolID = schoolID | ||
} | ||
|
||
enum CodingKeys: String, CodingKey { | ||
case name | ||
case field | ||
case schoolID = "schoolId" | ||
} | ||
} |
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
5 changes: 5 additions & 0 deletions
5
Service/Sources/Domain/ClubDomain/UseCase/CreatedClubUseCase.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,5 @@ | ||
import Foundation | ||
|
||
public protocol CreatedClubUseCase { | ||
func callAsFunction(schoolID: String, req: CreatedClubRequestDTO) async throws | ||
} |
5 changes: 5 additions & 0 deletions
5
Service/Sources/Domain/ClubDomain/UseCase/DeleteClubUseCase.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,5 @@ | ||
import Foundation | ||
|
||
public protocol DeleteClubUseCase { | ||
func callAsFunction(clubID: Int) async throws | ||
} |
5 changes: 5 additions & 0 deletions
5
Service/Sources/Domain/ClubDomain/UseCase/ModifyClubUseCase.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,5 @@ | ||
import Foundation | ||
|
||
public protocol ModifyClubUseCase { | ||
func callAsFunction(clubID: Int, req: ModifyClubRequestDTO) async throws | ||
} |