签入脚本
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"easygoadmin/api/v1"
|
||||
"easygoadmin/internal/service"
|
||||
)
|
||||
|
||||
// ============================== 个人中心与菜单聚合控制器 ==============================
|
||||
|
||||
// CIndex 个人中心与菜单聚合控制器
|
||||
// 薄层控制器,仅负责参数透传,业务逻辑由 service.Index() 处理
|
||||
type CIndex struct{}
|
||||
|
||||
// GetUser 获取当前登录用户信息
|
||||
// 返回用户基础信息、角色与权限集合
|
||||
func (c *CIndex) GetUser(ctx context.Context, req *v1.GetUserReq) (res *v1.GetUserRes, err error) {
|
||||
return service.Index().GetUser(ctx, req)
|
||||
}
|
||||
|
||||
// GetMenus 获取当前用户菜单树
|
||||
// 返回当前用户可见的菜单树形结构
|
||||
func (c *CIndex) GetMenus(ctx context.Context, req *v1.GetMenusReq) (res *v1.GetMenusRes, err error) {
|
||||
return service.Index().GetMenus(ctx, req)
|
||||
}
|
||||
|
||||
// GetMenusById 获取当前用户菜单树(带路径参数)
|
||||
// 与无路径参数的菜单路由共用同一处理逻辑
|
||||
func (c *CIndex) GetMenusById(ctx context.Context, req *v1.GetMenusByIdReq) (res *v1.GetMenusRes, err error) {
|
||||
return service.Index().GetMenusById(ctx, req)
|
||||
}
|
||||
|
||||
// UpdatePassword 修改个人密码
|
||||
// 校验原密码后更新为新密码
|
||||
func (c *CIndex) UpdatePassword(ctx context.Context, req *v1.UpdatePasswordReq) (res *v1.UpdatePasswordRes, err error) {
|
||||
return service.Index().UpdatePassword(ctx, req)
|
||||
}
|
||||
|
||||
// UpdateProfile 更新个人信息
|
||||
// 更新当前登录用户的个人资料
|
||||
func (c *CIndex) UpdateProfile(ctx context.Context, req *v1.UpdateProfileReq) (res *v1.UpdateProfileRes, err error) {
|
||||
return service.Index().UpdateProfile(ctx, req)
|
||||
}
|
||||
Reference in New Issue
Block a user