2 Star 5 Fork 8

联犀/中台模块

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
tenantAppIndexLogic.go 1.32 KB
一键复制 编辑 原始数据 按行查看 历史
杨磊 提交于 4个月前 . feat: 更新mod
package tenantmanagelogic
import (
"context"
"gitee.com/unitedrhino/core/service/syssvr/internal/repo/relationDB"
"gitee.com/unitedrhino/core/service/syssvr/internal/svc"
"gitee.com/unitedrhino/core/service/syssvr/pb/sys"
"gitee.com/unitedrhino/share/ctxs"
"github.com/zeromicro/go-zero/core/logx"
)
type TenantAppIndexLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
logx.Logger
}
func NewTenantAppIndexLogic(ctx context.Context, svcCtx *svc.ServiceContext) *TenantAppIndexLogic {
return &TenantAppIndexLogic{
ctx: ctx,
svcCtx: svcCtx,
Logger: logx.WithContext(ctx),
}
}
func (l *TenantAppIndexLogic) TenantAppIndex(in *sys.TenantAppIndexReq) (*sys.TenantAppIndexResp, error) {
if err := ctxs.IsRoot(l.ctx); err == nil && in.Code != "" {
ctxs.GetUserCtx(l.ctx).AllTenant = true
defer func() {
ctxs.GetUserCtx(l.ctx).AllTenant = false
}()
}
f := relationDB.TenantAppFilter{TenantCode: in.Code, AppCodes: in.AppCodes, AppID: in.AppID, Type: in.Type, SubType: in.SubType}
list, err := relationDB.NewTenantAppRepo(l.ctx).FindByFilter(l.ctx, f, nil)
if err != nil {
return nil, err
}
var retList []*sys.TenantAppInfo
for _, v := range list {
val := ToTenantApp(l.ctx, l.svcCtx, v)
retList = append(retList, val)
}
return &sys.TenantAppIndexResp{List: retList, Total: int64(len(list))}, nil
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/unitedrhino/core.git
git@gitee.com:unitedrhino/core.git
unitedrhino
core
中台模块
v0.2.4

搜索帮助