package cn.reghao.devops.web.admin.sys.controller;

import cn.reghao.devops.web.admin.sys.service.SysMessageService;
import cn.reghao.jutil.jdk.result.WebResult;
import io.swagger.annotations.Api;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author reghao
 * @date 2024-07-30 10:03:22
 */
@Api(tags = "系统消息接口")
@RestController
@RequestMapping("/api/sys")
public class SysMessageController {
    private final SysMessageService sysMessageService;

    public SysMessageController(SysMessageService sysMessageService) {
        this.sysMessageService = sysMessageService;
    }

    @PostMapping(value = "/message/clear", produces = MediaType.APPLICATION_JSON_VALUE)
    @ResponseBody
    public String clearMessage() {
        sysMessageService.clearUnread();
        return WebResult.success();
    }
}
