feat: 添加和删除养护事项

This commit is contained in:
Blizzard
2026-02-10 14:57:53 +08:00
parent 556ab6baff
commit 01f8306be2
6 changed files with 172 additions and 4 deletions
+19
View File
@@ -6,6 +6,7 @@ import (
"sundynix-go/model/commom/response"
"sundynix-go/model/system"
systemReq "sundynix-go/model/system/request"
"sundynix-go/utils/auth"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
@@ -14,6 +15,24 @@ import (
type UserApi struct {
}
// CurrentUser
// @tags 用户管理
// @Summary 当前登录用户
// @Security ApiKeyAuth
// @Produce json
// @Success 200 {object} response.Response "{"code": 200, "data": {}, "msg": "添加成功"}"
// @Router /user/info [get]
func (u *UserApi) CurrentUser(c *gin.Context) {
userId := auth.GetUserId(c)
user, err := userService.GetUserById(userId)
if err != nil {
global.Logger.Error("获取用户信息失败!", zap.Error(err))
response.FailWithMsg(err.Error(), c)
return
}
response.OkWithData(user, c)
}
// SaveUser
// @tags 用户管理
// @Summary 新增用户