|
@@ -16,6 +16,7 @@ import cn.seecoder.web.service.project.CommitService;
|
|
|
import cn.seecoder.web.service.tree.TreeNodeService;
|
|
import cn.seecoder.web.service.tree.TreeNodeService;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.nju.edu.gitlab.SeecoderGitlabApi;
|
|
import com.nju.edu.gitlab.SeecoderGitlabApi;
|
|
|
|
|
+import com.nju.edu.gitlab.vo.DiffVO;
|
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
@@ -25,6 +26,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
+import java.util.Set;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* @author chenyz
|
|
* @author chenyz
|
|
@@ -172,8 +174,34 @@ public class CommitController {
|
|
|
@ApiImplicitParam(name = "projectId", dataType = "int", paramType = "query"),
|
|
@ApiImplicitParam(name = "projectId", dataType = "int", paramType = "query"),
|
|
|
@ApiImplicitParam(name = "branchName", dataType = "String", paramType = "query")
|
|
@ApiImplicitParam(name = "branchName", dataType = "String", paramType = "query")
|
|
|
})
|
|
})
|
|
|
- public Response<List<com.nju.edu.gitlab.vo.commit.CommitVO>> getCommitsByBranch(@RequestParam("projectId") Integer projectId,
|
|
|
|
|
|
|
+ public Response<List<CommitVO>> getCommitsByBranch(@RequestParam("projectId") Integer projectId,
|
|
|
@RequestParam("branchName") String branchName){
|
|
@RequestParam("branchName") String branchName){
|
|
|
return Response.buildSuccess(commitService.getCommitsByBranchName(projectId, branchName));
|
|
return Response.buildSuccess(commitService.getCommitsByBranchName(projectId, branchName));
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ @ApiOperation(value = "获得一个commit的信息", httpMethod = "GET")
|
|
|
|
|
+ @GetMapping("/commit")
|
|
|
|
|
+ @ApiImplicitParams({
|
|
|
|
|
+ @ApiImplicitParam(name = "projectId", dataType = "int", paramType = "query"),
|
|
|
|
|
+ @ApiImplicitParam(name = "hash", dataType = "String", paramType = "query")
|
|
|
|
|
+ })
|
|
|
|
|
+ public Response<CommitVO> getCommitByHash(@RequestParam("projectId") Integer projectId,
|
|
|
|
|
+ @RequestParam("hash") String hash)
|
|
|
|
|
+ {
|
|
|
|
|
+ return Response.buildSuccess(commitService.getCommitByHash(projectId, hash));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @ApiOperation(value = "获得两个提交之间的差异", httpMethod = "GET")
|
|
|
|
|
+ @GetMapping("/commits/diff")
|
|
|
|
|
+ @ApiImplicitParams({
|
|
|
|
|
+ @ApiImplicitParam(name = "projectId", dataType = "int", paramType = "query"),
|
|
|
|
|
+ @ApiImplicitParam(name = "from", dataType = "String", paramType = "query"),
|
|
|
|
|
+ @ApiImplicitParam(name = "to", dataType = "String", paramType = "query")
|
|
|
|
|
+ })
|
|
|
|
|
+ public Response<Set<DiffVO>> getDiff(@RequestParam("projectId") Integer projectId,
|
|
|
|
|
+ @RequestParam("from") String from,
|
|
|
|
|
+ @RequestParam("to") String to)
|
|
|
|
|
+ {
|
|
|
|
|
+ return Response.buildSuccess(commitService.getDiff(projectId, from, to));
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|