package com.njcn.kafka.event.controller;

import com.njcn.kafka.event.service.KafkaProducerService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Description:
 * Date: 2025/05/27  下午 2:06【需求编号】
 *
 * @author clam
 * @version V1.0.0
 */

@Slf4j
@RestController
@RequestMapping("/test")
@AllArgsConstructor
public class KafkaTestController {
    private final KafkaProducerService kafkaProducerService;

    @GetMapping("/testkafka")

    public void test(@RequestParam("context") String context) {
        kafkaProducerService.sendMessageWithCallback("eventdata",context);
    }
}
