24 lines
467 B
Go
24 lines
467 B
Go
package repository
|
|
|
|
import (
|
|
"Lee-WineList/client"
|
|
"Lee-WineList/model/entity"
|
|
)
|
|
|
|
type oauth2Client struct{}
|
|
|
|
// OAuth2Client ...
|
|
func OAuth2Client() *oauth2Client {
|
|
return &oauth2Client{}
|
|
}
|
|
|
|
// FinAll 查询所有客户端
|
|
func (oauth2Client) FinAll(clients *[]entity.OAuth2Client) error {
|
|
return client.MySQL.Find(&clients).Error
|
|
}
|
|
|
|
// FindOne 查询某一个
|
|
func (oauth2Client) FindOne(c *entity.OAuth2Client) error {
|
|
return client.MySQL.Take(&c, c).Error
|
|
}
|