🔊 v0.3.0 计划任务(定期备份等场景)

This commit is contained in:
naiba
2021-01-19 09:59:04 +08:00
parent f20a501ab4
commit d7a3ba607b
24 changed files with 417 additions and 38 deletions

View File

@@ -5,7 +5,8 @@ import (
"time"
"github.com/google/go-github/github"
"github.com/naiba/com"
"github.com/naiba/nezha/pkg/utils"
)
type User struct {
@@ -44,6 +45,6 @@ func NewUserFromGitHub(gu *github.User) User {
}
func (u *User) IssueNewToken() {
u.Token = com.MD5(fmt.Sprintf("%d%d%s", time.Now().UnixNano(), u.ID, u.Login))
u.Token = utils.MD5(fmt.Sprintf("%d%d%s", time.Now().UnixNano(), u.ID, u.Login))
u.TokenExpired = time.Now().AddDate(0, 2, 0)
}