通用文件上传
到店订单分页
This commit is contained in:
@@ -3,6 +3,7 @@ package com.chaozhanggui.system.cashierservice.controller;
|
||||
import com.chaozhanggui.system.cashierservice.dao.TbPlatformDictMapper;
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbPlatformDict;
|
||||
import com.chaozhanggui.system.cashierservice.exception.MsgException;
|
||||
import com.chaozhanggui.system.cashierservice.service.FileService;
|
||||
import com.chaozhanggui.system.cashierservice.sign.CodeEnum;
|
||||
import com.chaozhanggui.system.cashierservice.sign.Result;
|
||||
import com.chaozhanggui.system.cashierservice.util.LocationUtils;
|
||||
@@ -12,15 +13,12 @@ import com.chaozhanggui.system.cashierservice.util.ValidateCodeUtil;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import com.google.gson.*;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@@ -39,6 +37,8 @@ public class CommonController {
|
||||
private RedisUtils redisUtils;
|
||||
@Resource
|
||||
private TbPlatformDictMapper platformDictMapper;
|
||||
@Resource
|
||||
private FileService fileService;
|
||||
/**
|
||||
* 一分钟
|
||||
*/
|
||||
@@ -100,4 +100,9 @@ public class CommonController {
|
||||
JsonNode jsonNode = mapper.readTree(gpsInfo);
|
||||
return Result.success(CodeEnum.SUCCESS, jsonNode);
|
||||
}
|
||||
|
||||
@RequestMapping("common/upload")
|
||||
public Result upload(MultipartFile file) throws Exception {
|
||||
return new Result(CodeEnum.SUCCESS, fileService.uploadFile(file));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user