package com.fdkankan.platform.api.feign;

import com.fdkankan.common.response.ResultData;
import com.fdkankan.platform.api.dto.Camera;
import com.fdkankan.platform.api.dto.CameraDetail;
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-platform",contextId = "platformGoodsClient")
@RequestMapping("/platform/feign/goods")
public interface PlatformGoodsClient {

    /**
     *
     * @return Camera
     */
    @PostMapping("/getCameraByChildName")
    ResultData<Camera> getCameraByChildName(@RequestParam(value = "childName",required = false) String childName);

    /**
     *
     * @return CameraDetail
     */
    @PostMapping("/getCameraDetailByCameraId")
    ResultData<CameraDetail> getCameraDetailByCameraId(@RequestParam(value = "cameraId",required = false) Long cameraId);

    /**
     *
     * @return CameraDetail
     */
    @PostMapping("/updateCameraDetailByCameraIdAndSpace")
    ResultData<CameraDetail> updateCameraDetailByCameraIdAndSpace(@RequestParam(value = "cameraId", required = false) Long cameraId,
                                                           @RequestParam(value = "space", required = false) Long space);
    /**
     *
     * @return Camera
     */
    @PostMapping("/getCameraBySnCode")
    ResultData<Camera> getCameraBySnCode(@RequestParam(value = "snCode", required = false) String snCode);

    /**
     *
     * @return Camera
     */
    @PostMapping("/getByChildNameAndChildPassword")
    ResultData<Camera> getByChildNameAndChildPassword(@RequestParam(value = "appUserName") String appUserName,
                                                      @RequestParam(value = "appPassword") String appPassword);

    /**
     *
     * @return Camera
     */
    @PostMapping("/getCameraById")
    ResultData<Camera> getCameraById(@RequestParam(value = "cameraId") Long cameraId);

    @PostMapping("/getCameraLikeSnCode")
    ResultData<List<Camera>> getCameraLikeSnCode(@RequestParam(value = "searchKey")String searchKey);

    @PostMapping("/test")
    ResultData<String> test();
}
