package com.artfess.rescue.external.controller;

import com.artfess.base.annotation.ApiGroup;
import com.artfess.base.constants.ApiGroupConsts;
import com.artfess.base.model.CommonResult;
import com.artfess.rescue.external.manager.ReceiveEventManager;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author: wsf
 * @Description: 首讯-总中心事件数据推送
 * @DateTime: 2025/4/17 16:06
 **/

@RestController
@RequestMapping("external/api")
@ApiGroup(group = {ApiGroupConsts.GROUP_BIZ_RESCUE})
@Api(tags = "首讯-总中心事件数据推送")
public class ReceiveEventController {

    @Resource
    private ReceiveEventManager receiveEventManager;

    @PostMapping("/receive/event")
    @ApiOperation(value = "总中心事件数据推送接收", notes = "总中心事件数据推送接收")
    public CommonResult<String> receiveEvent(@ApiParam(name = "data", value = "事件信息") @RequestParam String data,
                                             @ApiParam(name = "optType", value = "事件类型") @RequestParam String optType) {
        return receiveEventManager.receiveEvent(data,optType);
    }


}
