Refactor the original db code.

This commit is contained in:
Gucheng Wang
2021-12-18 01:08:03 +08:00
parent 07f9a9ee96
commit 318cf52b33
16 changed files with 342 additions and 382 deletions

View File

@ -39,6 +39,8 @@ type Syncer struct {
AvatarBaseUrl string `xorm:"varchar(100)" json:"avatarBaseUrl"`
SyncInterval int `json:"syncInterval"`
IsEnabled bool `json:"isEnabled"`
Adapter *Adapter `xorm:"-" json:"-"`
}
func GetSyncerCount(owner string) int {
@ -143,6 +145,6 @@ func DeleteSyncer(syncer *Syncer) bool {
return affected != 0
}
func (p *Syncer) GetId() string {
return fmt.Sprintf("%s/%s", p.Owner, p.Name)
func (syncer *Syncer) GetId() string {
return fmt.Sprintf("%s/%s", syncer.Owner, syncer.Name)
}