字典值功能更新
This commit is contained in:
parent
0e8982ec3b
commit
f0350db727
@ -1,6 +1,7 @@
|
|||||||
package com.cdzy.operations.service.impl;
|
package com.cdzy.operations.service.impl;
|
||||||
|
|
||||||
import cn.dev33.satoken.stp.StpUtil;
|
import cn.dev33.satoken.stp.StpUtil;
|
||||||
|
import cn.hutool.core.io.file.FileNameUtil;
|
||||||
import com.cdzy.common.ex.EbikeException;
|
import com.cdzy.common.ex.EbikeException;
|
||||||
import com.cdzy.operations.enums.CommandType;
|
import com.cdzy.operations.enums.CommandType;
|
||||||
import com.cdzy.operations.mapper.EbikeBikeInfoMapper;
|
import com.cdzy.operations.mapper.EbikeBikeInfoMapper;
|
||||||
@ -53,8 +54,6 @@ public class EbikeEcuInfoServiceImpl extends ServiceImpl<EbikeEcuInfoMapper, Ebi
|
|||||||
|
|
||||||
private static final String upgradeUrl = "/upgrade-file/";
|
private static final String upgradeUrl = "/upgrade-file/";
|
||||||
|
|
||||||
private static final String upgradeSuffix = ".bin";
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void saveEcu(EbikeEcuInfoVo ebikeEcuInfo) {
|
public void saveEcu(EbikeEcuInfoVo ebikeEcuInfo) {
|
||||||
EbikeEcuInfo ebikeEcuInfoEntity = EbikeEcuInfo.builder()
|
EbikeEcuInfo ebikeEcuInfoEntity = EbikeEcuInfo.builder()
|
||||||
@ -181,8 +180,7 @@ public class EbikeEcuInfoServiceImpl extends ServiceImpl<EbikeEcuInfoMapper, Ebi
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String upload(MultipartFile file) throws Exception {
|
public String upload(MultipartFile file) throws Exception {
|
||||||
String fileName = UUID.randomUUID().toString().replace("-", "");
|
String objectName = upgradeUrl + UUID.randomUUID().toString().replace("-", "") + FileNameUtil.extName(file.getOriginalFilename());
|
||||||
String objectName = upgradeUrl + fileName + upgradeSuffix;
|
|
||||||
minioUtil.uploadFile(file.getInputStream() , objectName);
|
minioUtil.uploadFile(file.getInputStream() , objectName);
|
||||||
return minioUtil.getShowUrl(objectName);
|
return minioUtil.getShowUrl(objectName);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -50,4 +50,9 @@ public class EbikeDicValue implements Serializable {
|
|||||||
@NotNull(message = "字典id不能为空")
|
@NotNull(message = "字典id不能为空")
|
||||||
private Long dicId;
|
private Long dicId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字典icon
|
||||||
|
*/
|
||||||
|
private String dicIcon;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user