资源上传的校验优化
This commit is contained in:
parent
506a7a2dc8
commit
312d307772
|
@ -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());
|
||||||
|
|
|
@ -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());
|
||||||
|
|
|
@ -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());
|
||||||
|
|
Loading…
Reference in New Issue