Commit 527984bc02bf005ca06c55983bee366584827694
1 parent
b77fd09f
Exists in
v1.2
and in
2 other branches
update readme.md
Showing
4 changed files
with
41 additions
and
23 deletions
Show diff stats
.gitignore
API/Scenic.go
... | ... | @@ -13,7 +13,7 @@ import ( |
13 | 13 | // @Accept json |
14 | 14 | // @Produce json |
15 | 15 | // @Param id 5dfb03070a9ac17ac7a82054 string true "景区id" |
16 | -// @Success 200 {object} tools.ResponseSeccess "{"errcode":0,"result":{"Name":"名称","Describe":"介绍","OpenHours":"开放时间","Mobile":"电话","Address":"地址","SLocation":{"Latitude":0,"Longitude":0},"Picture":["照片1","照片2"]}}" | |
16 | +// @Success 200 {object} tools.ResponseSeccess "Name名称;Describe介绍;OpenHours营业时间;Picture最上面图片;ShopAdPicture商城列表页图片;ItemScenicPicture项目场次照片;ActivityPicture活动照片;VideoList视频" | |
17 | 17 | // @Failure 500 {object} tools.ResponseError "{"errcode":1,"errmsg":"错误原因"}" |
18 | 18 | // @Router /ScenicInfo? [get] |
19 | 19 | func ScenicInfo(c *gin.Context) { |
... | ... | @@ -52,7 +52,7 @@ func ScenicInfo(c *gin.Context) { |
52 | 52 | // @Accept json |
53 | 53 | // @Produce json |
54 | 54 | // @Param id 5dfb03070a9ac17ac7a82054 string true "景区id" |
55 | -// @Success 200 {object} tools.ResponseSeccess "{"errcode":0,"result":{"Name":"名称","Describe":"介绍","OpenHours":"开放时间","Mobile":"电话","Address":"地址","SLocation":{"Latitude":0,"Longitude":0},"Picture":["照片1","照片2"]}}" | |
55 | +// @Success 200 {object} tools.ResponseSeccess "Name名称;Describe介绍;OpenHours营业时间;Picture最上面图片;ShopAdPicture商城列表页图片;ItemScenicPicture项目场次照片;ActivityPicture活动照片;VideoList视频" | |
56 | 56 | // @Failure 500 {object} tools.ResponseError "{"errcode":1,"errmsg":"错误原因"}" |
57 | 57 | // @Router /UpdateScenic? [post] |
58 | 58 | func UpdateScenic(c *gin.Context) { |
... | ... | @@ -65,6 +65,18 @@ func UpdateScenic(c *gin.Context) { |
65 | 65 | var Picture []string |
66 | 66 | json.Unmarshal([]byte(c.PostForm("Picture")), &Picture) |
67 | 67 | |
68 | + var ShopAdPicture []string | |
69 | + json.Unmarshal([]byte(c.PostForm("ShopAdPicture")), &ShopAdPicture) | |
70 | + | |
71 | + var ItemScenicPicture []string | |
72 | + json.Unmarshal([]byte(c.PostForm("ItemScenicPicture")), &ItemScenicPicture) | |
73 | + | |
74 | + var ActivityPicture []string | |
75 | + json.Unmarshal([]byte(c.PostForm("ActivityPicture")), &ActivityPicture) | |
76 | + | |
77 | + var VideoList []string | |
78 | + json.Unmarshal([]byte(c.PostForm("VideoList")), &VideoList) | |
79 | + | |
68 | 80 | var id bson.ObjectId |
69 | 81 | if pid := c.PostForm("id"); pid == "null" { |
70 | 82 | id = bson.NewObjectId() |
... | ... | @@ -75,13 +87,17 @@ func UpdateScenic(c *gin.Context) { |
75 | 87 | DB.CScenic.UpsertId( |
76 | 88 | id, |
77 | 89 | bson.M{"$set": bson.M{ |
78 | - "Name": c.PostForm("Name"), | |
79 | - "Describe": c.PostForm("Describe"), | |
80 | - "Location": Location, | |
81 | - "OpenHours": c.PostForm("OpenHours"), | |
82 | - "Mobile": c.PostForm("Mobile"), | |
83 | - "Address": c.PostForm("Address"), | |
84 | - "Picture": Picture, | |
90 | + "Name": c.PostForm("Name"), | |
91 | + "Describe": c.PostForm("Describe"), | |
92 | + "Location": Location, | |
93 | + "OpenHours": c.PostForm("OpenHours"), | |
94 | + "Mobile": c.PostForm("Mobile"), | |
95 | + "Address": c.PostForm("Address"), | |
96 | + "Picture": Picture, | |
97 | + "ShopAdPicture": ShopAdPicture, | |
98 | + "ItemScenicPicture": ItemScenicPicture, | |
99 | + "ActivityPicture": ActivityPicture, | |
100 | + "VideoList": VideoList, | |
85 | 101 | }}, |
86 | 102 | ) |
87 | 103 | ... | ... |
DB/db.go
... | ... | @@ -44,7 +44,7 @@ type SCommodity struct { |
44 | 44 | ShopName string `bson:"ShopName" json:"ShopName"` |
45 | 45 | Location SLocation `bson:"Location" json:"Location"` |
46 | 46 | KvPhoto string `bson:"KvPhoto" json:"KvPhoto"` |
47 | - TopPhoto []string `bson:"TopPhoto" json:"TopPhoto"` | |
47 | + TopPhoto []string `bson:"TopPhoto" json:"TopPhoto"` | |
48 | 48 | Images []string `bson:"Images" json:"Images"` |
49 | 49 | } |
50 | 50 | type SLine struct { |
... | ... | @@ -82,12 +82,16 @@ type STag struct { |
82 | 82 | Name string `bson:"Name" json:"Name"` |
83 | 83 | } |
84 | 84 | type SScenic struct { |
85 | - Id *bson.ObjectId `bson:"_id" json:"Id" valid:"required"` | |
86 | - Name string `bson:"Name" json:"Name"` | |
87 | - Describe string `bson:"Describe" json:"Describe"` | |
88 | - OpenHours string `bson:"OpenHours" json:"OpenHours"` | |
89 | - Mobile string `bson:"Mobile" json:"Mobile"` | |
90 | - Address string `bson:"Address" json:"Address"` | |
91 | - Location SLocation `bson:"Location" json:"Location"` | |
92 | - Picture []string `bson:"Picture" json:"Picture"` | |
85 | + Id *bson.ObjectId `bson:"_id" json:"Id" valid:"required"` | |
86 | + Name string `bson:"Name" json:"Name"` | |
87 | + Describe string `bson:"Describe" json:"Describe"` | |
88 | + OpenHours string `bson:"OpenHours" json:"OpenHours"` | |
89 | + Mobile string `bson:"Mobile" json:"Mobile"` | |
90 | + Address string `bson:"Address" json:"Address"` | |
91 | + Location SLocation `bson:"Location" json:"Location"` | |
92 | + Picture []string `bson:"Picture" json:"Picture"` | |
93 | + ShopAdPicture []string `bson:"ShopAdPicture" json:"ShopAdPicture"` | |
94 | + ItemScenicPicture []string `bson:"ItemScenicPicture" json:"ItemScenicPicture"` | |
95 | + ActivityPicture []string `bson:"ActivityPicture" json:"ActivityPicture"` | |
96 | + VideoList []string `bson:"VideoList" json:"VideoList"` | |
93 | 97 | } | ... | ... |
README.md
... | ... | @@ -7,8 +7,6 @@ |
7 | 7 | |
8 | 8 | |
9 | 9 | |
10 | - | |
11 | - | |
12 | 10 | ### API List |
13 | 11 | 1. [查询所有商品](#查询所有商品) |
14 | 12 | 1. [查询所有游玩项目](#查询所有游玩项目) |
... | ... | @@ -239,7 +237,7 @@ |
239 | 237 | |
240 | 238 | | Code | Type | Model | Message | |
241 | 239 | |-----|-----|-----|-----| |
242 | -| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | {"errcode":0,"result":{"Name":"名称","Describe":"介绍","OpenHours":"开放时间","Mobile":"电话","Address":"地址","SLocation":{"Latitude":0,"Longitude":0},"Picture":["照片1","照片2"]}} | | |
240 | +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | Name名称;Describe介绍;OpenHours营业时间;Picture最上面图片;ShopAdPicture商城列表页图片;ItemScenicPicture项目场次照片;ActivityPicture活动照片;VideoList视频 | | |
243 | 241 | | 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | |
244 | 242 | |
245 | 243 | |
... | ... | @@ -333,7 +331,7 @@ |
333 | 331 | |
334 | 332 | | Code | Type | Model | Message | |
335 | 333 | |-----|-----|-----|-----| |
336 | -| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | {"errcode":0,"result":{"Name":"名称","Describe":"介绍","OpenHours":"开放时间","Mobile":"电话","Address":"地址","SLocation":{"Latitude":0,"Longitude":0},"Picture":["照片1","照片2"]}} | | |
334 | +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | Name名称;Describe介绍;OpenHours营业时间;Picture最上面图片;ShopAdPicture商城列表页图片;ItemScenicPicture项目场次照片;ActivityPicture活动照片;VideoList视频 | | |
337 | 335 | | 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | |
338 | 336 | |
339 | 337 | ... | ... |