package com.njcn.gather.storage.controller;

import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.db.mybatisplus.handler.DynamicTableNameHandler;
import com.njcn.gather.storage.pojo.po.SimAndDigHarmonicResult;
import com.njcn.gather.storage.pojo.po.SimAndDigNonHarmonicResult;
import com.njcn.gather.storage.service.DetectionDataDealService;
import com.njcn.web.controller.BaseController;
import com.njcn.web.utils.HttpResultUtil;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
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.RestController;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

@Slf4j
@Api(tags = "处理数据")
@RestController
@RequestMapping("/dataDeal")
@RequiredArgsConstructor
public class DataDealController extends BaseController {

    private final DetectionDataDealService detectionDataDealService;


    @GetMapping("ttt")
    public HttpResult<Object> dataDealAndInsert(){
        String methodDescribe = getMethodDescribe("dataDealAndInsert");

        List<SimAndDigHarmonicResult> list2 = new ArrayList<>();
        SimAndDigHarmonicResult SimAndDigHarmonicResult = new SimAndDigHarmonicResult();
        SimAndDigHarmonicResult.setDataType("aa");
        SimAndDigHarmonicResult.setAdType("aaaa");

        SimAndDigHarmonicResult.setDevMonitorId("ss");
        SimAndDigHarmonicResult.setScriptId("ddd");
        SimAndDigHarmonicResult.setTimeId(LocalDateTime.now());

        list2.add(SimAndDigHarmonicResult);
        SimAndDigHarmonicResult SimAndDigHarmonicResult2 = new SimAndDigHarmonicResult();
        SimAndDigHarmonicResult2.setDataType("aabb");
        SimAndDigHarmonicResult2.setAdType("aaaabb");

        SimAndDigHarmonicResult2.setDevMonitorId("ssbb");
        SimAndDigHarmonicResult2.setScriptId("dddbb");
        SimAndDigHarmonicResult2.setTimeId(LocalDateTime.now());
        list2.add(SimAndDigHarmonicResult2);

        detectionDataDealService.acceptHarmonic(list2,"1");


        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);

    }

}
