From b5d177910c553609347d4279ddb46adfefe1af1c Mon Sep 17 00:00:00 2001 From: liuyuanchuang Date: Fri, 6 Mar 2026 14:02:04 +0800 Subject: [PATCH] feat: add email in userinfo --- api/v1/user/handler.go | 8 +------- internal/model/user/user.go | 3 +-- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/api/v1/user/handler.go b/api/v1/user/handler.go index 29f593e..1c18b1b 100644 --- a/api/v1/user/handler.go +++ b/api/v1/user/handler.go @@ -100,15 +100,9 @@ func (h *UserEndpoint) GetUserInfo(ctx *gin.Context) { return } - status := 0 - if user.ID > 0 { - status = 1 - } - ctx.JSON(http.StatusOK, common.SuccessResponse(ctx, model.UserInfoResponse{ Username: user.Username, - Phone: user.Phone, - Status: status, + Email: user.Email, })) } diff --git a/internal/model/user/user.go b/internal/model/user/user.go index 652c5a9..f558210 100644 --- a/internal/model/user/user.go +++ b/internal/model/user/user.go @@ -20,8 +20,7 @@ type PhoneLoginResponse struct { type UserInfoResponse struct { Username string `json:"username"` - Phone string `json:"phone"` - Status int `json:"status"` // 0: not login, 1: login + Email string `json:"email"` } type EmailRegisterRequest struct {