feat(商城): 代码优化

master
wayn 4 years ago
parent 4d749a1d9d
commit 7eb4bf7f01

@ -53,6 +53,12 @@
<version>${spring-boot.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<version>${spring-boot.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-redis</artifactId>

@ -1,6 +1,7 @@
package com.wayn.admin.api.controller.shop;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wayn.admin.framework.config.properties.ExpressProperties;
import com.wayn.common.base.BaseController;
import com.wayn.common.core.domain.shop.Order;
import com.wayn.common.core.service.shop.IAdminOrderService;
@ -13,6 +14,9 @@ import org.springframework.web.bind.annotation.*;
@RequestMapping("shop/order")
public class AdminOrderController extends BaseController {
@Autowired
private ExpressProperties expressProperties;
@Autowired
private IAdminOrderService iAdminOrderService;
@ -37,6 +41,11 @@ public class AdminOrderController extends BaseController {
return iAdminOrderService.refund(orderId);
}
@PostMapping("listChannel")
public R channel() {
return R.success().add("data", expressProperties.getVendors());
}
@PostMapping("ship/{orderId}")
public R ship(@PathVariable Long orderId) {
return iAdminOrderService.ship(orderId);

@ -0,0 +1,51 @@
package com.wayn.admin.framework.config.properties;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@Configuration
@EnableConfigurationProperties
@ConfigurationProperties(prefix = "shop.express")
public class ExpressProperties {
private boolean enable;
private String appId;
private String appKey;
private List<Map<String, String>> vendors = new ArrayList<>();
public boolean isEnable() {
return enable;
}
public void setEnable(boolean enable) {
this.enable = enable;
}
public List<Map<String, String>> getVendors() {
return vendors;
}
public void setVendors(List<Map<String, String>> vendors) {
this.vendors = vendors;
}
public String getAppKey() {
return appKey;
}
public void setAppKey(String appKey) {
this.appKey = appKey;
}
public String getAppId() {
return appId;
}
public void setAppId(String appId) {
this.appId = appId;
}
}

@ -65,3 +65,37 @@ qiniu:
bucket: wayntest
## 此处填写你自己的七牛云 域名
prefix: http://cdn.wayn.xin
# 快递列表
shop:
express:
enable: false
appId: "XXXXXXXXX"
appKey: "XXXXXXXXXXXXXXXXXXXXXXXXX"
vendors:
- code: "ZTO"
name: "中通快递"
- code: "YTO"
name: "圆通速递"
- code: "YD"
name: "韵达速递"
- code: "YZPY"
name: "邮政快递包裹"
- code: "EMS"
name: "EMS"
- code: "DBL"
name: "德邦快递"
- code: "FAST"
name: "快捷快递"
- code: "ZJS"
name: "宅急送"
- code: "TNT"
name: "TNT快递"
- code: "UPS"
name: "UPS"
- code: "DHL"
name: "DHL"
- code: "FEDEX"
name: "FEDEX联邦(国内件)"
- code: "FEDEX_GJ"
name: "FEDEX联邦(国际件)"

@ -19,6 +19,12 @@
<version>${spring-boot.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<version>${spring-boot.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-redis</artifactId>

Loading…
Cancel
Save