加注释喵
This commit is contained in:
@@ -7,6 +7,10 @@ import org.springframework.data.redis.core.RedisTemplate;
|
|||||||
import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;
|
import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;
|
||||||
import org.springframework.data.redis.serializer.StringRedisSerializer;
|
import org.springframework.data.redis.serializer.StringRedisSerializer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Redis 配置类
|
||||||
|
* @author KilLze
|
||||||
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
public class RedisConfig {
|
public class RedisConfig {
|
||||||
@Bean
|
@Bean
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ public class PostController {
|
|||||||
* @param postId 动态ID
|
* @param postId 动态ID
|
||||||
* @return 动态对象
|
* @return 动态对象
|
||||||
*/
|
*/
|
||||||
@PostMapping("/{postId}")
|
@GetMapping("/{postId}")
|
||||||
public Result<PostEditVO> getPostById(@PathVariable Long postId) {
|
public Result<PostEditVO> getPostById(@PathVariable Long postId) {
|
||||||
PostEditVO postEditVO = postService.getPostForEdit(postId);
|
PostEditVO postEditVO = postService.getPostForEdit(postId);
|
||||||
return Result.success(ResultCode.SUCCESS,"查询成功", postEditVO);
|
return Result.success(ResultCode.SUCCESS,"查询成功", postEditVO);
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ public class GlobalExceptionHandler {
|
|||||||
@ExceptionHandler(RuntimeException.class)
|
@ExceptionHandler(RuntimeException.class)
|
||||||
public Result<String> handleRuntimeException(RuntimeException e) {
|
public Result<String> handleRuntimeException(RuntimeException e) {
|
||||||
log.error("运行时异常: ", e);
|
log.error("运行时异常: ", e);
|
||||||
return Result.error(ResultCode.SYSTEM_ERROR, "系统异常,请稍后重试");
|
return Result.error(ResultCode.SYSTEM_ERROR, e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user