|
@@ -0,0 +1,54 @@
|
|
|
+package com.ydd.app.controller;
|
|
|
+
|
|
|
+import com.ydd.app.dto.OrderReq;
|
|
|
+import com.ydd.app.dto.ValuationRes;
|
|
|
+import com.ydd.app.service.OpenApiOrderService;
|
|
|
+import com.ydd.common.annotation.AccessToken;
|
|
|
+import com.ydd.common.annotation.ControllerLog;
|
|
|
+import com.ydd.common.annotation.RepeatSubmit;
|
|
|
+import com.ydd.common.core.domain.BaseResult;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 开放接口-订单模块
|
|
|
+ * @author 叶君翔
|
|
|
+ * @date 2022/04/07 16:35
|
|
|
+ */
|
|
|
+@Api(value = "开放接口-订单模块", tags = {"开放接口-订单模块"})
|
|
|
+@RestController
|
|
|
+@RequestMapping("/order")
|
|
|
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
|
|
+public class OrderOpenApi {
|
|
|
+
|
|
|
+ private final OpenApiOrderService apiOrderService;
|
|
|
+
|
|
|
+ @ApiOperation("计价")
|
|
|
+ @RequestMapping(value = "/valuation", method = RequestMethod.POST)
|
|
|
+ @AccessToken
|
|
|
+ @RepeatSubmit
|
|
|
+ @ControllerLog("开放接口-订单模块-计价")
|
|
|
+ public BaseResult<ValuationRes> valuation(@RequestBody OrderReq orderReq) {
|
|
|
+ // 0骑手,1货运
|
|
|
+// if (null == orderReq.getTransport()) {
|
|
|
+// orderReq.setTransport(0);
|
|
|
+// }
|
|
|
+// Member member = (Member)((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest().getAttribute("memberUser");
|
|
|
+// ValuationResultData resultData = apiOrderService.orderValuation(member, orderReq, 1);
|
|
|
+// if (resultData == null) {
|
|
|
+// return BaseResult.error("计价异常, 请联系客服!");
|
|
|
+// }
|
|
|
+// if (resultData.getCode() == 1) {
|
|
|
+// return BaseResult.error(resultData.getMsg());
|
|
|
+// }
|
|
|
+ return BaseResult.success(null);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+}
|