Blame view

models/prop.go 311 Bytes
1584eb4b   zhangqijia   修复创建唯一索引的bug
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
  }