😎增加一键同步所有租户数据库
This commit is contained in:
parent
51695c9e84
commit
95d156fe71
@ -381,6 +381,20 @@ public class SysTenantService : IDynamicApiController, ITransient
|
|||||||
return password;
|
return password;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 同步所有租户数据库 🔖
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[DisplayName("同步所有租户数据库")]
|
||||||
|
public async Task SyncTenantDb()
|
||||||
|
{
|
||||||
|
var tenantList = await _sysTenantRep.GetListAsync();
|
||||||
|
foreach (var tenant in tenantList)
|
||||||
|
{
|
||||||
|
await InitTenantDb(new TenantInput { Id = tenant.Id });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 缓存所有租户
|
/// 缓存所有租户
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -408,9 +422,8 @@ public class SysTenantService : IDynamicApiController, ITransient
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="input"></param>
|
/// <param name="input"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[ApiDescriptionSettings(Name = "CreateDb"), HttpPost]
|
|
||||||
[DisplayName("创建租户数据库")]
|
[DisplayName("创建租户数据库")]
|
||||||
public async Task CreateDb(TenantInput input)
|
public async Task InitTenantDb(TenantInput input)
|
||||||
{
|
{
|
||||||
var tenant = await _sysTenantRep.GetSingleAsync(u => u.Id == input.Id);
|
var tenant = await _sysTenantRep.GetSingleAsync(u => u.Id == input.Id);
|
||||||
if (tenant == null) return;
|
if (tenant == null) return;
|
||||||
|
|||||||
@ -84,54 +84,6 @@ export const SysTenantApiAxiosParamCreator = function (configuration?: Configura
|
|||||||
options: localVarRequestOptions,
|
options: localVarRequestOptions,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @summary 创建租户数据库 🔖
|
|
||||||
* @param {TenantInput} [body]
|
|
||||||
* @param {*} [options] Override http request option.
|
|
||||||
* @throws {RequiredError}
|
|
||||||
*/
|
|
||||||
apiSysTenantCreateDbPost: async (body?: TenantInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
||||||
const localVarPath = `/api/sysTenant/createDb`;
|
|
||||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
||||||
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
|
||||||
let baseOptions;
|
|
||||||
if (configuration) {
|
|
||||||
baseOptions = configuration.baseOptions;
|
|
||||||
}
|
|
||||||
const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
|
|
||||||
const localVarHeaderParameter = {} as any;
|
|
||||||
const localVarQueryParameter = {} as any;
|
|
||||||
|
|
||||||
// authentication Bearer required
|
|
||||||
// http bearer authentication required
|
|
||||||
if (configuration && configuration.accessToken) {
|
|
||||||
const accessToken = typeof configuration.accessToken === 'function'
|
|
||||||
? await configuration.accessToken()
|
|
||||||
: await configuration.accessToken;
|
|
||||||
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
|
|
||||||
|
|
||||||
const query = new URLSearchParams(localVarUrlObj.search);
|
|
||||||
for (const key in localVarQueryParameter) {
|
|
||||||
query.set(key, localVarQueryParameter[key]);
|
|
||||||
}
|
|
||||||
for (const key in options.params) {
|
|
||||||
query.set(key, options.params[key]);
|
|
||||||
}
|
|
||||||
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
|
||||||
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
||||||
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
||||||
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
|
|
||||||
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
|
|
||||||
|
|
||||||
return {
|
|
||||||
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
|
||||||
options: localVarRequestOptions,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary 删除租户 🔖
|
* @summary 删除租户 🔖
|
||||||
@ -228,6 +180,54 @@ export const SysTenantApiAxiosParamCreator = function (configuration?: Configura
|
|||||||
options: localVarRequestOptions,
|
options: localVarRequestOptions,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @summary 创建租户数据库 🔖
|
||||||
|
* @param {TenantInput} [body]
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
apiSysTenantInitTenantDbPost: async (body?: TenantInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||||
|
const localVarPath = `/api/sysTenant/initTenantDb`;
|
||||||
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||||
|
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
||||||
|
let baseOptions;
|
||||||
|
if (configuration) {
|
||||||
|
baseOptions = configuration.baseOptions;
|
||||||
|
}
|
||||||
|
const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
|
||||||
|
const localVarHeaderParameter = {} as any;
|
||||||
|
const localVarQueryParameter = {} as any;
|
||||||
|
|
||||||
|
// authentication Bearer required
|
||||||
|
// http bearer authentication required
|
||||||
|
if (configuration && configuration.accessToken) {
|
||||||
|
const accessToken = typeof configuration.accessToken === 'function'
|
||||||
|
? await configuration.accessToken()
|
||||||
|
: await configuration.accessToken;
|
||||||
|
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
|
||||||
|
|
||||||
|
const query = new URLSearchParams(localVarUrlObj.search);
|
||||||
|
for (const key in localVarQueryParameter) {
|
||||||
|
query.set(key, localVarQueryParameter[key]);
|
||||||
|
}
|
||||||
|
for (const key in options.params) {
|
||||||
|
query.set(key, options.params[key]);
|
||||||
|
}
|
||||||
|
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
||||||
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||||
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||||
|
const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
|
||||||
|
localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
|
||||||
|
|
||||||
|
return {
|
||||||
|
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
||||||
|
options: localVarRequestOptions,
|
||||||
|
};
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary 获取租户管理员角色拥有菜单Id集合 🔖
|
* @summary 获取租户管理员角色拥有菜单Id集合 🔖
|
||||||
@ -420,6 +420,49 @@ export const SysTenantApiAxiosParamCreator = function (configuration?: Configura
|
|||||||
options: localVarRequestOptions,
|
options: localVarRequestOptions,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @summary 同步所有租户数据库 🔖
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
apiSysTenantSyncTenantDbPost: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||||
|
const localVarPath = `/api/sysTenant/syncTenantDb`;
|
||||||
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||||
|
const localVarUrlObj = new URL(localVarPath, 'https://example.com');
|
||||||
|
let baseOptions;
|
||||||
|
if (configuration) {
|
||||||
|
baseOptions = configuration.baseOptions;
|
||||||
|
}
|
||||||
|
const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
|
||||||
|
const localVarHeaderParameter = {} as any;
|
||||||
|
const localVarQueryParameter = {} as any;
|
||||||
|
|
||||||
|
// authentication Bearer required
|
||||||
|
// http bearer authentication required
|
||||||
|
if (configuration && configuration.accessToken) {
|
||||||
|
const accessToken = typeof configuration.accessToken === 'function'
|
||||||
|
? await configuration.accessToken()
|
||||||
|
: await configuration.accessToken;
|
||||||
|
localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
|
||||||
|
}
|
||||||
|
|
||||||
|
const query = new URLSearchParams(localVarUrlObj.search);
|
||||||
|
for (const key in localVarQueryParameter) {
|
||||||
|
query.set(key, localVarQueryParameter[key]);
|
||||||
|
}
|
||||||
|
for (const key in options.params) {
|
||||||
|
query.set(key, options.params[key]);
|
||||||
|
}
|
||||||
|
localVarUrlObj.search = (new URLSearchParams(query)).toString();
|
||||||
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
||||||
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
||||||
|
|
||||||
|
return {
|
||||||
|
url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
|
||||||
|
options: localVarRequestOptions,
|
||||||
|
};
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary 更新租户 🔖
|
* @summary 更新租户 🔖
|
||||||
@ -539,20 +582,6 @@ export const SysTenantApiFp = function(configuration?: Configuration) {
|
|||||||
return axios.request(axiosRequestArgs);
|
return axios.request(axiosRequestArgs);
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @summary 创建租户数据库 🔖
|
|
||||||
* @param {TenantInput} [body]
|
|
||||||
* @param {*} [options] Override http request option.
|
|
||||||
* @throws {RequiredError}
|
|
||||||
*/
|
|
||||||
async apiSysTenantCreateDbPost(body?: TenantInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
|
|
||||||
const localVarAxiosArgs = await SysTenantApiAxiosParamCreator(configuration).apiSysTenantCreateDbPost(body, options);
|
|
||||||
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
||||||
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
|
||||||
return axios.request(axiosRequestArgs);
|
|
||||||
};
|
|
||||||
},
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary 删除租户 🔖
|
* @summary 删除租户 🔖
|
||||||
@ -581,6 +610,20 @@ export const SysTenantApiFp = function(configuration?: Configuration) {
|
|||||||
return axios.request(axiosRequestArgs);
|
return axios.request(axiosRequestArgs);
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @summary 创建租户数据库 🔖
|
||||||
|
* @param {TenantInput} [body]
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
async apiSysTenantInitTenantDbPost(body?: TenantInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
|
||||||
|
const localVarAxiosArgs = await SysTenantApiAxiosParamCreator(configuration).apiSysTenantInitTenantDbPost(body, options);
|
||||||
|
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
||||||
|
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
||||||
|
return axios.request(axiosRequestArgs);
|
||||||
|
};
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary 获取租户管理员角色拥有菜单Id集合 🔖
|
* @summary 获取租户管理员角色拥有菜单Id集合 🔖
|
||||||
@ -637,6 +680,19 @@ export const SysTenantApiFp = function(configuration?: Configuration) {
|
|||||||
return axios.request(axiosRequestArgs);
|
return axios.request(axiosRequestArgs);
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @summary 同步所有租户数据库 🔖
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
async apiSysTenantSyncTenantDbPost(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
|
||||||
|
const localVarAxiosArgs = await SysTenantApiAxiosParamCreator(configuration).apiSysTenantSyncTenantDbPost(options);
|
||||||
|
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
||||||
|
const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
|
||||||
|
return axios.request(axiosRequestArgs);
|
||||||
|
};
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary 更新租户 🔖
|
* @summary 更新租户 🔖
|
||||||
@ -684,16 +740,6 @@ export const SysTenantApiFactory = function (configuration?: Configuration, base
|
|||||||
async apiSysTenantAddPost(body?: AddTenantInput, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
|
async apiSysTenantAddPost(body?: AddTenantInput, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
|
||||||
return SysTenantApiFp(configuration).apiSysTenantAddPost(body, options).then((request) => request(axios, basePath));
|
return SysTenantApiFp(configuration).apiSysTenantAddPost(body, options).then((request) => request(axios, basePath));
|
||||||
},
|
},
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @summary 创建租户数据库 🔖
|
|
||||||
* @param {TenantInput} [body]
|
|
||||||
* @param {*} [options] Override http request option.
|
|
||||||
* @throws {RequiredError}
|
|
||||||
*/
|
|
||||||
async apiSysTenantCreateDbPost(body?: TenantInput, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
|
|
||||||
return SysTenantApiFp(configuration).apiSysTenantCreateDbPost(body, options).then((request) => request(axios, basePath));
|
|
||||||
},
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary 删除租户 🔖
|
* @summary 删除租户 🔖
|
||||||
@ -714,6 +760,16 @@ export const SysTenantApiFactory = function (configuration?: Configuration, base
|
|||||||
async apiSysTenantGrantMenuPost(body?: RoleMenuInput, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
|
async apiSysTenantGrantMenuPost(body?: RoleMenuInput, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
|
||||||
return SysTenantApiFp(configuration).apiSysTenantGrantMenuPost(body, options).then((request) => request(axios, basePath));
|
return SysTenantApiFp(configuration).apiSysTenantGrantMenuPost(body, options).then((request) => request(axios, basePath));
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @summary 创建租户数据库 🔖
|
||||||
|
* @param {TenantInput} [body]
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
async apiSysTenantInitTenantDbPost(body?: TenantInput, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
|
||||||
|
return SysTenantApiFp(configuration).apiSysTenantInitTenantDbPost(body, options).then((request) => request(axios, basePath));
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary 获取租户管理员角色拥有菜单Id集合 🔖
|
* @summary 获取租户管理员角色拥有菜单Id集合 🔖
|
||||||
@ -754,6 +810,15 @@ export const SysTenantApiFactory = function (configuration?: Configuration, base
|
|||||||
async apiSysTenantSetStatusPost(body?: TenantInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultInt32>> {
|
async apiSysTenantSetStatusPost(body?: TenantInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultInt32>> {
|
||||||
return SysTenantApiFp(configuration).apiSysTenantSetStatusPost(body, options).then((request) => request(axios, basePath));
|
return SysTenantApiFp(configuration).apiSysTenantSetStatusPost(body, options).then((request) => request(axios, basePath));
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @summary 同步所有租户数据库 🔖
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
*/
|
||||||
|
async apiSysTenantSyncTenantDbPost(options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
|
||||||
|
return SysTenantApiFp(configuration).apiSysTenantSyncTenantDbPost(options).then((request) => request(axios, basePath));
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary 更新租户 🔖
|
* @summary 更新租户 🔖
|
||||||
@ -795,17 +860,6 @@ export class SysTenantApi extends BaseAPI {
|
|||||||
public async apiSysTenantAddPost(body?: AddTenantInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
|
public async apiSysTenantAddPost(body?: AddTenantInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
|
||||||
return SysTenantApiFp(this.configuration).apiSysTenantAddPost(body, options).then((request) => request(this.axios, this.basePath));
|
return SysTenantApiFp(this.configuration).apiSysTenantAddPost(body, options).then((request) => request(this.axios, this.basePath));
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @summary 创建租户数据库 🔖
|
|
||||||
* @param {TenantInput} [body]
|
|
||||||
* @param {*} [options] Override http request option.
|
|
||||||
* @throws {RequiredError}
|
|
||||||
* @memberof SysTenantApi
|
|
||||||
*/
|
|
||||||
public async apiSysTenantCreateDbPost(body?: TenantInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
|
|
||||||
return SysTenantApiFp(this.configuration).apiSysTenantCreateDbPost(body, options).then((request) => request(this.axios, this.basePath));
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary 删除租户 🔖
|
* @summary 删除租户 🔖
|
||||||
@ -828,6 +882,17 @@ export class SysTenantApi extends BaseAPI {
|
|||||||
public async apiSysTenantGrantMenuPost(body?: RoleMenuInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
|
public async apiSysTenantGrantMenuPost(body?: RoleMenuInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
|
||||||
return SysTenantApiFp(this.configuration).apiSysTenantGrantMenuPost(body, options).then((request) => request(this.axios, this.basePath));
|
return SysTenantApiFp(this.configuration).apiSysTenantGrantMenuPost(body, options).then((request) => request(this.axios, this.basePath));
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @summary 创建租户数据库 🔖
|
||||||
|
* @param {TenantInput} [body]
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
* @memberof SysTenantApi
|
||||||
|
*/
|
||||||
|
public async apiSysTenantInitTenantDbPost(body?: TenantInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
|
||||||
|
return SysTenantApiFp(this.configuration).apiSysTenantInitTenantDbPost(body, options).then((request) => request(this.axios, this.basePath));
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary 获取租户管理员角色拥有菜单Id集合 🔖
|
* @summary 获取租户管理员角色拥有菜单Id集合 🔖
|
||||||
@ -872,6 +937,16 @@ export class SysTenantApi extends BaseAPI {
|
|||||||
public async apiSysTenantSetStatusPost(body?: TenantInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultInt32>> {
|
public async apiSysTenantSetStatusPost(body?: TenantInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultInt32>> {
|
||||||
return SysTenantApiFp(this.configuration).apiSysTenantSetStatusPost(body, options).then((request) => request(this.axios, this.basePath));
|
return SysTenantApiFp(this.configuration).apiSysTenantSetStatusPost(body, options).then((request) => request(this.axios, this.basePath));
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @summary 同步所有租户数据库 🔖
|
||||||
|
* @param {*} [options] Override http request option.
|
||||||
|
* @throws {RequiredError}
|
||||||
|
* @memberof SysTenantApi
|
||||||
|
*/
|
||||||
|
public async apiSysTenantSyncTenantDbPost(options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
|
||||||
|
return SysTenantApiFp(this.configuration).apiSysTenantSyncTenantDbPost(options).then((request) => request(this.axios, this.basePath));
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @summary 更新租户 🔖
|
* @summary 更新租户 🔖
|
||||||
|
|||||||
@ -118,14 +118,6 @@ export interface AddOrgInput {
|
|||||||
*/
|
*/
|
||||||
level?: number | null;
|
level?: number | null;
|
||||||
|
|
||||||
/**
|
|
||||||
* 机构类型-数据字典
|
|
||||||
*
|
|
||||||
* @type {string}
|
|
||||||
* @memberof AddOrgInput
|
|
||||||
*/
|
|
||||||
type?: string | null;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 负责人Id
|
* 负责人Id
|
||||||
*
|
*
|
||||||
@ -179,4 +171,12 @@ export interface AddOrgInput {
|
|||||||
* @memberof AddOrgInput
|
* @memberof AddOrgInput
|
||||||
*/
|
*/
|
||||||
name: string;
|
name: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 机构类型
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof AddOrgInput
|
||||||
|
*/
|
||||||
|
type?: string | null;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -154,4 +154,12 @@ export interface LoginUserOutput {
|
|||||||
* @memberof LoginUserOutput
|
* @memberof LoginUserOutput
|
||||||
*/
|
*/
|
||||||
roleIds?: Array<number> | null;
|
roleIds?: Array<number> | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 水印文字
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof LoginUserOutput
|
||||||
|
*/
|
||||||
|
watermarkText?: string | null;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -30,6 +30,12 @@ export interface MemberInfo {
|
|||||||
*/
|
*/
|
||||||
memberType?: MemberTypes;
|
memberType?: MemberTypes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {string}
|
||||||
|
* @memberof MemberInfo
|
||||||
|
*/
|
||||||
|
name?: string | null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Type}
|
* @type {Type}
|
||||||
* @memberof MemberInfo
|
* @memberof MemberInfo
|
||||||
@ -42,12 +48,6 @@ export interface MemberInfo {
|
|||||||
*/
|
*/
|
||||||
reflectedType?: Type;
|
reflectedType?: Type;
|
||||||
|
|
||||||
/**
|
|
||||||
* @type {string}
|
|
||||||
* @memberof MemberInfo
|
|
||||||
*/
|
|
||||||
name?: string | null;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Module}
|
* @type {Module}
|
||||||
* @memberof MemberInfo
|
* @memberof MemberInfo
|
||||||
|
|||||||
@ -118,14 +118,6 @@ export interface UpdateOrgInput {
|
|||||||
*/
|
*/
|
||||||
level?: number | null;
|
level?: number | null;
|
||||||
|
|
||||||
/**
|
|
||||||
* 机构类型-数据字典
|
|
||||||
*
|
|
||||||
* @type {string}
|
|
||||||
* @memberof UpdateOrgInput
|
|
||||||
*/
|
|
||||||
type?: string | null;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 负责人Id
|
* 负责人Id
|
||||||
*
|
*
|
||||||
@ -179,4 +171,12 @@ export interface UpdateOrgInput {
|
|||||||
* @memberof UpdateOrgInput
|
* @memberof UpdateOrgInput
|
||||||
*/
|
*/
|
||||||
name: string;
|
name: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 机构类型
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof UpdateOrgInput
|
||||||
|
*/
|
||||||
|
type?: string | null;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,6 +17,9 @@
|
|||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="ele-Plus" @click="openAddTenant" v-auth="'sysTenant:add'"> 新增 </el-button>
|
<el-button type="primary" icon="ele-Plus" @click="openAddTenant" v-auth="'sysTenant:add'"> 新增 </el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="danger" icon="ele-Refresh" @click="syncTenantDb" plain> 同步所有租户数据库 </el-button>
|
||||||
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
@ -239,7 +242,7 @@ const createTenant = (row: any) => {
|
|||||||
type: 'warning',
|
type: 'warning',
|
||||||
})
|
})
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
await getAPI(SysTenantApi).apiSysTenantCreateDbPost({ id: row.id });
|
await getAPI(SysTenantApi).apiSysTenantInitTenantDbPost({ id: row.id });
|
||||||
ElMessage.success('创建/更新租户数据库成功');
|
ElMessage.success('创建/更新租户数据库成功');
|
||||||
})
|
})
|
||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
@ -256,4 +259,20 @@ const changeStatus = (row: any) => {
|
|||||||
row.status = row.status == 1 ? 2 : 1;
|
row.status = row.status == 1 ? 2 : 1;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 同步所有租户数据库
|
||||||
|
const syncTenantDb = (row: any) => {
|
||||||
|
ElMessageBox.confirm(`确定同步所有租户数据库?`, '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
})
|
||||||
|
.then(async () => {
|
||||||
|
state.loading = true;
|
||||||
|
await getAPI(SysTenantApi).apiSysTenantSyncTenantDbPost();
|
||||||
|
ElMessage.success('同步成功');
|
||||||
|
state.loading = false;
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user