|
@@ -17,15 +17,26 @@ import com.chelvc.cloud.vehicle.client.dto.BalanceDetailDTO;
|
|
import com.chelvc.cloud.vehicle.client.dto.MerchantDTO;
|
|
import com.chelvc.cloud.vehicle.client.dto.MerchantDTO;
|
|
import com.chelvc.cloud.vehicle.client.dto.MerchantDetailDTO;
|
|
import com.chelvc.cloud.vehicle.client.dto.MerchantDetailDTO;
|
|
import com.chelvc.cloud.vehicle.client.dto.MerchantRankDTO;
|
|
import com.chelvc.cloud.vehicle.client.dto.MerchantRankDTO;
|
|
-import com.chelvc.cloud.vehicle.client.param.*;
|
|
|
|
|
|
+import com.chelvc.cloud.vehicle.client.param.LocationQueryParam;
|
|
|
|
+import com.chelvc.cloud.vehicle.client.param.MerchantQueryParam;
|
|
|
|
+import com.chelvc.cloud.vehicle.client.param.MerchantQueryParamPaging;
|
|
|
|
+import com.chelvc.cloud.vehicle.client.param.MerchantRankParam;
|
|
|
|
+import com.chelvc.cloud.vehicle.client.param.OmsCartItemPagingParam;
|
|
|
|
+import com.chelvc.cloud.vehicle.client.param.QueryMerchantBalanceParam;
|
|
|
|
+import com.chelvc.cloud.vehicle.client.param.SxyNotifyParam;
|
|
import com.chelvc.framework.base.annotation.ResponseWrapping;
|
|
import com.chelvc.framework.base.annotation.ResponseWrapping;
|
|
import com.chelvc.framework.base.context.SessionContextHolder;
|
|
import com.chelvc.framework.base.context.SessionContextHolder;
|
|
import com.chelvc.framework.common.model.Pagination;
|
|
import com.chelvc.framework.common.model.Pagination;
|
|
-import com.chelvc.framework.security.annotation.Authorize;
|
|
|
|
|
|
+import com.chelvc.framework.security.annotation.Security;
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.validation.annotation.Validated;
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.PutMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 商家接口
|
|
* 商家接口
|
|
@@ -51,8 +62,8 @@ public class MerchantController {
|
|
*/
|
|
*/
|
|
@GetMapping("/merchantSort")
|
|
@GetMapping("/merchantSort")
|
|
public List<SimpleMerchantVO> listSimpleMerchants(@Valid MerchantQueryParam param) {
|
|
public List<SimpleMerchantVO> listSimpleMerchants(@Valid MerchantQueryParam param) {
|
|
- param.setCode((param.getRegion()/100)*100);
|
|
|
|
- param.setBoundary((param.getRegion()/100)*100+99);
|
|
|
|
|
|
+ param.setCode((param.getRegion() / 100) * 100);
|
|
|
|
+ param.setBoundary((param.getRegion() / 100) * 100 + 99);
|
|
return MerchantCopier.INSTANCE.copying(this.merchantClient.listSimpleMerchants(param));
|
|
return MerchantCopier.INSTANCE.copying(this.merchantClient.listSimpleMerchants(param));
|
|
}
|
|
}
|
|
|
|
|
|
@@ -64,8 +75,8 @@ public class MerchantController {
|
|
*/
|
|
*/
|
|
@GetMapping("/merchantPagingList")
|
|
@GetMapping("/merchantPagingList")
|
|
public Pagination<MerchantDTO> merchantPagingList(@Valid MerchantQueryParamPaging param) {
|
|
public Pagination<MerchantDTO> merchantPagingList(@Valid MerchantQueryParamPaging param) {
|
|
- param.setCode((param.getRegion()/100)*100);
|
|
|
|
- param.setBoundary((param.getRegion()/100)*100+99);
|
|
|
|
|
|
+ param.setCode((param.getRegion() / 100) * 100);
|
|
|
|
+ param.setBoundary((param.getRegion() / 100) * 100 + 99);
|
|
return this.merchantClient.merchantPagingList(param);
|
|
return this.merchantClient.merchantPagingList(param);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -90,8 +101,8 @@ public class MerchantController {
|
|
@GetMapping("/merchant/{id}")
|
|
@GetMapping("/merchant/{id}")
|
|
public MerchantDetailDTO getMerchantDetail(@PathVariable("id") @Min(value = 1, message = "商家ID不能小于1") Long id,
|
|
public MerchantDetailDTO getMerchantDetail(@PathVariable("id") @Min(value = 1, message = "商家ID不能小于1") Long id,
|
|
@Valid LocationQueryParam param) {
|
|
@Valid LocationQueryParam param) {
|
|
- param.setCode((param.getRegion()/100)*100);
|
|
|
|
- param.setBoundary((param.getRegion()/100)*100+99);
|
|
|
|
|
|
+ param.setCode((param.getRegion() / 100) * 100);
|
|
|
|
+ param.setBoundary((param.getRegion() / 100) * 100 + 99);
|
|
return this.merchantClient.queryMerchantDetail(id, param);
|
|
return this.merchantClient.queryMerchantDetail(id, param);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -171,12 +182,11 @@ public class MerchantController {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 子商户入网回调接口
|
|
* 子商户入网回调接口
|
|
- *
|
|
|
|
*/
|
|
*/
|
|
|
|
+ @Security(enabled = false)
|
|
@PostMapping("/merchant/apply/notify")
|
|
@PostMapping("/merchant/apply/notify")
|
|
- @Authorize(enabled = false)
|
|
|
|
public void merchantApplyNotify(HttpServletRequest request,
|
|
public void merchantApplyNotify(HttpServletRequest request,
|
|
- @RequestBody SxyNotifyParam param) {
|
|
|
|
|
|
+ @RequestBody SxyNotifyParam param) {
|
|
String merchantId = request.getHeader("merchantId");
|
|
String merchantId = request.getHeader("merchantId");
|
|
String encryptKey = request.getHeader("encryptKey");
|
|
String encryptKey = request.getHeader("encryptKey");
|
|
param.setMerchantId(merchantId);
|
|
param.setMerchantId(merchantId);
|