fix[订单模块]:排队,oss路径,自动任务,订单状态等逻辑
This commit is contained in:
+4
-4
@@ -6,6 +6,7 @@ import com.central.common.model.Result;
|
||||
import com.central.file.service.IFileService;
|
||||
import com.central.file.utils.HexToJpeg;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.*;
|
||||
import org.springframework.util.LinkedMultiValueMap;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
@@ -13,7 +14,6 @@ import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.util.LinkedHashMap;
|
||||
@@ -26,7 +26,7 @@ import java.util.Map;
|
||||
*/
|
||||
@RestController
|
||||
public class FileController {
|
||||
@Resource
|
||||
@Autowired
|
||||
private IFileService fileService;
|
||||
|
||||
// @Value("tencent.accessTokenUrl")
|
||||
@@ -81,8 +81,8 @@ public class FileController {
|
||||
return fileService.getViewUrl(id);
|
||||
}
|
||||
|
||||
@GetMapping("/files/name")
|
||||
public String getViewUrlByName(@RequestParam String name) {
|
||||
@PostMapping("/files/name")
|
||||
public String getViewUrlByName(@RequestBody String name) {
|
||||
return fileService.getViewUrlByName(name);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,4 +17,6 @@ import java.util.Map;
|
||||
@Mapper
|
||||
public interface FileMapper extends SuperMapper<FileInfo> {
|
||||
List<FileInfo> findList(Page<FileInfo> page, @Param("f") Map<String, Object> params);
|
||||
|
||||
FileInfo findById(@Param("id") String id);
|
||||
}
|
||||
|
||||
+5
@@ -110,4 +110,9 @@ public abstract class AbstractIFileService extends ServiceImpl<FileMapper, FileI
|
||||
}
|
||||
|
||||
public abstract String getViewUrlByName(String name);
|
||||
|
||||
@Override
|
||||
public FileInfo getFileInfo(String id) {
|
||||
return baseMapper.selectById(id);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -66,7 +66,7 @@ public class OssService extends AbstractIFileService {
|
||||
|
||||
@Override
|
||||
public String getViewUrl(String fileId) {
|
||||
FileInfo fileInfo = baseMapper.selectById(fileId);
|
||||
FileInfo fileInfo = getFileInfo(fileId);
|
||||
if (fileInfo != null) {
|
||||
return ossTemplate.getViewUrl(fileInfo.getName());
|
||||
}
|
||||
@@ -82,7 +82,7 @@ public class OssService extends AbstractIFileService {
|
||||
|
||||
@Override
|
||||
public FileInfo getFileInfo(String id) {
|
||||
return baseMapper.selectById(id);
|
||||
return baseMapper.findById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -8,7 +8,7 @@ spring:
|
||||
mybatis-plus:
|
||||
mapper-locations: classpath:/mapper/*Mapper.xml
|
||||
#实体扫描,多个package用逗号或者分号分隔
|
||||
typeAliasesPackage: com.central.file.model
|
||||
typeAliasesPackage: com.central.common.model
|
||||
global-config:
|
||||
db-config:
|
||||
id-type: INPUT
|
||||
|
||||
@@ -4,7 +4,7 @@ server:
|
||||
spring:
|
||||
application:
|
||||
name: file-center
|
||||
# cloud:
|
||||
# nacos:
|
||||
# discovery:
|
||||
# ip: 119.45.169.13
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
ip: 119.45.169.13
|
||||
|
||||
@@ -25,4 +25,8 @@
|
||||
<include refid="where" />
|
||||
order by t.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="findById" resultType="com.central.common.model.FileInfo">
|
||||
SELECT * FROM file_info WHERE id = #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user