mirror of
https://github.com/certd/certd.git
synced 2026-05-15 04:27:31 +08:00
Merge branch 'v2-dev' into v2-dev-buy
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import {Controller, Get, Provide} from '@midwayjs/core';
|
||||
import {BaseController, Constants} from '@certd/lib-server';
|
||||
|
||||
/**
|
||||
*/
|
||||
@Provide()
|
||||
@Controller('/health')
|
||||
export class HealthController extends BaseController {
|
||||
|
||||
|
||||
@Get('/liveliness', { summary: Constants.per.guest })
|
||||
async liveliness(): Promise<any> {
|
||||
return this.ok('ok')
|
||||
}
|
||||
|
||||
@Get('/readiness', { summary: Constants.per.guest })
|
||||
async readiness(): Promise<any> {
|
||||
return this.ok('ok')
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,6 +10,7 @@ export type CertGetReq = {
|
||||
domains?: string;
|
||||
certId: number;
|
||||
autoApply?:boolean;
|
||||
format?:string; //默认是所有,pem,der,p12,pfx,jks,one,p7b
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -38,6 +39,7 @@ export class OpenCertController extends BaseOpenController {
|
||||
domains: req.domains,
|
||||
certId: req.certId,
|
||||
autoApply: req.autoApply??false,
|
||||
format: req.format
|
||||
});
|
||||
return this.ok(res);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,11 @@ import { ALL, Body, Controller, Inject, Post, Provide, Query } from '@midwayjs/c
|
||||
import { merge } from 'lodash-es';
|
||||
import { CrudController } from '@certd/lib-server';
|
||||
import { PluginImportReq, PluginService } from "../../../modules/plugin/service/plugin-service.js";
|
||||
import { CommPluginConfig, PluginConfigService } from '../../../modules/plugin/service/plugin-config-service.js';
|
||||
import {
|
||||
CommPluginConfig,
|
||||
PluginConfig,
|
||||
PluginConfigService
|
||||
} from '../../../modules/plugin/service/plugin-config-service.js';
|
||||
/**
|
||||
* 插件
|
||||
*/
|
||||
@@ -79,7 +83,11 @@ export class PluginController extends CrudController<PluginService> {
|
||||
const res = await this.pluginConfigService.saveCommPluginConfig(body);
|
||||
return this.ok(res);
|
||||
}
|
||||
|
||||
@Post('/saveSetting', { summary: 'sys:settings:edit' })
|
||||
async saveSetting(@Body(ALL) body: PluginConfig) {
|
||||
const res = await this.pluginConfigService.savePluginConfig(body);
|
||||
return this.ok(res);
|
||||
}
|
||||
|
||||
@Post('/import', { summary: 'sys:settings:edit' })
|
||||
async import(@Body(ALL) body: PluginImportReq) {
|
||||
|
||||
@@ -164,7 +164,8 @@ export class SysSettingsController extends CrudController<SysSettingsService> {
|
||||
|
||||
@Post('/getSmsTypeDefine', { summary: 'sys:settings:view' })
|
||||
async getSmsTypeDefine(@Body('type') type: string) {
|
||||
return this.ok(SmsServiceFactory.getDefine(type));
|
||||
const define =await SmsServiceFactory.getDefine(type);
|
||||
return this.ok(define);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user