package com.keao.edu.auth.web.controller;

import com.keao.edu.auth.api.entity.SysMessageParams;
import com.keao.edu.auth.service.SysMessageService;
import com.keao.edu.common.controller.BaseController;
import com.keao.edu.common.enums.MessageTypeEnum;
import com.keao.edu.thirdparty.message.MessageSenderPluginContext;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author Joburgess
 * @Date 2020.07.02
 */
@RestController
@RequestMapping("sysMessage")
@Api(tags = "消息推送服务")
public class SysMessageController extends BaseController {

    @Autowired
    private SysMessageService sysMessageService;

    @ApiOperation(value = "发送消息")
    @PostMapping(value = "/batchSendMessage")
    public void batchSendMessage(@RequestBody SysMessageParams sysMessageParams){
        sysMessageService.batchSendMessage(sysMessageParams.getMessageSender(), sysMessageParams.getMessageType(), sysMessageParams.getReceivers(),
                sysMessageParams.getTriggerTime(), sysMessageParams.getReadStatus(), sysMessageParams.getUrl(), sysMessageParams.getJpushType(),
                sysMessageParams.getArgs());
    }

}
