|
@@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.qmth.themis.backend.config.DictionaryConfig;
|
|
|
import com.qmth.themis.business.config.SystemConfig;
|
|
|
import com.qmth.themis.business.constant.SystemConstant;
|
|
|
-import com.qmth.themis.business.dto.response.TEExamActivityDto;
|
|
|
import com.qmth.themis.business.entity.*;
|
|
|
import com.qmth.themis.business.enums.DownloadFileEnum;
|
|
|
import com.qmth.themis.business.enums.RoleEnum;
|
|
@@ -115,10 +114,19 @@ public class SysController {
|
|
|
if (Objects.isNull(tbAttachment)) {
|
|
|
throw new BusinessException(ExceptionResultEnum.ATTACHMENT_ERROR);
|
|
|
}
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(tbAttachment.getRemark());
|
|
|
+ String attachmentType = String.valueOf(jsonObject.get("type"));
|
|
|
+ String url = null;
|
|
|
+ if (Objects.equals(attachmentType, SystemConstant.LOCAL)) {
|
|
|
+ url = "http://" + dictionaryConfig.sysDomain().getFileHost() + File.separator + jsonObject.get("path");
|
|
|
+ } else {
|
|
|
+ url = dictionaryConfig.aliYunOssDomain().getUrl() + File.separator + jsonObject.get("path");
|
|
|
+ }
|
|
|
Map map = new HashMap();
|
|
|
map.put(SystemConstant.ID, tbAttachment.getId());
|
|
|
map.put("name", tbAttachment.getName());
|
|
|
map.put(SystemConstant.TYPE, tbAttachment.getType());
|
|
|
+ map.put("url", url);
|
|
|
return ResultUtil.ok(map);
|
|
|
}
|
|
|
|