package com.fdkankan.scene.controller;

import com.fdkankan.common.controller.BaseController;
import com.fdkankan.common.response.ResultData;
import com.fdkankan.scene.service.ISceneEditInfoService;
import com.fdkankan.scene.service.ISceneUpgradeToV4Service;
import com.fdkankan.scene.vo.UpgradeToV4ParamVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * TODO
 * </p>
 *
 * @author dengsixing
 * @since 2022/5/20
 **/
@RestController
@RequestMapping("/service-v3/scene")
public class V3Controller extends BaseController {

    @Autowired
    private ISceneUpgradeToV4Service sceneUpgradeToV4Service;
    @Autowired
    private ISceneEditInfoService sceneEditInfoService;

    /**
     * <p>
     场景升级
     此接口用于V3\V4系统并存过渡期，场景升级v4做数据迁移用，待V3关闭可以删除
     * </p>
     * @author dengsixing
     * @date 2022/4/21
     * @return com.fdkankan.common.response.ResultData
     **/
    @PostMapping(value = "/upgradeToV4")
    public ResultData upgradeToV4(@RequestBody @Validated UpgradeToV4ParamVO param){
        ResultData resultData = sceneUpgradeToV4Service.upgradeToV4(param);
        return resultData;
    }

    /**
     * <p>
     场景升级进度查询
     此接口用于V3\V4系统并存过渡期，场景升级v4做数据迁移用，待V3关闭可以删除
     * </p>
     * @author dengsixing
     * @date 2022/4/21
     * @return com.fdkankan.common.response.ResultData
     **/
    @GetMapping(value = "/getUpgradeToV4Progress")
    public ResultData getUpgradeToV4Progress(@RequestParam(value = "num") String num){
        ResultData resultData = sceneUpgradeToV4Service.getUpgradeToV4Progress(num);
        return resultData;
    }

    /**
     * <p>
     查询场景scenejson
     此接口用于V3\V4系统并存过渡期，待V3关闭可以删除
     * </p>
     * @author dengsixing
     * @date 2022/4/21
     * @return com.fdkankan.common.response.ResultData
     **/
    @GetMapping(value = "/getSceneViewInfo")
    public ResultData getSceneViewInfo(@RequestParam(value = "num") String num){
        return sceneUpgradeToV4Service.getSceneViewInfo(num);
    }


}
