Int should be enough

This commit is contained in:
2015-03-20 22:22:49 +07:00
parent 788b7d7683
commit abd0d96b10
10 changed files with 39 additions and 39 deletions
+7 -7
View File
@@ -5,13 +5,13 @@ import (
)
type Contrib struct {
Week uint64 `json:"week"`
OrgID uint64 `json:"org_id"`
RepoID uint64 `json:"repo_id"`
UserID uint64 `json:"user_id"`
Commits uint64 `json:"commits"`
Additions uint64 `json:"additions"`
Deletions uint64 `json:"deletions"`
Week int `json:"week"`
OrgID int `json:"org_id"`
RepoID int `json:"repo_id"`
UserID int `json:"user_id"`
Commits int `json:"commits"`
Additions int `json:"additions"`
Deletions int `json:"deletions"`
}
func (c *Contrib) Save() {
+6 -6
View File
@@ -7,13 +7,13 @@ import (
"time"
)
func SaveOrgMembers(orgID uint64, members []uint64) {
func SaveOrgMembers(orgID int, members []int) {
defer measure("SaveOrgMembers", time.Now())
tx := db.MustBegin()
var ids = []string{}
for _, id := range members {
ids = append(ids, strconv.FormatUint(id, 10))
ids = append(ids, strconv.Itoa(id))
}
tx.MustExec(fmt.Sprintf(`
delete from org_members
@@ -37,13 +37,13 @@ func SaveOrgMembers(orgID uint64, members []uint64) {
}
}
func SaveTeamMembers(orgID, teamID uint64, members []uint64) {
func SaveTeamMembers(orgID, teamID int, members []int) {
defer measure("SaveTeamMembers", time.Now())
tx := db.MustBegin()
var ids = []string{}
for _, id := range members {
ids = append(ids, strconv.FormatUint(id, 10))
ids = append(ids, strconv.Itoa(id))
}
tx.MustExec(fmt.Sprintf(`
delete from team_members
@@ -68,13 +68,13 @@ func SaveTeamMembers(orgID, teamID uint64, members []uint64) {
}
}
func SaveTeamRepos(orgID, teamID uint64, repos []uint64) {
func SaveTeamRepos(orgID, teamID int, repos []int) {
defer measure("SaveTeamRepos", time.Now())
tx := db.MustBegin()
var ids = []string{}
for _, id := range repos {
ids = append(ids, strconv.FormatUint(id, 10))
ids = append(ids, strconv.Itoa(id))
}
tx.MustExec(fmt.Sprintf(`
delete from team_repos
+1 -1
View File
@@ -5,7 +5,7 @@ import (
)
type Org struct {
ID uint64 `json:"id"`
ID int `json:"id"`
Login string `json:"login"`
Company string `json:"company"`
AvatarURL string `json:"avatar_url" db:"avatar_url"`
+2 -2
View File
@@ -5,8 +5,8 @@ import (
)
type Repo struct {
ID uint64 `json:"id"`
OrgID uint64 `json:"org_id"`
ID int `json:"id"`
OrgID int `json:"org_id"`
Name string `json:"name"`
Description string `json:"description"`
IsPrivate bool `json:"is_private"`
+2 -2
View File
@@ -5,8 +5,8 @@ import (
)
type Team struct {
ID uint64 `json:"id"`
OrgID uint64 `json:"org_id" db:"org_id"`
ID int `json:"id"`
OrgID int `json:"org_id"`
Slug string `json:"slug"`
Name string `json:"name"`
Permission string `json:"permission"`
+3 -3
View File
@@ -5,11 +5,11 @@ import (
)
type Token struct {
ID uint64 `json:"id"`
ID int `json:"id"`
User string `json:"user"`
Token string `json:"token"`
Quota uint64 `json:"quota"`
Remaining uint64 `json:"remaining"`
Quota int `json:"quota"`
Remaining int `json:"remaining"`
ResetAt time.Time `json:"reset_at" db:"reset_at"`
CreatedAt time.Time `json:"created_at" db:"created_at"`
}
+1 -1
View File
@@ -5,7 +5,7 @@ import (
)
type User struct {
ID uint64 `json:"id"`
ID int `json:"id"`
Login string `json:"login"`
Name string `json:"name"`
AvatarURL string `json:"avatar_url" db:"avatar_url"`