package com.fdkankan.scene.util.forest; import com.dtflys.forest.annotation.Address; import com.dtflys.forest.annotation.Body; import com.dtflys.forest.annotation.Delete; import com.dtflys.forest.annotation.Get; import com.dtflys.forest.annotation.JSONBody; import com.dtflys.forest.annotation.Post; import com.dtflys.forest.annotation.Query; 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.fdkankan.web.response.ResultData; /** *

* TODO *

* * @author dengsixing * @since 2022/4/24 **/ @Success(condition = SuccessCondition.class) public interface HttpClient { @Get("{2}") @Address(host = "{0}", port = "{1}") ResultData get(String host, int port, String api, OnSuccess onSuccess, OnError onError); @Get("{2}") @Address(host = "{0}", port = "{1}") ResultData get(String host, int port, String api, @Query Object params, OnSuccess onSuccess, OnError onError); @Post("{2}") @Address(host = "{0}", port = "{1}") ResultData postForm(String host, int port, String api, @Body Object params, OnSuccess onSuccess, OnError onError); @Post("{2}") @Address(host = "{0}", port = "{1}") ResultData postJson(String host, int port, String api, @JSONBody Object params, OnSuccess onSuccess, OnError onError); @Delete("{2}") @Address(host = "{0}", port = "{1}") ResultData deleteForm(String host, int port, String api, @Body Object params, OnSuccess onSuccess, OnError onError); }