|
|
|
@@ -4,6 +4,7 @@ import com.simple.common.ErrorCode; |
|
|
|
import com.simple.domain.po.WxCouponChannel; |
|
|
|
import com.simple.domain.vo.WxCouponCVo; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.apache.log4j.Logger; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.util.Assert; |
|
|
|
@@ -28,10 +29,23 @@ public class WxCouponController extends BaseController { |
|
|
|
@Autowired |
|
|
|
private WxCouponService wxCouponService; |
|
|
|
|
|
|
|
@ApiOperation("根据id查询接口") |
|
|
|
@ApiOperation("根据id(couponChannel)查询接口") |
|
|
|
@GetMapping("/detail") |
|
|
|
public ResultData detail(@ModelAttribute WxCouponChannel wxCouponChannel) { |
|
|
|
if(wxCouponChannel == null) wxCouponChannel = new WxCouponChannel(); |
|
|
|
@ApiImplicitParams({ |
|
|
|
@ApiImplicitParam(name = "id", value = "couponChannelId", dataType = "String", paramType = "query", required = true)}) |
|
|
|
public ResultData detail(String id) { |
|
|
|
if (StringUtils.isBlank(id)) { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "id为空"); |
|
|
|
} |
|
|
|
Long couponChannelId = 0L; |
|
|
|
try { |
|
|
|
couponChannelId = Long.valueOf(id); |
|
|
|
} catch (NumberFormatException e) { |
|
|
|
logger.error("id转换失败" + id); |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "id转换失败" + id); |
|
|
|
} |
|
|
|
WxCouponChannel wxCouponChannel = new WxCouponChannel(); |
|
|
|
wxCouponChannel.setId(couponChannelId); |
|
|
|
wxCouponChannel.setTenantId(getTenantId()); |
|
|
|
WxCouponCVo wxCouponCVo = wxCouponService.selectDetailForCUser(wxCouponChannel); |
|
|
|
if (wxCouponCVo == null) |
|
|
|
|