package com.fdkankan.scene.api.feign;

import com.fdkankan.common.response.ResultData;
import com.fdkankan.scene.api.dto.SceneCntDTO;
import com.fdkankan.scene.api.dto.SceneInfoDTO;
import com.fdkankan.scene.api.dto.ScenePODTO;
import com.fdkankan.scene.api.dto.SceneProDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "4dkankan-center-scene",contextId = "sceneUserSceneClient")
@RequestMapping("/scene/feign/user/scene")
public interface SceneUserSceneClient {

    @PostMapping("/getSceneCnt")
    ResultData<SceneCntDTO> getSceneCnt(@RequestParam(value = "userId") Long userId, @RequestParam(value = "cameraId") Long cameraId) ;

    @PostMapping("/getSceneNumByCameraId")
    ResultData<Integer> getSceneNumByCameraId(@RequestParam(value = "cameraId") Long cameraId,
                                              @RequestParam(value = "cameraType")Integer cameraType,
                                              @RequestParam(value = "snCode")String snCode) ;

    @PostMapping("/getLastSceneByCameraId")
    ResultData<SceneProDTO> getLastSceneByCameraId(@RequestParam(value = "cameraId") Long cameraId) ;

    @PostMapping("/updateSceneDownloadLog")
    ResultData updateSceneDownloadLog(
        @RequestParam(value = "num") String num,
        @RequestParam(value = "status") Integer status,
        @RequestParam(value = "url", required = false) String url,
        @RequestParam(value = "reason", required = false) String reason);

    @PostMapping("/getSceneViewInfo")
    ResultData<SceneInfoDTO> getSceneViewInfo(@RequestParam(value = "num") String num) throws Exception;

    @PostMapping("/lockBeyondSpaceScenes")
    ResultData lockBeyondSpaceScenes(@RequestParam(value = "usedSpace")Long usedSpace,
                                     @RequestParam(value = "totalSpace")Long totalSpace,
                                     @RequestParam(value = "cameraId")Long cameraId);

    @PostMapping("/unlockBeyondSpaceScenes")
    ResultData unlockBeyondSpaceScenes(@RequestParam(value = "usedSpace")Long usedSpace,
                                       @RequestParam(value = "cameraId")Long cameraId);

    @PostMapping("/findAllByYesterday")
    ResultData<List<ScenePODTO>> findAllByYesterday();

    @PostMapping("/updatePayStatus")
    ResultData updatePayStatus(@RequestParam(value = "num") String num ,
                               @RequestParam(value = "payStatus") Integer payStatus);

    @PostMapping("/updateUserIdByCameraId")
    ResultData updateUserIdByCameraId(@RequestParam(value = "userId")Long userId,
                                      @RequestParam(value = "cameraId")Long cameraId);

    @PostMapping("/getSceneCount")
    ResultData getSceneCount(@RequestParam(value = "cameraId") Long cameraId,
                             @RequestParam(value = "userId") Long userId,
                             @RequestParam(value = "cameraType") Integer cameraType);

    @PostMapping("/disableCooperation")
    ResultData disableCooperation(@RequestParam(value = "cameraId")Long cameraId,
                                 @RequestParam(value = "snCode")String snCode,
                                 @RequestParam(value = "cooperationUserName")String cooperationUserName);

    @PostMapping("/saveCooperation")
    ResultData saveCooperation(@RequestParam(value = "cameraId") Long cameraId,
                               @RequestParam(value = "resourceIds") String resourceIds,
                               @RequestParam(value = "userId") Long userId,
                               @RequestParam(value = "snCode")String snCode,
                               @RequestParam(value = "cooperationUserName")String cooperationUserName);

    @PostMapping("/updateImageVersionFromSceneProEdit")
    ResultData updateImageVersionFromSceneProEdit(@RequestParam(value = "num" ) String num);

    @PostMapping("/getSceneResourceByCameraId")
    ResultData getSceneResourceByCameraId(@RequestParam(value = "cameraId" ) Long cameraId);

    @PostMapping("/checkDownLoad")
    ResultData checkDownLoad(@RequestParam(value = "sceneNum") String sceneNum);

    @PostMapping("/findByCameraIds")
    ResultData findByCameraIds(@RequestParam(value = "cameraIds") String cameraIds,
                                      @RequestParam(value = "startTime") String startTime,
                                      @RequestParam(value = "endTime")   String endTime);
}
