Browse Source

Merge remote-tracking branch 'remotes/origin/dev_voice' into dev

dev_shibei_match
jianjun 5 years ago
parent
commit
596b7bed08
  1. 3
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java
  2. 5
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/utils/ModuleConstant.java
  3. 1
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java

3
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java

@ -191,7 +191,8 @@ public class OssController {
public Result<UploadImgResultDTO> uploadArticleImg(@RequestParam("file") MultipartFile file) { public Result<UploadImgResultDTO> uploadArticleImg(@RequestParam("file") MultipartFile file) {
// 校验文件类型 // 校验文件类型
if (!MediaType.IMAGE_PNG_VALUE.equals(file.getContentType()) && !MediaType.IMAGE_JPEG_VALUE.equals(file.getContentType())) { if (!MediaType.IMAGE_PNG_VALUE.equals(file.getContentType()) && !MediaType.IMAGE_JPEG_VALUE.equals(file.getContentType())
&& !ModuleConstant.FILE_CONTENT_TYPE_JPG.equals(file.getContentType()) ) {
log.error("uploadArticleImg file type:{} is not support 2 upload",file.getContentType() == null? null:file.getContentType()); log.error("uploadArticleImg file type:{} is not support 2 upload",file.getContentType() == null? null:file.getContentType());
throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_TYPE_ERROR.getCode() throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_TYPE_ERROR.getCode()
, EpmetErrorCode.OPER_UPLOAD_FILE_TYPE_ERROR.getMsg()); , EpmetErrorCode.OPER_UPLOAD_FILE_TYPE_ERROR.getMsg());

5
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/utils/ModuleConstant.java

@ -21,4 +21,9 @@ public interface ModuleConstant extends Constant {
* 云存储配置KEY * 云存储配置KEY
*/ */
String CLOUD_STORAGE_CONFIG_KEY = "CLOUD_STORAGE_CONFIG_KEY"; String CLOUD_STORAGE_CONFIG_KEY = "CLOUD_STORAGE_CONFIG_KEY";
/**
* jpg文件类型
*/
String FILE_CONTENT_TYPE_JPG = "image/jpg";
} }

1
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java

@ -356,7 +356,6 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void executeSaveDraftAttr(DraftEntity draftEntity, DraftCoverEntity coverEntity, List<DraftPublishRangeEntity> publishRangeEntityList) { public void executeSaveDraftAttr(DraftEntity draftEntity, DraftCoverEntity coverEntity, List<DraftPublishRangeEntity> publishRangeEntityList) {
Map<String, Object> draftIdMap = new HashMap<>();
//物理删除 //物理删除
draftCoverDao.deleteByDraftId(draftEntity.getId()); draftCoverDao.deleteByDraftId(draftEntity.getId());
if (coverEntity != null) { if (coverEntity != null) {

Loading…
Cancel
Save