You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

53 lines
1.9 KiB

  1. package com.simple.controller;
  2. import com.simple.domain.vo.WxCouponChannelVo;
  3. import org.apache.log4j.Logger;
  4. import org.springframework.beans.factory.annotation.Autowired;
  5. import org.springframework.util.Assert;
  6. import org.springframework.web.bind.annotation.*;
  7. import com.github.pagehelper.PageInfo;
  8. import com.simple.common.Result;
  9. import com.simple.common.ResultData;
  10. import com.simple.domain.po.WxCouponChannel;
  11. import com.simple.service.WxCouponChannelService;
  12. import io.swagger.annotations.ApiImplicitParam;
  13. import io.swagger.annotations.ApiImplicitParams;
  14. import io.swagger.annotations.ApiOperation;
  15. @RestController
  16. @RequestMapping("/api/wxCouponChannel")
  17. public class WxCouponChannelController extends BaseController
  18. {
  19. private Logger logger = Logger.getLogger(WxCouponChannelController.class);
  20. @Autowired
  21. private WxCouponChannelService wxCouponChannelService;
  22. @ApiOperation("分页列表接口")
  23. @GetMapping("list")
  24. @ApiImplicitParams({
  25. @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true),
  26. @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)})
  27. public ResultData list(@ModelAttribute WxCouponChannel wxCouponChannel,Integer pageNum, Integer pageSize) {
  28. if (null == wxCouponChannel) wxCouponChannel = new WxCouponChannel();
  29. wxCouponChannel.setTenantId(getTenantId());
  30. final PageInfo<WxCouponChannelVo> page = wxCouponChannelService.listPageCAPI(wxCouponChannel, pageNum, pageSize);
  31. return new ResultData(page);
  32. }
  33. @ApiOperation("根据id查询接口")
  34. @GetMapping("/findById")
  35. @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
  36. public ResultData findById(Long id) {
  37. return new ResultData(Result.SUCCESS,"查询成功",wxCouponChannelService.getById(id));
  38. }
  39. }