diff --git a/.gitignore b/.gitignore index b41ac26..de92754 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ main tiles -upload +Upload Console diff --git a/API/Scenic.go b/API/Scenic.go index ecc32ab..40b4272 100644 --- a/API/Scenic.go +++ b/API/Scenic.go @@ -13,7 +13,7 @@ import ( // @Accept json // @Produce json // @Param id 5dfb03070a9ac17ac7a82054 string true "景区id" -// @Success 200 {object} tools.ResponseSeccess "{"errcode":0,"result":{"Name":"名称","Describe":"介绍","OpenHours":"开放时间","Mobile":"电话","Address":"地址","SLocation":{"Latitude":0,"Longitude":0},"Picture":["照片1","照片2"]}}" +// @Success 200 {object} tools.ResponseSeccess "Name名称;Describe介绍;OpenHours营业时间;Picture最上面图片;ShopAdPicture商城列表页图片;ItemScenicPicture项目场次照片;ActivityPicture活动照片;VideoList视频" // @Failure 500 {object} tools.ResponseError "{"errcode":1,"errmsg":"错误原因"}" // @Router /ScenicInfo? [get] func ScenicInfo(c *gin.Context) { @@ -52,7 +52,7 @@ func ScenicInfo(c *gin.Context) { // @Accept json // @Produce json // @Param id 5dfb03070a9ac17ac7a82054 string true "景区id" -// @Success 200 {object} tools.ResponseSeccess "{"errcode":0,"result":{"Name":"名称","Describe":"介绍","OpenHours":"开放时间","Mobile":"电话","Address":"地址","SLocation":{"Latitude":0,"Longitude":0},"Picture":["照片1","照片2"]}}" +// @Success 200 {object} tools.ResponseSeccess "Name名称;Describe介绍;OpenHours营业时间;Picture最上面图片;ShopAdPicture商城列表页图片;ItemScenicPicture项目场次照片;ActivityPicture活动照片;VideoList视频" // @Failure 500 {object} tools.ResponseError "{"errcode":1,"errmsg":"错误原因"}" // @Router /UpdateScenic? [post] func UpdateScenic(c *gin.Context) { @@ -65,6 +65,18 @@ func UpdateScenic(c *gin.Context) { var Picture []string json.Unmarshal([]byte(c.PostForm("Picture")), &Picture) + var ShopAdPicture []string + json.Unmarshal([]byte(c.PostForm("ShopAdPicture")), &ShopAdPicture) + + var ItemScenicPicture []string + json.Unmarshal([]byte(c.PostForm("ItemScenicPicture")), &ItemScenicPicture) + + var ActivityPicture []string + json.Unmarshal([]byte(c.PostForm("ActivityPicture")), &ActivityPicture) + + var VideoList []string + json.Unmarshal([]byte(c.PostForm("VideoList")), &VideoList) + var id bson.ObjectId if pid := c.PostForm("id"); pid == "null" { id = bson.NewObjectId() @@ -75,13 +87,17 @@ func UpdateScenic(c *gin.Context) { DB.CScenic.UpsertId( id, bson.M{"$set": bson.M{ - "Name": c.PostForm("Name"), - "Describe": c.PostForm("Describe"), - "Location": Location, - "OpenHours": c.PostForm("OpenHours"), - "Mobile": c.PostForm("Mobile"), - "Address": c.PostForm("Address"), - "Picture": Picture, + "Name": c.PostForm("Name"), + "Describe": c.PostForm("Describe"), + "Location": Location, + "OpenHours": c.PostForm("OpenHours"), + "Mobile": c.PostForm("Mobile"), + "Address": c.PostForm("Address"), + "Picture": Picture, + "ShopAdPicture": ShopAdPicture, + "ItemScenicPicture": ItemScenicPicture, + "ActivityPicture": ActivityPicture, + "VideoList": VideoList, }}, ) diff --git a/DB/db.go b/DB/db.go index 8dffe9f..0d6c594 100644 --- a/DB/db.go +++ b/DB/db.go @@ -44,7 +44,7 @@ type SCommodity struct { ShopName string `bson:"ShopName" json:"ShopName"` Location SLocation `bson:"Location" json:"Location"` KvPhoto string `bson:"KvPhoto" json:"KvPhoto"` - TopPhoto []string `bson:"TopPhoto" json:"TopPhoto"` + TopPhoto []string `bson:"TopPhoto" json:"TopPhoto"` Images []string `bson:"Images" json:"Images"` } type SLine struct { @@ -82,12 +82,16 @@ type STag struct { 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"` + 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"` } diff --git a/README.md b/README.md index 14e2173..8434ff2 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,6 @@ - - ### API List 1. [查询所有商品](#查询所有商品) 1. [查询所有游玩项目](#查询所有游玩项目) @@ -239,7 +237,7 @@ | Code | Type | Model | Message | |-----|-----|-----|-----| -| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | {"errcode":0,"result":{"Name":"名称","Describe":"介绍","OpenHours":"开放时间","Mobile":"电话","Address":"地址","SLocation":{"Latitude":0,"Longitude":0},"Picture":["照片1","照片2"]}} | +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | Name名称;Describe介绍;OpenHours营业时间;Picture最上面图片;ShopAdPicture商城列表页图片;ItemScenicPicture项目场次照片;ActivityPicture活动照片;VideoList视频 | | 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | @@ -333,7 +331,7 @@ | Code | Type | Model | Message | |-----|-----|-----|-----| -| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | {"errcode":0,"result":{"Name":"名称","Describe":"介绍","OpenHours":"开放时间","Mobile":"电话","Address":"地址","SLocation":{"Latitude":0,"Longitude":0},"Picture":["照片1","照片2"]}} | +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | Name名称;Describe介绍;OpenHours营业时间;Picture最上面图片;ShopAdPicture商城列表页图片;ItemScenicPicture项目场次照片;ActivityPicture活动照片;VideoList视频 | | 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | -- libgit2 0.21.0