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
@@ -20,65 +20,65 @@ export class UserSettingsController extends CrudController<UserSettingsService>
return this.service;
}
@Post('/page', { summary: Constants.per.authOnly })
@Post('/page', { description: Constants.per.authOnly })
async page(@Body(ALL) body) {
body.query = body.query ?? {};
body.query.userId = this.getUserId();
return super.page(body);
}
@Post('/list', { summary: Constants.per.authOnly })
@Post('/list', { description: Constants.per.authOnly })
async list(@Body(ALL) body) {
body.query = body.query ?? {};
body.query.userId = this.getUserId();
return super.list(body);
}
@Post('/add', { summary: Constants.per.authOnly })
@Post('/add', { description: Constants.per.authOnly })
async add(@Body(ALL) bean) {
bean.userId = this.getUserId();
return super.add(bean);
}
@Post('/update', { summary: Constants.per.authOnly })
@Post('/update', { description: Constants.per.authOnly })
async update(@Body(ALL) bean) {
await this.service.checkUserId(bean.id, this.getUserId());
delete bean.userId;
return super.update(bean);
}
@Post('/info', { summary: Constants.per.authOnly })
@Post('/info', { description: Constants.per.authOnly })
async info(@Query('id') id: number) {
await this.service.checkUserId(id, this.getUserId());
return super.info(id);
}
@Post('/delete', { summary: Constants.per.authOnly })
@Post('/delete', { description: Constants.per.authOnly })
async delete(@Query('id') id: number) {
await this.service.checkUserId(id, this.getUserId());
return super.delete(id);
}
@Post('/save', { summary: Constants.per.authOnly })
@Post('/save', { description: Constants.per.authOnly })
async save(@Body(ALL) bean: UserSettingsEntity) {
bean.userId = this.getUserId();
await this.service.save(bean);
return this.ok({});
}
@Post('/get', { summary: Constants.per.authOnly })
@Post('/get', { description: Constants.per.authOnly })
async get(@Query('key') key: string) {
const {projectId,userId} = await this.getProjectUserIdRead();
const entity = await this.service.getByKey(key, userId, projectId);
return this.ok(entity);
}
@Post("/grant/get", { summary: Constants.per.authOnly })
@Post("/grant/get", { description: Constants.per.authOnly })
async grantSettingsGet() {
const userId = this.getUserId();
const setting = await this.service.getSetting<UserGrantSetting>(userId, null, UserGrantSetting);
return this.ok(setting);
}
@Post("/grant/save", { summary: Constants.per.authOnly })
@Post("/grant/save", { description: Constants.per.authOnly })
async grantSettingsSave(@Body(ALL) bean: UserGrantSetting) {
if (!isPlus()) {
throw new Error('本功能需要开通专业版')