-
-
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.
refactor: migrate return table to new function
- Loading branch information
1 parent
09198e0
commit 08ef801
Showing
13 changed files
with
635 additions
and
670 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
[{"id":"1687526808254750400","name":"Genre","description":"Description"},{"id":"1687526812227435700","name":"Genre","description":"Description"},{"id":"1687526815631740700","name":"Genre","description":"Description"},{"id":"1687526818712543300","name":"Genre","description":"Description"},{"id":"1687605897304680300","name":"hiih","description":"ok"},{"id":"1687606171273872000","name":"okkoko","description":"vgv"},{"id":"1687703776885603200","name":"hihi","description":"okoh"},{"id":"1687704016678422300","name":"","description":""},{"id":"1687704295465036500","name":"","description":""},{"id":"1687704371901516500","name":"","description":""},{"id":"1687704954686620900","name":"effe","description":"fe"},{"id":"1687710868792967500","name":"","description":""},{"id":"1687712036555293800","name":"drdr","description":"ferfe"}] | ||
[{"id":"1687526808254750400","name":"Genre","description":"Description"},{"id":"1687526812227435700","name":"Genre","description":"Description"},{"id":"1687526815631740700","name":"Genre","description":"Description"},{"id":"1687526818712543300","name":"Genre","description":"Description"},{"id":"1687606171273872000","name":"okkoko","description":"vgv"},{"id":"1687703776885603200","name":"hihi","description":"okoh"},{"id":"1687704016678422300","name":"","description":""},{"id":"1687704295465036500","name":"","description":""},{"id":"1687704371901516500","name":"","description":""},{"id":"1687704954686620900","name":"effe","description":"fe"},{"id":"1687710868792967500","name":"","description":""},{"id":"1687712036555293800","name":"drdr","description":"ferfe"}] |
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,51 +1,51 @@ | ||
package artists | ||
|
||
import ( | ||
"github.com/thuongtruong109/soundlib/internal/common" | ||
"github.com/thuongtruong109/soundlib/pkg/constants" | ||
"github.com/thuongtruong109/soundlib/pkg/helpers" | ||
) | ||
|
||
type ArtistHandler struct { | ||
uc ArtistUsecase | ||
helper helpers.Helper | ||
ch common.CommonHandler | ||
} | ||
|
||
func NewArtistHandler(uc ArtistUsecase, helper helpers.Helper, ch common.CommonHandler) *ArtistHandler { | ||
return &ArtistHandler{ | ||
uc: uc, | ||
helper: helper, | ||
ch: ch, | ||
} | ||
} | ||
|
||
func (u *ArtistHandler) GetArtists() { | ||
result, err := u.uc.GetArtists() | ||
u.ch.ErrorWrapper(constants.GET_FAILED, err) | ||
u.ch.SuccessWrapper(constants.GET_SUCCESS, result) | ||
} | ||
|
||
func (u *ArtistHandler) GetArtist() { | ||
result, err := u.uc.GetArtist() | ||
u.ch.ErrorWrapper(constants.GET_FAILED, err) | ||
u.ch.SuccessWrapper(constants.GET_SUCCESS, result) | ||
} | ||
|
||
func (u *ArtistHandler) CreateArtist() { | ||
result, err := u.uc.CreateArtist() | ||
u.ch.ErrorWrapper(constants.CREATE_FAILED, err) | ||
u.ch.SuccessWrapper(constants.CREATE_SUCCESS, result) | ||
} | ||
|
||
func (u *ArtistHandler) DeleteArtist() { | ||
err := u.uc.DeleteArtist() | ||
u.ch.ErrorWrapper(constants.DELETE_FAILED, err) | ||
u.helper.OutputSuccess(constants.DELETE_SUCCESS) | ||
} | ||
|
||
func (u *ArtistHandler) UpdateArtist() { | ||
result, err := u.uc.UpdateArtist() | ||
u.ch.ErrorWrapper(constants.UPDATE_FAILED, err) | ||
u.ch.SuccessWrapper(constants.UPDATE_SUCCESS, result) | ||
} | ||
// import ( | ||
// "github.com/thuongtruong109/soundlib/internal/common" | ||
// "github.com/thuongtruong109/soundlib/pkg/constants" | ||
// "github.com/thuongtruong109/soundlib/pkg/helpers" | ||
// ) | ||
|
||
// type ArtistHandler struct { | ||
// uc ArtistUsecase | ||
// helper helpers.Helper | ||
// ch common.CommonHandler | ||
// } | ||
|
||
// func NewArtistHandler(uc ArtistUsecase, helper helpers.Helper, ch common.CommonHandler) *ArtistHandler { | ||
// return &ArtistHandler{ | ||
// uc: uc, | ||
// helper: helper, | ||
// ch: ch, | ||
// } | ||
// } | ||
|
||
// func (u *ArtistHandler) GetArtists() { | ||
// result, err := u.uc.GetArtists() | ||
// u.ch.ErrorWrapper(constants.GET_FAILED, err) | ||
// u.ch.SuccessWrapper(constants.GET_SUCCESS, result) | ||
// } | ||
|
||
// func (u *ArtistHandler) GetArtist() { | ||
// result, err := u.uc.GetArtist() | ||
// u.ch.ErrorWrapper(constants.GET_FAILED, err) | ||
// u.ch.SuccessWrapper(constants.GET_SUCCESS, result) | ||
// } | ||
|
||
// func (u *ArtistHandler) CreateArtist() { | ||
// result, err := u.uc.CreateArtist() | ||
// u.ch.ErrorWrapper(constants.CREATE_FAILED, err) | ||
// u.ch.SuccessWrapper(constants.CREATE_SUCCESS, result) | ||
// } | ||
|
||
// func (u *ArtistHandler) DeleteArtist() { | ||
// err := u.uc.DeleteArtist() | ||
// u.ch.ErrorWrapper(constants.DELETE_FAILED, err) | ||
// u.helper.OutputSuccess(constants.DELETE_SUCCESS) | ||
// } | ||
|
||
// func (u *ArtistHandler) UpdateArtist() { | ||
// result, err := u.uc.UpdateArtist() | ||
// u.ch.ErrorWrapper(constants.UPDATE_FAILED, err) | ||
// u.ch.SuccessWrapper(constants.UPDATE_SUCCESS, result) | ||
// } |
Oops, something went wrong.