package com.fdkankan.scene.httpclient;

import com.dtflys.forest.annotation.Body;
import com.dtflys.forest.annotation.Get;
import com.dtflys.forest.annotation.Header;
import com.dtflys.forest.annotation.Post;
import com.dtflys.forest.annotation.Retry;
import com.dtflys.forest.annotation.Success;
import com.dtflys.forest.annotation.Var;
import com.dtflys.forest.callback.OnError;
import com.dtflys.forest.callback.OnSuccess;
import com.dtflys.forest.http.ForestResponse;
import com.fdkankan.common.response.Result;
import com.fdkankan.scene.bean.CameraBean;
import com.fdkankan.scene.bean.RequestSceneProV4;
import com.fdkankan.scene.bean.UserIncrementBean;
//import com.fdkankan.scene.callback.FdkkMiniReqSuccessCondition;
import com.fdkankan.scene.callback.FdkkMiniReqSuccessCondition;
import com.fdkankan.scene.entity.SceneProV3;
import java.io.File;
import java.io.InputStream;
import java.util.Map;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

/**
 * <p>
 * TODO
 * </p>
 *
 * @author dengsixing
 * @since 2022/4/24
 **/
@Success(condition = FdkkMiniReqSuccessCondition.class)
public interface FdkankanMiniClient {

    @Get(url="{url}"
//        ,interceptor = TLogForestInterceptor.class    加这个拦截器，打印的tlog日志会详细一些，包括头信息等等
    )
    @Retry(maxRetryCount = "3", maxRetryInterval = "100")
    Result<String> getDataSyncType(@Var("url") String url, OnSuccess<Result> onSuccess, OnError onError);

    @Get("{url}")
    @Retry(maxRetryCount = "3", maxRetryInterval = "100")
    Result<UserIncrementBean> getUserIncrementByCameraId(@Var("url") String url, OnSuccess<Result> onSuccess, OnError onError);

    @Get("{url}")
    @Retry(maxRetryCount = "3", maxRetryInterval = "100")
    Result<CameraBean> getCameraByCameraId(@Var("url") String url, OnSuccess<Result> onSuccess, OnError onError);

    @Get(url="{url}")
    @Retry(maxRetryCount = "3", maxRetryInterval = "100")
    Result<SceneProV3> getSceneProByNum(@Var("url") String url, OnSuccess<Result> onSuccess, OnError onError);

    @Post(url="{url}")
    @Retry(maxRetryCount = "3", maxRetryInterval = "100")
    Result<Map<String, Object>> getIsLogin(@Var("url") String url, @Header("token") String token, OnSuccess<Result> onSuccess, OnError onError);

    @Post(
        url = "${url}",
        contentType = "application/json"
    )
    @Retry(maxRetryCount = "3", maxRetryInterval = "100")
    Result upgradeToV4ResultSync(@Var("url") String url, @Body RequestSceneProV4 param, OnSuccess<Result> onSuccess, OnError onError);

}
