dtp/cmd/main.go

29 lines
531 B
Go
Raw Normal View History

2023-12-24 15:29:12 +08:00
package main
import (
"context"
"fmt"
"github.com/Leufolium/test/mongo"
2023-12-24 22:22:45 +08:00
goproto "google.golang.org/protobuf/proto"
2023-12-24 15:29:12 +08:00
)
func main() {
fmt.Println("Start importing...")
client, err := mongo.NewMongo()
if err != nil {
fmt.Printf("mongo client init fail : %v", err)
return
}
2024-03-16 23:39:10 +08:00
ctx := context.Background()
account, _ := client.GetAccountListByMid(ctx, 2)
if account != nil {
account.UserIdString = goproto.String(fmt.Sprint(*account.UserId))
client.UpdateAccount(ctx, account)
2023-12-24 15:29:12 +08:00
}
fmt.Println("End importing...")
}