package com.fdkankan.scene.controller;

import com.fdkankan.common.constant.ErrorCode;
import com.fdkankan.common.constant.SceneInfoReqType;
import com.fdkankan.common.controller.BaseController;
import com.fdkankan.common.exception.BusinessException;
import com.fdkankan.scene.service.ISceneEditInfoService;
import com.fdkankan.scene.service.ISceneEditService;
import com.fdkankan.scene.service.ISceneProService;
import com.fdkankan.scene.service.ISceneUploadService;
import com.fdkankan.scene.vo.*;
import com.fdkankan.common.response.ResultData;
import java.io.IOException;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/**
 * 场景编辑管理
 */
@Log4j2
@RestController
@RequestMapping("/service/scene/edit")
public class SceneEditController extends BaseController {

    @Autowired
    private ISceneProService sceneProService;
    @Autowired
    private ISceneEditInfoService sceneEditInfoService;
    @Autowired
    private ISceneUploadService sceneUploadService;
    @Autowired
    private ISceneEditService sceneEditService;
    @Value("${spring.profiles.active}")
    private String env;

    /**
     * <p>
        保存编辑的数据
     * </p>
     * @author dengsixing
     * @date 2022/1/12
     * @param sceneEditParamVO
     * @return com.fdkankan.common.response.ResultData
     **/
    @PostMapping(value = "/saveSceneInfo")
    public ResultData saveSceneInfo(@RequestBody SceneEditParamVO sceneEditParamVO) throws Exception {
        return sceneProService.saveSceneInfo(sceneEditParamVO);
    }

    /**
     * <p>
     保存场景编辑数据
     * </p>
     * @author dengsixing
     * @date 2022/1/12
     * @param param
     * @return com.fdkankan.common.response.ResultData
     **/
    @PostMapping(value = "/base/save")
    public SceneEditInfoVO saveScene(@RequestBody @Validated SceneEditInfoParamVO param){
        return sceneEditInfoService.saveScene(param);
    }

    /**
     * <p>
     发布场景数据
     * </p>
     * @author dengsixing
     * @date 2022/1/12
     * @param param
     * @return com.fdkankan.common.response.ResultData
     **/
    @PostMapping(value = "/publicScene")
    public ResultData publicScene(@RequestBody @Validated SceneEditInfoParamVO param) throws Exception {
        return sceneEditInfoService.publicScene(param);
    }

    /**
     * <p>
        单独保存tourList
     * </p>
     * @author dengsixing
     * @date 2022/1/12
     * @param sceneEditParamVO
     * @return com.fdkankan.common.response.ResultData
     **/
    @PostMapping(value = "/saveTourList")
    public ResultData saveTourList(@RequestBody SceneEditParamVO sceneEditParamVO) throws Exception {
        return sceneProService.saveTourList(sceneEditParamVO);
    }

    /**
     * <p>
        删除导览
     * </p>
     * @author dengsixing
     * @date 2022/1/12
     * @param sceneEditParamVO
     * @return com.fdkankan.common.response.ResultData
     **/
    @PostMapping(value = "/deleteScreencap")
    public ResultData deleteScreencap(@RequestBody SceneEditParamVO sceneEditParamVO) throws Exception {
        return sceneProService.deleteScreencap(sceneEditParamVO);
    }

    /**
     * <p>
        删除录屏音频文件
     * </p>
     * @author dengsixing
     * @date 2022/1/12
     * @param sceneEditParamVO
     * @return com.fdkankan.common.response.ResultData
     **/
    @PostMapping(value = "/deleteScreencapVoiceNew")
    public ResultData deleteScreencapVoiceNew(@RequestBody SceneEditParamVO sceneEditParamVO) throws Exception {
        return sceneProService.deleteScreencapVoice(sceneEditParamVO);
    }

    /**
     * <p>
        上传音频
     * </p>
     * @author dengsixing
     * @date 2022/1/12
     * @param param
     * @param file
     * @return com.fdkankan.common.response.ResultData
     **/
    @PostMapping(value = "/uploadScreencapVoiceNew")
    public ResultData uploadScreencapVoice(FileParamVO param,
                                           @RequestParam("file") MultipartFile file) throws Exception {
        return sceneProService.uploadScreencapVoiceNew(param, file);
    }

    /**
     * <p>
     上传音频
     * </p>
     * @author dengsixing
     * @date 2022/1/12
     * @param param
     * @param file
     * @return com.fdkankan.common.response.ResultData
     **/
    @PostMapping(value = "/uploadScreencapVoiceNewV3")
    public ResultData uploadScreencapVoiceV3(FileParamVO param,
                                         @RequestParam("file")  MultipartFile file) throws Exception {
        return sceneProService.uploadScreencapVoiceNewV3(param, file);
    }

    /**
     * <p>
        删除音频
     * </p>
     * @author dengsixing
     * @date 2022/1/12
     * @param param
     * @return com.fdkankan.common.response.ResultData
     **/
    @PostMapping(value = "/deleteScreencapVoicePart")
    public ResultData deleteScreencapVoicePart(@RequestBody @Validated FileParamVO param) throws Exception {
        return sceneProService.deleteScreencapVoicePart(param);
    }

    /**
     * <p>
     获取录屏的文件名称
     * </p>
     * @author dengsixing
     * @date 2022/1/12
     * @param param
     * @return com.fdkankan.common.response.ResultData
     **/
    @PostMapping(value = "/getScreencapVoice")
    public ResultData getScreencapVoice(@RequestBody SceneEditParamVO param) throws Exception {
        return sceneProService.getScreencapVoice(param);
    }

    /**
     * <p>
     保存初始页面
     * </p>
     * @author dengsixing
     * @date 2022/1/12
     * @param param
     * @return com.fdkankan.common.response.ResultData
     **/
    @PostMapping(value = "/saveInitialPage")
    public ResultData saveInitialPage(@RequestBody @Validated FileNameAndDataParamVO param) throws Exception {
        return sceneProService.saveInitialPage(param);
    }

    /**
     * <p>
     保存背景音乐(只是编辑页面生效)
     * </p>
     * @author dengsixing
     * @date 2022/1/12
     * @param param
     * @return com.fdkankan.common.response.ResultData
     **/
    @PostMapping(value = "/saveBackgroundMusic")
    public ResultData saveBackgroundMusic(@RequestBody SceneEditParamVO param) throws Exception {
        return sceneProService.saveBackgroundMusic(param);
    }

    /**
     * <p>
     保存地面logo
     * </p>
     * @author dengsixing
     * @date 2022/1/12
     * @param param
     * @return com.fdkankan.common.response.ResultData
     **/
    @PostMapping(value = "/saveFloorLogo")
    public ResultData saveFloorLogo(@RequestBody SceneEditParamVO param) throws Exception {
        return sceneProService.saveFloorLogo(param);
    }

    /**
     * <p>
     保存场景热点
     * </p>
     * @author dengsixing
     * @date 2022/1/12
     * @param param
     * @return com.fdkankan.common.response.ResultData
     **/
    @PostMapping(value = "/tagSave")
    public ResultData tagSave(@RequestBody @Validated SaveTagsParamVO param) throws Exception {
        return sceneProService.tagSave(param);
    }

    /**
     * <p>
        新增或修改场景热点
     * </p>
     * @author dengsixing
     * @date 2022/1/12
     * @param param
     * @return com.fdkankan.common.response.ResultData
     **/
    @PostMapping(value = "/tag/save")
    public ResultData saveTag(@RequestBody @Validated SaveTagsParamVO param) throws Exception {
        return sceneProService.addOrUpdateTag(param);
    }

    /**
     * <p>
            删除热点
     * </p>
     * @author dengsixing
     * @date 2022/2/16
     * @param param
     * @return com.fdkankan.common.response.ResultData
     **/
    @PostMapping(value = "/tag/delete")
    public ResultData deleteTag(@RequestBody @Validated DeleteHotParamVO param) throws Exception {
        return sceneProService.deleteTag(param);
    }

    @PostMapping(value = "/tag/list")
    public ResultData listTags(@RequestParam(value = "num") String num) throws Exception {
        return sceneProService.listTags(num);
    }

    /**
     * <p>
     删除热点
     * </p>
     * @author dengsixing
     * @date 2022/2/16
     * @param param
     * @return com.fdkankan.common.response.ResultData
     **/
    @PostMapping(value = "/icons/delete")
    public ResultData deleteIcons(@RequestBody @Validated DeleteHotIconParamVO param) throws Exception {
        return sceneProService.deleteIcons(param);
    }

    /**
     * <p>
     保存场景热点
     * </p>
     * @author dengsixing
     * @date 2022/1/12
     * @param param
     * @return com.fdkankan.common.response.ResultData
     **/
    @PostMapping(value = "/saveShopHot")
    public ResultData saveShopHot(@RequestBody SceneEditParamVO param) throws Exception {
        return sceneProService.saveShopHot(param);
    }

    /**
     * <p>
     保存场景热点
     * </p>
     * @author dengsixing
     * @date 2022/1/12
     * @param param
     * @return com.fdkankan.common.response.ResultData
     **/
    @PostMapping(value = "/saveOverlay")
    public ResultData saveOverlay(@RequestBody SceneEditParamVO param) throws Exception {
        return sceneProService.saveOverlay(param);
    }

    /**
     * <p>
     保存导览静态数据
     * </p>
     * @author dengsixing
     * @date 2022/1/12
     * @param param
     * @return com.fdkankan.common.response.ResultData
     **/
    @PostMapping(value = "/saveScreencapData")
    public ResultData saveScreencapData(@RequestBody SceneEditParamVO param) throws Exception {
        return sceneProService.saveScreencapData(param);
    }

    /**
     * <p>
     修改场景秘钥
     * </p>
     * @author dengsixing
     * @date 2022/1/12
     * @param param
     * @return com.fdkankan.common.response.ResultData
     **/
    @PostMapping(value = "/saveSceneKey")
    public ResultData saveSceneKey(@RequestBody SceneEditParamVO param) throws Exception {
        return sceneProService.saveSceneKey(param);
    }

    /**
     * <p>
     增加热点媒体文件
     * </p>
     * @author dengsixing
     * @date 2022/1/12
     * @param param
     * @return com.fdkankan.common.response.ResultData
     **/
    @PostMapping(value = "/saveScreencapFile")
    public ResultData saveScreencapFile(@RequestBody SceneEditParamVO param) throws Exception {
        return sceneProService.saveScreencapFile(param);
    }

    /**
     * <p>
     上传场景的热点媒体文件
     * </p>
     * @author dengsixing
     * @date 2022/1/12
     * @param param
     * @param file
     * @return com.fdkankan.common.response.ResultData
     **/
    @PostMapping(value = "/uploadHotMedia")
    public ResultData uploadHotMedia(FileParamVO param, @RequestParam("file")  MultipartFile file) throws Exception {
        return sceneProService.uploadHotMedia(param, file);
    }

    /**
     * <p>
     上传场景的Overlay媒体文件
     * </p>
     * @author dengsixing
     * @date 2022/1/12
     * @param param
     * @param file
     * @return com.fdkankan.common.response.ResultData
     **/
    @PostMapping(value = "/uploadOverlayMedia")
    public ResultData uploadOverlayMedia(FileParamVO param, @RequestParam("file")  MultipartFile file) throws Exception {
        return sceneProService.uploadOverlayMedia(param, file);
    }

    /**
     * <p>
     增加热点媒体文件
     * </p>
     * @author dengsixing
     * @date 2022/1/12
     * @param param
     * @return com.fdkankan.common.response.ResultData
     **/
    @PostMapping(value = "/addHotMediaInfo")
    public ResultData addHotMediaInfo(@RequestBody SceneEditParamVO param) throws Exception {
        return sceneProService.addHotMediaInfo(param);
    }

    /**
     * <p>
     保存漫游可行
     * </p>
     * @author dengsixing
     * @date 2022/1/12
     * @param param
     * @return com.fdkankan.common.response.ResultData
     **/
    @PostMapping(value = "/saveRoam")
    public ResultData saveRoam(@RequestBody @Validated BaseDataParamVO param) throws Exception {
        return sceneProService.saveRoam(param);
    }

    /**
     * 保存热点可见性的数据
     * @return
     */
    @PostMapping(value = "/saveTagsVisible")
    public ResultData saveTagsVisible(@RequestBody @Validated SaveTagsVisibleParamVO param) throws Exception {
        return sceneProService.saveTagsVisible(param);
    }


    /**
     * 获取从浏览器的音频
     */
    @PostMapping(value = "/getRecordAudioFromBrowser")
    public ResultData getRecordAudioFromBrowser(FileParamVO param, @RequestParam("file") MultipartFile file) throws Exception{
        return sceneProService.getRecordAudioFromBrowser(param, file);
    }

    /**
     * 新增画墙重建模型（钟文）
     */
    @PostMapping(value = "/uploadFloorJson")
    public ResultData uploadFloorJson(@RequestBody SceneEditParamVO param) throws Exception{
        return sceneProService.uploadFloorJson(param);
    }

    /**
     * 安居客
     */
    @PostMapping(value = "/uploadFloorJsonAjk")
    public ResultData uploadFloorJsonAjk(FileParamVO param, @RequestParam("file") MultipartFile[] file) throws Exception{

        return sceneProService.uploadFloorJsonAjk(param, file);
    }

    /**
     * 重置画墙重建模型
     * @return
     */
    @PostMapping(value = "/resetUploadFloorJson")
    public ResultData resetUploadFloorJson(@RequestBody SceneEditParamVO param) throws Exception {
        return sceneProService.resetUploadFloorJson(param);
    }

    /**
     * 上传二维码和分享的logo
     * @return
     */
    @RequestMapping(value = "/uploadShareLogo", method = RequestMethod.POST)
    public ResultData uploadShareLogo(@RequestParam("num") String sceneNum, @RequestParam("file") MultipartFile file) throws Exception {
        SceneEditParamVO base = new SceneEditParamVO();
        base.setNum(sceneNum);
        return sceneProService.uploadShareLogo(base, file);
    }

    /**
     * 上传图片多媒体数据，直接到七牛云
     * @param file
     * @return
     */
    @PostMapping(value = "/uploadPic")
    public ResultData uploadPic(FileParamVO param, @RequestParam("file") MultipartFile file) throws Exception {
        return sceneProService.uploadPic(param, file);
    }

    /**
     * 直接上传hot.json到oss
     * @return
     */
    @PostMapping(value = "/uploadHotJsonToOss")
    public ResultData uploadHotJsonToOss(@RequestBody SceneEditParamVO param) throws Exception {
        return sceneProService.uploadHotJsonToOss(param);
    }

    /**
     * 删除oss的数据
     * @return
     */
    @PostMapping(value = "/deleteOss")
    public ResultData deleteOss(@RequestBody FileParamVO param) throws Exception {
        return sceneProService.deleteOss(param);
    }

    /**
     * 上传图片多媒体数据，直接到七牛云
     * @param file
     * @return
     */
    @PostMapping(value = "/uploadFloorplanPng")
    public ResultData uploadFloorplanPng(FileParamVO param, @RequestParam("file") MultipartFile[] file) throws Exception {
        return sceneProService.uploadFloorplanPng(param, file);
    }


    /**
     * 检验视频网站url是否正确
     * @return
     */
    @PostMapping(value = "/checkVideoUrl")
    public ResultData checkVideoUrl(@RequestBody FileParamVO param){
        return sceneProService.checkVideoUrl(param);
    }

    /**
     * 肖安需求，下载场景obj和贴图
     */
    @PostMapping(value = "/downloadModel")
    public ResultData downloadTexData(@RequestParam("num") String num) throws Exception {
        return sceneProService.downloadTexData(num);
    }

    /**
     * 肖安需求，上传修改后的obj和贴图
     * @param file
     * @return
     */
//    @SystemControllerLog(description = "上传修改后的obj和贴图")
    @PostMapping(value = "/uploadModel")
    public ResultData uploadObjAndImg(@RequestParam("num") String num, @RequestParam("file") MultipartFile file) throws Exception {
        return sceneProService.uploadObjAndImg(num, file);
    }

    /**
     * 修改logoBottom状态
     * @param
     * @return
     */
    @PostMapping(value = "/uploadLogoBottomStatus")
    public ResultData uploadLogoBottomStatus(@RequestBody FileParamVO param) throws Exception {
        return sceneProService.uploadLogoBottomStatus(param);
    }

    /**
     * 保存通用json数据
     */
    @PostMapping(value = "/saveJsonData")
    public ResultData saveJsonData(@RequestBody FileParamVO param) throws Exception{
        return sceneProService.saveJsonData(param);
    }

    /**
     * 下载点位全景图或视频
     */
    @PostMapping(value = "/downloadPanoramaOrVideo")
    public ResultData downloadPanoramaOrVideo(@RequestBody FileParamVO param) throws Exception{
        return sceneProService.downloadPanoramaOrVideo(param);
    }

    /**
     * 上传点位全景图或视频
     */
    @PostMapping(value = "/uploadPanoramaOrVideo")
    public ResultData uploadPanoramaOrVideo(FileParamVO param, @RequestParam("file") MultipartFile file) throws Exception{
        return sceneProService.uploadPanoramaOrVideo(param, file);
    }

    /**
     * 上传绿幕抠图视频
     */
    @PostMapping(value = "/uploadROIVideo")
    public ResultData uploadROIVideo(FileParamVO param, @RequestParam(name = "file", required = false) MultipartFile file) throws Exception{
        return sceneProService.uploadROIVideo(param, file);
    }

    /**
     * 删除绿幕抠图视频
     */
    @PostMapping(value = "/deleteROIVideo")
    public ResultData deleteROIVideo(@RequestBody FileParamVO param) throws Exception{
        return sceneProService.deleteROIVideo(param);
    }


    /**
     * 上传场景背景音乐
     */
    @PostMapping(value = "/uploadBgMusic")
    public ResultData uploadBgMusic(FileParamVO param, @RequestParam("file") MultipartFile file) throws Exception{
        return sceneProService.uploadBgMusic(param, file);
    }

    /**
     * 删除上传的场景背景音乐
     */
    @PostMapping(value = "/deleteUploadBgMusic")
    public ResultData deleteUploadBgMusic(@RequestBody FileParamVO param) throws Exception{
        return sceneProService.deleteUploadBgMusic(param);
    }


    /**
     * 保存关联全景图
     */
    @PostMapping(value = "/savePanorama")
    public ResultData savePanorama(FileParamVO param, @RequestParam("file") MultipartFile file) throws Exception{
        return sceneProService.savePanorama(param, file);
    }

    /**
     * 保存关联全景图
     */
    @PostMapping(value = "/savePanoramaJson")
    public ResultData savePanoramaJson(@RequestBody FileParamVO param) throws Exception{
        return sceneProService.savePanoramaJson(param);
    }

    /**
     * 保存关联全景图json
     */
    @PostMapping(value = "/copyAndUpdateFloorJson")
    public ResultData copyAndUpdateFloorJson(@RequestBody FileParamVO param) throws Exception{
        return sceneProService.copyAndUpdateFloorJson(param);
    }

    /**
     * 保存关联全景图json
     */
    @PostMapping(value = "/updateFloorJson")
    public ResultData updateFloorJson(@RequestBody FileParamVO param) throws Exception{
        return sceneProService.updateFloorJson(param);
    }

    /**
     * 下载点位数据
     */
    @PostMapping(value = "/downloadVisionData")
    public ResultData downloadVisionData(@RequestBody SceneEditParamVO param) throws Exception{
        return sceneProService.downloadVisionData(param);
    }

    /**
     * 下载全景图数据
     */
    @PostMapping(value = "/downloadPanoramaData")
    public ResultData downloadPanoramaData(@RequestBody SceneEditParamVO param) throws Exception{
        return sceneProService.downloadPanoramaData(param);
    }

    /**
     * <p>
            上传后保存
     * </p>
     * @author dengsixing
     * @date 2022/1/20
     * @param param
     * @return com.fdkankan.common.response.ResultData
     **/
    @PostMapping(value = "/saveUpload")
    public ResultData saveUpload(@RequestBody @Validated SaveUploadParamVO param) throws Exception{
        return sceneEditInfoService.saveUpload(param);
    }

    /**
     * <p>
     保存户型图
     * </p>
     * @author dengsixing
     * @date 2022/1/20
     * @param param
     * @return com.fdkankan.common.response.ResultData
     **/
    @PostMapping(value = "/cad/save")
    public ResultData saveCad(@RequestBody @Validated BaseDataParamVO param) throws Exception{
        return sceneEditInfoService.saveCad(param);
    }

    /**
     * <p>
     重置户型图
     * </p>
     * @author dengsixing
     * @date 2022/2/16
     * @param num
     * @return
     **/
    @PostMapping(value = "/cad/reset")
    public ResultData resetCad(@RequestParam(value = "num") String num){
        return sceneEditInfoService.resetCad(num);
    }

    /**
     * <p>
     楼层户型重命名
     * </p>
     * @author dengsixing
     * @date 2022/2/16
     * @param num
     * @return
     **/
    @PostMapping(value = "/cad/rename")
    public ResultData renameCad(@RequestBody @Validated RenameCadParamVO param) throws IOException {
        return sceneEditInfoService.renameCad(param);
    }

    /**
     * 获取场景详情
     */
    @GetMapping(value = "/getInfo")
    public SceneInfoVO getInfo(@Validated SceneInfoParamVO param) throws Exception{
        param.setReqType(SceneInfoReqType.EDIT.code());
        return sceneEditInfoService.getSceneInfo(param);
    }

    /**
     * <p>
            批量上传全景照片
     * </p>
     * @author dengsixing
     * @date 2022/2/16
     * @param num
     * @param file
     * @return java.util.List<java.lang.String>
     **/
    @PostMapping(value = "/uploadPanorama")
    public ResultData uploadPanorama(@RequestParam(value = "num") String num,
        @RequestParam("file") MultipartFile file) throws Exception {
        return sceneEditInfoService.uploadPanorama(num, file);
    }

    /**
     * <p>
            下载全景图
     * </p>
     * @author dengsixing
     * @date 2022/2/16
     * @return java.util.List<java.lang.String>
     **/
    @PostMapping(value = "/downloadPanorama")
    public ResultData downloadPanorama(@RequestBody @Validated FileParamVO param) throws Exception {
        return sceneEditInfoService.downloadPanorama(param);
    }

    /**
     * <p>
            保存视频盒子
     * </p>
     * @author dengsixing
     * @date 2022/2/18
     * @param param
     * @return com.fdkankan.common.response.ResultData
     **/
    @PostMapping(value = "/video/box/save")
    public ResultData saveVideoBox(@RequestBody @Validated FileNameAndDataParamVO param) throws Exception {
        return sceneEditInfoService.saveVideoBox(param);
    }

    /**
     * <p>
            删除视频盒子
     * </p>
     * @author dengsixing
     * @date 2022/2/18
     * @param param
     * @return com.fdkankan.common.response.ResultData
     **/
    @PostMapping(value = "/video/box/delete")
    public ResultData deleteVideoBox(@RequestBody @Validated DeleteSidParamVO param) throws Exception {
        return sceneEditInfoService.deleteVideoBox(param);
    }

    /**
     * <p>
     保存空间贴图
     * </p>
     * @author dengsixing
     * @date 2022/2/18
     * @param param
     * @return com.fdkankan.common.response.ResultData
     **/
    @PostMapping(value = "/photo/box/save")
    public ResultData savePhotoBox(@RequestBody @Validated BaseDataParamVO param) throws Exception {
        return sceneEditInfoService.saveBoxPhoto(param);
    }

    /**
     * <p>
     删除空间贴图
     * </p>
     * @author dengsixing
     * @date 2022/2/18
     * @param param
     * @return com.fdkankan.common.response.ResultData
     **/
    @PostMapping(value = "/photo/box/delete")
    public ResultData deletePhotoBox(@RequestBody @Validated DeleteSidParamVO param) throws Exception {
        return sceneEditInfoService.deleteBoxPhoto(param);
    }


    /**
     * <p>
        下载视频
     * </p>
     * @author dengsixing
     * @date 2022/2/23
     * @param param
     * @return com.fdkankan.scene.vo.DownloadVO
     **/
    @PostMapping(value = "downloadBallScreenVideo")
    public DownloadVO downloadBallScreenVideo(@RequestBody @Validated BallScreenVideoParamVO param){
        return sceneEditInfoService.downloadBallScreenVideo(param);
    }

    /**
     * <p>
            上传视频
     * </p>
     * @author dengsixing
     * @date 2022/2/23
     * @param num
     * @param fileName
     * @param file
     * @return com.fdkankan.common.response.ResultData
     **/
    @PostMapping(value = "uploadBallScreenVideo")
    public ResultData uploadBallScreenVideo(
            @RequestParam("num") String num,
            @RequestParam("fileName") String fileName,
            @RequestParam("file") MultipartFile file) throws Exception {
        return sceneEditInfoService.uploadBallScreenVideo(num, fileName, file);
    }

    /**
     * 上传图片到oss,base64
     * base64   图片base64
     * fileName  文件名称
     * bizType  业务类型
     * files     文件
     * num 场景码
     * type 操作类型 0添加，1替换
     */
    @RequestMapping(value = "/upload/files", method = RequestMethod.POST)
    public String uploads(@RequestParam(value = "base64",required = false) String base64,
        @RequestParam(value = "fileName",required = false) String fileName,
        @RequestParam(value = "bizType",required = false) String bizType,
        @RequestParam(value = "files",required = false) MultipartFile[] files,
        @RequestParam(value = "num",required = false) String num,
        @RequestParam(value = "type",required = false,defaultValue = "1") Integer type) throws Exception {
        return sceneUploadService.uploads(base64,fileName,bizType,files,num,type,getToken());
    }

    /**
     * <p>
            删除文件
     * </p>
     * @author dengsixing
     * @date 2022/2/23
     * @param paramVO
     * @return com.fdkankan.common.response.ResultData
     **/
    @PostMapping("/delete/file")
    public ResultData delete(@RequestBody @Validated DeleteFileParamVO paramVO) throws Exception{
        return sceneUploadService.delete(paramVO);
    }

    /**
     * 场景同步
     */
    @PostMapping(value = "/sceneSync")
    public ResultData sceneSync(
        @RequestParam("num") String num,
        @RequestParam(value = "type", defaultValue = "ajk") String type,
        @RequestParam("floorPlanJson") String floorPlanJson,
        @RequestParam("ajkJson") String ajkJson,
        @RequestParam("cameraJson") String cameraJson,
        @RequestParam("files") MultipartFile[] files) throws Exception{
        return sceneEditInfoService.sceneSync(num, type, floorPlanJson, ajkJson, cameraJson, files);
    }

    /**
     * 获取场景权限
     * @param param
     * @return
     * @throws Exception
     */
    @PostMapping(value = "/getAuth")
    public SceneAuthVO getAuth(BaseSceneParamVO param) throws Exception{
        return sceneEditService.getAuth(param, this.getToken());
    }

    /**
     * <p>
            上传国际化文件
     * </p>
     * @author dengsixing
     * @date 2022/4/11
     * @param param
     * @return com.fdkankan.common.response.ResultData
     **/
    @PostMapping(value = "/locales")
    public ResultData locales(@RequestBody @Validated LocalesParamVO param) throws Exception {
        if("pro".equals(env)){
            throw new BusinessException(ErrorCode.HAVE_NO_RIGHT);
        }
        return sceneEditService.locales(param);
    }

    /**
     * 保存导览
     * @param param
     * @return
     * @throws Exception
     */
    @PostMapping(value = "/tour/save")
    public ResultData saveTour(@RequestBody @Validated BaseDataParamVO param) throws Exception{
        return sceneEditService.saveTour(param);
    }

    @PostMapping(value = "/tour/delete")
    public ResultData deleteTour(@RequestBody @Validated BaseSceneParamVO param) throws Exception{
        return sceneEditService.deleteTour(param);
    }

    @PostMapping(value = "/mosaics/add")
    public ResultData addMosaics(@RequestBody @Validated BaseDataParamVO param) throws Exception{
        return sceneEditInfoService.addMosaics(param);
    }









}
