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

添加消息任务表

parent 75051351
......@@ -3,7 +3,10 @@ package com.mortals.xhx.base.system.upload.web;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
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 org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
......@@ -23,10 +26,18 @@ import java.util.Map;
@RestController
@RequestMapping("file")
public class UploadController extends BaseController {
protected String moduleDesc = "";
@Resource
private UploadService uploadService;
public UploadController() {
this.setModuleDesc("资源信息");
}
public void setModuleDesc(String moduleDesc) {
this.moduleDesc = moduleDesc;
}
@RequestMapping(value = "upload")
public String doFileUpload(HttpServletRequest request, UploadForm form) {
Map<String, Object> model = new HashMap<>();
......@@ -52,7 +63,7 @@ public class UploadController extends BaseController {
@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<>();
String jsonStr = "";
try {
......@@ -97,7 +108,7 @@ public class UploadController extends BaseController {
* @param 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 {
uploadService.preview(fileName, response);
} catch (Exception e) {
......@@ -111,7 +122,7 @@ public class UploadController extends BaseController {
* @param 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 {
uploadService.uploadDownload(fileName, response);
} 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