modified: go.mod
modified: go.sum new file: internal/model/o_auth_provider.go modified: internal/server/server.go deleted: main delete bin main in root directory add OAuth struct
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type OAuthProvider struct {
|
||||
ID uint `json:"id" gorm:"primaryKey"`
|
||||
UserID uint `json:"user_id" gorm:"not null;index"`
|
||||
Provider string `json:"provider" gorm:"not null;index"` // google, yandex, vk
|
||||
ProviderID string `json:"provider_id" gorm:"not null"` // ID пользователя в провайдере
|
||||
AccessToken string `json:"access_token"`
|
||||
RefreshToken string `json:"refresh_token"`
|
||||
ExpiresAt time.Time `json:"expires_at"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
}
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
"github.com/go-chi/chi/v5"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
type Server struct {
|
||||
router *chi.Mux
|
||||
db *gorm.DB
|
||||
|
||||
Reference in New Issue
Block a user