2 Star 5 Fork 7

联犀/中台模块

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
tenantAppMenuUpdateLogic.go 1.31 KB
一键复制 编辑 原始数据 按行查看 历史
杨磊 提交于 4个月前 . feat: 更新mod
package tenantmanagelogic
import (
"context"
"gitee.com/unitedrhino/core/service/syssvr/internal/repo/relationDB"
"gitee.com/unitedrhino/share/ctxs"
"gitee.com/unitedrhino/core/service/syssvr/internal/svc"
"gitee.com/unitedrhino/core/service/syssvr/pb/sys"
"github.com/zeromicro/go-zero/core/logx"
)
type TenantAppMenuUpdateLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
logx.Logger
}
func NewTenantAppMenuUpdateLogic(ctx context.Context, svcCtx *svc.ServiceContext) *TenantAppMenuUpdateLogic {
return &TenantAppMenuUpdateLogic{
ctx: ctx,
svcCtx: svcCtx,
Logger: logx.WithContext(ctx),
}
}
func (l *TenantAppMenuUpdateLogic) TenantAppMenuUpdate(in *sys.TenantAppMenu) (*sys.Empty, error) {
if err := ctxs.IsRoot(l.ctx); err != nil {
return nil, err
}
ctxs.GetUserCtx(l.ctx).AllTenant = true
defer func() {
ctxs.GetUserCtx(l.ctx).AllTenant = false
}()
old, err := relationDB.NewTenantAppMenuRepo(l.ctx).FindOne(l.ctx, in.Info.Id)
old.Type = in.Info.Type
old.Order = in.Info.Order
old.Name = in.Info.Name
old.Path = in.Info.Path
old.Component = in.Info.Component
old.Icon = in.Info.Icon
old.Redirect = in.Info.Redirect
old.Body = in.Info.Body.Value
old.HideInMenu = in.Info.HideInMenu
err = relationDB.NewTenantAppMenuRepo(l.ctx).Update(l.ctx, old)
return &sys.Empty{}, err
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/unitedrhino/core.git
git@gitee.com:unitedrhino/core.git
unitedrhino
core
中台模块
v1.1.2

搜索帮助