generated from PenaSide/GolangTemplate
remove account
This commit is contained in:
parent
cbbcb19b50
commit
f37abc8c7a
@ -101,7 +101,7 @@ func Run(config *models.Config, logger *zap.Logger) (appErr error) {
|
|||||||
apix := initialize.NewAPI(*controllers)
|
apix := initialize.NewAPI(*controllers)
|
||||||
_ = apix
|
_ = apix
|
||||||
|
|
||||||
api := swagger.NewAPI2(logger, mongoDB)
|
api := swagger.NewAPI2(logger, mongoDB, config)
|
||||||
|
|
||||||
serverHTTP, httpErr := server.NewHTTP(server.DepsHTTP{
|
serverHTTP, httpErr := server.NewHTTP(server.DepsHTTP{
|
||||||
Logger: logger,
|
Logger: logger,
|
||||||
|
@ -127,7 +127,6 @@ func (receiver *Controller) RemoveDirectAccount(ctx echo.Context, userID string)
|
|||||||
return ctx.JSON(http.StatusOK, account)
|
return ctx.JSON(http.StatusOK, account)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO delete
|
|
||||||
func (receiver *Controller) SetVerificationStatus(ctx echo.Context, userID string) error {
|
func (receiver *Controller) SetVerificationStatus(ctx echo.Context, userID string) error {
|
||||||
request, bindErr := echotools.Bind[models.SetAccountStatus](ctx)
|
request, bindErr := echotools.Bind[models.SetAccountStatus](ctx)
|
||||||
if bindErr != nil {
|
if bindErr != nil {
|
||||||
@ -144,7 +143,6 @@ func (receiver *Controller) SetVerificationStatus(ctx echo.Context, userID strin
|
|||||||
return ctx.JSON(http.StatusOK, account)
|
return ctx.JSON(http.StatusOK, account)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO delete
|
|
||||||
func (receiver *Controller) UpdateAccountName(ctx echo.Context) error {
|
func (receiver *Controller) UpdateAccountName(ctx echo.Context) error {
|
||||||
userID, ok := ctx.Get(models.AuthJWTDecodedUserIDKey).(string)
|
userID, ok := ctx.Get(models.AuthJWTDecodedUserIDKey).(string)
|
||||||
if !ok {
|
if !ok {
|
||||||
|
@ -184,8 +184,17 @@ func (api *API2) AddAccount(ctx echo.Context) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (api *API2) DeleteDirectAccount(ctx echo.Context, userID string) error {
|
func (api *API2) DeleteDirectAccount(ctx echo.Context, userID string) error {
|
||||||
// return receiver.accountController.RemoveDirectAccount(ctx, userID)
|
account, err := api.account.Remove(ctx.Request().Context(), userID)
|
||||||
return ctx.JSON(http.StatusBadRequest, models.ResponseErrorHTTP{Message: "TODO", StatusCode: 888})
|
if err != nil {
|
||||||
|
api.logger.Error("failed to remove account on <RemoveAccount> of <AccountService>",
|
||||||
|
zap.Error(err),
|
||||||
|
zap.String("userID", userID),
|
||||||
|
)
|
||||||
|
return errors.HTTP(ctx, err)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return ctx.JSON(http.StatusOK, account)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (api *API2) GetDirectAccount(ctx echo.Context, userID string) error {
|
func (api *API2) GetDirectAccount(ctx echo.Context, userID string) error {
|
||||||
|
Loading…
Reference in New Issue
Block a user