资源上传的校验优化

This commit is contained in:
cjw 2024-06-18 16:58:57 +08:00
parent 506a7a2dc8
commit 312d307772
3 changed files with 4 additions and 2 deletions

View File

@ -105,6 +105,8 @@ public class SysOssPersonServiceImpl implements ISysOssPersonService {
public Boolean insertByBo(SysOssPersonBo bo) { public Boolean insertByBo(SysOssPersonBo bo) {
SysOssPerson add = MapstructUtils.convert(bo, SysOssPerson.class); SysOssPerson add = MapstructUtils.convert(bo, SysOssPerson.class);
validEntityBeforeSave(add); validEntityBeforeSave(add);
String path = catalogService.selectCatalogNameById(add.getCatalogId());
add.setFilePath(path);
boolean flag = baseMapper.insert(add) > 0; boolean flag = baseMapper.insert(add) > 0;
if (flag) { if (flag) {
bo.setId(add.getId()); bo.setId(add.getId());

View File

@ -112,10 +112,10 @@ public class SysOssResourceServiceImpl implements ISysOssResourceService {
@Override @Override
public Boolean insertByBo(SysOssResourceBo bo) { public Boolean insertByBo(SysOssResourceBo bo) {
SysOssResource add = MapstructUtils.convert(bo, SysOssResource.class); SysOssResource add = MapstructUtils.convert(bo, SysOssResource.class);
validEntityBeforeSave(add);
String path = catalogService.selectCatalogNameById(add.getCatalogId()); String path = catalogService.selectCatalogNameById(add.getCatalogId());
add.setFilePath(path); add.setFilePath(path);
add.setStatus(-1); add.setStatus(-1);
validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0; boolean flag = baseMapper.insert(add) > 0;
if (flag) { if (flag) {
bo.setOssId(add.getOssId()); bo.setOssId(add.getOssId());

View File

@ -112,10 +112,10 @@ public class SysOssTextbookServiceImpl implements ISysOssTextbookService {
@Override @Override
public Boolean insertByBo(SysOssTextbookBo bo) { public Boolean insertByBo(SysOssTextbookBo bo) {
SysOssTextbook add = MapstructUtils.convert(bo, SysOssTextbook.class); SysOssTextbook add = MapstructUtils.convert(bo, SysOssTextbook.class);
validEntityBeforeSave(add);
String path = catalogService.selectCatalogNameById(add.getCatalogId()); String path = catalogService.selectCatalogNameById(add.getCatalogId());
add.setFilePath(path); add.setFilePath(path);
add.setStatus(-1); add.setStatus(-1);
validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0; boolean flag = baseMapper.insert(add) > 0;
if (flag) { if (flag) {
bo.setOssId(add.getOssId()); bo.setOssId(add.getOssId());