mirror of
https://github.com/cool-team-official/cool-admin-midway.git
synced 2025-12-11 00:22:49 +00:00
完善
This commit is contained in:
parent
6a499c033f
commit
6c39f42a56
@ -68,8 +68,8 @@ export default {
|
||||
// 是否开启多租户
|
||||
tenant: {
|
||||
// 是否开启多租户
|
||||
enable: true,
|
||||
// 需要过滤多租户的url
|
||||
enable: false,
|
||||
// 需要过滤多租户的url, 支持通配符, 如/admin/**/* 表示admin模块下的所有接口都进行多租户过滤
|
||||
urls: [],
|
||||
},
|
||||
// 国际化配置
|
||||
|
||||
7
src/modules/demo/controller/open/tenant.ts
Normal file
7
src/modules/demo/controller/open/tenant.ts
Normal file
@ -0,0 +1,7 @@
|
||||
import { CoolController, BaseController } from '@cool-midway/core';
|
||||
|
||||
/**
|
||||
* 多租户
|
||||
*/
|
||||
@CoolController({})
|
||||
export class DemoTenantController extends BaseController {}
|
||||
29
src/modules/demo/service/tenant.ts
Normal file
29
src/modules/demo/service/tenant.ts
Normal 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() {}
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user