GITLAB

zhangqijia / Pro2DServer

Sign in
  • Sign in
  • Project
  • Files
  • Commits
  • Network
  • Graphs
  • Issues 0
  • Merge Requests 0
  • Wiki
  • Pro2DServer
  • models
  • prop.go
  • 1584eb4b   修复创建唯一索引的bug Browse Code »
    zhangqijia
    2022-02-17 17:44:24 +0800  
prop.go 311 Bytes
Edit Raw Blame History
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
package models

import (
	"pro2d/components/db"
	"pro2d/protos/pb"
	"strconv"
)

type PropModels struct {
	*db.MgoColl
	Prop *pb.Prop
}

func NewProp(id int64) *PropModels{
	data := &pb.Prop{
		Id: id,
	}
	m := &PropModels{
		MgoColl: db.NewMongoColl(strconv.Itoa(int(id)), data),
		Prop:  data,
	}

	return m
}