TestController.java 709 Bytes
package com.tanpu.community.controller;

import com.tanpu.community.manager.KafkaManager;
import com.tanpu.community.service.VisitSummaryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@Slf4j
@RequestMapping(value = "/api/test")
public class TestController {

    @Autowired
    private KafkaManager kafkaManager;

    @Autowired
    private VisitSummaryService visitSummaryService;

    @PostMapping(value = "/sendKafka")
    @ResponseBody
    public String sendKafka(@RequestBody String message) {
        visitSummaryService.updateDurByIdent("12", 1);
        return "22";
    }
}