-
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
1 parent
1bd92b1
commit f9746f0
Showing
21 changed files
with
180 additions
and
204 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
protoc-gen-go-crud/internal/authorization/repositories/wire.go
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
package entities | ||
|
||
type Users struct { | ||
type User struct { | ||
entity.BaseEntity | ||
} | ||
|
||
func (u *Users) TableName() string { return "userss" } | ||
func (u *User) TableName() string { return "users" } |
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 |
---|---|---|
@@ -1,41 +1,41 @@ | ||
package repositories | ||
|
||
type IUsersRepo interface { | ||
CreateUsers(ctx context.Context, Users *entities.Users) error | ||
UpdateUsers(ctx context.Context, updateFields []string, Users *entities.Users) error | ||
GetUsers(ctx context.Context, id entity.ID) (*entities.Users, error) | ||
GetUserss(ctx context.Context, filter *database.Filter) (res []*entities.User, count int64, err error) | ||
DeleteUsers(ctx context.Context, id entity.ID) error | ||
type IUserRepo interface { | ||
CreateUser(ctx context.Context, User *entities.User) error | ||
UpdateUser(ctx context.Context, updateFields []string, User *entities.User) error | ||
GetUser(ctx context.Context, id entity.ID) (*entities.User, error) | ||
GetUsers(ctx context.Context, filter *database.Filter) (res []*entities.User, count int64, err error) | ||
DeleteUser(ctx context.Context, id entity.ID) error | ||
Log(ctx context.Context) *zap.SugaredLogger | ||
} | ||
|
||
type UsersRepo struct { | ||
type UserRepo struct { | ||
} | ||
|
||
func (u *UsersRepo) DB(ctx context.Context) *gorm.DB { | ||
return global.DBFromContext(ctx).Model(&entities.Users{}) | ||
func (u *UserRepo) DB(ctx context.Context) *gorm.DB { | ||
return global.DBFromContext(ctx).Model(&entities.User{}) | ||
} | ||
|
||
func (u UsersRepo) CreateUsers(ctx context.Context, users *entities.Users) error { | ||
func (u UserRepo) CreateUser(ctx context.Context, user *entities.User) error { | ||
panic("todo") | ||
} | ||
|
||
func (u UsersRepo) UpdateUsers(ctx context.Context, updateFields []string, users *entities.Users) error { | ||
func (u UserRepo) UpdateUser(ctx context.Context, updateFields []string, user *entities.User) error { | ||
panic("todo") | ||
} | ||
|
||
func (u UsersRepo) GetUsers(ctx context.Context, id entity.ID) (*entities.Users, error) { | ||
func (u UserRepo) GetUser(ctx context.Context, id entity.ID) (*entities.User, error) { | ||
panic("todo") | ||
} | ||
|
||
func (u UsersRepo) DeleteUsers(ctx context.Context, id entity.ID) error { | ||
func (u UserRepo) DeleteUser(ctx context.Context, id entity.ID) error { | ||
panic("todo") | ||
} | ||
|
||
func (u UsersRepo) GetUserss(ctx context.Context, filter *database.Filter) (res []*entities.Users, count int64, err error) { | ||
func (u UserRepo) GetUsers(ctx context.Context, filter *database.Filter) (res []*entities.User, count int64, err error) { | ||
panic("todo") | ||
} | ||
|
||
func (u UsersRepo) Log(ctx context.Context) *zap.SugaredLogger { | ||
return global.Logger(ctx).Named("UsersRepo") | ||
func (u UserRepo) Log(ctx context.Context) *zap.SugaredLogger { | ||
return global.Logger(ctx).Named("UserRepo") | ||
} |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,41 +1,41 @@ | ||
package usecase | ||
|
||
type IUsersUsecase interface { | ||
CreateUsers(ctx context.Context, in *usersV1.CreateUsersRequest) error | ||
UpdateUsers(ctx context.Context, in *usersV1.UpdateUsersRequest) error | ||
DeleteUsers(ctx context.Context, in *usersV1.DeleteUsersRequest) error | ||
GetUsers(ctx context.Context, in *usersV1.GetUsersRequest) (*entities.Users, error) | ||
ListUsers(ctx context.Context, in *usersV1.ListUsersRequest) ([]*entities.Users, int64, error) | ||
type IUserUseCase interface { | ||
CreateUser(ctx context.Context, in *usersV1.CreateUserRequest) error | ||
UpdateUser(ctx context.Context, in *usersV1.UpdateUserRequest) error | ||
DeleteUser(ctx context.Context, in *usersV1.DeleteUserRequest) error | ||
GetUser(ctx context.Context, in *usersV1.GetUserRequest) (*entities.User, error) | ||
ListUser(ctx context.Context, in *usersV1.ListUserRequest) ([]*entities.User, int64, error) | ||
Log(ctx context.Context) *zap.SugaredLogger | ||
} | ||
|
||
type UsersUseCase struct { | ||
type UserUseCase struct { | ||
} | ||
|
||
func NewUsersUseCase() IUsersUsecase { | ||
return &UsersUseCase{} | ||
func NewUserUseCase() IUserUseCase { | ||
return &UserUseCase{} | ||
} | ||
|
||
func (u *UsersUseCase) CreateUsers(ctx context.Context, in *usersV1.CreateUsersRequest) error { | ||
func (u *UserUseCase) CreateUser(ctx context.Context, in *usersV1.CreateUserRequest) error { | ||
panic("todo") | ||
} | ||
|
||
func (u *UsersUseCase) UpdateUsers(ctx context.Context, in *usersV1.UpdateUsersRequest) error { | ||
func (u *UserUseCase) UpdateUser(ctx context.Context, in *usersV1.UpdateUserRequest) error { | ||
panic("todo") | ||
} | ||
|
||
func (u *UsersUseCase) DeleteUsers(ctx context.Context, in *usersV1.DeleteUsersRequest) error { | ||
func (u *UserUseCase) DeleteUser(ctx context.Context, in *usersV1.DeleteUserRequest) error { | ||
panic("todo") | ||
} | ||
|
||
func (u *UsersUseCase) GetUsers(ctx context.Context, in *usersV1.GetUsersRequest) (*entities.Users, error) { | ||
func (u *UserUseCase) GetUser(ctx context.Context, in *usersV1.GetUserRequest) (*entities.User, error) { | ||
panic("todo") | ||
} | ||
|
||
func (u *UsersUseCase) ListUsers(ctx context.Context, in *usersV1.ListUsersRequest) ([]*entities.Users, int64, error) { | ||
func (u *UserUseCase) ListUser(ctx context.Context, in *usersV1.ListUserRequest) ([]*entities.User, int64, error) { | ||
panic("todo") | ||
} | ||
|
||
func (u UsersUseCase) Log(ctx context.Context) *zap.SugaredLogger { | ||
return global.Logger(ctx).Named("UsersRepo") | ||
func (u UserUseCase) Log(ctx context.Context) *zap.SugaredLogger { | ||
return global.Logger(ctx).Named("UserRepo") | ||
} |
This file was deleted.
Oops, something went wrong.
Binary file not shown.
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