|
@@ -4,6 +4,11 @@ import { ReturnModelType } from '@typegoose/typegoose';
|
|
|
import { BaseService } from 'free-midway-component';
|
|
|
import { Good } from '../entity/Good.entity';
|
|
|
type modelType = ReturnModelType<typeof Good>;
|
|
|
+interface infoInterface {
|
|
|
+ name?: object;
|
|
|
+ is_use?: string;
|
|
|
+ type?: string;
|
|
|
+}
|
|
|
@Provide()
|
|
|
export class GoodService extends BaseService<modelType> {
|
|
|
@InjectEntityModel(Good)
|
|
@@ -11,7 +16,7 @@ export class GoodService extends BaseService<modelType> {
|
|
|
|
|
|
async search(filter): Promise<object> {
|
|
|
const { name, is_use, type } = filter;
|
|
|
- const info: any = {
|
|
|
+ const info: infoInterface = {
|
|
|
name: { $regex: name || '' },
|
|
|
is_use: is_use,
|
|
|
};
|