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
@@ -32,7 +32,7 @@ export class AddonController extends CrudController<AddonService> {
return this.service;
}
@Post("/page", { summary: Constants.per.authOnly })
@Post("/page", { description: Constants.per.authOnly })
async page(@Body(ALL) body) {
const {projectId,userId} = await this.getProjectUserIdRead();
body.query = body.query ?? {};
@@ -50,7 +50,7 @@ export class AddonController extends CrudController<AddonService> {
return this.ok(res);
}
@Post("/list", { summary: Constants.per.authOnly })
@Post("/list", { description: Constants.per.authOnly })
async list(@Body(ALL) body) {
const {projectId,userId} = await this.getProjectUserIdRead();
body.query = body.query ?? {};
@@ -59,7 +59,7 @@ export class AddonController extends CrudController<AddonService> {
return super.list(body);
}
@Post("/add", { summary: Constants.per.authOnly })
@Post("/add", { description: Constants.per.authOnly })
async add(@Body(ALL) bean) {
const {userId,projectId} = await this.getProjectUserIdRead();
bean.userId = userId;
@@ -79,7 +79,7 @@ export class AddonController extends CrudController<AddonService> {
return super.add(bean);
}
@Post("/update", { summary: Constants.per.authOnly })
@Post("/update", { description: Constants.per.authOnly })
async update(@Body(ALL) bean) {
await this.checkOwner(this.getService(), bean.id, "write");
const old = await this.service.info(bean.id);
@@ -102,25 +102,25 @@ export class AddonController extends CrudController<AddonService> {
return super.update(bean);
}
@Post("/info", { summary: Constants.per.authOnly })
@Post("/info", { description: Constants.per.authOnly })
async info(@Query("id") id: number) {
await this.checkOwner(this.getService(), id, "read");
return super.info(id);
}
@Post("/delete", { summary: Constants.per.authOnly })
@Post("/delete", { description: Constants.per.authOnly })
async delete(@Query("id") id: number) {
await this.checkOwner(this.getService(), id, "write");
return 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) {
const notification = this.service.getDefineByType(type, addonType);
return this.ok(notification);
}
@Post("/getTypeDict", { summary: Constants.per.authOnly })
@Post("/getTypeDict", { description: Constants.per.authOnly })
async getTypeDict(@Query("addonType") addonType: string) {
const list: any = this.service.getDefineList(addonType);
let dict = [];
@@ -138,7 +138,7 @@ export class AddonController extends CrudController<AddonService> {
return this.ok(dict);
}
@Post("/simpleInfo", { summary: Constants.per.authOnly })
@Post("/simpleInfo", { description: Constants.per.authOnly })
async simpleInfo(@Query("addonType") addonType: string, @Query("id") id: number) {
if (id === 0) {
//获取默认
@@ -155,14 +155,14 @@ export class AddonController extends CrudController<AddonService> {
return this.ok(res);
}
@Post("/getDefaultId", { summary: Constants.per.authOnly })
@Post("/getDefaultId", { description: Constants.per.authOnly })
async getDefaultId(@Query("addonType") addonType: string) {
const {projectId,userId} = await this.getProjectUserIdRead();
const res = await this.service.getDefault(userId, addonType,projectId);
return this.ok(res?.id);
}
@Post("/setDefault", { summary: Constants.per.authOnly })
@Post("/setDefault", { description: Constants.per.authOnly })
async setDefault(@Query("addonType") addonType: string, @Query("id") id: number) {
const {projectId,userId} = await this.checkOwner(this.getService(), id, "write",true);
const res = await this.service.setDefault(id, userId, addonType,projectId);
@@ -170,7 +170,7 @@ export class AddonController extends CrudController<AddonService> {
}
@Post("/options", { summary: Constants.per.authOnly })
@Post("/options", { description: Constants.per.authOnly })
async options(@Query("addonType") addonType: string) {
const {projectId,userId} = await this.getProjectUserIdRead();
const res = await this.service.list({
@@ -187,7 +187,7 @@ export class AddonController extends CrudController<AddonService> {
}
@Post("/handle", { summary: Constants.per.authOnly })
@Post("/handle", { description: Constants.per.authOnly })
async handle(@Body(ALL) body: AddonRequestHandleReq) {
let inputAddon = body.input.addon;
if (body.input.id > 0) {