|
@@ -1,18 +1,31 @@
|
|
|
package com.ydd.third.controller;
|
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.ydd.third.common.dto.*;
|
|
|
import com.ydd.third.common.vo.ResObject;
|
|
|
-import com.ydd.third.common.vo.vo.order.OrderQueryResultVo;
|
|
|
-import com.ydd.third.common.vo.vo.order.OrderQueryVo;
|
|
|
-import com.ydd.third.common.vo.vo.order.RiderLocationResultVo;
|
|
|
-import com.ydd.third.common.vo.vo.order.RiderLocationVo;
|
|
|
+import com.ydd.third.common.vo.huolalavo.HCity;
|
|
|
+import com.ydd.third.common.vo.huolalavo.HCityInfo;
|
|
|
+import com.ydd.third.common.vo.huolalavo.HPoiSearch;
|
|
|
+import com.ydd.third.common.vo.huolalavo.Haddress;
|
|
|
+import com.ydd.third.common.vo.shop.*;
|
|
|
+import com.ydd.third.common.vo.vo.order.*;
|
|
|
import com.ydd.third.delivery.Client;
|
|
|
+import com.ydd.third.delivery.aipt.AiptClient;
|
|
|
+import com.ydd.third.delivery.dada.DadaClient;
|
|
|
+import com.ydd.third.delivery.fengniao.FengniaoClient;
|
|
|
+import com.ydd.third.delivery.huolala.HuolalaClient;
|
|
|
+import com.ydd.third.delivery.kuaifu.KfClient;
|
|
|
+import com.ydd.third.delivery.shansong.ShansongClient;
|
|
|
+import com.ydd.third.delivery.uupt.service.UuptUserDeliveryService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
/**
|
|
|
* Project:lb-server
|
|
|
* Class:WaimaiApi
|
|
@@ -24,12 +37,24 @@ import org.springframework.web.bind.annotation.*;
|
|
|
@Api(value = "配送平台接口", tags = {"配送平台接口"})
|
|
|
@Slf4j
|
|
|
@RestController
|
|
|
-//@RequestMapping("/delivery")
|
|
|
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
|
|
public class DeliveryController {
|
|
|
|
|
|
private final Client client;
|
|
|
|
|
|
+ private final HuolalaClient huolalaClient;
|
|
|
+
|
|
|
+ private final UuptUserDeliveryService uuptUserDeliveryService;
|
|
|
+
|
|
|
+ private final ShansongClient shansongClient;
|
|
|
+
|
|
|
+ private final FengniaoClient fengniaoClient;
|
|
|
+
|
|
|
+ private final AiptClient aiptClient;
|
|
|
+
|
|
|
+ private final KfClient kfClient;
|
|
|
+
|
|
|
+ private final DadaClient dadaClient;
|
|
|
|
|
|
@RequestMapping(value = "/queryOrderInfo",method = RequestMethod.POST)
|
|
|
public ResObject<OrderQueryResultVo> list(@RequestBody OrderQueryVo orderQueryVo) {
|
|
@@ -39,13 +64,119 @@ public class DeliveryController {
|
|
|
|
|
|
|
|
|
@PostMapping(value = "/getRiderLocation")
|
|
|
- public ResObject<RiderLocationResultVo> release(@RequestBody RiderLocationVo orderQueryVo) {
|
|
|
+ public ResObject<RiderLocationResultVo> getRiderLocation(@RequestBody RiderLocationVo orderQueryVo) {
|
|
|
return client.getRiderLocation(orderQueryVo);
|
|
|
|
|
|
}
|
|
|
|
|
|
- @RequestMapping(value = "/test",method = RequestMethod.GET)
|
|
|
- public String test(@RequestParam("id")Integer id) {
|
|
|
- return "ok"+id;
|
|
|
+ @PostMapping(value="/getCityList")
|
|
|
+ public List<HCity> getCityList(){
|
|
|
+ return huolalaClient.getCityList();
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping(value="/getCityInfo")
|
|
|
+ public HCityInfo getCityInfo(@RequestParam("cityId") String cityId){
|
|
|
+ return huolalaClient.getCityInfo(cityId);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @RequestMapping(value="/poiSearch",method = RequestMethod.GET)
|
|
|
+ public List<Haddress> poiSearch(@RequestBody HPoiSearch hPoiSearch){
|
|
|
+ return huolalaClient.poiSearch(hPoiSearch);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping(value="/queryAmount")
|
|
|
+ public ResObject<AmountResultVo> queryAmount(@RequestBody QueryAmount queryAmount){
|
|
|
+ return client.queryAmount(queryAmount);
|
|
|
+ }
|
|
|
+ @GetMapping(value="/bindVirtualPhone")
|
|
|
+ public String bindVirtualPhone(@RequestParam("authToken")String authToken,@RequestParam("authToken")String outTradeNo,@RequestParam("authToken")String sendPhone){
|
|
|
+ return huolalaClient.bindVirtualPhone(authToken, outTradeNo, sendPhone);
|
|
|
+ }
|
|
|
+ @PostMapping(value="/orderAddTip")
|
|
|
+ public ResObject<OrderTipsResultVo> orderAddTip(@RequestBody OrderTipsVo orderVo){
|
|
|
+ return client.orderAddTip(orderVo);
|
|
|
+ }
|
|
|
+ @PostMapping(value="/queryOrderDeliverFee")
|
|
|
+ public ResObject<OrderResultVo> queryOrderDeliverFee(@RequestBody OrderVo orderVo){
|
|
|
+ return client.queryOrderDeliverFee(orderVo);
|
|
|
+ }
|
|
|
+ @PostMapping(value="/createShop")
|
|
|
+ public ResObject<ShopResultVo> createShop(@RequestBody ShopVo shopVo ){
|
|
|
+ return client.createShop(shopVo);
|
|
|
+ }
|
|
|
+ @PostMapping(value="/updateShop")
|
|
|
+ public ResObject<ShopResultVo> updateShop(@RequestBody ShopVo shopVo ){
|
|
|
+ return client.updateShop(shopVo);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping(value="/cancelOrder")
|
|
|
+ public ResObject<CancelOrderResultVo> cancelOrder(@RequestBody CancelOrderVo orderVo){
|
|
|
+ return client.cancelOrder(orderVo);
|
|
|
+ }
|
|
|
+ @PostMapping(value="/createOrder")
|
|
|
+ public ResObject<OrderResultVo> createOrder(@RequestBody OrderVo orderVo){
|
|
|
+ return client.createOrder(orderVo);
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping(value="/uupt/cancelBind")
|
|
|
+ public ResObject<CancelBindResponse> cancelBind(@RequestParam("openId")String openId){
|
|
|
+ return uuptUserDeliveryService.cancelBind(openId);
|
|
|
+ }
|
|
|
+ @GetMapping(value="/uupt/bindUserApply")
|
|
|
+ public ResObject<BindUserApplyResponse> bindUserApply(@RequestParam("mobile")String mobile, @RequestParam("ip") String ip){
|
|
|
+ return uuptUserDeliveryService.bindUserApply(mobile, ip);
|
|
|
+ }
|
|
|
+ @GetMapping(value="/uupt/bindUserSubmit")
|
|
|
+ public ResObject<BindUserSubmitResponse> bindUserSubmit(@RequestParam("mobile")String mobile, @RequestParam("validateCode") String validateCode, @RequestParam("cityName") String cityName){
|
|
|
+ return uuptUserDeliveryService.bindUserSubmit(mobile, validateCode, cityName);
|
|
|
+ }
|
|
|
+ @GetMapping(value="/uupt/getBalance")
|
|
|
+ public ResObject<GetBalanceDetailResponse> getBalance(@RequestParam("openId")String openId){
|
|
|
+ return uuptUserDeliveryService.getBalance(openId);
|
|
|
+ }
|
|
|
+ //auth url
|
|
|
+ @GetMapping(value="/shansongAuthUrl")
|
|
|
+ public String shansongAuthUrl(@RequestParam("code")String thirdStoreId){
|
|
|
+ return shansongClient.getAuthUrl(thirdStoreId);
|
|
|
+ }
|
|
|
+ @GetMapping(value="/shansong/cancelToken")
|
|
|
+ public ResObject cancelToken (@RequestParam("token")String token){
|
|
|
+ return shansongClient.cancelToken(token);
|
|
|
+ }
|
|
|
+ @GetMapping(value="/fengniaoAuthUrl")
|
|
|
+ public String fengniaoAuthUrl(){
|
|
|
+ return fengniaoClient.getAuthUrl();
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping(value="/hllAuthUrl")
|
|
|
+ public String hllAuthUrl(){
|
|
|
+ return huolalaClient.getAuthUrl();
|
|
|
+ }
|
|
|
+ @GetMapping(value="/kfAuthUrl")
|
|
|
+ public String kfAuthUrl(@RequestParam("code")String code){
|
|
|
+ return kfClient.getAuthUrlH5(code);
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping(value="/dada/partyTicket")
|
|
|
+ public JSONObject partyTicket(@RequestParam("type")Integer type){
|
|
|
+ return dadaClient.partyTicket(type);
|
|
|
+ }
|
|
|
+ @GetMapping(value="/dada/authUrl")
|
|
|
+ public String dadaAuthUrl(@RequestParam("result")String result,@RequestParam("type")Integer type,@RequestParam("code")String code){
|
|
|
+ return dadaClient.getPartyOauth(result, type, code);
|
|
|
+ }
|
|
|
+ @GetMapping(value="/aptAuthUrl")
|
|
|
+ public String aptAuthUrl(@RequestParam("code")String code){
|
|
|
+ return aiptClient.getAuthUrl(code);
|
|
|
+ }
|
|
|
+ @GetMapping(value="/apt/unBind")
|
|
|
+ public AiptUnBindDto unBind (@RequestParam("account")String account){
|
|
|
+ return aiptClient.unBind(account);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping(value="/apt/queryShop")
|
|
|
+ public ResObject<ShopQueryResultVo> queryShop (@RequestBody ShopQueryVo shopQueryVo ){
|
|
|
+ return client.queryShop(shopQueryVo);
|
|
|
}
|
|
|
}
|