Move WebInterace Calls to own Interface (#338)

optimize imports

Merge branch 'master' into moveWebInteraceCalls-2-ownInterface

Merge branch 'master' into moveWebInteraceCalls-2-ownInterface

move WebInterface calls to own interface

rename WEB api for getting PullDiff

Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/338
Reviewed-by: M M Arif <mmarif@swatian.com>
This commit is contained in:
6543
2020-04-02 16:00:03 +00:00
committed by M M Arif
parent 8853b33c11
commit 7fe583c816
4 changed files with 27 additions and 8 deletions

View File

@@ -255,9 +255,6 @@ public interface ApiInterface {
@GET("repos/{owner}/{repo}/pulls") // get repository pull requests
Call<List<PullRequests>> getPullRequests(@Header("Authorization") String token, @Path("owner") String owner, @Path("repo") String repo, @Query("page") int page, @Query("state") String state, @Query("limit") int limit);
@GET("{owner}/{repo}/pulls/{filename}") // get pull diff file contents
Call<ResponseBody> getFileDiffContents(@Path("owner") String owner, @Path("repo") String repo, @Path("filename") String fileName);
@POST("repos/{owner}/{repo}/pulls/{index}/merge") // merge a pull request
Call<ResponseBody> mergePullRequest(@Header("Authorization") String token, @Path("owner") String ownerName, @Path("repo") String repoName, @Path("index") int index, @Body MergePullRequest jsonStr);

View File

@@ -0,0 +1,17 @@
package org.mian.gitnex.interfaces;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Path;
/**
* Author M M Arif
*/
public interface WebInterface {
@GET("{owner}/{repo}/pulls/{index}.diff") // get pull diff file contents
Call<ResponseBody> getPullDiffContent(@Path("owner") String owner, @Path("repo") String repo, @Path("index") String pullIndex);
}