package DB import ( "gopkg.in/mgo.v2" "gopkg.in/mgo.v2/bson" "letu/Lib/Cache" ) var Redis *Cache.Redis 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 CActionLog *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 int64 `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 SActionLog struct { UserId string `bson:"UserId" json:"UserId"` // 用户ID UserName string `bson:"UserName" json:"UserName"` //用户名称 Mobile string `bson:"Mobile" json:"Mobile"` //手机号 TypeNum int64 `bson:"TypeNum" json:"TypeNum"` //类型编号 TypeName string `bson:"TypeName" json:"TypeName"` //类型名称 DateTime int64 `bson:"DateTime" json:"DateTime"` //时间戳 Location SLocation `bson:"Location" json:"Location"` //位置 Content string `bson:"Content" json:"Content"` //内容 Error interface{} `bson:"Error" json:"Error"` //错误信息 } 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"` Distance string `bson:"Distance" json:"Distance"` // 距离 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"` }