|
|
@@ -2,14 +2,16 @@ package cn.seecoder.query.facade;
|
|
|
|
|
|
import cn.seecoder.query.Response;
|
|
|
import cn.seecoder.query.dao.QueryMapper;
|
|
|
-import cn.seecoder.query.model.BugListDTO;
|
|
|
import cn.seecoder.query.model.CommitDTO;
|
|
|
-import cn.seecoder.query.model.TreeDTO;
|
|
|
+import org.apache.ibatis.annotations.Param;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import java.sql.Timestamp;
|
|
|
+import java.text.ParseException;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
@@ -29,17 +31,11 @@ public class QueryController {
|
|
|
}
|
|
|
|
|
|
@GetMapping("/commits")
|
|
|
- public Response<List<CommitDTO>> queryCommits(){
|
|
|
- return Response.buildSuccess(queryMapper.selectCommits());
|
|
|
+ public Response<List<CommitDTO>> queryCommits(@Param("startAt") String startAt,@Param("endAt") String endAt) throws ParseException {
|
|
|
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
+ Timestamp startTime=new Timestamp(simpleDateFormat.parse(startAt).getTime());
|
|
|
+ Timestamp endTime=new Timestamp(simpleDateFormat.parse(endAt).getTime());
|
|
|
+ return Response.buildSuccess(queryMapper.selectCommits(startTime,endTime));
|
|
|
}
|
|
|
|
|
|
- @GetMapping("/buglist")
|
|
|
- public Response<List<BugListDTO>> queryBugList(){
|
|
|
- return Response.buildSuccess(queryMapper.selectBugLists());
|
|
|
- }
|
|
|
-
|
|
|
- @GetMapping("/leaf")
|
|
|
- public Response<List<TreeDTO>> queryLeaf(){
|
|
|
- return Response.buildSuccess(queryMapper.selectTreeLeaf());
|
|
|
- }
|
|
|
}
|