package com.inspect.metadata.montdatamqhandle.controller;

import com.alibaba.fastjson.JSONObject;
import com.inspect.base.core.web.controller.BaseController;
import com.inspect.metadata.montdatamqhandle.service.impl.BasedataMontPatrolPointConsumerHandle;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@Slf4j
@RestController
@RequestMapping({"/rabbitmq"})
public class RabbitmqUnitTestController extends BaseController {

    @Resource
    private BasedataMontPatrolPointConsumerHandle basedataMontPatrolPointConsumerHandle;

    @PostMapping("/sync/model")
    public void syncModel(@RequestBody JSONObject jsonObject) {
        log.info("syncModel jsonObject {}", jsonObject);
        basedataMontPatrolPointConsumerHandle.handleMontDataEx(jsonObject);
    }

    @DeleteMapping("/del/model")
    public void deleteModel(@RequestBody JSONObject jsonObject) {
        log.info("deleteModel jsonObject {}", jsonObject);
        basedataMontPatrolPointConsumerHandle.delMontData(jsonObject);
    }
}
