增加用户注销功能
This commit is contained in:
@@ -339,6 +339,11 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
||||
|
||||
server.AddRoutes(
|
||||
[]rest.Route{
|
||||
{
|
||||
Method: http.MethodPost,
|
||||
Path: "/user/cancelOut",
|
||||
Handler: user.CancelOutHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
// get user info
|
||||
Method: http.MethodGet,
|
||||
|
||||
17
app/user/cmd/api/internal/handler/user/cancelouthandler.go
Normal file
17
app/user/cmd/api/internal/handler/user/cancelouthandler.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package user
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"tydata-server/app/user/cmd/api/internal/logic/user"
|
||||
"tydata-server/app/user/cmd/api/internal/svc"
|
||||
"tydata-server/common/result"
|
||||
)
|
||||
|
||||
func CancelOutHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
l := user.NewCancelOutLogic(r.Context(), svcCtx)
|
||||
err := l.CancelOut()
|
||||
result.HttpResult(r, w, nil, err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user