mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-03 16:00:25 +08:00
25 lines
561 B
Go
25 lines
561 B
Go
package persistence
|
|
|
|
import (
|
|
"mayfly-go/internal/sys/domain/entity"
|
|
"mayfly-go/internal/sys/domain/repository"
|
|
"mayfly-go/pkg/gormx"
|
|
)
|
|
|
|
type authAccountRepoImpl struct{}
|
|
|
|
func newAuthAccountRepo() repository.OAuthAccount {
|
|
return new(authAccountRepoImpl)
|
|
}
|
|
|
|
func (a *authAccountRepoImpl) GetOAuthAccount(condition *entity.OAuthAccount, cols ...string) error {
|
|
return gormx.GetBy(condition, cols...)
|
|
}
|
|
|
|
func (a *authAccountRepoImpl) SaveOAuthAccount(e *entity.OAuthAccount) error {
|
|
if e.Id == 0 {
|
|
return gormx.Insert(e)
|
|
}
|
|
return gormx.UpdateById(e)
|
|
}
|