chore: src/modules/knowledge/service/film-category.ts

This commit is contained in:
2026-07-01 17:44:58 +08:00
parent 1d6b7dc58e
commit bb3d2a2fbc
@@ -0,0 +1,33 @@
import { Provide } from '@midwayjs/core';
import { BaseService } from '@cool-midway/core';
import { InjectEntityModel } from '@midwayjs/typeorm';
import { Repository } from 'typeorm';
import { KnowledgeFilmCategoryEntity } from '../entity/film-category';
import { escapeObject } from '../utils/xss';
/**
* 知识库模块-电影分类
*/
@Provide()
export class KnowledgeFilmCategoryService extends BaseService {
@InjectEntityModel(KnowledgeFilmCategoryEntity)
knowledgeFilmCategoryEntity: Repository<KnowledgeFilmCategoryEntity>;
/**
* 新增分类 - XSS 防护
* @param params 分类数据
*/
async add(params: any) {
const safeParams = escapeObject(params);
return super.add(safeParams);
}
/**
* 更新分类 - XSS 防护
* @param params 分类数据
*/
async update(params: any) {
const safeParams = escapeObject(params);
return super.update(safeParams);
}
}