dtp/cmd/main.go

29 lines
531 B
Go

package main
import (
"context"
"fmt"
"github.com/Leufolium/test/mongo"
goproto "google.golang.org/protobuf/proto"
)
func main() {
fmt.Println("Start importing...")
client, err := mongo.NewMongo()
if err != nil {
fmt.Printf("mongo client init fail : %v", err)
return
}
ctx := context.Background()
account, _ := client.GetAccountListByMid(ctx, 2)
if account != nil {
account.UserIdString = goproto.String(fmt.Sprint(*account.UserId))
client.UpdateAccount(ctx, account)
}
fmt.Println("End importing...")
}