223
This commit is contained in:
parent
f3652b8170
commit
f625139d2c
|
@ -16,30 +16,13 @@ export class GoodsController {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 示例2:路径参数
|
// 示例2:路径参数
|
||||||
@Get('detail/:id')
|
@Get('detail/:id')<<<<<<< HEAD
|
||||||
getDetail(@Param('id') id: string) {
|
|
||||||
return {
|
|
||||||
id: id,
|
|
||||||
detail: `Detail for product ${id}`
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// 示例3:多个查询参数
|
|
||||||
@Get('search')
|
|
||||||
searchProducts(
|
|
||||||
@Query('keyword') keyword: string,
|
|
||||||
@Query('page') page: number = 1,
|
|
||||||
@Query('limit') limit: number = 10
|
|
||||||
) {
|
|
||||||
return {
|
|
||||||
keyword,
|
keyword,
|
||||||
page,
|
page,
|
||||||
limit,
|
limit,
|
||||||
results: []
|
results: []
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
<<<<<<< HEAD
|
|
||||||
}
|
}
|
||||||
=======
|
|
||||||
}
|
|
||||||
>>>>>>> de6e632ec69dd408a6c4e85d5cda01a1aa8e8276
|
|
||||||
|
|
|
@ -3,18 +3,8 @@ import { GoodsService } from './goods.service';
|
||||||
import { GoodsController } from './goods.controller';
|
import { GoodsController } from './goods.controller';
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
<<<<<<< HEAD
|
|
||||||
|
|
||||||
providers: [GoodsService],
|
|
||||||
controllers:[GoodsController]
|
|
||||||
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
export class GoodsModule {}
|
|
||||||
=======
|
|
||||||
providers: [GoodsService],
|
providers: [GoodsService],
|
||||||
controllers: [GoodsController],
|
controllers: [GoodsController],
|
||||||
})
|
})
|
||||||
export class GoodsModule {}
|
export class GoodsModule {}
|
||||||
>>>>>>> de6e632ec69dd408a6c4e85d5cda01a1aa8e8276
|
|
||||||
|
|
Loading…
Reference in New Issue