Files
EasyGoAdmin_GoFrame_EleVue/internal/service/index.go
T
2026-10-20 11:37:25 +08:00

54 lines
2.0 KiB
Go

// ================================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// You can delete these comments if you wish manually maintain this interface file.
// ================================================================================
package service
import (
"context"
"easygoadmin/api/v1"
)
// 按模块独立拆分(源:gf gen service 产物手工重组)。
// logic 方法签名变更时需同步维护本文件(手维护,勿整体运行 gf gen service)。
// IIndex 个人中心与菜单聚合服务接口
type (
IIndex interface {
// GetUser 获取当前登录用户信息
// 敏感字段永不返回,角色与权限来自身份加载器
GetUser(ctx context.Context, req *v1.GetUserReq) (res *v1.GetUserRes, err error)
// GetMenus 获取当前用户菜单树
// 关联路径:user → user_role → role → role_menu → menu,超管返回全量
GetMenus(ctx context.Context, req *v1.GetMenusReq) (res *v1.GetMenusRes, err error)
// GetMenusById 获取当前用户菜单树(带路径参数)
// 与无路径参数的菜单路由共用同一处理逻辑
GetMenusById(ctx context.Context, req *v1.GetMenusByIdReq) (res *v1.GetMenusRes, err error)
// UpdatePassword 修改个人密码
// 校验旧密码后使用 bcrypt 重写
UpdatePassword(ctx context.Context, req *v1.UpdatePasswordReq) (res *v1.UpdatePasswordRes, err error)
// UpdateProfile 更新个人信息
// 审计字段由全局钩子盖章
UpdateProfile(ctx context.Context, req *v1.UpdateProfileReq) (res *v1.UpdateProfileRes, err error)
}
)
// localIndex 个人中心与菜单聚合服务实现实例
var (
localIndex IIndex
)
// Index 获取个人中心与菜单聚合服务实例
func Index() IIndex {
if localIndex == nil {
panic("implement not found for interface IIndex, forgot register?")
}
return localIndex
}
// RegisterIndex 注册个人中心与菜单聚合服务实现
func RegisterIndex(i IIndex) {
localIndex = i
}