代码拉取完成,页面将自动刷新
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
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。