mirror of
https://github.com/chaitin/SafeLine.git
synced 2026-02-15 05:03:53 +08:00
feat: rm page limit
This commit is contained in:
@@ -11,14 +11,12 @@ import (
|
||||
// GitHubHandler provides HTTP handlers for GitHub operations.
|
||||
type GitHubHandler struct {
|
||||
gitHubService *service.GitHubService
|
||||
pageLimit int
|
||||
}
|
||||
|
||||
// NewGitHubHandler creates a new instance of GitHubHandler.
|
||||
func NewGitHubHandler(gitHubService *service.GitHubService, pageLimit int) *GitHubHandler {
|
||||
func NewGitHubHandler(gitHubService *service.GitHubService) *GitHubHandler {
|
||||
return &GitHubHandler{
|
||||
gitHubService: gitHubService,
|
||||
pageLimit: pageLimit,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,10 +37,6 @@ func (h *GitHubHandler) GetIssues(c *gin.Context) {
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
||||
return
|
||||
}
|
||||
if len(issues) > h.pageLimit {
|
||||
c.JSON(http.StatusOK, issues[:h.pageLimit])
|
||||
return
|
||||
}
|
||||
c.JSON(http.StatusOK, issues)
|
||||
}
|
||||
|
||||
@@ -64,10 +58,5 @@ func (h *GitHubHandler) GetDiscussions(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
if len(discussions) > h.pageLimit {
|
||||
c.JSON(http.StatusOK, discussions[:h.pageLimit])
|
||||
return
|
||||
}
|
||||
|
||||
c.JSON(http.StatusOK, discussions)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user