package thyyxxk.webserver.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import thyyxxk.webserver.config.auth.PassToken;
import thyyxxk.webserver.entity.ResultVo;
import thyyxxk.webserver.service.redislike.RedisLikeService;
import thyyxxk.webserver.utils.ResultVoUtil;

@RequestMapping("/cache/flushed")
@RestController
public class CacheFlushedController {

    private RedisLikeService redisLikeService;

    public CacheFlushedController(RedisLikeService redisLikeService) {
        this.redisLikeService = redisLikeService;
    }

    @GetMapping("/specialMedicalAdvice")
    @PassToken
    public ResultVo<Boolean> specialMedicalAdvice() {
        redisLikeService.refreshSpecialMedicalAdvice();
        return ResultVoUtil.success(true);
    }
}
