chore: 修改权限判断字段从summary改成description

This commit is contained in:
xiaojunnuo
2026-03-15 16:20:20 +08:00
parent b88ee33ae4
commit 25e361b9f9
60 changed files with 385 additions and 385 deletions
@@ -26,57 +26,57 @@ export class SysAccessController extends AccessController {
return 0;
}
@Post('/page', { summary: 'sys:settings:view' })
@Post('/page', { description: 'sys:settings:view' })
async page(@Body(ALL) body: any) {
return await super.page(body);
}
@Post('/list', { summary: 'sys:settings:view' })
@Post('/list', { description: 'sys:settings:view' })
async list(@Body(ALL) body: any) {
return await super.list(body);
}
@Post('/add', { summary: 'sys:settings:edit' })
@Post('/add', { description: 'sys:settings:edit' })
async add(@Body(ALL) bean: any) {
return await super.add(bean);
}
@Post('/update', { summary: 'sys:settings:edit' })
@Post('/update', { description: 'sys:settings:edit' })
async update(@Body(ALL) bean: any) {
return await super.update(bean);
}
@Post('/info', { summary: 'sys:settings:view' })
@Post('/info', { description: 'sys:settings:view' })
async info(@Query('id') id: number) {
return await super.info(id);
}
@Post('/delete', { summary: 'sys:settings:edit' })
@Post('/delete', { description: 'sys:settings:edit' })
async delete(@Query('id') id: number) {
return await super.delete(id);
}
@Post('/define', { summary: 'sys:settings:view' })
@Post('/define', { description: 'sys:settings:view' })
async define(@Query('type') type: string) {
return await super.define(type);
}
@Post('/getSecretPlain', { summary: 'sys:settings:view' })
@Post('/getSecretPlain', { description: 'sys:settings:view' })
async getSecretPlain(@Body(ALL) body: { id: number; key: string }) {
const value = await this.service.getById(body.id, 0);
return this.ok(value[body.key]);
}
@Post('/accessTypeDict', { summary: 'sys:settings:view' })
@Post('/accessTypeDict', { description: 'sys:settings:view' })
async getAccessTypeDict() {
return await super.getAccessTypeDict();
}
@Post('/simpleInfo', { summary: 'sys:settings:view' })
@Post('/simpleInfo', { description: 'sys:settings:view' })
async simpleInfo(@Query('id') id: number) {
return await super.simpleInfo(id);
}
@Post('/getDictByIds', { summary: 'sys:settings:view' })
@Post('/getDictByIds', { description: 'sys:settings:view' })
async getDictByIds(@Body('ids') ids: number[]) {
return await super.getDictByIds(ids);
}
@@ -18,7 +18,7 @@ export class BasicController extends BaseController {
@Inject()
sysSettingsService: SysSettingsService;
@Post('/preBindUser', { summary: 'sys:settings:edit' })
@Post('/preBindUser', { description: 'sys:settings:edit' })
public async preBindUser(@Body(ALL) body: PreBindUserReq) {
// 设置缓存内容
if (body.userId == null || body.userId <= 0) {
@@ -28,7 +28,7 @@ export class BasicController extends BaseController {
return this.ok({});
}
@Post('/bindUser', { summary: 'sys:settings:edit' })
@Post('/bindUser', { description: 'sys:settings:edit' })
public async bindUser(@Body(ALL) body: BindUserReq) {
if (body.userId == null || body.userId <= 0) {
throw new Error("用户ID不能为空");
@@ -39,7 +39,7 @@ export class BasicController extends BaseController {
return this.ok({});
}
@Post('/unbindUser', { summary: 'sys:settings:edit' })
@Post('/unbindUser', { description: 'sys:settings:edit' })
public async unbindUser() {
const installInfo: SysInstallInfo = await this.sysSettingsService.getSetting(SysInstallInfo);
installInfo.bindUserId = null;
@@ -47,7 +47,7 @@ export class BasicController extends BaseController {
return this.ok({});
}
@Post('/updateLicense', { summary: 'sys:settings:edit' })
@Post('/updateLicense', { description: 'sys:settings:edit' })
public async updateLicense(@Body(ALL) body: { license: string }) {
await this.plusService.updateLicense(body.license);
return this.ok(true);
@@ -22,66 +22,66 @@ export class SysAddonController extends AddonController {
return 0;
}
@Post('/page', { summary: 'sys:settings:view' })
@Post('/page', { description: 'sys:settings:view' })
async page(@Body(ALL) body: any) {
return await super.page(body);
}
@Post('/list', { summary: 'sys:settings:view' })
@Post('/list', { description: 'sys:settings:view' })
async list(@Body(ALL) body: any) {
return await super.list(body);
}
@Post('/add', { summary: 'sys:settings:edit' })
@Post('/add', { description: 'sys:settings:edit' })
async add(@Body(ALL) bean: any) {
return await super.add(bean);
}
@Post('/update', { summary: 'sys:settings:edit' })
@Post('/update', { description: 'sys:settings:edit' })
async update(@Body(ALL) bean: any) {
return await super.update(bean);
}
@Post('/info', { summary: 'sys:settings:view' })
@Post('/info', { description: 'sys:settings:view' })
async info(@Query('id') id: number) {
return await super.info(id);
}
@Post('/delete', { summary: 'sys:settings:edit' })
@Post('/delete', { description: 'sys:settings:edit' })
async delete(@Query('id') id: number) {
return await super.delete(id);
}
@Post('/define', { summary: Constants.per.authOnly })
@Post('/define', { description: Constants.per.authOnly })
async define(@Query('type') type: string,@Query('addonType') addonType: string) {
return await super.define(type,addonType);
}
@Post('/getTypeDict', { summary: Constants.per.authOnly })
@Post('/getTypeDict', { description: Constants.per.authOnly })
async getTypeDict(@Query('addonType') addonType: string) {
return await super.getTypeDict(addonType);
}
@Post('/simpleInfo', { summary: Constants.per.authOnly })
@Post('/simpleInfo', { description: Constants.per.authOnly })
async simpleInfo(@Query('addonType') addonType: string,@Query('id') id: number) {
return await super.simpleInfo(addonType,id);
}
@Post('/getDefaultId', { summary: Constants.per.authOnly })
@Post('/getDefaultId', { description: Constants.per.authOnly })
async getDefaultId(@Query('addonType') addonType: string) {
return await super.getDefaultId(addonType);
}
@Post('/setDefault', { summary: Constants.per.authOnly })
@Post('/setDefault', { description: Constants.per.authOnly })
async setDefault(@Query('addonType') addonType: string,@Query('id') id: number) {
return await super.setDefault(addonType,id);
}
@Post('/options', { summary: Constants.per.authOnly })
@Post('/options', { description: Constants.per.authOnly })
async options(@Query('addonType') addonType: string) {
return await super.options(addonType);
}
@Post('/handle', { summary: Constants.per.authOnly })
@Post('/handle', { description: Constants.per.authOnly })
async handle(@Body(ALL) body: AddonRequestHandleReq) {
return await super.handle(body);
}
@@ -15,7 +15,7 @@ export class PermissionController extends CrudController<PermissionService> {
return this.service;
}
@Post('/page', { summary: 'sys:auth:per:view' })
@Post('/page', { description: 'sys:auth:per:view' })
async page(
@Body(ALL)
body
@@ -23,7 +23,7 @@ export class PermissionController extends CrudController<PermissionService> {
return await super.page(body);
}
@Post('/add', { summary: 'sys:auth:per:add' })
@Post('/add', { description: 'sys:auth:per:add' })
async add(
@Body(ALL)
bean
@@ -31,14 +31,14 @@ export class PermissionController extends CrudController<PermissionService> {
return await super.add(bean);
}
@Post('/update', { summary: 'sys:auth:per:edit' })
@Post('/update', { description: 'sys:auth:per:edit' })
async update(
@Body(ALL)
bean
) {
return await super.update(bean);
}
@Post('/delete', { summary: 'sys:auth:per:remove' })
@Post('/delete', { description: 'sys:auth:per:remove' })
async delete(
@Query('id')
id: number
@@ -46,7 +46,7 @@ export class PermissionController extends CrudController<PermissionService> {
return await super.delete(id);
}
@Post('/tree', { summary: 'sys:auth:per:view' })
@Post('/tree', { description: 'sys:auth:per:view' })
async tree() {
const tree = await this.service.tree({});
return this.ok(tree);
@@ -15,7 +15,7 @@ export class RoleController extends CrudController<RoleService> {
return this.service;
}
@Post('/page', { summary: 'sys:auth:role:view' })
@Post('/page', { description: 'sys:auth:role:view' })
async page(
@Body(ALL)
body
@@ -23,13 +23,13 @@ export class RoleController extends CrudController<RoleService> {
return await super.page(body);
}
@Post('/list', { summary: 'sys:auth:role:view' })
@Post('/list', { description: 'sys:auth:role:view' })
async list() {
const ret = await this.service.find({});
return this.ok(ret);
}
@Post('/add', { summary: 'sys:auth:role:add' })
@Post('/add', { description: 'sys:auth:role:add' })
async add(
@Body(ALL)
bean
@@ -37,14 +37,14 @@ export class RoleController extends CrudController<RoleService> {
return await super.add(bean);
}
@Post('/update', { summary: 'sys:auth:role:edit' })
@Post('/update', { description: 'sys:auth:role:edit' })
async update(
@Body(ALL)
bean
) {
return await super.update(bean);
}
@Post('/delete', { summary: 'sys:auth:role:remove' })
@Post('/delete', { description: 'sys:auth:role:remove' })
async delete(
@Query('id')
id: number
@@ -55,7 +55,7 @@ export class RoleController extends CrudController<RoleService> {
return await super.delete(id);
}
@Post('/getPermissionTree', { summary: 'sys:auth:role:view' })
@Post('/getPermissionTree', { description: 'sys:auth:role:view' })
async getPermissionTree(
@Query('id')
id: number
@@ -64,7 +64,7 @@ export class RoleController extends CrudController<RoleService> {
return this.ok(ret);
}
@Post('/getPermissionIds', { summary: 'sys:auth:role:view' })
@Post('/getPermissionIds', { description: 'sys:auth:role:view' })
async getPermissionIds(
@Query('id')
id: number
@@ -78,7 +78,7 @@ export class RoleController extends CrudController<RoleService> {
* @param roleId
* @param permissionIds
*/
@Post('/authz', { summary: 'sys:auth:role:edit' })
@Post('/authz', { description: 'sys:auth:role:edit' })
async authz(@Body('roleId') roleId, @Body('permissionIds') permissionIds) {
await this.service.authz(roleId, permissionIds);
return this.ok(null);
@@ -28,7 +28,7 @@ export class UserController extends CrudController<UserService> {
return this.service;
}
@Post('/getSimpleUserByIds', {summary: 'sys:auth:user:view'})
@Post('/getSimpleUserByIds', {description: 'sys:auth:user:view'})
async getSimpleUserByIds(@Body('ids') ids: number[]) {
const users = await this.service.find({
select: {
@@ -47,7 +47,7 @@ export class UserController extends CrudController<UserService> {
}
@Post('/getSimpleUsers', {summary: 'sys:auth:user:view'})
@Post('/getSimpleUsers', {description: 'sys:auth:user:view'})
async getSimpleUsers() {
const users = await this.service.find({
select: {
@@ -61,7 +61,7 @@ export class UserController extends CrudController<UserService> {
return this.ok(users);
}
@Post('/page', {summary: 'sys:auth:user:view'})
@Post('/page', {description: 'sys:auth:user:view'})
async page(
@Body(ALL)
body
@@ -93,7 +93,7 @@ export class UserController extends CrudController<UserService> {
return ret;
}
@Post('/add', {summary: 'sys:auth:user:add'})
@Post('/add', {description: 'sys:auth:user:add'})
async add(
@Body(ALL)
bean
@@ -101,7 +101,7 @@ export class UserController extends CrudController<UserService> {
return await super.add(bean);
}
@Post('/update', {summary: 'sys:auth:user:edit'})
@Post('/update', {description: 'sys:auth:user:edit'})
async update(
@Body(ALL)
bean
@@ -109,7 +109,7 @@ export class UserController extends CrudController<UserService> {
return await super.update(bean);
}
@Post('/delete', {summary: 'sys:auth:user:remove'})
@Post('/delete', {description: 'sys:auth:user:remove'})
async delete(
@Query('id')
id: number
@@ -126,7 +126,7 @@ export class UserController extends CrudController<UserService> {
/**
* 解除登录锁定
*/
@Post('/unlockBlock', {summary: "sys:auth:user:edit"})
@Post('/unlockBlock', {description: "sys:auth:user:edit"})
public async unlockBlock(@Body('id') id: number) {
const info = await this.service.info(id, ['password']);
this.loginService.clearCacheOnSuccess(info.username)
@@ -139,7 +139,7 @@ export class UserController extends CrudController<UserService> {
/**
* 当前登录用户的个人信息
*/
@Post('/mine', {summary: Constants.per.authOnly})
@Post('/mine', {description: Constants.per.authOnly})
public async mine() {
const id = this.getUserId();
const info = await this.service.info(id, ['password']);
@@ -149,7 +149,7 @@ export class UserController extends CrudController<UserService> {
/**
* 当前登录用户的权限列表
*/
@Post('/permissions', {summary: Constants.per.authOnly})
@Post('/permissions', {description: Constants.per.authOnly})
public async permissions() {
const id = this.getUserId();
const permissions = await this.service.getUserPermissions(id);
@@ -159,7 +159,7 @@ export class UserController extends CrudController<UserService> {
/**
* 当前登录用户的权限树形列表
*/
@Post('/permissionTree', {summary: Constants.per.authOnly})
@Post('/permissionTree', {description: Constants.per.authOnly})
public async permissionTree() {
const id = this.getUserId();
const permissions = await this.service.getUserPermissions(id);
@@ -16,18 +16,18 @@ export class CnameRecordController extends CrudController<CnameProviderService>
return this.service;
}
@Post('/page', { summary: 'sys:settings:view' })
@Post('/page', { description: 'sys:settings:view' })
async page(@Body(ALL) body: any) {
body.query = body.query ?? {};
return await super.page(body);
}
@Post('/list', { summary: 'sys:settings:view' })
@Post('/list', { description: 'sys:settings:view' })
async list(@Body(ALL) body: any) {
return super.list(body);
}
@Post('/add', { summary: 'sys:settings:edit' })
@Post('/add', { description: 'sys:settings:edit' })
async add(@Body(ALL) bean: any) {
const def: any = {
isDefault: false,
@@ -38,35 +38,35 @@ export class CnameRecordController extends CrudController<CnameProviderService>
return super.add(bean);
}
@Post('/update', { summary: 'sys:settings:edit' })
@Post('/update', { description: 'sys:settings:edit' })
async update(@Body(ALL) bean: any) {
bean.userId = this.getUserId();
return super.update(bean);
}
@Post('/info', { summary: 'sys:settings:view' })
@Post('/info', { description: 'sys:settings:view' })
async info(@Query('id') id: number) {
return super.info(id);
}
@Post('/delete', { summary: 'sys:settings:edit' })
@Post('/delete', { description: 'sys:settings:edit' })
async delete(@Query('id') id: number) {
return super.delete(id);
}
@Post('/deleteByIds', { summary: 'sys:settings:edit' })
@Post('/deleteByIds', { description: 'sys:settings:edit' })
async deleteByIds(@Body('ids') ids: number[]) {
const res = await this.service.delete(ids);
return this.ok(res);
}
@Post('/setDefault', { summary: 'sys:settings:edit' })
@Post('/setDefault', { description: 'sys:settings:edit' })
async setDefault(@Body('id') id: number) {
await this.service.setDefault(id);
return this.ok();
}
@Post('/setDisabled', { summary: 'sys:settings:edit' })
@Post('/setDisabled', { description: 'sys:settings:edit' })
async setDisabled(@Body('id') id: number, @Body('disabled') disabled: boolean) {
await this.service.setDisabled(id, disabled);
return this.ok();
@@ -31,7 +31,7 @@ export class SysStatisticController extends BaseController {
@Inject()
historyService: HistoryService;
@Post('/count', { summary: 'sys:settings:view' })
@Post('/count', { description: 'sys:settings:view' })
public async count() {
const userCount = await this.userService.count();
const userRegisterCountPerDay = await this.userService.registerCountPerDay({ days: 7 });
@@ -19,18 +19,18 @@ export class SysProjectController extends CrudController<ProjectEntity> {
return this.service;
}
@Post("/page", { summary: "sys:settings:view" })
@Post("/page", { description: "sys:settings:view" })
async page(@Body(ALL) body: any) {
body.query = body.query ?? {};
return await super.page(body);
}
@Post("/list", { summary: "sys:settings:view" })
@Post("/list", { description: "sys:settings:view" })
async list(@Body(ALL) body: any) {
return super.list(body);
}
@Post("/add", { summary: "sys:settings:edit" })
@Post("/add", { description: "sys:settings:edit" })
async add(@Body(ALL) bean: any) {
const def: any = {
isDefault: false,
@@ -45,28 +45,28 @@ export class SysProjectController extends CrudController<ProjectEntity> {
});
}
@Post("/update", { summary: "sys:settings:edit" })
@Post("/update", { description: "sys:settings:edit" })
async update(@Body(ALL) bean: any) {
bean.userId = this.getUserId();
return super.update(bean);
}
@Post("/info", { summary: "sys:settings:view" })
@Post("/info", { description: "sys:settings:view" })
async info(@Query("id") id: number) {
return super.info(id);
}
@Post("/delete", { summary: "sys:settings:edit" })
@Post("/delete", { description: "sys:settings:edit" })
async delete(@Query("id") id: number) {
return super.delete(id);
}
@Post("/deleteByIds", { summary: "sys:settings:edit" })
@Post("/deleteByIds", { description: "sys:settings:edit" })
async deleteByIds(@Body("ids") ids: number[]) {
const res = await this.service.delete(ids);
return this.ok(res);
}
@Post("/setDisabled", { summary: "sys:settings:edit" })
@Post("/setDisabled", { description: "sys:settings:edit" })
async setDisabled(@Body("id") id: number, @Body("disabled") disabled: boolean) {
await this.service.setDisabled(id, disabled);
return this.ok();
@@ -23,18 +23,18 @@ export class SysProjectMemberController extends CrudController<ProjectMemberEnti
return this.service;
}
@Post("/page", { summary: "sys:settings:view" })
@Post("/page", { description: "sys:settings:view" })
async page(@Body(ALL) body: any) {
body.query = body.query ?? {};
return await super.page(body);
}
@Post("/list", { summary: "sys:settings:view" })
@Post("/list", { description: "sys:settings:view" })
async list(@Body(ALL) body: any) {
return super.list(body);
}
@Post("/add", { summary: "sys:settings:edit" })
@Post("/add", { description: "sys:settings:edit" })
async add(@Body(ALL) bean: any) {
const def: any = {
isDefault: false,
@@ -50,7 +50,7 @@ export class SysProjectMemberController extends CrudController<ProjectMemberEnti
return super.add(bean);
}
@Post("/update", { summary: "sys:settings:edit" })
@Post("/update", { description: "sys:settings:edit" })
async update(@Body(ALL) bean: any) {
if (!bean.id) {
throw new Error("id is required");
@@ -68,7 +68,7 @@ export class SysProjectMemberController extends CrudController<ProjectMemberEnti
return this.ok(res);
}
@Post("/info", { summary: "sys:settings:view" })
@Post("/info", { description: "sys:settings:view" })
async info(@Query("id") id: number) {
if (!id) {
throw new Error("id is required");
@@ -81,7 +81,7 @@ export class SysProjectMemberController extends CrudController<ProjectMemberEnti
return super.info(id);
}
@Post("/delete", { summary: "sys:settings:edit" })
@Post("/delete", { description: "sys:settings:edit" })
async delete(@Query("id") id: number) {
if (!id) {
throw new Error("id is required");
@@ -94,7 +94,7 @@ export class SysProjectMemberController extends CrudController<ProjectMemberEnti
return super.delete(id);
}
@Post("/deleteByIds", { summary: "sys:settings:edit" })
@Post("/deleteByIds", { description: "sys:settings:edit" })
async deleteByIds(@Body("ids") ids: number[]) {
for (const id of ids) {
if (!id) {
@@ -11,7 +11,7 @@ export class SysNetTestController extends BaseController {
netTestService: NetTestService;
@Post('/domainResolve', { summary: 'sys:settings:view' })
@Post('/domainResolve', { description: 'sys:settings:view' })
public async domainResolve(@Body(ALL) body: { domain: string }) {
const { domain } = body;
@@ -20,7 +20,7 @@ export class SysNetTestController extends BaseController {
}
// ping
@Post('/ping', { summary: 'sys:settings:view' })
@Post('/ping', { description: 'sys:settings:view' })
public async ping(@Body(ALL) body: { domain: string }) {
const { domain } = body;
@@ -29,7 +29,7 @@ export class SysNetTestController extends BaseController {
}
// telnet
@Post('/telnet', { summary: 'sys:settings:view' })
@Post('/telnet', { description: 'sys:settings:view' })
public async telnet(@Body(ALL) body: { domain: string, port: number }) {
const { domain, port } = body;
@@ -38,7 +38,7 @@ export class SysNetTestController extends BaseController {
}
// telnet
@Post('/serverInfo', { summary: 'sys:settings:view' })
@Post('/serverInfo', { description: 'sys:settings:view' })
public async serverInfo() {
const result = await this.netTestService.serverInfo();
@@ -23,18 +23,18 @@ export class PluginController extends CrudController<PluginService> {
return this.service;
}
@Post('/page', { summary: 'sys:settings:view' })
@Post('/page', { description: 'sys:settings:view' })
async page(@Body(ALL) body: any) {
body.query = body.query ?? {};
return await super.page(body);
}
@Post('/list', { summary: 'sys:settings:view' })
@Post('/list', { description: 'sys:settings:view' })
async list(@Body(ALL) body: any) {
return super.list(body);
}
@Post('/add', { summary: 'sys:settings:edit' })
@Post('/add', { description: 'sys:settings:edit' })
async add(@Body(ALL) bean: any) {
const def: any = {
isDefault: false,
@@ -44,58 +44,58 @@ export class PluginController extends CrudController<PluginService> {
return super.add(bean);
}
@Post('/update', { summary: 'sys:settings:edit' })
@Post('/update', { description: 'sys:settings:edit' })
async update(@Body(ALL) bean: any) {
const res = await super.update(bean);
return res
}
@Post('/info', { summary: 'sys:settings:view' })
@Post('/info', { description: 'sys:settings:view' })
async info(@Query('id') id: number) {
return super.info(id);
}
@Post('/delete', { summary: 'sys:settings:edit' })
@Post('/delete', { description: 'sys:settings:edit' })
async delete(@Query('id') id: number) {
return super.deleteByIds([id]);
}
@Post('/deleteByIds', { summary: 'sys:settings:edit' })
@Post('/deleteByIds', { description: 'sys:settings:edit' })
async deleteByIds(@Body('ids') ids: number[]) {
const res = await this.service.deleteByIds(ids);
return this.ok(res);
}
@Post('/setDisabled', { summary: 'sys:settings:edit' })
@Post('/setDisabled', { description: 'sys:settings:edit' })
async setDisabled(@Body(ALL) body: { id: number; name: string; type: string; disabled: boolean }) {
await this.service.setDisabled(body);
return this.ok();
}
@Post('/getCommPluginConfigs', { summary: 'sys:settings:view' })
@Post('/getCommPluginConfigs', { description: 'sys:settings:view' })
async getCommPluginConfigs() {
const res = await this.pluginConfigService.getCommPluginConfig();
return this.ok(res);
}
@Post('/saveCommPluginConfigs', { summary: 'sys:settings:edit' })
@Post('/saveCommPluginConfigs', { description: 'sys:settings:edit' })
async saveCommPluginConfigs(@Body(ALL) body: CommPluginConfig) {
const res = await this.pluginConfigService.saveCommPluginConfig(body);
return this.ok(res);
}
@Post('/saveSetting', { summary: 'sys:settings:edit' })
@Post('/saveSetting', { description: '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' })
@Post('/import', { description: 'sys:settings:edit' })
async import(@Body(ALL) body: PluginImportReq) {
const res = await this.service.importPlugin(body);
return this.ok(res);
}
@Post('/export', { summary: 'sys:settings:edit' })
@Post('/export', { description: 'sys:settings:edit' })
async export(@Body('id') id: number) {
const res = await this.service.exportPlugin(id);
return this.ok(res);
@@ -13,7 +13,7 @@ export class SysPlusController extends BaseController {
@Inject()
plusService: PlusService;
@Post('/active', { summary: 'sys:settings:edit' })
@Post('/active', { description: 'sys:settings:edit' })
async active(@Body(ALL) body) {
const { code, inviteCode } = body;
@@ -21,7 +21,7 @@ export class SysPlusController extends BaseController {
return this.ok(true);
}
@Post('/bindUrl', { summary: 'sys:settings:edit' })
@Post('/bindUrl', { description: 'sys:settings:edit' })
async bindUrl(@Body(ALL) body: { url: string ,url2?:string }) {
const { url,url2 } = body;
await this.plusService.register();
@@ -42,18 +42,18 @@ export class SysPlusController extends BaseController {
return this.ok(true);
}
@Post('/getVipTrial', { summary: 'sys:settings:edit' })
@Post('/getVipTrial', { description: 'sys:settings:edit' })
async getVipTrial(@Body("vipType") vipType?:string) {
const res = await this.plusService.getVipTrial(vipType);
return this.ok(res);
}
@Post('/getTodayVipOrderCount', { summary: 'sys:settings:edit' })
@Post('/getTodayVipOrderCount', { description: 'sys:settings:edit' })
async getTodayVipOrderCount() {
const res = await this.plusService.getTodayOrderCount();
return this.ok(res);
}
//
// @Get('/test', { summary: Constants.per.guest })
// @Get('/test', { description: Constants.per.guest })
// async test() {
// const subjectId = 'xxxxxx';
// const license = '';
@@ -14,7 +14,7 @@ export class SysSettingsController extends BaseController {
@Post("/get", { summary: "sys:settings:view" })
@Post("/get", { description: "sys:settings:view" })
async safeGet() {
const res = await this.safeService.getSafeSetting()
const clone:SysSafeSetting = cloneDeep(res);
@@ -22,7 +22,7 @@ export class SysSettingsController extends BaseController {
return this.ok(clone);
}
@Post("/save", { summary: "sys:settings:edit" })
@Post("/save", { description: "sys:settings:edit" })
async safeSave(@Body(ALL) body: any) {
await this.safeService.saveSafeSetting(body);
return this.ok({});
@@ -31,7 +31,7 @@ export class SysSettingsController extends BaseController {
/**
* 立即隐藏
*/
@Post("/hidden", { summary: "sys:settings:edit" })
@Post("/hidden", { description: "sys:settings:edit" })
async hiddenImmediate() {
await this.safeService.hiddenImmediately();
return this.ok({});
@@ -38,58 +38,58 @@ export class SysSettingsController extends CrudController<SysSettingsService> {
return this.service;
}
@Post('/page', { summary: 'sys:settings:view' })
@Post('/page', { description: 'sys:settings:view' })
async page(@Body(ALL) body) {
return super.page(body);
}
@Post('/list', { summary: 'sys:settings:view' })
@Post('/list', { description: 'sys:settings:view' })
async list(@Body(ALL) body) {
return super.list(body);
}
@Post('/add', { summary: 'sys:settings:edit' })
@Post('/add', { description: 'sys:settings:edit' })
async add(@Body(ALL) bean) {
return super.add(bean);
}
@Post('/update', { summary: 'sys:settings:edit' })
@Post('/update', { description: 'sys:settings:edit' })
async update(@Body(ALL) bean) {
await this.service.checkUserId(bean.id, this.getUserId());
return super.update(bean);
}
@Post('/info', { summary: 'sys:settings:view' })
@Post('/info', { description: 'sys:settings:view' })
async info(@Query('id') id: number) {
await this.service.checkUserId(id, this.getUserId());
return super.info(id);
}
@Post('/delete', { summary: 'sys:settings:edit' })
@Post('/delete', { description: 'sys:settings:edit' })
async delete(@Query('id') id: number) {
await this.service.checkUserId(id, this.getUserId());
return super.delete(id);
}
@Post('/save', { summary: 'sys:settings:edit' })
@Post('/save', { description: 'sys:settings:edit' })
async save(@Body(ALL) bean: SysSettingsEntity) {
await this.service.save(bean);
return this.ok({});
}
@Post('/get', { summary: 'sys:settings:view' })
@Post('/get', { description: 'sys:settings:view' })
async get(@Query('key') key: string) {
const entity = await this.service.getByKey(key);
return this.ok(entity);
}
// savePublicSettings
@Post('/getEmailSettings', { summary: 'sys:settings:view' })
@Post('/getEmailSettings', { description: 'sys:settings:view' })
async getEmailSettings(@Body(ALL) body) {
const conf = await getEmailSettings(this.service, this.userSettingsService);
return this.ok(conf);
}
@Post('/getEmailTemplates', { summary: 'sys:settings:view' })
@Post('/getEmailTemplates', { description: 'sys:settings:view' })
async getEmailTemplates(@Body(ALL) body) {
const conf = await getEmailSettings(this.service, this.userSettingsService);
const templates = conf.templates || {}
@@ -108,7 +108,7 @@ export class SysSettingsController extends CrudController<SysSettingsService> {
return this.ok(proviers);
}
@Post('/saveEmailSettings', { summary: 'sys:settings:edit' })
@Post('/saveEmailSettings', { description: 'sys:settings:edit' })
async saveEmailSettings(@Body(ALL) body) {
const conf = await getEmailSettings(this.service, this.userSettingsService);
merge(conf, body);
@@ -116,7 +116,7 @@ export class SysSettingsController extends CrudController<SysSettingsService> {
return this.ok(conf);
}
@Post('/getSysSettings', { summary: 'sys:settings:view' })
@Post('/getSysSettings', { description: 'sys:settings:view' })
async getSysSettings() {
const publicSettings = await this.service.getPublicSettings();
let privateSettings = await this.service.getPrivateSettings();
@@ -125,7 +125,7 @@ export class SysSettingsController extends CrudController<SysSettingsService> {
}
// savePublicSettings
@Post('/saveSysSettings', { summary: 'sys:settings:edit' })
@Post('/saveSysSettings', { description: 'sys:settings:edit' })
async saveSysSettings(@Body(ALL) body: { public: SysPublicSettings; private: SysPrivateSettings }) {
const publicSettings = await this.service.getPublicSettings();
const privateSettings = await this.service.getPrivateSettings();
@@ -135,13 +135,13 @@ export class SysSettingsController extends CrudController<SysSettingsService> {
await this.service.savePrivateSettings(privateSettings);
return this.ok({});
}
@Post('/stopOtherUserTimer', { summary: 'sys:settings:edit' })
@Post('/stopOtherUserTimer', { description: 'sys:settings:edit' })
async stopOtherUserTimer(@Body(ALL) body) {
await this.pipelineService.stopOtherUserPipeline(1);
return this.ok({});
}
@Post('/testProxy', { summary: 'sys:settings:edit' })
@Post('/testProxy', { description: 'sys:settings:edit' })
async testProxy(@Body(ALL) body) {
const google = 'https://www.google.com/';
const baidu = 'https://www.baidu.com/';
@@ -179,13 +179,13 @@ export class SysSettingsController extends CrudController<SysSettingsService> {
});
}
@Post('/testSms', { summary: 'sys:settings:edit' })
@Post('/testSms', { description: 'sys:settings:edit' })
async testSms(@Body(ALL) body) {
await this.codeService.sendSmsCode(body.phoneCode, body.mobile );
return this.ok({});
}
@Post('/getSmsTypeDefine', { summary: 'sys:settings:view' })
@Post('/getSmsTypeDefine', { description: 'sys:settings:view' })
async getSmsTypeDefine(@Body('type') type: string) {
const define =await SmsServiceFactory.getDefine(type);
return this.ok(define);
@@ -193,7 +193,7 @@ export class SysSettingsController extends CrudController<SysSettingsService> {
@Post("/safe/get", { summary: "sys:settings:view" })
@Post("/safe/get", { description: "sys:settings:view" })
async safeGet() {
const res = await this.service.getSetting<SysSafeSetting>(SysSafeSetting);
const clone:SysSafeSetting = cloneDeep(res);
@@ -201,7 +201,7 @@ export class SysSettingsController extends CrudController<SysSettingsService> {
return this.ok(clone);
}
@Post("/safe/save", { summary: "sys:settings:edit" })
@Post("/safe/save", { description: "sys:settings:edit" })
async safeSave(@Body(ALL) body: any) {
if(body.hidden.openPassword){
body.hidden.openPassword = utils.hash.md5(body.hidden.openPassword);
@@ -217,13 +217,13 @@ export class SysSettingsController extends CrudController<SysSettingsService> {
}
@Post("/captchaTest", { summary: "sys:settings:edit" })
@Post("/captchaTest", { description: "sys:settings:edit" })
async captchaTest(@Body(ALL) body: any,@RequestIP() remoteIp: string) {
await this.codeService.checkCaptcha(body,{remoteIp});
return this.ok({});
}
@Post('/oauth/providers', { summary: 'sys:settings:view' })
@Post('/oauth/providers', { description: 'sys:settings:view' })
async oauthProviders() {
const list = await addonRegistry.getDefineList("oauth");
return this.ok(list);