23 lines
757 B
Java
23 lines
757 B
Java
package com.gzzn.omms.msgexchangeapi.controller;
|
|||
|
|
|
||
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
||
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
||
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||
|
|
import org.springframework.web.bind.annotation.RestController;
|
||
|
|
|
||
|
|
import com.gzzn.omms.msgexchangeapi.dto.ResponseDto;
|
||
|
|
import com.gzzn.omms.msgexchangeapi.service.IKafkaService;
|
||
|
|
|
||
|
|
@RestController
|
||
|
|
@RequestMapping("/kafka")
|
||
|
|
public class KafkaController {
|
||
|
|
@Autowired
|
||
|
|
private IKafkaService kafkaservice;
|
||
|
|
|
||
|
|
@GetMapping(value = "/send")
|
||
|
|
public ResponseDto sendKafka(String msg,String topic) {
|
||
|
|
kafkaservice.msgSend(topic, msg);
|
||
|
|
return ResponseDto.success();
|
||
|
|
}
|
||
|
|
}
|