//package cn.com.taiji.track.producer;
//
//import cn.hutool.core.date.DateUtil;
//import cn.hutool.json.JSONUtil;
//import com.alibaba.fastjson.JSONObject;
//import org.springframework.kafka.core.KafkaTemplate;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import javax.annotation.Resource;
//import java.util.UUID;
//
///**
// * @author chenfangchao
// * @title: BeidouShipTestProducer
// * @projectName ax-geoserver-project
// * @description: TODO
// * @date 2022/8/15 9:41 PM
// */
//@RestController
//@RequestMapping("/producer")
//public class BeidouShipTestProducer {
//
//
//    @Resource
//    private KafkaTemplate kafkaTemplate;
//
//    @GetMapping("/beidou")
//    public void  testBeidouShipData(){
//
//        for (int i = 0; i < 100; i++) {
//            String time = String.valueOf(DateUtil.date());
//            Object msg = "{\n" +
//                    "  \"id\": \"00b72b21b7cb41feb360a0db59403712\",\n" +
//                    "  \"content\": \"167153587,15011858,255,255,0,2022-04-02 16:22:13,2022-04-02 16:22:12,1,39,12,255,110.636777,19.260833,0,0,3\",\n" +
//                    "  \"time\": \"2022-04-02 16:22:14\",\n" +
//                    "  \"curren_time\": \"2022-04-02 16:22:15\",\n" +
//                    "  \"trackId\": \"167153587\",\n" +
//                    "  \"deviceId\": \"15011858\",\n" +
//                    "  \"shipType\": \"255\",\n" +
//                    "  \"workType\": \"255\",\n" +
//                    "  \"workWay\": \"0\",\n" +
//                    "  \"sendTime\": \"+ " + time + " +\",\n" +
//                    "  \"locationTime\": \"2022-04-02 16:22:12\",\n" +
//                    "  \"online\": \"1\",\n" +
//                    "  \"shipLength\": \"39\",\n" +
//                    "  \"shipWidth\": \"12\",\n" +
//                    "  \"texture\": \"255\",\n" +
//                    "  \"longitude\": \"110.636777\",\n" +
//                    "  \"latitude\": \"19.260833\",\n" +
//                    "  \"direction\": \"0\",\n" +
//                    "  \"speed\": \"0\",\n" +
//                    "  \"kwh\": \"3\",\n" +
//                    "  \"kafka_xrsj\": \"2022-04-02 16:22:19.932\"\n" +
//                    "}\n";
//            BeidouShipTrackDTO beidou = JSONObject.parseObject(msg.toString(), BeidouShipTrackDTO.class);
//            beidou.setTrackId(1001L);
//            beidou.setDeviceId(String.valueOf(i));
//            beidou.setShipName(UUID.randomUUID().toString());
//            beidou.setLongitude(beidou.getLongitude());
//            beidou.setLatitude(beidou.getLatitude());
//
//            String data = JSONUtil.toJsonStr(beidou);
//            kafkaTemplate.send("sgAxBeidouTrack", data);
//        }
//    }
//
//}
