FengChaoYu hai 1 mes
pai
achega
0d6ea68895

+ 8 - 0
src/main/java/com/gree/mall/manager/controller/common/CommonController.java

@@ -10,6 +10,7 @@ import com.gree.mall.manager.logic.common.kuaidi100.response.SubscribeResp;
 import com.gree.mall.manager.plus.entity.*;
 import com.gree.mall.manager.plus.service.OrderDetailService;
 import com.gree.mall.manager.plus.service.OrderInfoService;
+import com.gree.mall.manager.utils.CommonUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
@@ -21,6 +22,7 @@ import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import javax.validation.constraints.NotBlank;
 import java.io.IOException;
 import java.util.List;
 
@@ -53,6 +55,12 @@ public class CommonController {
         return ResponseHelper.success(commonFile);
     }
 
+    @GetMapping("template/download")
+    @ApiOperation("下载模板")
+    public void download(@RequestParam(required = false) @NotBlank(message = "需下载的模板名称不能为空") String name, HttpServletResponse response) throws IOException {
+        CommonUtils.downloadFile(name, response);
+    }
+
     @GetMapping("/express")
     @ApiOperation(value = "查看物流")
     public ResponseHelper<List<ExpressInfo>> express(