Feat: Api fix
This commit is contained in:
parent
a9250ed81c
commit
9cf073b73d
|
|
@ -16,6 +16,7 @@ public enum ApiFrom {
|
|||
private final String apiDealStrategy;
|
||||
|
||||
|
||||
public static final String ApiDealStrategyImpl = "ApiDealStrategyImpl";
|
||||
public static final String LianTongApiDealStrategy = "LianTongApiDealStrategy";
|
||||
public static final String GuangZhouDXApiDealStrategy = "GuangZhouDXApiDealStrategy";
|
||||
public static final String HaiNanDXApiDealStrategy = "HaiNanDXApiDealStrategy";
|
||||
|
|
|
|||
|
|
@ -4,9 +4,7 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|||
import cn.iocoder.yudao.module.haoka.api.ApiFrom;
|
||||
import cn.iocoder.yudao.module.haoka.controller.admin.address.vo.AddressVo;
|
||||
import cn.iocoder.yudao.module.haoka.service.address.HaoKaAddressService;
|
||||
import cn.iocoder.yudao.module.haoka.service.api.ApiDealResp;
|
||||
import cn.iocoder.yudao.module.haoka.service.api.OrderApiCreateParam;
|
||||
import cn.iocoder.yudao.module.haoka.service.api.OrderApiCreateResp;
|
||||
import cn.iocoder.yudao.module.haoka.service.api.*;
|
||||
import cn.iocoder.yudao.module.haoka.service.api.strategy.LianTongApiDealStrategy;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
|
|
@ -22,7 +20,7 @@ import java.util.List;
|
|||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 地址")
|
||||
@Tag(name = "管理后台 -好卡---- 地址")
|
||||
@RestController
|
||||
@RequestMapping("/haoka/address")
|
||||
@Validated
|
||||
|
|
@ -51,13 +49,20 @@ public class AddressAreaController {
|
|||
}
|
||||
|
||||
@Autowired
|
||||
@Qualifier(ApiFrom.LianTongApiDealStrategy)
|
||||
private LianTongApiDealStrategy lianTongApiDealStrategy;
|
||||
@Qualifier(ApiFrom.ApiDealStrategyImpl)
|
||||
private ApiDealStrategyService apiDealStrategyService;
|
||||
|
||||
@Operation(summary = "联通订单全部流程接口")
|
||||
@PostMapping("/preOrder")
|
||||
public CommonResult<ApiDealResp<OrderApiCreateResp>> proOrder(@RequestBody OrderApiCreateParam param) {
|
||||
ApiDealResp<OrderApiCreateResp> order = lianTongApiDealStrategy.createOrder(param);
|
||||
@Operation(summary = "创建订单")
|
||||
@PostMapping("/createOrder")
|
||||
public CommonResult<ApiDealResp<OrderApiCreateResp>> createOrder(@RequestBody OrderApiCreateParam param) {
|
||||
ApiDealResp<OrderApiCreateResp> order = apiDealStrategyService.createOrder(param);
|
||||
return success(order);
|
||||
}
|
||||
|
||||
@Operation(summary = "查询订单")
|
||||
@PostMapping("/queryOrder")
|
||||
public CommonResult<ApiDealResp<OrderApiQueryResp>> queryOrder(@RequestBody OrderApiQueryParam param) {
|
||||
ApiDealResp<OrderApiQueryResp> order = apiDealStrategyService.queryOrder(param);
|
||||
return success(order);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,11 +4,12 @@ import cn.iocoder.yudao.module.haoka.api.ApiFrom;
|
|||
import cn.iocoder.yudao.module.haoka.controller.admin.onsaleproduct.vo.OnSaleProductPreOrderRespVO;
|
||||
import cn.iocoder.yudao.module.haoka.service.onsaleproduct.OnSaleProductService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
@Component(ApiFrom.ApiDealStrategyImpl)
|
||||
public class ApiDealServiceImpl implements ApiDealStrategyService {
|
||||
|
||||
@Resource
|
||||
|
|
@ -40,7 +41,7 @@ public class ApiDealServiceImpl implements ApiDealStrategyService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ApiDealResp<OrderApiQueryResp> queryOrder(OrderApiCreateParam param) {
|
||||
public ApiDealResp<OrderApiQueryResp> queryOrder(OrderApiQueryParam param) {
|
||||
ApiDealStrategy apiDealStrategy = this.getApiDealStrategy(param.getProductId());
|
||||
if (apiDealStrategy == null) {
|
||||
return new ApiDealResp<>(false, "NoneService", null);
|
||||
|
|
|
|||
|
|
@ -3,5 +3,6 @@ package cn.iocoder.yudao.module.haoka.service.api;
|
|||
public interface ApiDealStrategy {
|
||||
ApiDealResp<OrderApiCreateResp> createOrder(OrderApiCreateParam param);
|
||||
|
||||
ApiDealResp<OrderApiQueryResp > queryOrder(OrderApiCreateParam param);
|
||||
ApiDealResp<OrderApiQueryResp > queryOrder(
|
||||
OrderApiQueryParam param);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ import lombok.*;
|
|||
@AllArgsConstructor
|
||||
public class OrderApiQueryParam {
|
||||
|
||||
private String outerOrderId;
|
||||
|
||||
/**
|
||||
* 订单ID AAA
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ public class GuangZhouDxApiDealStrategy implements ApiDealStrategy {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ApiDealResp<OrderApiQueryResp> queryOrder(OrderApiCreateParam param) {
|
||||
public ApiDealResp<OrderApiQueryResp> queryOrder(OrderApiQueryParam param) {
|
||||
ApiDealResp<OrderApiQueryResp> result = new ApiDealResp<>();
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ public class HaiNanDxApiDealStrategy implements ApiDealStrategy {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ApiDealResp<OrderApiQueryResp> queryOrder(OrderApiCreateParam param) {
|
||||
public ApiDealResp<OrderApiQueryResp> queryOrder( OrderApiQueryParam param) {
|
||||
ApiDealResp<OrderApiQueryResp> result = new ApiDealResp<>();
|
||||
try {
|
||||
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ public class HuNanDxApiDealStrategy implements ApiDealStrategy {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ApiDealResp<OrderApiQueryResp> queryOrder(OrderApiCreateParam param) {
|
||||
public ApiDealResp<OrderApiQueryResp> queryOrder(OrderApiQueryParam param) {
|
||||
|
||||
|
||||
ApiDealResp<OrderApiQueryResp> result = new ApiDealResp<>();
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ public class LianTongApiDealStrategy implements ApiDealStrategy {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ApiDealResp<OrderApiQueryResp> queryOrder(OrderApiCreateParam param) {
|
||||
public ApiDealResp<OrderApiQueryResp> queryOrder(OrderApiQueryParam param) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue