package net.vtstar.zhongtong.avi.monitoring.controller;

import com.alibaba.fastjson.JSONObject;
import io.jsonwebtoken.lang.Assert;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import net.vtstar.utils.asserts.ParamAssert;
import net.vtstar.utils.domain.Return;
import net.vtstar.zhongtong.avi.monitoring.service.PDAService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Slf4j
@Api(description = "PDA相关操作模块")
@RestController
@RequestMapping("/PDA")
public class PDAController {

    @Autowired
    private PDAService pdaService;

    @ApiOperation(value = "焊装车间钣金上撬请求")
    @PostMapping("/hanzhuang/bound")
    private Return hanZhuangBound(@RequestBody JSONObject json) {

        ParamAssert.notNull(json.get("vehicleNo"),"param is null");
        ParamAssert.notNull(json.get("busNo"),"param is null");
        return Return.success();
    }

    @ApiOperation(value = "换撬请求")
    @PostMapping("/change/skid")
    private Return changeSkid(@RequestBody JSONObject json) {

        ParamAssert.notNull(json.get("sourceStation"),"param is null");
        ParamAssert.notNull(json.get("sourceStation"),"param is null");
        return Return.success();
    }

    @ApiOperation(value = "返修车请求")
    @PostMapping("/repair")
    private Return repair(@RequestBody JSONObject json) {

        ParamAssert.notNull(json.get("busNo"),"param is null");
        return Return.success();
    }
}
