格式化代码

This commit is contained in:
huangxiaolei
2022-12-19 13:40:04 +08:00
parent f773ba8df7
commit 58b2df2bc6
92 changed files with 682 additions and 626 deletions

View File

@@ -20,7 +20,7 @@ func NewDao() (r *Dao, err error) {
clientOptions := options.Client().ApplyURI(config.CONF.Database.Url)
client, err := mongo.Connect(context.TODO(), clientOptions)
if err != nil {
logger.LOG.Error("mongo connect error: %v", err)
logger.Error("mongo connect error: %v", err)
return nil, err
}
r.client = client
@@ -31,6 +31,6 @@ func NewDao() (r *Dao, err error) {
func (d *Dao) CloseDao() {
err := d.client.Disconnect(context.TODO())
if err != nil {
logger.LOG.Error("mongo close error: %v", err)
logger.Error("mongo close error: %v", err)
}
}

View File

@@ -2,9 +2,11 @@ package dao
import (
"context"
"hk4e/gs/model"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/mongo"
"hk4e/gs/model"
)
func (d *Dao) InsertPlayer(player *model.Player) error {