db.go
5.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
package DB
import (
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
)
var DBSession *mgo.Session
var CItem *mgo.Collection //所有游玩项目内容
var CComplaint *mgo.Collection //投诉
var CInvestigation *mgo.Collection //调查
var CMember *mgo.Collection //会员
var CCommodity *mgo.Collection //商城
var CTags *mgo.Collection //标签
var CScenic *mgo.Collection //景区
var CLine *mgo.Collection //推荐线路
var CAccessLog *mgo.Collection //访问记录
var DB *mgo.Database
type SItem struct {
Id *bson.ObjectId `bson:"_id" json:"Id" valid:"required"`
Name string `bson:"Name" json:"Name"`
SubName string `bson:"SubName" json:"SubName"`
Location SLocation `bson:"Location" json:"Location"`
Tags []STag `bson:"Tags" json:"Tags"`
Icon string `bson:"Icon" json:"Icon"`
LimitHeight string `bson:"LimitHeight" json:"LimitHeight"` //限高
PlayDuration string `bson:"PlayDuration" json:"PlayDuration"` //游玩时长
SceneTime string `bson:"SceneTime" json:"SceneTime"` //场次时间
Picture []string `bson:"Picture" json:"Picture"`
Voice string `bson:"Voice" json:"Voice"` //音频
Tel string `bson:"Tel" json:"Tel"`
AverageConsumption string `bson:"AverageConsumption" json:"AverageConsumption"` //人均消费
Menu string `bson:"Menu" json:"Menu"` //菜单
Time string `bson:"Time" json:"Time"`
}
type SLocation struct {
Latitude float64 `bson:"Latitude" json:"Latitude"` //纬度
Longitude float64 `bson:"Longitude" json:"Longitude"` //经度
}
type SAccessLog struct {
UserId string `bson:"UserId" json:"UserId"` // 用户ID
UserName string `bson:"UserName" json:"UserName"` //用户名称
TypeNum string `bson:"TypeNum" json:"TypeNum"` //类型编号
TypeName string `bson:"TypeName" json:"TypeName"` //类型名称
DateTime int64 `bson:"DateTime" json:"DateTime"` //时间戳
Location SLocation `bson:"Location" json:"Location"` //位置
Remarks string `bson:"Remarks" json:"Remarks"` //备注
}
type SCommodity struct {
Id *bson.ObjectId `bson:"_id" json:"Id" valid:"required"`
Name string `bson:"Name" json:"Name"`
Price string `bson:"Price" json:"Price"`
ShopName string `bson:"ShopName" json:"ShopName"`
Location SLocation `bson:"Location" json:"Location"`
KvPhoto string `bson:"KvPhoto" json:"KvPhoto"` //用于列表页的图片
TopPhoto []string `bson:"TopPhoto" json:"TopPhoto"` //详情页最上面的轮播图
Images []string `bson:"Images" json:"Images"` //详情页下面的产品详细图
}
type SLine struct {
Id *bson.ObjectId `bson:"_id" json:"Id" valid:"required"`
Name string `bson:"Name" json:"Name"`
SubName string `bson:"SubName" json:"SubName"` //游玩时长
Location []SLocation `bson:"Location" json:"Location"` //线路点坐标
PlayDuration string `bson:"PlayDuration" json:"PlayDuration"`
Suitable string `bson:"Suitable" json:"Suitable"` //适合人群
Content string `bson:"Content" json:"Content"`
Annotations []string `bson:"Annotations" json:"Annotations"` //需要点亮的设施id
}
type SComplaint struct {
Type string `bson:"Type" json:"Type"`
Mobile string `bson:"Mobile" json:"Mobile"`
Content string `bson:"Content" json:"Content"`
Image []string `bson:"Image" json:"Image"`
}
type SInvestigation struct {
}
type SMember struct {
Id *bson.ObjectId `bson:"_id" json:"Id" valid:"required"`
Password string `bson:"Password" json:"Password"`
Birthday string `bson:"Birthday" json:"Birthday"`
FullName string `bson:"FullName" json:"FullName"`
Mobile string `bson:"Mobile" json:"Mobile"`
Openid string `bson:"Openid" json:"Openid"`
Token string `bson:"Token" json:"Token"`
}
type STag struct {
Type string `bson:"Type" json:"Type"`
Name string `bson:"Name" json:"Name"`
}
type SScenic struct {
Id *bson.ObjectId `bson:"_id" json:"Id" valid:"required"`
Name string `bson:"Name" json:"Name"`
Describe string `bson:"Describe" json:"Describe"`
OpenHours string `bson:"OpenHours" json:"OpenHours"` //营业时间
Mobile string `bson:"Mobile" json:"Mobile"`
Address string `bson:"Address" json:"Address"`
Location SLocation `bson:"Location" json:"Location"`
Picture []string `bson:"Picture" json:"Picture"`
ShopAdPicture []string `bson:"ShopAdPicture" json:"ShopAdPicture"` //商城列表页图片
ItemScenicPicture []string `bson:"ItemScenicPicture" json:"ItemScenicPicture"` //项目场次照片
ActivityPicture []string `bson:"ActivityPicture" json:"ActivityPicture"` //活动照片
VideoList []string `bson:"VideoList" json:"VideoList"`
}