|
|
@ -30,6 +30,7 @@ import me.zhengjie.exception.BadRequestException;
|
|
|
|
import me.zhengjie.modules.constant.DefaultConstant;
|
|
|
|
import me.zhengjie.modules.constant.DefaultConstant;
|
|
|
|
import me.zhengjie.modules.formdata.service.FormdataService;
|
|
|
|
import me.zhengjie.modules.formdata.service.FormdataService;
|
|
|
|
import me.zhengjie.modules.formdata.service.dto.FormdataDto;
|
|
|
|
import me.zhengjie.modules.formdata.service.dto.FormdataDto;
|
|
|
|
|
|
|
|
import me.zhengjie.modules.upload.consts.SysConst;
|
|
|
|
import me.zhengjie.modules.uploadnew.domain.TbUploadFileNew;
|
|
|
|
import me.zhengjie.modules.uploadnew.domain.TbUploadFileNew;
|
|
|
|
import me.zhengjie.modules.uploadnew.redis.RedisParentDao;
|
|
|
|
import me.zhengjie.modules.uploadnew.redis.RedisParentDao;
|
|
|
|
import me.zhengjie.modules.uploadnew.service.TbUploadFileNewService;
|
|
|
|
import me.zhengjie.modules.uploadnew.service.TbUploadFileNewService;
|
|
|
@ -60,6 +61,7 @@ import java.util.Objects;
|
|
|
|
|
|
|
|
|
|
|
|
import static me.zhengjie.modules.constant.FileConstant.*;
|
|
|
|
import static me.zhengjie.modules.constant.FileConstant.*;
|
|
|
|
import static me.zhengjie.modules.upload.consts.UploadFileConst.FILE_PATH_SPLIT;
|
|
|
|
import static me.zhengjie.modules.upload.consts.UploadFileConst.FILE_PATH_SPLIT;
|
|
|
|
|
|
|
|
import static me.zhengjie.modules.upload.consts.UploadFileConst.WHITE_LIST;
|
|
|
|
import static me.zhengjie.modules.uploadnew.consts.SysConstNew.*;
|
|
|
|
import static me.zhengjie.modules.uploadnew.consts.SysConstNew.*;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -105,9 +107,29 @@ public class TbUploadFileNewController {
|
|
|
|
@ApiOperation("查询文件上传接口")
|
|
|
|
@ApiOperation("查询文件上传接口")
|
|
|
|
@PreAuthorize("@el.check('tbUploadFileNew:list')")
|
|
|
|
@PreAuthorize("@el.check('tbUploadFileNew:list')")
|
|
|
|
public ResponseEntity<Object> query(TbUploadFileNewQueryCriteria criteria, Pageable pageable) {
|
|
|
|
public ResponseEntity<Object> query(TbUploadFileNewQueryCriteria criteria, Pageable pageable) {
|
|
|
|
|
|
|
|
filterOfWriteList(criteria);
|
|
|
|
|
|
|
|
log.info("======= [ criteria is {} ] =======", criteria.toString());
|
|
|
|
return new ResponseEntity<>(tbUploadFileNewService.queryAll(criteria, pageable), HttpStatus.OK);
|
|
|
|
return new ResponseEntity<>(tbUploadFileNewService.queryAll(criteria, pageable), HttpStatus.OK);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 加一个判断,除了白名单账户外,其他的人查询只能返回自己上传的列表
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param criteria 查询的参数
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @return
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
private void filterOfWriteList(TbUploadFileNewQueryCriteria criteria) {
|
|
|
|
|
|
|
|
if (!SysConst.sysDebug){
|
|
|
|
|
|
|
|
if (!CollectionUtil.contains(WHITE_LIST, SecurityUtils.getCurrentUsername())){
|
|
|
|
|
|
|
|
criteria.setOperation(SecurityUtils.getCurrentUsername());
|
|
|
|
|
|
|
|
log.info("======= [TbUploadFileNewController|filterOfWriteList, userName is {} ] =======", SecurityUtils.getCurrentUsername());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping
|
|
|
|
@PostMapping
|
|
|
|
@Log("新增文件上传接口")
|
|
|
|
@Log("新增文件上传接口")
|
|
|
|
@ApiOperation("新增文件上传接口")
|
|
|
|
@ApiOperation("新增文件上传接口")
|
|
|
|