195 lines
7.8 KiB
Go
195 lines
7.8 KiB
Go
package model
|
|
|
|
import "time"
|
|
|
|
type Repo struct {
|
|
Id int `json:"id"`
|
|
Owner struct {
|
|
Id int `json:"id"`
|
|
Login string `json:"login"`
|
|
FullName string `json:"full_name"`
|
|
Email string `json:"email"`
|
|
AvatarUrl string `json:"avatar_url"`
|
|
Language string `json:"language"`
|
|
IsAdmin bool `json:"is_admin"`
|
|
IsActive bool `json:"is_active"`
|
|
LastLogin time.Time `json:"last_login"`
|
|
Created time.Time `json:"created"`
|
|
Username string `json:"username"`
|
|
} `json:"owner"`
|
|
Name string `json:"name"`
|
|
Alias string `json:"alias"`
|
|
FullName string `json:"full_name"`
|
|
FullDisplayName string `json:"full_display_name"`
|
|
Description string `json:"description"`
|
|
Empty bool `json:"empty"`
|
|
Private bool `json:"private"`
|
|
Fork bool `json:"fork"`
|
|
Template bool `json:"template"`
|
|
Parent struct {
|
|
Id int `json:"id"`
|
|
Owner struct {
|
|
Id int `json:"id"`
|
|
Login string `json:"login"`
|
|
FullName string `json:"full_name"`
|
|
Email string `json:"email"`
|
|
AvatarUrl string `json:"avatar_url"`
|
|
Language string `json:"language"`
|
|
IsAdmin bool `json:"is_admin"`
|
|
IsActive bool `json:"is_active"`
|
|
LastLogin time.Time `json:"last_login"`
|
|
Created time.Time `json:"created"`
|
|
Username string `json:"username"`
|
|
} `json:"owner"`
|
|
Name string `json:"name"`
|
|
Alias string `json:"alias"`
|
|
FullName string `json:"full_name"`
|
|
FullDisplayName string `json:"full_display_name"`
|
|
Description string `json:"description"`
|
|
Empty bool `json:"empty"`
|
|
Private bool `json:"private"`
|
|
Fork bool `json:"fork"`
|
|
Template bool `json:"template"`
|
|
Parent interface{} `json:"parent"`
|
|
Mirror bool `json:"mirror"`
|
|
Size int `json:"size"`
|
|
HtmlUrl string `json:"html_url"`
|
|
SshUrl string `json:"ssh_url"`
|
|
CloneUrl string `json:"clone_url"`
|
|
OriginalUrl string `json:"original_url"`
|
|
Website string `json:"website"`
|
|
StarsCount int `json:"stars_count"`
|
|
ForksCount int `json:"forks_count"`
|
|
WatchersCount int `json:"watchers_count"`
|
|
OpenIssuesCount int `json:"open_issues_count"`
|
|
OpenPrCounter int `json:"open_pr_counter"`
|
|
ReleaseCounter int `json:"release_counter"`
|
|
DefaultBranch string `json:"default_branch"`
|
|
Archived bool `json:"archived"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
Permissions struct {
|
|
Admin bool `json:"admin"`
|
|
Push bool `json:"push"`
|
|
Pull bool `json:"pull"`
|
|
} `json:"permissions"`
|
|
HasIssues bool `json:"has_issues"`
|
|
InternalTracker struct {
|
|
EnableTimeTracker bool `json:"enable_time_tracker"`
|
|
AllowOnlyContributorsToTrackTime bool `json:"allow_only_contributors_to_track_time"`
|
|
EnableIssueDependencies bool `json:"enable_issue_dependencies"`
|
|
} `json:"internal_tracker"`
|
|
HasWiki bool `json:"has_wiki"`
|
|
HasPullRequests bool `json:"has_pull_requests"`
|
|
IgnoreWhitespaceConflicts bool `json:"ignore_whitespace_conflicts"`
|
|
AllowMergeCommits bool `json:"allow_merge_commits"`
|
|
AllowRebase bool `json:"allow_rebase"`
|
|
AllowRebaseExplicit bool `json:"allow_rebase_explicit"`
|
|
AllowSquashMerge bool `json:"allow_squash_merge"`
|
|
AvatarUrl string `json:"avatar_url"`
|
|
Status int `json:"status"`
|
|
} `json:"parent"`
|
|
Mirror bool `json:"mirror"`
|
|
Size int `json:"size"`
|
|
HtmlUrl string `json:"html_url"`
|
|
SshUrl string `json:"ssh_url"`
|
|
CloneUrl string `json:"clone_url"`
|
|
OriginalUrl string `json:"original_url"`
|
|
Website string `json:"website"`
|
|
StarsCount int `json:"stars_count"`
|
|
ForksCount int `json:"forks_count"`
|
|
WatchersCount int `json:"watchers_count"`
|
|
OpenIssuesCount int `json:"open_issues_count"`
|
|
OpenPrCounter int `json:"open_pr_counter"`
|
|
ReleaseCounter int `json:"release_counter"`
|
|
DefaultBranch string `json:"default_branch"`
|
|
Archived bool `json:"archived"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
Permissions struct {
|
|
Admin bool `json:"admin"`
|
|
Push bool `json:"push"`
|
|
Pull bool `json:"pull"`
|
|
} `json:"permissions"`
|
|
HasIssues bool `json:"has_issues"`
|
|
InternalTracker struct {
|
|
EnableTimeTracker bool `json:"enable_time_tracker"`
|
|
AllowOnlyContributorsToTrackTime bool `json:"allow_only_contributors_to_track_time"`
|
|
EnableIssueDependencies bool `json:"enable_issue_dependencies"`
|
|
} `json:"internal_tracker"`
|
|
HasWiki bool `json:"has_wiki"`
|
|
HasPullRequests bool `json:"has_pull_requests"`
|
|
IgnoreWhitespaceConflicts bool `json:"ignore_whitespace_conflicts"`
|
|
AllowMergeCommits bool `json:"allow_merge_commits"`
|
|
AllowRebase bool `json:"allow_rebase"`
|
|
AllowRebaseExplicit bool `json:"allow_rebase_explicit"`
|
|
AllowSquashMerge bool `json:"allow_squash_merge"`
|
|
AvatarUrl string `json:"avatar_url"`
|
|
Status int `json:"status"`
|
|
}
|
|
|
|
type RepoCreateParam struct {
|
|
AutoInit bool `json:"auto_init"`
|
|
DefaultBranch string `json:"default_branch"`
|
|
Description string `json:"description"`
|
|
Gitignores string `json:"gitignores"`
|
|
IssueLabels string `json:"issue_labels"`
|
|
License string `json:"license"`
|
|
Name string `json:"name"`
|
|
Alias string `json:"alias"`
|
|
Private bool `json:"private"`
|
|
Readme string `json:"readme"`
|
|
}
|
|
|
|
type RepoUploadFileParam struct {
|
|
UserName string `json:"username" form:"username" binding:"required"`
|
|
RepoName string `json:"repoName" form:"repoName" binding:"required"`
|
|
FileContents []*FileContent `json:"fileContents" form:"filePath" binding:"required"`
|
|
}
|
|
|
|
type FileContent struct {
|
|
FilePath string `json:"filePath" form:"filePath" binding:"required"`
|
|
Content string `json:"content" form:"content" binding:"required"`
|
|
FileSha string `json:"fileSha" form:"content"`
|
|
}
|
|
|
|
type RepoUpdateFileParam struct {
|
|
UserName string `json:"username" form:"username" binding:"required"`
|
|
RepoName string `json:"repoName" form:"repoName" binding:"required"`
|
|
FileContents []*FileContent `json:"fileContents" form:"filePath" binding:"required"`
|
|
}
|
|
|
|
type FileContentErr struct {
|
|
Message string `json:"message"`
|
|
Url string `json:"url"`
|
|
}
|
|
|
|
type QueryFilesContentParam struct {
|
|
UserName string `json:"username" form:"username" binding:"required"`
|
|
RepoName string `json:"repoName" form:"repoName" binding:"required"`
|
|
FilePath string `json:"filePath" form:"filePath"`
|
|
}
|
|
|
|
type FileContentResp struct {
|
|
Name string `json:"name"`
|
|
Path string `json:"path"`
|
|
Sha string `json:"sha"`
|
|
Type string `json:"type"`
|
|
Size int `json:"size"`
|
|
Encoding string `json:"encoding"`
|
|
Content string `json:"content"`
|
|
Target interface{} `json:"target"`
|
|
Url string `json:"url"`
|
|
HtmlUrl string `json:"html_url"`
|
|
GitUrl string `json:"git_url"`
|
|
DownloadUrl string `json:"download_url"`
|
|
SubmoduleGitUrl interface{} `json:"submodule_git_url"`
|
|
Links struct {
|
|
Self string `json:"self"`
|
|
Git string `json:"git"`
|
|
Html string `json:"html"`
|
|
} `json:"_links"`
|
|
Language string `json:"language"`
|
|
FileType string `json:"fileType"`
|
|
}
|