package com.sikey.wa04.api.message.client.rest;

import com.sikey.wa04.business.application.service.message.MessageCenterService;
import com.sikey.wa04.business.infrastructure.configuration.ProjectContextConstant;
import com.sikey.wa04.business.infrastructure.dto.response.messaging.MessageCenterResponse;
import com.sikey.wa04.common.BaseController;
import com.sikey.wa04.common.interceptor.Authenticated;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 消息 Controller
 *
 * @author nelson
 * @date 2025年5月26日
 */
@RestController
@RequestMapping(ProjectContextConstant.MESSAGE_URL + "/messaging/get")
public class MessageCenterController extends BaseController {

    @Resource
    private MessageCenterService messageCenterService;

    /**
     * 消息中心
     *
     * @return
     */
    @Authenticated
    @GetMapping("/findMessageCenter")
    public MessageCenterResponse findMessageCenter() {
        return new MessageCenterResponse().setMessageCenters(messageCenterService.findMessageCenterByChild());
    }
}
