This commit is contained in:
COOL 2025-01-22 11:28:30 +08:00
parent 6a499c033f
commit 6c39f42a56
4 changed files with 50 additions and 2 deletions

View File

@ -68,8 +68,8 @@ export default {
// 是否开启多租户
tenant: {
// 是否开启多租户
enable: true,
// 需要过滤多租户的url
enable: false,
// 需要过滤多租户的url, 支持通配符, 如/admin/**/* 表示admin模块下的所有接口都进行多租户过滤
urls: [],
},
// 国际化配置

View File

@ -0,0 +1,7 @@
import { CoolController, BaseController } from '@cool-midway/core';
/**
*
*/
@CoolController({})
export class DemoTenantController extends BaseController {}

View File

@ -0,0 +1,29 @@
import { Provide } from '@midwayjs/core';
import { BaseService } from '@cool-midway/core';
import { InjectEntityModel } from '@midwayjs/typeorm';
import { Repository } from 'typeorm';
import { DemoGoodsEntity } from '../entity/goods';
/**
*
*/
@Provide()
export class DemoTenantService extends BaseService {
@InjectEntityModel(DemoGoodsEntity)
demoGoodsEntity: Repository<DemoGoodsEntity>;
/**
* 使
*/
async use() {}
/**
* 使(使)
*/
async noUse() {}
/**
*
*/
async invalid() {}
}

View File

@ -34,4 +34,16 @@ export class UserInfoEntity extends BaseEntity {
@Column({ comment: '密码', nullable: true })
password: string;
@Column({ comment: '介绍', type: 'text', nullable: true })
description: string;
@Column({
comment: '余额',
type: 'decimal',
precision: 10,
scale: 2,
default: 0,
})
balance: number;
}