You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
718 B
Go
32 lines
718 B
Go
package user
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"git.noahlan.cn/noahlan/ntool-biz/zero/statusz"
|
|
|
|
"git.noahlan.cn/n-admin/n-admin-server/api/internal/logic/user"
|
|
"git.noahlan.cn/n-admin/n-admin-server/api/internal/svc"
|
|
)
|
|
|
|
// swagger:route get /api/user user GetCurrentUser
|
|
//
|
|
// Get Current User | 获取当前登录用户信息
|
|
//
|
|
// Get Current User | 获取当前登录用户信息
|
|
//
|
|
// Responses:
|
|
// 200: UserInfo
|
|
|
|
func GetCurrentUserHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|
return func(w http.ResponseWriter, r *http.Request) {
|
|
const transErr = true
|
|
|
|
l := user.NewGetCurrentUserLogic(r, r.Context(), svcCtx)
|
|
resp, err := l.GetCurrentUser()
|
|
|
|
statusz.ResponseHandler(r, w, transErr, resp, err)
|
|
|
|
}
|
|
}
|