refactor: oauth2登录调整

This commit is contained in:
meilin.huang
2023-07-24 22:36:07 +08:00
parent 155ae65b4a
commit 5083b2bdfe
19 changed files with 227 additions and 60 deletions

View File

@@ -12,6 +12,8 @@ type Oauth2 interface {
GetOAuthAccount(condition *entity.Oauth2Account, cols ...string) error
BindOAuthAccount(e *entity.Oauth2Account) error
Unbind(accountId uint64)
}
func newAuthApp(oauthAccountRepo repository.Oauth2Account) Oauth2 {
@@ -36,3 +38,7 @@ func (a *oauth2AppImpl) GetOAuthAccount(condition *entity.Oauth2Account, cols ..
func (a *oauth2AppImpl) BindOAuthAccount(e *entity.Oauth2Account) error {
return a.oauthAccountRepo.SaveOAuthAccount(e)
}
func (a *oauth2AppImpl) Unbind(accountId uint64) {
a.oauthAccountRepo.DeleteBy(&entity.Oauth2Account{AccountId: accountId})
}