common.controller.ts 759 B

1234567891011121314151617181920212223242526272829
  1. import { Controller, Get, Inject, Param } from '@midwayjs/core';
  2. import { RF } from '../response/CustomerResponse';
  3. import { PartsService } from '../service/parts.service';
  4. @Controller('/common')
  5. export class CommonController {
  6. @Inject()
  7. service: PartsService
  8. /**
  9. * 查询channel
  10. * @param channel_id
  11. */
  12. @Get('/channel/:channel_id')
  13. async channelDetail(@Param('channel_id') channel_id: string) {
  14. const data = await this.service.channelDetail(channel_id)
  15. return RF.success(data)
  16. }
  17. /**
  18. * 查询content
  19. * @param content_id
  20. */
  21. @Get('/content/:content_id')
  22. async contentDetail(@Param('content_id') content_id: string) {
  23. const data = await this.service.contentDetail(content_id)
  24. return RF.success(data)
  25. }
  26. }