Merge remote-tracking branch 'origin/0.8.X' into 0.8.X
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
package com.klp.web.controller.system;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.validation.constraints.*;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.klp.common.annotation.RepeatSubmit;
|
||||
import com.klp.common.annotation.Log;
|
||||
import com.klp.common.core.controller.BaseController;
|
||||
import com.klp.common.core.domain.R;
|
||||
import com.klp.common.core.validate.AddGroup;
|
||||
import com.klp.common.enums.BusinessType;
|
||||
import com.klp.system.domain.vo.SysFileCommentVo;
|
||||
import com.klp.system.domain.bo.SysFileCommentBo;
|
||||
import com.klp.system.service.ISysFileCommentService;
|
||||
|
||||
/**
|
||||
* 文件评论
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-07-04
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/system/file/comment")
|
||||
public class SysFileCommentController extends BaseController {
|
||||
|
||||
private final ISysFileCommentService iSysFileCommentService;
|
||||
|
||||
/**
|
||||
* 查询文件评论列表
|
||||
*/
|
||||
@GetMapping("/list/{fileId}")
|
||||
public R<List<SysFileCommentVo>> list(@NotNull(message = "文件ID不能为空") @PathVariable Long fileId) {
|
||||
return R.ok(iSysFileCommentService.queryListByFileId(fileId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增文件评论
|
||||
*/
|
||||
@Log(title = "文件评论", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody SysFileCommentBo bo) {
|
||||
return toAjax(iSysFileCommentService.insertByBo(bo));
|
||||
}
|
||||
}
|
||||
@@ -98,6 +98,15 @@ public class SysFileController extends BaseController {
|
||||
return toAjax(iSysFileService.deleteWithValidByIds(Arrays.asList(fileIds), true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件浏览次数 +1
|
||||
*/
|
||||
@PutMapping("/incrementView/{fileId}")
|
||||
public R<Void> incrementView(@NotNull(message = "主键不能为空") @PathVariable Long fileId) {
|
||||
iSysFileService.incrementViewCount(fileId);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询与我相关的文件(私有文件且当前用户在可见用户列表中)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user