feat: 添加Category_attribute实体类和仓库接口
refactor(security): 限制文章更新仅限AUTHOR角色 修改ArticleController的updateArticle方法权限,移除ADMIN角色访问权限 chore: 更新application.properties中的Redis配置 取消注释Redis相关配置,包括缓存和连接池设置
This commit is contained in:
@@ -57,13 +57,13 @@ public class ArticleController {
|
||||
|
||||
/**
|
||||
* 更新现有文章
|
||||
* 仅限AUTHOR或ADMIN角色用户访问
|
||||
* 仅限AUTHOR角色用户访问
|
||||
* @param id 要更新的文章ID
|
||||
* @param articleDto 包含更新后文章数据的DTO对象
|
||||
* @return 返回包含更新后文章信息的ResponseMessage对象
|
||||
*/
|
||||
@PutMapping("/{id}")
|
||||
@PreAuthorize("hasRole('AUTHOR') or hasRole('ADMIN')")
|
||||
@PreAuthorize("hasRole('AUTHOR')")
|
||||
public ResponseMessage<Article> updateArticle(
|
||||
@PathVariable Integer id,
|
||||
@Valid @RequestBody ArticleDto articleDto) {
|
||||
|
||||
Reference in New Issue
Block a user