-
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.
- Loading branch information
YutaKakiki
authored and
YutaKakiki
committed
Jan 11, 2025
1 parent
ebf5873
commit dd0ab04
Showing
34 changed files
with
339 additions
and
186 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package queryservice | ||
|
||
import "context" | ||
|
||
// ORMはこのインターフェースを満たすように設計する | ||
type Querier interface { | ||
FetchTaskById(ctx context.Context, id string) (FetchTaskByIdRow, error) | ||
FetchAllTasks(ctx context.Context) ([]FetchAllTasksRow, error) | ||
FetchUserTasks(ctx context.Context, userID string) ([]FetchUserTasksRow, error) | ||
} | ||
|
||
type FetchTaskByIdRow struct { | ||
ID string | ||
Name string | ||
UserID string | ||
Content string | ||
State int32 | ||
} | ||
|
||
type FetchAllTasksRow struct { | ||
ID string | ||
Name string | ||
UserID string | ||
Content string | ||
State int32 | ||
} | ||
|
||
type FetchUserTasksRow struct { | ||
ID string | ||
Name string | ||
UserID string | ||
Content string | ||
State int32 | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
package repository | ||
|
||
import "context" | ||
|
||
// ORMはこのインターフェースを満たすように設計する | ||
type Querier interface { | ||
DeleteTask(ctx context.Context, id string) error | ||
DeleteUser(ctx context.Context, id string) error | ||
FetchAllUser(ctx context.Context) ([]FetchAllUsersRow, error) | ||
FindTaskById(ctx context.Context, id string) (FindTaskByIdRow, error) | ||
FindUserByEmail(ctx context.Context, email string) (FindUserByEmailRow, error) | ||
FindUserById(ctx context.Context, id string) (FindUserByIdRow, error) | ||
InsertTask(ctx context.Context, arg InsertTaskParams) error | ||
InsertUser(ctx context.Context, arg InsertUserParams) error | ||
UpdateTask(ctx context.Context, arg UpdateTaskParams) error | ||
UpdateUser(ctx context.Context, arg UpdateUserParams) error | ||
} | ||
|
||
type FetchAllUsersRow struct { | ||
ID string | ||
Email string | ||
Name string | ||
HashedPassword string | ||
} | ||
|
||
type FindUserByEmailRow struct { | ||
ID string | ||
Email string | ||
Name string | ||
HashedPassword string | ||
} | ||
|
||
type FindUserByIdRow struct { | ||
ID string | ||
Email string | ||
Name string | ||
HashedPassword string | ||
} | ||
|
||
type InsertUserParams struct { | ||
ID string | ||
Name string | ||
Email string | ||
HashedPassword string | ||
} | ||
|
||
type UpdateUserParams struct { | ||
Name string | ||
Email string | ||
ID string | ||
} | ||
|
||
type FindTaskByIdRow struct { | ||
ID string | ||
UserID string | ||
Content string | ||
State int32 | ||
} | ||
|
||
type InsertTaskParams struct { | ||
ID string | ||
UserID string | ||
Content string | ||
State int32 | ||
} | ||
|
||
type UpdateTaskParams struct { | ||
State int32 | ||
ID string | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.