mirror of
https://github.com/taigrr/gico.git
synced 2026-04-02 03:09:07 -07:00
refactor Author type
This commit is contained in:
@@ -10,10 +10,10 @@ func NewDataSet() DataSet {
|
||||
return make(DataSet)
|
||||
}
|
||||
|
||||
func NewCommit(Author, Message, Repo, Path string, Added, Deleted, FilesChanged int) Commit {
|
||||
func NewCommit(AuthorName, AuthorEmail, Message, Repo, Path string, Added, Deleted, FilesChanged int) Commit {
|
||||
ci := Commit{
|
||||
Message: Message, Added: Added, Deleted: Deleted,
|
||||
Author: Author, FilesChanged: FilesChanged, TimeStamp: time.Now(),
|
||||
Author: Author{Name: AuthorName, Email: AuthorEmail}, FilesChanged: FilesChanged, TimeStamp: time.Now(),
|
||||
Repo: Repo, Path: Path,
|
||||
}
|
||||
return ci
|
||||
|
||||
@@ -8,6 +8,10 @@ import (
|
||||
|
||||
type (
|
||||
Month string
|
||||
Author struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
Email string `json:"email,omitempty"`
|
||||
}
|
||||
Commit struct {
|
||||
Deleted int `json:"deleted,omitempty"`
|
||||
Added int `json:"added,omitempty"`
|
||||
@@ -15,7 +19,7 @@ type (
|
||||
Message string `json:"message,omitempty"`
|
||||
Hash string `json:"hash,omitempty"`
|
||||
TimeStamp time.Time `json:"ts,omitempty"`
|
||||
Author string `json:"author,omitempty"`
|
||||
Author Author `json:"author,omitempty"`
|
||||
Repo string `json:"repo,omitempty"`
|
||||
Path string `json:"path,omitempty"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user