package com.njcn.msgpush.module.push.controller.admin.message;

import com.njcn.msgpush.framework.common.pojo.CommonResult;
import com.njcn.msgpush.module.push.controller.admin.message.vo.MessageRecordSendReqVO;
import com.njcn.msgpush.module.push.service.message.MessageRecordService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.security.PermitAll;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Tag(name = "管理后台 - 消息")
@Slf4j
@Validated
@RestController
@RequestMapping("/push/message")
public class MessageRecordController {

    @Autowired
    private MessageRecordService messageRecordService;

    @PostMapping("send")
    @PermitAll
    @Operation(summary = "使用账号密码登录")
    @Parameter(name = "id", description = "编号", required = true, example = "1024")
    public CommonResult<Boolean> send(MessageRecordSendReqVO messageRecordSendReqVO) {
        Boolean result = messageRecordService.send(messageRecordSendReqVO);
        return CommonResult.success(result);
    }
}
