Custom table name
This commit is contained in:
parent
0ce6822978
commit
f85de1bf74
@ -40,6 +40,7 @@ type MysqlConfig struct {
|
||||
User string
|
||||
Password string
|
||||
DB string
|
||||
Table string
|
||||
}
|
||||
|
||||
func InitConfig() {
|
||||
@ -71,6 +72,7 @@ func InitConfig() {
|
||||
User: viper.GetString("mysql.user"),
|
||||
Password: viper.GetString("mysql.password"),
|
||||
DB: viper.GetString("mysql.database"),
|
||||
Table: viper.GetString("mysql.table"),
|
||||
}
|
||||
viper.WatchConfig()
|
||||
viper.OnConfigChange(func(e fsnotify.Event) {
|
||||
|
||||
@ -2,6 +2,7 @@ package model
|
||||
|
||||
import (
|
||||
"github.com/guonaihong/gout"
|
||||
"github.com/iyear/E5SubBot/config"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/tidwall/gjson"
|
||||
"net/url"
|
||||
@ -30,6 +31,9 @@ const (
|
||||
scope string = "openid offline_access mail.read user.read"
|
||||
)
|
||||
|
||||
func (c *Client) TableName() string {
|
||||
return config.Mysql.Table
|
||||
}
|
||||
func NewClient(clientId string, clientSecret string) *Client {
|
||||
return &Client{
|
||||
ClientId: clientId,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user