mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 10:56:10 +01:00 
			
		
		
		
	feat(api): add date range filtering to commit retrieval endpoints (#34497)
- Add support for filtering commits by date range via new "since" and "until" parameters - Update API endpoints and command logic to handle the new parameters for fetching commits within given dates - Extend API documentation and Swagger specs to describe the new "since" and "until" query parameters - Refactor related function signatures and implementations to accept and pass "since" and "until" values --------- Signed-off-by: appleboy <appleboy.tw@gmail.com> Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
		| @@ -166,6 +166,8 @@ type CommitsCountOptions struct { | ||||
| 	Not      string | ||||
| 	Revision []string | ||||
| 	RelPath  []string | ||||
| 	Since    string | ||||
| 	Until    string | ||||
| } | ||||
|  | ||||
| // CommitsCount returns number of total commits of until given revision. | ||||
| @@ -199,8 +201,8 @@ func (c *Commit) CommitsCount() (int64, error) { | ||||
| } | ||||
|  | ||||
| // CommitsByRange returns the specific page commits before current revision, every page's number default by CommitsRangeSize | ||||
| func (c *Commit) CommitsByRange(page, pageSize int, not string) ([]*Commit, error) { | ||||
| 	return c.repo.commitsByRange(c.ID, page, pageSize, not) | ||||
| func (c *Commit) CommitsByRange(page, pageSize int, not, since, until string) ([]*Commit, error) { | ||||
| 	return c.repo.commitsByRangeWithTime(c.ID, page, pageSize, not, since, until) | ||||
| } | ||||
|  | ||||
| // CommitsBefore returns all the commits before current revision | ||||
|   | ||||
		Reference in New Issue
	
	Block a user