Commit 68b28d4d authored by 赵啸非's avatar 赵啸非

添加消息任务表

parent 75051351
...@@ -3,7 +3,10 @@ package com.mortals.xhx.base.system.upload.web; ...@@ -3,7 +3,10 @@ package com.mortals.xhx.base.system.upload.web;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.framework.web.BaseController; import com.mortals.framework.web.BaseController;
import com.mortals.xhx.base.system.resource.model.ResourceEntity;
import com.mortals.xhx.base.system.resource.service.ResourceService;
import com.mortals.xhx.base.system.upload.service.UploadService; import com.mortals.xhx.base.system.upload.service.UploadService;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
...@@ -23,10 +26,18 @@ import java.util.Map; ...@@ -23,10 +26,18 @@ import java.util.Map;
@RestController @RestController
@RequestMapping("file") @RequestMapping("file")
public class UploadController extends BaseController { public class UploadController extends BaseController {
protected String moduleDesc = "";
@Resource @Resource
private UploadService uploadService; private UploadService uploadService;
public UploadController() {
this.setModuleDesc("资源信息");
}
public void setModuleDesc(String moduleDesc) {
this.moduleDesc = moduleDesc;
}
@RequestMapping(value = "upload") @RequestMapping(value = "upload")
public String doFileUpload(HttpServletRequest request, UploadForm form) { public String doFileUpload(HttpServletRequest request, UploadForm form) {
Map<String, Object> model = new HashMap<>(); Map<String, Object> model = new HashMap<>();
...@@ -52,7 +63,7 @@ public class UploadController extends BaseController { ...@@ -52,7 +63,7 @@ public class UploadController extends BaseController {
@RequestMapping(value = "commonupload") @RequestMapping(value = "commonupload")
public String doFileUpload(MultipartFile file, @RequestParam(value = "prePath",defaultValue = "/file/fileupload") String prePath) { public String doFileUpload(MultipartFile file, @RequestParam(value = "prePath", defaultValue = "/file/fileupload") String prePath) {
Map<String, Object> model = new HashMap<>(); Map<String, Object> model = new HashMap<>();
String jsonStr = ""; String jsonStr = "";
try { try {
...@@ -97,7 +108,7 @@ public class UploadController extends BaseController { ...@@ -97,7 +108,7 @@ public class UploadController extends BaseController {
* @param fileName 文件名称 * @param fileName 文件名称
*/ */
@GetMapping("preview/{fileName}") @GetMapping("preview/{fileName}")
public void preView(@PathVariable(value="fileName") String fileName, HttpServletResponse response) { public void preView(@PathVariable(value = "fileName") String fileName, HttpServletResponse response) {
try { try {
uploadService.preview(fileName, response); uploadService.preview(fileName, response);
} catch (Exception e) { } catch (Exception e) {
...@@ -111,7 +122,7 @@ public class UploadController extends BaseController { ...@@ -111,7 +122,7 @@ public class UploadController extends BaseController {
* @param fileName 文件名称 * @param fileName 文件名称
*/ */
@GetMapping("fileupload/{fileName}") @GetMapping("fileupload/{fileName}")
public void fileupload(@PathVariable(value="fileName") String fileName, HttpServletResponse response) { public void fileupload(@PathVariable(value = "fileName") String fileName, HttpServletResponse response) {
try { try {
uploadService.uploadDownload(fileName, response); uploadService.uploadDownload(fileName, response);
} catch (Exception e) { } catch (Exception e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment