package com.simple.controller; import com.simple.common.Result; import com.simple.common.ResultData; import com.simple.service.WxCouponService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; import org.apache.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping("/api/coupon") @Api(description="券类相关接口") public class WxCouponController extends BaseController { private Logger logger = Logger.getLogger(WxCouponController.class); @Autowired private WxCouponService wxCouponService; @ApiOperation("根据id查询接口") @GetMapping("/findById") @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) public ResultData findById(Long id) { return new ResultData(Result.SUCCESS, "查询成功", wxCouponService.getById(id)); } }