2 Star 5 Fork 8

联犀/中台模块

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
tenantInfoReadLogic.go 1.15 KB
一键复制 编辑 原始数据 按行查看 历史
杨磊 提交于 4个月前 . feat: 更新mod
package tenantmanagelogic
import (
"context"
"gitee.com/unitedrhino/core/service/syssvr/internal/logic"
"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 TenantInfoReadLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
logx.Logger
}
func NewTenantInfoReadLogic(ctx context.Context, svcCtx *svc.ServiceContext) *TenantInfoReadLogic {
return &TenantInfoReadLogic{
ctx: ctx,
svcCtx: svcCtx,
Logger: logx.WithContext(ctx),
}
}
// 获取区域信息详情
func (l *TenantInfoReadLogic) TenantInfoRead(in *sys.WithIDCode) (*sys.TenantInfo, error) {
if err := ctxs.IsRoot(l.ctx); err == nil {
ctxs.GetUserCtx(l.ctx).AllTenant = true
defer func() {
ctxs.GetUserCtx(l.ctx).AllTenant = false
}()
}
f := relationDB.TenantInfoFilter{ID: in.Id}
if in.Code != "" {
f.Codes = []string{in.Code}
}
ti, err := relationDB.NewTenantInfoRepo(l.ctx).FindOneByFilter(l.ctx, f)
return logic.ToTenantInfoRpc(l.ctx, l.svcCtx, ti), err
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/unitedrhino/core.git
git@gitee.com:unitedrhino/core.git
unitedrhino
core
中台模块
v1.0.3

搜索帮助