Skip to content

Commit 033e74b

Browse files
committed
feat(用户信息): 在用户DTO中新增电话字段
将电话字段添加到用户数据传输对象中,确保用户信息包含联系方式。 同时移除项目控制器中的多余空行,保持代码整洁。
1 parent f242887 commit 033e74b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

internal/app/controller/project_controller.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,6 @@ func (tc ProjectController) BatchDeleteProjectByIds(c *gin.Context) {
224224
response.ValidationFail(c, errStr)
225225
return
226226
}
227-
228227
// 前端传来的标签ID
229228
reqProjectIds := strings.Split(req.ProjectIds, ",")
230229
err := tc.ProjectRepository.BatchDeleteProjectByIds(reqProjectIds)
@@ -233,5 +232,4 @@ func (tc ProjectController) BatchDeleteProjectByIds(c *gin.Context) {
233232
return
234233
}
235234
response.Success(c, nil, common.Msg(c, common.MsgDeleteSuccess))
236-
237235
}

pkg/api/dto/user_dto.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ type UserDto struct {
2323
Status uint8 `json:"status"`
2424
Birthday string `json:"birthday"`
2525
Point float64 `json:"point"`
26+
Phone string `json:"phone"`
2627
CreatedAt string `json:"createdAt"`
2728
}
2829

@@ -47,6 +48,8 @@ func toUserDto(user *model.User) UserDto {
4748
AvatarURL: fmt.Sprintf("%s%s", domain, user.AvatarURL),
4849
CreatedAt: user.CreatedAt.Format(known.TIME_FORMAT),
4950
Point: user.Point,
51+
Status: user.Status,
52+
Phone: user.Phone,
5053
}
5154
}
5255

0 commit comments

Comments
 (0)