|
@@ -37,7 +37,7 @@ public class TFileController extends BaseController {
|
|
|
/**
|
|
|
* 查询附件列表
|
|
|
*/
|
|
|
- @PreAuthorize("@ss.hasPermi('file:file:list')")
|
|
|
+// @PreAuthorize("@ss.hasPermi('file:file:list')")
|
|
|
@GetMapping("/list")
|
|
|
public AjaxResult list(TFile tFile) {
|
|
|
if (StringUtils.isEmpty(tFile.getLinkName())) {
|
|
@@ -47,11 +47,17 @@ public class TFileController extends BaseController {
|
|
|
return AjaxResult.success(list);
|
|
|
}
|
|
|
|
|
|
+ @PreAuthorize("@ss.hasPermi('file:file:query')")
|
|
|
+ @GetMapping("/greaterThan1GFile")
|
|
|
+ public AjaxResult greaterThan1GFile() {
|
|
|
+ return AjaxResult.success(tFileService.selectGreaterThan1GFileList());
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 获取附件详细信息
|
|
|
*/
|
|
|
- @PreAuthorize("@ss.hasPermi('file:file:query')")
|
|
|
+// @PreAuthorize("@ss.hasPermi('file:file:query')")
|
|
|
@GetMapping(value = "/{id}")
|
|
|
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
|
|
return AjaxResult.success(tFileService.selectTFileById(id));
|
|
@@ -60,7 +66,7 @@ public class TFileController extends BaseController {
|
|
|
/**
|
|
|
* 新增附件
|
|
|
*/
|
|
|
- @PreAuthorize("@ss.hasPermi('file:file:add')")
|
|
|
+// @PreAuthorize("@ss.hasPermi('file:file:add')")
|
|
|
@Log(title = "附件", businessType = BusinessType.INSERT)
|
|
|
@PostMapping
|
|
|
public AjaxResult add(@RequestBody TFile tFile) {
|
|
@@ -70,7 +76,7 @@ public class TFileController extends BaseController {
|
|
|
/**
|
|
|
* 修改附件
|
|
|
*/
|
|
|
- @PreAuthorize("@ss.hasPermi('file:file:edit')")
|
|
|
+// @PreAuthorize("@ss.hasPermi('file:file:edit')")
|
|
|
@Log(title = "附件", businessType = BusinessType.UPDATE)
|
|
|
@PutMapping
|
|
|
public AjaxResult edit(@RequestBody TFile tFile) {
|
|
@@ -80,7 +86,7 @@ public class TFileController extends BaseController {
|
|
|
/**
|
|
|
* 删除附件
|
|
|
*/
|
|
|
- @PreAuthorize("@ss.hasPermi('file:file:remove')")
|
|
|
+// @PreAuthorize("@ss.hasPermi('file:file:remove')")
|
|
|
@Log(title = "附件", businessType = BusinessType.DELETE)
|
|
|
@DeleteMapping("/{ids}")
|
|
|
public AjaxResult remove(@PathVariable Long[] ids) {
|
|
@@ -132,6 +138,7 @@ public class TFileController extends BaseController {
|
|
|
}
|
|
|
tFile.setpId(pId);
|
|
|
tFile.setFileSize(String.valueOf(new BigDecimal(file.getSize()).
|
|
|
+ divide(BigDecimal.valueOf(1024), 2, RoundingMode.HALF_DOWN).
|
|
|
divide(BigDecimal.valueOf(1024), 2, RoundingMode.HALF_DOWN)));
|
|
|
tFile.setUploader(getNickname());
|
|
|
tFile.setUploadDate(new Date());
|