Ver a proveniência

[券详情][修改]:订单下单接口调试

release_toaliyun_real
Stormeye.Wu há 7 anos
ascendente
cometimento
2eb9a0c0f5
2 ficheiros alterados com 24 adições e 3 eliminações
  1. +17
    -3
      mallinkCApi/src/main/java/com/simple/controller/WxCouponController.java
  2. +7
    -0
      mallinkCApi/src/main/java/com/simple/controller/WxOrderController.java

+ 17
- 3
mallinkCApi/src/main/java/com/simple/controller/WxCouponController.java Ver ficheiro

@@ -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)


+ 7
- 0
mallinkCApi/src/main/java/com/simple/controller/WxOrderController.java Ver ficheiro

@@ -113,6 +113,13 @@ public class WxOrderController extends BaseController {
}
if (StringUtils.isBlank(couponIdStr)) {
couponId = wxCouponChannel.getCouponId();
} else {
try {
couponId = Long.valueOf(couponIdStr);
} catch (NumberFormatException e) {
logger.error("couponId convert error, " + couponIdStr + ", e:" + e.getMessage());
return new ResultData(ErrorCode.SYS_PARAMETER_CAST_ERROR.getCode(), "couponId: " + couponIdStr + ", e:" + e.getMessage());
}
}
WxCUser user = getUser();



Carregando…
Cancelar
Guardar