package com.kym.miniapp.controller;

import cn.dev33.satoken.annotation.SaIgnore;
import com.kym.common.R;
import com.kym.service.SystemNoticeService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 客户端-公告通知 前端控制器
 * </p>
 *
 * @author skyline
 * @since 2025-05-28
 */
@RestController
@RequestMapping("/notice")
public class NoticeController {

    private final SystemNoticeService systemNoticeService;

    public NoticeController(SystemNoticeService systemNoticeService) {
        this.systemNoticeService = systemNoticeService;
    }

    /**
     * 客户端公告列表（公开接口）
     * 返回当前生效中、目标为client或all、且在有效期内的公告
     */
    @SaIgnore
    @GetMapping("/client/list")
    public R<?> listClientNotice() {
        return R.success(systemNoticeService.listClientNotice());
    }
}
