Commit 483ade81417c32153bce17ceed964e30252d6448
1 parent
9d7c3c88
Exists in
v1.2
and in
1 other branch
v1.1
Showing
18 changed files
with
490 additions
and
108 deletions
Show diff stats
... | ... | @@ -0,0 +1,34 @@ |
1 | +package Api | |
2 | + | |
3 | +import ( | |
4 | + "github.com/aarongao/tools" | |
5 | + "github.com/gin-gonic/gin" | |
6 | + "go.mongodb.org/mongo-driver/bson" | |
7 | + "letu/DB" | |
8 | +) | |
9 | + | |
10 | +// @Title 数据统计 | |
11 | +// @Description 数据统计 | |
12 | +// @Accept json | |
13 | +// @Produce json | |
14 | +// @Param ScenicId wgergejfwe string true "景区id" | |
15 | +// @Param StartTime 1 int false "时间戳" | |
16 | +// @Param StopTime 1 int false "时间戳" | |
17 | +// @Success 200 {object} tools.ResponseSeccess "userTotal=用户总数registerTotal=注册用户总数nonRegisterTotal非注册用户总数" | |
18 | +// @Failure 500 {object} tools.ResponseError "{"errcode":1,"errmsg":"错误原因"}" | |
19 | +// @Router /Analysls/Count? [get] | |
20 | +func Analysls(c *gin.Context) { | |
21 | + c.Header("Access-Control-Allow-Origin", c.Request.Header.Get("Origin")) | |
22 | + c.Header("Access-Control-Allow-Credentials", "true") | |
23 | + | |
24 | + _map := make(map[string]int64) | |
25 | + _map["registerTotal"], _ = DB.CMember.CountDocuments(tools.GetContext(), bson.M{}) | |
26 | + _map["userTotal"], _ = DB.CDevice.CountDocuments(tools.GetContext(), bson.M{}) | |
27 | + _map["nonRegisterTotal"] = _map["userTotal"] - _map["registerTotal"] | |
28 | + | |
29 | + | |
30 | + c.JSON(200, tools.ResponseSeccess{ | |
31 | + 0, | |
32 | + _map, | |
33 | + }) | |
34 | +} | ... | ... |
API/Complaint.go
... | ... | @@ -5,8 +5,10 @@ import ( |
5 | 5 | "github.com/aarongao/tools" |
6 | 6 | "github.com/gin-gonic/gin" |
7 | 7 | "go.mongodb.org/mongo-driver/bson" |
8 | + "go.mongodb.org/mongo-driver/bson/primitive" | |
8 | 9 | "go.mongodb.org/mongo-driver/mongo/options" |
9 | 10 | "letu/DB" |
11 | + "letu/Lib/Auth" | |
10 | 12 | "math" |
11 | 13 | "regexp" |
12 | 14 | "strconv" |
... | ... | @@ -64,8 +66,9 @@ func CreateComplaint(c *gin.Context) { |
64 | 66 | var images []string |
65 | 67 | |
66 | 68 | json.Unmarshal([]byte(c.PostForm("Image")), &images) |
67 | - | |
69 | + objectID := primitive.NewObjectID() | |
68 | 70 | DB.CComplaint.InsertOne(tools.GetContext(), DB.SComplaint{ |
71 | + &objectID, | |
69 | 72 | c.PostForm("Type"), |
70 | 73 | c.PostForm("ScenicId"), |
71 | 74 | c.PostForm("Mobile"), |
... | ... | @@ -97,12 +100,12 @@ func AllComplaint(c *gin.Context) { |
97 | 100 | c.Header("Access-Control-Allow-Origin", c.Request.Header.Get("Origin")) |
98 | 101 | c.Header("Access-Control-Allow-Credentials", "true") |
99 | 102 | |
100 | - total, _ := DB.CComplaint.CountDocuments(tools.GetContext(), bson.M{}) | |
101 | - limit, _ := strconv.ParseInt(c.Query("Limit"),10,64) | |
103 | + total, _ := DB.CComplaint.CountDocuments(tools.GetContext(), bson.M{"ScenicId": c.Query("ScenicId")}) | |
104 | + limit, _ := strconv.ParseInt(c.Query("Limit"), 10, 64) | |
102 | 105 | if limit == 0 { |
103 | 106 | limit = 50 |
104 | 107 | } |
105 | - currPage, _ := strconv.ParseInt(c.Query("Page"),10,64) | |
108 | + currPage, _ := strconv.ParseInt(c.Query("Page"), 10, 64) | |
106 | 109 | if currPage == 0 { |
107 | 110 | currPage = 1 |
108 | 111 | } |
... | ... | @@ -110,13 +113,13 @@ func AllComplaint(c *gin.Context) { |
110 | 113 | |
111 | 114 | var aComplaint = []bson.M{} |
112 | 115 | |
113 | - cur, err := DB.CComplaint.Find(tools.GetContext(), bson.M{"ScenicId":c.Query("ScenicId")}, &options.FindOptions{Limit: &limit, Skip: &skip, Sort: bson.M{"_id": -1}}) | |
116 | + cur, err := DB.CComplaint.Find(tools.GetContext(), bson.M{"ScenicId": c.Query("ScenicId")}, &options.FindOptions{Limit: &limit, Skip: &skip, Sort: bson.M{"_id": -1}}) | |
114 | 117 | defer cur.Close(tools.GetContext()) |
115 | 118 | if err == nil { |
116 | 119 | for cur.Next(tools.GetContext()) { |
117 | 120 | var e bson.M |
118 | 121 | cur.Decode(&e) |
119 | - aComplaint = append(aComplaint,e) | |
122 | + aComplaint = append(aComplaint, e) | |
120 | 123 | } |
121 | 124 | } |
122 | 125 | |
... | ... | @@ -130,3 +133,43 @@ func AllComplaint(c *gin.Context) { |
130 | 133 | }) |
131 | 134 | |
132 | 135 | } |
136 | + | |
137 | +// @Title 处理投诉 | |
138 | +// @Description 处理投诉 | |
139 | +// @Accept json | |
140 | +// @Produce json | |
141 | +// @Param id 5dfb03070a9ac17ac7a82054 string true "投诉id" | |
142 | +// @Param ScenicId wgergejfwe string true "景区id" | |
143 | +// @Param Token wgergejfwe string true "用户token" | |
144 | +// @Success 200 {object} tools.ResponseSeccess "{"errcode":0,"result":"ok"}" | |
145 | +// @Failure 500 {object} tools.ResponseError "{"errcode":1,"errmsg":"错误原因"}" | |
146 | +// @Router /HandleComplaint? [post] | |
147 | +func HandleComplaint(c *gin.Context) { | |
148 | + c.Header("Access-Control-Allow-Origin", c.Request.Header.Get("Origin")) | |
149 | + c.Header("Access-Control-Allow-Credentials", "true") | |
150 | + | |
151 | + _user, _ := c.Get("UserInfo") | |
152 | + user := _user.(*DB.SMember) | |
153 | + | |
154 | + err := Auth.CheckScenicAuth(c.PostForm("ScenicId"), user) | |
155 | + if err != nil { | |
156 | + c.JSON(200, tools.ResponseError{ | |
157 | + 401, | |
158 | + "没有权限", | |
159 | + }) | |
160 | + return | |
161 | + } | |
162 | + objectID, _ := primitive.ObjectIDFromHex(c.PostForm("id")) | |
163 | + _, err = DB.CComplaint.UpdateOne(tools.GetContext(), | |
164 | + bson.M{"_id": objectID}, | |
165 | + bson.M{"$set": bson.M{ | |
166 | + "State": "已处理", | |
167 | + }}, | |
168 | + ) | |
169 | + | |
170 | + c.JSON(200, tools.ResponseSeccess{ | |
171 | + 0, | |
172 | + "ok", | |
173 | + }) | |
174 | + | |
175 | +} | ... | ... |
API/Operator.go
API/Scenic.go
... | ... | @@ -9,6 +9,7 @@ import ( |
9 | 9 | "go.mongodb.org/mongo-driver/mongo/options" |
10 | 10 | "letu/DB" |
11 | 11 | "letu/Lib/Auth" |
12 | + "strconv" | |
12 | 13 | ) |
13 | 14 | |
14 | 15 | // @Title 返回景区基础信息 |
... | ... | @@ -16,7 +17,7 @@ import ( |
16 | 17 | // @Accept json |
17 | 18 | // @Produce json |
18 | 19 | // @Param id 5dfb03070a9ac17ac7a82054 string true "景区id" |
19 | -// @Success 200 {object} tools.ResponseSeccess "Name名称;Describe介绍;OpenHours营业时间;Picture最上面图片;ShopAdPicture商城列表页图片;ItemScenicPicture项目场次照片;ActivityPicture活动照片;VideoList视频(VideoPicture=首桢图片);InvestigationUrl问券调查的url;RangeLocation景区范围(多个坐标点)" | |
20 | +// @Success 200 {object} tools.ResponseSeccess "Name名称;Describe介绍;OpenHours营业时间;Picture最上面图片;ShopAdPicture商城列表页图片;ItemScenicPicture项目场次照片;ActivityPicture活动照片;VideoList视频(VideoPicture=首桢图片);InvestigationUrl问券调查的url;RangeLocation景区范围(多个坐标点)ZoomForIOS地图的缩放大小(IOS);ZoomForAndroidMin地图的缩放大小(Android最小);ZoomForAndroidMax地图的缩放大小(Android最大);Rotation旋转角度;OpenTiles否开启地图切片;ColorTiles切片底色(#FFFFFF)" | |
20 | 21 | // @Failure 500 {object} tools.ResponseError "{"errcode":1,"errmsg":"错误原因"}" |
21 | 22 | // @Router /ScenicInfo? [get] |
22 | 23 | func ScenicInfo(c *gin.Context) { |
... | ... | @@ -32,7 +33,7 @@ func ScenicInfo(c *gin.Context) { |
32 | 33 | } |
33 | 34 | |
34 | 35 | var Scenic *DB.SScenic |
35 | - objID,_ := primitive.ObjectIDFromHex(c.Query("id")) | |
36 | + objID, _ := primitive.ObjectIDFromHex(c.Query("id")) | |
36 | 37 | DB.CScenic.FindOne(tools.GetContext(), bson.M{"_id": objID}).Decode(&Scenic) |
37 | 38 | |
38 | 39 | c.JSON(200, tools.ResponseSeccess{ |
... | ... | @@ -48,7 +49,7 @@ func ScenicInfo(c *gin.Context) { |
48 | 49 | // @Produce json |
49 | 50 | // @Param id 5dfb03070a9ac17ac7a82054 string true "景区id" |
50 | 51 | // @Param Token wgergejfwe string true "用户token" |
51 | -// @Success 200 {object} tools.ResponseSeccess "Name名称;Describe介绍;OpenHours营业时间;Picture最上面图片;ShopAdPicture商城列表页图片;ItemScenicPicture项目场次照片;ActivityPicture活动照片;VideoList视频(VideoPicture=首桢图片);InvestigationUrl问券调查的url;RangeLocation景区范围(多个坐标点)" | |
52 | +// @Success 200 {object} tools.ResponseSeccess "Name名称;Describe介绍;OpenHours营业时间;Picture最上面图片;ShopAdPicture商城列表页图片;ItemScenicPicture项目场次照片;ActivityPicture活动照片;VideoList视频(VideoPicture=首桢图片);InvestigationUrl问券调查的url;" | |
52 | 53 | // @Failure 500 {object} tools.ResponseError "{"errcode":1,"errmsg":"错误原因"}" |
53 | 54 | // @Router /UpdateScenic? [post] |
54 | 55 | func UpdateScenic(c *gin.Context) { |
... | ... | @@ -57,6 +58,7 @@ func UpdateScenic(c *gin.Context) { |
57 | 58 | |
58 | 59 | _user, _ := c.Get("UserInfo") |
59 | 60 | user := _user.(*DB.SMember) |
61 | + | |
60 | 62 | err := Auth.CheckScenicAuth(c.PostForm("id"), user) |
61 | 63 | if err != nil { |
62 | 64 | c.JSON(200, tools.ResponseError{ |
... | ... | @@ -66,13 +68,6 @@ func UpdateScenic(c *gin.Context) { |
66 | 68 | return |
67 | 69 | } |
68 | 70 | |
69 | - | |
70 | - var Location DB.SLocation | |
71 | - json.Unmarshal([]byte(c.PostForm("Location")), &Location) | |
72 | - | |
73 | - var RangeLocation []DB.SLocation | |
74 | - json.Unmarshal([]byte(c.PostForm("RangeLocation")), &RangeLocation) | |
75 | - | |
76 | 71 | var Picture []DB.SPicture |
77 | 72 | json.Unmarshal([]byte(c.PostForm("Picture")), &Picture) |
78 | 73 | |
... | ... | @@ -90,22 +85,27 @@ func UpdateScenic(c *gin.Context) { |
90 | 85 | |
91 | 86 | var id primitive.ObjectID |
92 | 87 | if pid := c.PostForm("id"); pid == "null" { |
88 | + | |
89 | + if user.UserType != "root" { | |
90 | + c.JSON(200, tools.ResponseError{ | |
91 | + 401, | |
92 | + "没有权限", | |
93 | + }) | |
94 | + return | |
95 | + } | |
93 | 96 | id = primitive.NewObjectID() |
94 | 97 | // 新景区,初始化 |
95 | 98 | initScenic(id.Hex()) |
96 | 99 | } else { |
97 | - id,_ = primitive.ObjectIDFromHex(pid) | |
100 | + id, _ = primitive.ObjectIDFromHex(pid) | |
98 | 101 | } |
99 | 102 | |
100 | - | |
101 | 103 | upsert := true |
102 | 104 | DB.CScenic.FindOneAndUpdate(tools.GetContext(), |
103 | 105 | bson.M{"_id": id}, |
104 | 106 | bson.M{"$set": bson.M{ |
105 | 107 | "Name": c.PostForm("Name"), |
106 | 108 | "Describe": c.PostForm("Describe"), |
107 | - "Location": Location, | |
108 | - "RangeLocation": RangeLocation, | |
109 | 109 | "OpenHours": c.PostForm("OpenHours"), |
110 | 110 | "Mobile": c.PostForm("Mobile"), |
111 | 111 | "Address": c.PostForm("Address"), |
... | ... | @@ -124,39 +124,205 @@ func UpdateScenic(c *gin.Context) { |
124 | 124 | 0, |
125 | 125 | "ok", |
126 | 126 | }) |
127 | +} | |
128 | + | |
129 | +// @Title 更新景区基础信息-高级 | |
130 | +// @Description 更新景区基础信息-高级 | |
131 | +// @Accept json | |
132 | +// @Produce json | |
133 | +// @Param id 5dfb03070a9ac17ac7a82054 string true "景区id" | |
134 | +// @Param Token wgergejfwe string true "用户token" | |
135 | +// @Success 200 {object} tools.ResponseSeccess "RangeLocation景区范围(多个坐标点)ZoomForIOS地图的缩放大小(IOS);ZoomForAndroidMin地图的缩放大小(Android最小);ZoomForAndroidMax地图的缩放大小(Android最大);Rotation旋转角度;OpenTiles否开启地图切片;ColorTiles切片底色(#FFFFFF)" | |
136 | +// @Failure 500 {object} tools.ResponseError "{"errcode":1,"errmsg":"错误原因"}" | |
137 | +// @Router /UpdateScenicSenior? [post] | |
138 | +func UpdateScenicSenior(c *gin.Context) { | |
139 | + c.Header("Access-Control-Allow-Origin", c.Request.Header.Get("Origin")) | |
140 | + c.Header("Access-Control-Allow-Credentials", "true") | |
141 | + | |
142 | + _user, _ := c.Get("UserInfo") | |
143 | + user := _user.(*DB.SMember) | |
144 | + | |
145 | + err := Auth.CheckScenicAuth(c.PostForm("id"), user) | |
146 | + if err != nil { | |
147 | + c.JSON(200, tools.ResponseError{ | |
148 | + 401, | |
149 | + "没有权限", | |
150 | + }) | |
151 | + return | |
152 | + } | |
153 | + | |
154 | + var Location DB.SLocation | |
155 | + json.Unmarshal([]byte(c.PostForm("Location")), &Location) | |
156 | + | |
157 | + var RangeLocation []DB.SLocation | |
158 | + json.Unmarshal([]byte(c.PostForm("RangeLocation")), &RangeLocation) | |
159 | + | |
160 | + var ZoomForIOS DB.SRange | |
161 | + json.Unmarshal([]byte(c.PostForm("ZoomForIOS")), &ZoomForIOS) | |
162 | + | |
163 | + var ZoomForAndroidMin []DB.SLocation | |
164 | + json.Unmarshal([]byte(c.PostForm("ZoomForAndroidMin")), &ZoomForAndroidMin) | |
165 | + | |
166 | + var ZoomForAndroidMax []DB.SLocation | |
167 | + json.Unmarshal([]byte(c.PostForm("ZoomForAndroidMax")), &ZoomForAndroidMax) | |
168 | + | |
169 | + var id primitive.ObjectID | |
170 | + if pid := c.PostForm("id"); pid == "null" { | |
171 | + | |
172 | + if user.UserType != "root" { | |
173 | + c.JSON(200, tools.ResponseError{ | |
174 | + 401, | |
175 | + "没有权限", | |
176 | + }) | |
177 | + return | |
178 | + } | |
179 | + id = primitive.NewObjectID() | |
180 | + // 新景区,初始化 | |
181 | + initScenic(id.Hex()) | |
182 | + } else { | |
183 | + id, _ = primitive.ObjectIDFromHex(pid) | |
184 | + } | |
185 | + | |
186 | + Rotation, err := strconv.ParseFloat(c.PostForm("Rotation"), 64) | |
187 | + OpenTiles, err := strconv.ParseBool(c.PostForm("OpenTiles")) | |
188 | + Display, _ := strconv.ParseBool(c.PostForm("Display")) | |
189 | + upsert := true | |
190 | + DB.CScenic.FindOneAndUpdate(tools.GetContext(), | |
191 | + bson.M{"_id": id}, | |
192 | + bson.M{"$set": bson.M{ | |
193 | + "Location": Location, | |
194 | + "RangeLocation": RangeLocation, | |
195 | + "ZoomForIOS": ZoomForIOS, | |
196 | + "ZoomForAndroidMin": ZoomForAndroidMin, | |
197 | + "ZoomForAndroidMax": ZoomForAndroidMax, | |
198 | + "Rotation": Rotation, | |
199 | + "OpenTiles": OpenTiles, | |
200 | + "ColorTiles": c.PostForm("ColorTiles"), | |
201 | + "Display": Display, | |
202 | + "Remove": false, | |
203 | + }}, &options.FindOneAndUpdateOptions{ | |
204 | + Upsert: &upsert, | |
205 | + }, | |
206 | + ) | |
127 | 207 | |
208 | + c.JSON(200, tools.ResponseSeccess{ | |
209 | + 0, | |
210 | + "ok", | |
211 | + }) | |
128 | 212 | } |
129 | 213 | |
130 | 214 | func initScenic(id string) { |
131 | 215 | |
132 | 216 | var dba []interface{} |
133 | - dba = append(dba,DB.STag{ | |
217 | + dba = append(dba, DB.STag{ | |
134 | 218 | id, |
135 | 219 | "type", |
136 | 220 | "服务设施", |
137 | 221 | }) |
138 | - dba = append(dba,DB.STag{ | |
222 | + dba = append(dba, DB.STag{ | |
139 | 223 | id, |
140 | 224 | "type", |
141 | - "游乐设施", | |
225 | + "普通", | |
142 | 226 | }) |
143 | - dba = append(dba,DB.STag{ | |
227 | + dba = append(dba, DB.STag{ | |
144 | 228 | id, |
145 | 229 | "type", |
146 | - "餐饮", | |
230 | + "演出", | |
147 | 231 | }) |
148 | - dba = append(dba,DB.STag{ | |
232 | + dba = append(dba, DB.STag{ | |
149 | 233 | id, |
150 | 234 | "type", |
151 | 235 | "购物", |
152 | 236 | }) |
153 | - DB.CTags.InsertMany(tools.GetContext(),dba[1:]) | |
237 | + dba = append(dba, DB.STag{ | |
238 | + id, | |
239 | + "type", | |
240 | + "餐饮", | |
241 | + }) | |
242 | + dba = append(dba, DB.STag{ | |
243 | + id, | |
244 | + "type", | |
245 | + "游乐设施", | |
246 | + }) | |
247 | + | |
248 | + dba = append(dba, DB.STag{ | |
249 | + id, | |
250 | + "age", | |
251 | + "儿童", | |
252 | + }) | |
253 | + dba = append(dba, DB.STag{ | |
254 | + id, | |
255 | + "age", | |
256 | + "成人", | |
257 | + }) | |
258 | + dba = append(dba, DB.STag{ | |
259 | + id, | |
260 | + "age", | |
261 | + "青少年", | |
262 | + }) | |
263 | + | |
264 | + dba = append(dba, DB.STag{ | |
265 | + id, | |
266 | + "food", | |
267 | + "海鲜", | |
268 | + }) | |
269 | + dba = append(dba, DB.STag{ | |
270 | + id, | |
271 | + "food", | |
272 | + "团餐", | |
273 | + }) | |
274 | + dba = append(dba, DB.STag{ | |
275 | + id, | |
276 | + "food", | |
277 | + "烧烤", | |
278 | + }) | |
279 | + dba = append(dba, DB.STag{ | |
280 | + id, | |
281 | + "food", | |
282 | + "小吃", | |
283 | + }) | |
284 | + | |
285 | + dba = append(dba, DB.STag{ | |
286 | + id, | |
287 | + "recommend", | |
288 | + "必玩", | |
289 | + }) | |
290 | + | |
291 | + dba = append(dba, DB.STag{ | |
292 | + id, | |
293 | + "shop", | |
294 | + "纪念品", | |
295 | + }) | |
296 | + dba = append(dba, DB.STag{ | |
297 | + id, | |
298 | + "shop", | |
299 | + "收藏品", | |
300 | + }) | |
301 | + dba = append(dba, DB.STag{ | |
302 | + id, | |
303 | + "shop", | |
304 | + "玩具", | |
305 | + }) | |
306 | + | |
307 | + dba = append(dba, DB.STag{ | |
308 | + id, | |
309 | + "thrilling", | |
310 | + "刺激", | |
311 | + }) | |
312 | + dba = append(dba, DB.STag{ | |
313 | + id, | |
314 | + "thrilling", | |
315 | + "放松", | |
316 | + }) | |
317 | + | |
318 | + DB.CTags.InsertMany(tools.GetContext(), dba[1:]) | |
154 | 319 | } |
155 | 320 | |
156 | 321 | // @Title 所有景区基础信息 |
157 | 322 | // @Description 所有景区基础信息 |
158 | 323 | // @Accept json |
159 | 324 | // @Produce json |
325 | +// @Param Display true string true "true=显示隐藏数据" | |
160 | 326 | // @Success 200 {object} tools.ResponseSeccess "" |
161 | 327 | // @Failure 500 {object} tools.ResponseError "{"errcode":1,"errmsg":"错误原因"}" |
162 | 328 | // @Router /AllScenic? [get] |
... | ... | @@ -164,14 +330,19 @@ func AllScenic(c *gin.Context) { |
164 | 330 | c.Header("Access-Control-Allow-Origin", c.Request.Header.Get("Origin")) |
165 | 331 | c.Header("Access-Control-Allow-Credentials", "true") |
166 | 332 | |
333 | + _select := bson.M{"Display": true} | |
334 | + if c.Query("Display") == "all"{ | |
335 | + _select = bson.M{} | |
336 | + } | |
337 | + | |
167 | 338 | var Scenic []DB.SScenic |
168 | - cur, err := DB.CScenic.Find(tools.GetContext(), bson.M{}) | |
339 | + cur, err := DB.CScenic.Find(tools.GetContext(), _select) | |
169 | 340 | defer cur.Close(tools.GetContext()) |
170 | 341 | if err == nil { |
171 | 342 | for cur.Next(tools.GetContext()) { |
172 | 343 | var e DB.SScenic |
173 | 344 | cur.Decode(&e) |
174 | - Scenic = append(Scenic,e) | |
345 | + Scenic = append(Scenic, e) | |
175 | 346 | } |
176 | 347 | } |
177 | 348 | ... | ... |
API/Shop.go
... | ... | @@ -54,7 +54,7 @@ func AllCommodity(c *gin.Context) { |
54 | 54 | c.Header("Access-Control-Allow-Origin", c.Request.Header.Get("Origin")) |
55 | 55 | c.Header("Access-Control-Allow-Credentials", "true") |
56 | 56 | |
57 | - var aCommoditys []DB.SCommodity | |
57 | + var aCommoditys = []DB.SCommodity{} | |
58 | 58 | cur, err := DB.CCommodity.Find(tools.GetContext(), bson.M{"ScenicId": c.Query("ScenicId")}) |
59 | 59 | defer cur.Close(tools.GetContext()) |
60 | 60 | if err == nil { | ... | ... |
API/SystemInfo.go
... | ... | @@ -19,9 +19,13 @@ func SystemInfo(c *gin.Context) { |
19 | 19 | c.Header("Access-Control-Allow-Credentials", "true") |
20 | 20 | |
21 | 21 | info := make(map[string]interface{}) |
22 | - info["Version"] = Config.Info.Version | |
22 | + info["ApiVersion"] = Config.Info.ApiVersion | |
23 | + | |
23 | 24 | info["SupportVersion"] = Config.Info.SupportVersion |
24 | 25 | |
26 | + //SupportVersion := DB.Redis.Get("SupportVersion") | |
27 | + //info["SupportVersion"] = SupportVersion | |
28 | + | |
25 | 29 | UpdateLocationInterval := DB.Redis.Get("UpdateLocationInterval") |
26 | 30 | info["UpdateLocationInterval"] = UpdateLocationInterval |
27 | 31 | |
... | ... | @@ -30,4 +34,4 @@ func SystemInfo(c *gin.Context) { |
30 | 34 | info, |
31 | 35 | }) |
32 | 36 | |
33 | 37 | -} |
38 | +} | |
34 | 39 | \ No newline at end of file | ... | ... |
API/TopMenus.go
... | ... | @@ -9,6 +9,7 @@ import ( |
9 | 9 | "go.mongodb.org/mongo-driver/mongo/options" |
10 | 10 | "letu/DB" |
11 | 11 | "letu/Lib/Auth" |
12 | + "strconv" | |
12 | 13 | ) |
13 | 14 | |
14 | 15 | // @Title 查询所有菜单 |
... | ... | @@ -25,13 +26,13 @@ func AllTopMenus(c *gin.Context) { |
25 | 26 | c.Header("Access-Control-Allow-Credentials", "true") |
26 | 27 | |
27 | 28 | var STopMenus []DB.STopMenus |
28 | - cur, err := DB.CTopMenus.Find(tools.GetContext(), bson.M{"ScenicId": c.Query("ScenicId")}) | |
29 | + cur, err := DB.CTopMenus.Find(tools.GetContext(), bson.M{"ScenicId": c.Query("ScenicId")}, &options.FindOptions{Sort: bson.M{"Order": 1}}) | |
29 | 30 | defer cur.Close(tools.GetContext()) |
30 | 31 | if err == nil { |
31 | 32 | for cur.Next(tools.GetContext()) { |
32 | 33 | var e DB.STopMenus |
33 | 34 | cur.Decode(&e) |
34 | - STopMenus = append(STopMenus,e) | |
35 | + STopMenus = append(STopMenus, e) | |
35 | 36 | } |
36 | 37 | } |
37 | 38 | |
... | ... | @@ -59,7 +60,6 @@ func UpdateTopMenus(c *gin.Context) { |
59 | 60 | c.Header("Access-Control-Allow-Origin", c.Request.Header.Get("Origin")) |
60 | 61 | c.Header("Access-Control-Allow-Credentials", "true") |
61 | 62 | |
62 | - | |
63 | 63 | _user, _ := c.Get("UserInfo") |
64 | 64 | user := _user.(*DB.SMember) |
65 | 65 | err := Auth.CheckScenicAuth(c.PostForm("ScenicId"), user) |
... | ... | @@ -86,15 +86,17 @@ func UpdateTopMenus(c *gin.Context) { |
86 | 86 | if pid := c.PostForm("id"); pid == "null" { |
87 | 87 | id = primitive.NewObjectID() |
88 | 88 | } else { |
89 | - id,_ = primitive.ObjectIDFromHex(pid) | |
89 | + id, _ = primitive.ObjectIDFromHex(pid) | |
90 | 90 | } |
91 | 91 | |
92 | + Order, err := strconv.ParseFloat(c.PostForm("Order"), 64) | |
92 | 93 | upsert := true |
93 | 94 | DB.CTopMenus.FindOneAndUpdate(tools.GetContext(), |
94 | 95 | bson.M{"_id": id}, |
95 | 96 | bson.M{"$set": bson.M{ |
96 | 97 | "ScenicId": c.PostForm("ScenicId"), |
97 | - "Name": c.PostForm("Name"), | |
98 | + "Name": c.PostForm("Name"), | |
99 | + "Order": Order, | |
98 | 100 | "Tags": Tags, |
99 | 101 | }}, &options.FindOneAndUpdateOptions{ |
100 | 102 | Upsert: &upsert, |
... | ... | @@ -151,4 +153,4 @@ func RemoveTopMenus(c *gin.Context) { |
151 | 153 | "ok", |
152 | 154 | }) |
153 | 155 | |
154 | -} | |
155 | 156 | \ No newline at end of file |
157 | +} | ... | ... |
API/User.go
... | ... | @@ -79,8 +79,10 @@ func LoginUser(c *gin.Context) { |
79 | 79 | c.Request.Header.Get("AppVersion"), |
80 | 80 | c.Request.Header.Get("AppVersion"), |
81 | 81 | c.Request.Header.Get("DeviceToken"), |
82 | + time.Now().Unix(), | |
82 | 83 | }, |
83 | - Auth: auth, | |
84 | + Auth: auth, | |
85 | + CreateTime: time.Now().Unix(), | |
84 | 86 | } |
85 | 87 | _, err := DB.CMember.InsertOne(tools.GetContext(), User) |
86 | 88 | if err != nil { |
... | ... | @@ -350,7 +352,6 @@ func RemoveUser(c *gin.Context) { |
350 | 352 | c.Header("Access-Control-Allow-Origin", c.Request.Header.Get("Origin")) |
351 | 353 | c.Header("Access-Control-Allow-Credentials", "true") |
352 | 354 | |
353 | - | |
354 | 355 | _user, _ := c.Get("UserInfo") |
355 | 356 | user := _user.(*DB.SMember) |
356 | 357 | ... | ... |
API/UserLog.go
Bin/Monitor.go
... | ... | @@ -4,6 +4,7 @@ import ( |
4 | 4 | "encoding/json" |
5 | 5 | "github.com/aarongao/tools" |
6 | 6 | "github.com/aliyun/alibaba-cloud-sdk-go/services/dysmsapi" |
7 | + "github.com/davecgh/go-spew/spew" | |
7 | 8 | "time" |
8 | 9 | ) |
9 | 10 | |
... | ... | @@ -12,7 +13,7 @@ var lastState = 0 |
12 | 13 | func main() { |
13 | 14 | |
14 | 15 | for { |
15 | - time.Sleep(180 * time.Second) | |
16 | + time.Sleep(600 * time.Second) | |
16 | 17 | httpState, body, error := tools.GET("http://leyoutu.st-i.com.cn/AllScenic") |
17 | 18 | if httpState == 200 && error == nil { |
18 | 19 | |
... | ... | @@ -22,11 +23,16 @@ func main() { |
22 | 23 | rlen := len(oBody.Result.([]interface{})) |
23 | 24 | if oBody.ErrCode != 0 || rlen == 0 { |
24 | 25 | sms(1) |
26 | + | |
27 | + println("ERROR---------------------1:",rlen) | |
28 | + spew.Dump(oBody) | |
25 | 29 | } else { |
26 | 30 | sms(2) |
27 | 31 | } |
28 | 32 | } else { |
29 | 33 | |
34 | + println("ERROR---------------------2:",httpState) | |
35 | + spew.Dump(error) | |
30 | 36 | sms(1) |
31 | 37 | } |
32 | 38 | |
... | ... | @@ -34,6 +40,7 @@ func main() { |
34 | 40 | |
35 | 41 | } |
36 | 42 | |
43 | + | |
37 | 44 | func sms(state int) { |
38 | 45 | |
39 | 46 | stateString := "" | ... | ... |
Config/config.go
Config/config.json
DB/db.go
... | ... | @@ -27,6 +27,31 @@ var CTopMenus *mongo.Collection //菜单 |
27 | 27 | var CSysAds *mongo.Collection //平台广告 |
28 | 28 | var DB *mongo.Database |
29 | 29 | |
30 | +type SScenic struct { | |
31 | + Id *primitive.ObjectID `bson:"_id" json:"Id" valid:"required"` | |
32 | + Name string `bson:"Name" json:"Name" valid:"required"` | |
33 | + Describe string `bson:"Describe" json:"Describe"` | |
34 | + OpenHours string `bson:"OpenHours" json:"OpenHours"` //营业时间 | |
35 | + Mobile string `bson:"Mobile" json:"Mobile"` | |
36 | + Address string `bson:"Address" json:"Address"` | |
37 | + InvestigationUrl string `bson:"InvestigationUrl" json:"InvestigationUrl"` //问券调查的url地址 | |
38 | + Location SLocation `bson:"Location" json:"Location"` | |
39 | + Picture []SPicture `bson:"Picture" json:"Picture"` | |
40 | + ShopAdPicture []SPicture `bson:"ShopAdPicture" json:"ShopAdPicture"` //商城列表页图片 | |
41 | + ItemScenicPicture []SPicture `bson:"ItemScenicPicture" json:"ItemScenicPicture"` //项目场次照片 | |
42 | + ActivityPicture []SPicture `bson:"ActivityPicture" json:"ActivityPicture"` //活动照片 | |
43 | + VideoList []SVideo `bson:"VideoList" json:"VideoList"` | |
44 | + RangeLocation []SLocation `bson:"RangeLocation" json:"RangeLocation"` //景区范围 | |
45 | + ZoomForIOS SRange `bson:"ZoomForIOS" json:"ZoomForIOS"` //地图的缩放大小(IOS) | |
46 | + ZoomForAndroidMin []SLocation `bson:"ZoomForAndroidMin" json:"ZoomForAndroidMin"` //地图的缩放大小(Android最小) | |
47 | + ZoomForAndroidMax []SLocation `bson:"ZoomForAndroidMax" json:"ZoomForAndroidMax"` //地图的缩放大小(Android最大) | |
48 | + Rotation float64 `bson:"Rotation" json:"Rotation"` //旋转角度 | |
49 | + OpenTiles bool `bson:"OpenTiles" json:"OpenTiles"` //否开启地图切片 | |
50 | + ColorTiles string `bson:"ColorTiles" json:"ColorTiles"` //切片底色(#FFFFFF) | |
51 | + Display bool `bson:"Display" json:"Display"` //是否显示 | |
52 | + Remove bool `bson:"Remove" json:"Remove"` //是否删除 | |
53 | +} | |
54 | + | |
30 | 55 | type SItem struct { |
31 | 56 | Id *primitive.ObjectID `bson:"_id" json:"Id" valid:"required"` |
32 | 57 | ScenicId string `bson:"ScenicId" json:"ScenicId"` // 景区id |
... | ... | @@ -83,19 +108,21 @@ type SLocation struct { |
83 | 108 | type STopMenus struct { |
84 | 109 | Id *primitive.ObjectID `bson:"_id" json:"Id" valid:"required"` |
85 | 110 | ScenicId string `bson:"ScenicId" json:"ScenicId" valid:"required"` |
86 | - Name string `bson:"Name" json:"Name" valid:"required"` //菜单标题 | |
87 | - Tags []string `bson:"Tags" json:"Tags" valid:"required"` //标签 | |
111 | + Name string `bson:"Name" json:"Name" valid:"required"` //菜单标题 | |
112 | + Tags []string `bson:"Tags" json:"Tags" valid:"required"` //标签 | |
113 | + Order int64 `bson:"Order" json:"Order" valid:"required"` //排序 | |
88 | 114 | } |
89 | 115 | |
90 | 116 | type SDevice struct { |
91 | 117 | DeviceId string `bson:"DeviceId" json:"DeviceId"` |
92 | 118 | Mac string `bson:"Mac" json:"Mac"` |
93 | 119 | UDID string `bson:"UDID" json:"UDID"` |
94 | - SystemType string `bson:"SystemType" json:"SystemType"` //ios,android | |
95 | - SystemVersion string `bson:"SystemVersion" json:"SystemVersion"` //系统版本 | |
96 | - SystemModel string `bson:"SystemModel" json:"SystemModel"` //机型 | |
97 | - AppVersion string `bson:"AppVersion" json:"AppVersion"` //app版本 | |
98 | - DeviceToken string `bson:"DeviceToken" json:"DeviceToken"` //用于推送的token | |
120 | + SystemType string `bson:"SystemType" json:"SystemType"` //ios,android | |
121 | + SystemVersion string `bson:"SystemVersion" json:"SystemVersion"` //系统版本 | |
122 | + SystemModel string `bson:"SystemModel" json:"SystemModel"` //机型 | |
123 | + AppVersion string `bson:"AppVersion" json:"AppVersion"` //app版本 | |
124 | + DeviceToken string `bson:"DeviceToken" json:"DeviceToken"` //用于推送的token | |
125 | + CreateTime int64 `bson:"CreateTime,omitempty" json:"CreateTime"` //创建时间 | |
99 | 126 | } |
100 | 127 | |
101 | 128 | type SUserLog struct { |
... | ... | @@ -113,14 +140,15 @@ type SUserLog struct { |
113 | 140 | } |
114 | 141 | |
115 | 142 | type SOperatorLog struct { |
116 | - ScenicId string `bson:"ScenicId" json:"ScenicId"` | |
117 | - UserId string `bson:"UserId" json:"UserId"` // 用户ID | |
118 | - UserName string `bson:"UserName" json:"UserName"` //用户名称 | |
119 | - DateTime int64 `bson:"DateTime" json:"DateTime"` //时间戳 | |
120 | - Remarks string `bson:"Remarks" json:"Remarks"` //备注 | |
121 | - Model SModel `bson:"Model" json:"Model"` | |
122 | - Api string `bson:"Api" json:"Api"` | |
123 | - Parames interface{} `bson:"Parames" json:"Parames"` | |
143 | + Id *primitive.ObjectID `bson:"_id" json:"Id" valid:"required"` | |
144 | + ScenicId string `bson:"ScenicId" json:"ScenicId"` | |
145 | + UserId string `bson:"UserId" json:"UserId"` // 用户ID | |
146 | + UserName string `bson:"UserName" json:"UserName"` //用户名称 | |
147 | + DateTime int64 `bson:"DateTime" json:"DateTime"` //时间戳 | |
148 | + Remarks string `bson:"Remarks" json:"Remarks"` //备注 | |
149 | + Model SModel `bson:"Model" json:"Model"` | |
150 | + Api string `bson:"Api" json:"Api"` | |
151 | + Parames interface{} `bson:"Parames" json:"Parames"` | |
124 | 152 | } |
125 | 153 | type SSystemLog struct { |
126 | 154 | UserId string `bson:"UserId" json:"UserId"` // 用户ID |
... | ... | @@ -156,15 +184,16 @@ type SLine struct { |
156 | 184 | } |
157 | 185 | |
158 | 186 | type SComplaint struct { |
159 | - Type string `bson:"Type" json:"Type"` | |
160 | - ScenicId string `bson:"ScenicId" json:"ScenicId"` // 景区id | |
161 | - Mobile string `bson:"Mobile" json:"Mobile"` | |
162 | - FullName string `bson:"FullName" json:"FullName"` | |
163 | - Sex string `bson:"Sex" json:"Sex"` | |
164 | - Content string `bson:"Content" json:"Content"` | |
165 | - Image []string `bson:"Image" json:"Image"` | |
166 | - State string `bson:"State" json:"State"` // 处理状态(未处理,已处理) | |
167 | - DateTime int64 `bson:"DateTime" json:"DateTime"` //时间戳 | |
187 | + Id *primitive.ObjectID `bson:"_id" json:"Id" valid:"required"` | |
188 | + Type string `bson:"Type" json:"Type"` | |
189 | + ScenicId string `bson:"ScenicId" json:"ScenicId"` // 景区id | |
190 | + Mobile string `bson:"Mobile" json:"Mobile"` | |
191 | + FullName string `bson:"FullName" json:"FullName"` | |
192 | + Sex string `bson:"Sex" json:"Sex"` | |
193 | + Content string `bson:"Content" json:"Content"` | |
194 | + Image []string `bson:"Image" json:"Image"` | |
195 | + State string `bson:"State" json:"State"` // 处理状态(未处理,已处理) | |
196 | + DateTime int64 `bson:"DateTime" json:"DateTime"` //时间戳 | |
168 | 197 | } |
169 | 198 | |
170 | 199 | type SInvestigation struct { |
... | ... | @@ -173,20 +202,21 @@ type SInvestigation struct { |
173 | 202 | Data interface{} `bson:"Data" json:"Data"` |
174 | 203 | } |
175 | 204 | type SMember struct { |
176 | - Id *primitive.ObjectID `bson:"_id" json:"Id" valid:"required"` | |
177 | - UserType string `bson:"UserType" json:"UserType" valid:"required,in(root|operator|visitor)"` // "root" or "operator" or "visitor" | |
178 | - ScenicId string `bson:"ScenicId,omitempty" json:"ScenicId,omitempty"` | |
179 | - Username string `bson:"Username,omitempty" json:"Username,omitempty"` | |
180 | - Password string `bson:"Password,omitempty" json:"Password,omitempty"` | |
181 | - Birthday string `bson:"Birthday,omitempty" json:"Birthday"` | |
182 | - FullName string `bson:"FullName,omitempty" json:"FullName"` | |
183 | - Mobile string `bson:"Mobile,omitempty" json:"Mobile"` | |
184 | - Openid string `bson:"Openid,omitempty" json:"Openid"` | |
185 | - Token string `bson:"Token,omitempty" json:"Token,omitempty"` | |
186 | - Sex string `bson:"Sex,omitempty" json:"Sex"` | |
187 | - Device *SDevice `bson:"Device,omitempty" json:"Device"` //设备信息 | |
188 | - Auth []string `bson:"Auth,omitempty" json:"Auth"` //权限信息 | |
189 | - Remarks string `bson:"Remarks,omitempty" json:"Remarks"` //说明 | |
205 | + Id *primitive.ObjectID `bson:"_id" json:"Id" valid:"required"` | |
206 | + UserType string `bson:"UserType" json:"UserType" valid:"required,in(root|operator|visitor)"` // "root" or "operator" or "visitor" | |
207 | + ScenicId string `bson:"ScenicId,omitempty" json:"ScenicId,omitempty"` | |
208 | + Username string `bson:"Username,omitempty" json:"Username,omitempty"` | |
209 | + Password string `bson:"Password,omitempty" json:"Password,omitempty"` | |
210 | + Birthday string `bson:"Birthday,omitempty" json:"Birthday"` | |
211 | + FullName string `bson:"FullName,omitempty" json:"FullName"` | |
212 | + Mobile string `bson:"Mobile,omitempty" json:"Mobile"` | |
213 | + Openid string `bson:"Openid,omitempty" json:"Openid"` | |
214 | + Token string `bson:"Token,omitempty" json:"Token,omitempty"` | |
215 | + Sex string `bson:"Sex,omitempty" json:"Sex"` | |
216 | + Device *SDevice `bson:"Device,omitempty" json:"Device"` //设备信息 | |
217 | + Auth []string `bson:"Auth,omitempty" json:"Auth"` //权限信息 | |
218 | + Remarks string `bson:"Remarks,omitempty" json:"Remarks"` //说明 | |
219 | + CreateTime int64 `bson:"CreateTime,omitempty" json:"CreateTime"` //创建时间 | |
190 | 220 | } |
191 | 221 | |
192 | 222 | type STag struct { |
... | ... | @@ -209,27 +239,15 @@ type SSize struct { |
209 | 239 | Width int64 `bson:"Width" json:"Width"` |
210 | 240 | Height int64 `bson:"Height" json:"Height"` |
211 | 241 | } |
242 | +type SRange struct { | |
243 | + Min float64 `bson:"Min" json:"Min"` | |
244 | + Max float64 `bson:"Max" json:"Max"` | |
245 | +} | |
212 | 246 | type SSysAds struct { |
213 | 247 | Id *primitive.ObjectID `bson:"_id" json:"Id" valid:"required"` |
214 | - Site string `bson:"Site" json:"Site" valid:"required"` // 位置 | |
215 | - Size SSize `bson:"Size" json:"Size" valid:"required"` // 尺寸 | |
248 | + Site string `bson:"Site" json:"Site" valid:"required"` // 位置 | |
249 | + Size SSize `bson:"Size" json:"Size" valid:"required"` // 尺寸 | |
216 | 250 | Type string `bson:"Type" json:"Type" valid:"required,in(轮播|单图|单视频)"` // 类型 |
217 | - Picture []SPicture `bson:"Picture" json:"Picture"` // 图片 | |
218 | - Video []SVideo `bson:"Video" json:"Video"` // 视频 | |
219 | -} | |
220 | -type SScenic struct { | |
221 | - Id *primitive.ObjectID `bson:"_id" json:"Id" valid:"required"` | |
222 | - Name string `bson:"Name" json:"Name"` | |
223 | - Describe string `bson:"Describe" json:"Describe"` | |
224 | - OpenHours string `bson:"OpenHours" json:"OpenHours"` //营业时间 | |
225 | - Mobile string `bson:"Mobile" json:"Mobile"` | |
226 | - Address string `bson:"Address" json:"Address"` | |
227 | - InvestigationUrl string `bson:"InvestigationUrl" json:"InvestigationUrl"` //问券调查的url地址 | |
228 | - Location SLocation `bson:"Location" json:"Location"` | |
229 | - Picture []SPicture `bson:"Picture" json:"Picture"` | |
230 | - ShopAdPicture []SPicture `bson:"ShopAdPicture" json:"ShopAdPicture"` //商城列表页图片 | |
231 | - ItemScenicPicture []SPicture `bson:"ItemScenicPicture" json:"ItemScenicPicture"` //项目场次照片 | |
232 | - ActivityPicture []SPicture `bson:"ActivityPicture" json:"ActivityPicture"` //活动照片 | |
233 | - VideoList []SVideo `bson:"VideoList" json:"VideoList"` | |
234 | - RangeLocation []SLocation `bson:"RangeLocation" json:"RangeLocation"` //景区范围 | |
251 | + Picture []SPicture `bson:"Picture" json:"Picture"` // 图片 | |
252 | + Video []SVideo `bson:"Video" json:"Video"` // 视频 | |
235 | 253 | } | ... | ... |
Lib/Auth/Auth.go
... | ... | @@ -102,6 +102,9 @@ func CheckAuthFunc(handFunc func(c *gin.Context), auth *DB.SModel) func(c *gin.C |
102 | 102 | |
103 | 103 | func CheckScenicAuth(ScenicId string, user *DB.SMember) error { |
104 | 104 | |
105 | + if user.UserType == "root" { | |
106 | + return nil | |
107 | + } | |
105 | 108 | if ScenicId == "" { |
106 | 109 | return errors.New("景区id不能为空") |
107 | 110 | } |
... | ... | @@ -121,6 +124,9 @@ func CheckScenicAuth(ScenicId string, user *DB.SMember) error { |
121 | 124 | |
122 | 125 | func CheckUserAuth(UserId string, user *DB.SMember) error { |
123 | 126 | |
127 | + if user.UserType == "root" { | |
128 | + return nil | |
129 | + } | |
124 | 130 | if UserId == "" { |
125 | 131 | return errors.New("用户id不能为空") |
126 | 132 | } | ... | ... |
Lib/OperatorLog/operatorLog.go
... | ... | @@ -2,13 +2,15 @@ package OperatorLog |
2 | 2 | |
3 | 3 | import ( |
4 | 4 | "github.com/aarongao/tools" |
5 | + "go.mongodb.org/mongo-driver/bson/primitive" | |
5 | 6 | "letu/DB" |
6 | 7 | "time" |
7 | 8 | ) |
8 | 9 | |
9 | 10 | func CreateOperatorLog(ScenicId string, user *DB.SMember, model *DB.SModel, api string, parames interface{}) { |
10 | - | |
11 | + id := primitive.NewObjectID() | |
11 | 12 | DB.COperatorLog.InsertOne(tools.GetContext(), DB.SOperatorLog{ |
13 | + &id, | |
12 | 14 | ScenicId, |
13 | 15 | user.Id.Hex(), |
14 | 16 | user.Username, | ... | ... |
README.md
... | ... | @@ -19,12 +19,14 @@ |
19 | 19 | 1. [标签 - 所有标签](#alltag-get) |
20 | 20 | 1. [标签 - 按照标签分组查看所有标签](#alltaggroup-get) |
21 | 21 | 1. [查询所有用户行为](#alluserlog-get) |
22 | +1. [数据统计](#analysls-count-get) | |
22 | 23 | 1. [用户管理 - 检查Token是否过期](#checktoken-post) |
23 | 24 | 1. [查询商品信息](#commodityinfo-get) |
24 | 25 | 1. [投诉 - 增加投诉](#createcomplaint-post) |
25 | 26 | 1. [查询用户的定时提醒](#dealymessage-info-get) |
26 | 27 | 1. [创建提醒](#dealymessage-create-post) |
27 | 28 | 1. [删除提醒](#dealymessage-remove-post) |
29 | +1. [处理投诉](#handlecomplaint-post) | |
28 | 30 | 1. [图标管理 - 返回图标基础信息](#icon-info-get) |
29 | 31 | 1. [图标管理 - 增加或修改图标信息](#icon-update-post) |
30 | 32 | 1. [图标管理 - 所有图标](#icon-all-get) |
... | ... | @@ -59,6 +61,7 @@ |
59 | 61 | 1. [更新线路](#updateline-post) |
60 | 62 | 1. [操作员管理 - 修改用户信息](#updateoperator-post) |
61 | 63 | 1. [更新景区基础信息](#updatescenic-post) |
64 | +1. [更新景区基础信息-高级](#updatescenicsenior-post) | |
62 | 65 | 1. [用户管理 - 修改用户信息](#updateuser-post) |
63 | 66 | 1. [上传](#upload-post) |
64 | 67 | 1. [用户管理 - 获取用户信息](#userinfo-get) |
... | ... | @@ -204,6 +207,11 @@ |
204 | 207 | |
205 | 208 | 所有景区基础信息 |
206 | 209 | |
210 | +| Param Name | Example | Data Type | Description | Required? | | |
211 | +|-----|-----|-----|-----|-----| | |
212 | +| Display | true | string | true=显示隐藏数据 | Yes | | |
213 | + | |
214 | + | |
207 | 215 | | Code | Type | Model | Message | |
208 | 216 | |-----|-----|-----|-----| |
209 | 217 | | 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | | |
... | ... | @@ -269,6 +277,27 @@ |
269 | 277 | |
270 | 278 | |
271 | 279 | |
280 | +<a name="analysls-count-get"></a> | |
281 | + | |
282 | +#### /Analysls/Count (GET) | |
283 | + | |
284 | + | |
285 | +数据统计 | |
286 | + | |
287 | +| Param Name | Example | Data Type | Description | Required? | | |
288 | +|-----|-----|-----|-----|-----| | |
289 | +| ScenicId | wgergejfwe | string | 景区id | Yes | | |
290 | +| StartTime | 1 | int | 时间戳 | | | |
291 | +| StopTime | 1 | int | 时间戳 | | | |
292 | + | |
293 | + | |
294 | +| Code | Type | Model | Message | | |
295 | +|-----|-----|-----|-----| | |
296 | +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | userTotal=用户总数registerTotal=注册用户总数nonRegisterTotal非注册用户总数 | | |
297 | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | | |
298 | + | |
299 | + | |
300 | + | |
272 | 301 | <a name="checktoken-post"></a> |
273 | 302 | |
274 | 303 | #### /CheckToken (POST) |
... | ... | @@ -396,6 +425,27 @@ |
396 | 425 | |
397 | 426 | |
398 | 427 | |
428 | +<a name="handlecomplaint-post"></a> | |
429 | + | |
430 | +#### /HandleComplaint (POST) | |
431 | + | |
432 | + | |
433 | +处理投诉 | |
434 | + | |
435 | +| Param Name | Example | Data Type | Description | Required? | | |
436 | +|-----|-----|-----|-----|-----| | |
437 | +| id | 5dfb03070a9ac17ac7a82054 | string | 投诉id | Yes | | |
438 | +| ScenicId | wgergejfwe | string | 景区id | Yes | | |
439 | +| Token | wgergejfwe | string | 用户token | Yes | | |
440 | + | |
441 | + | |
442 | +| Code | Type | Model | Message | | |
443 | +|-----|-----|-----|-----| | |
444 | +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | {"errcode":0,"result":"ok"} | | |
445 | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | | |
446 | + | |
447 | + | |
448 | + | |
399 | 449 | <a name="icon-info-get"></a> |
400 | 450 | |
401 | 451 | #### /Icon/Info (GET) |
... | ... | @@ -739,7 +789,7 @@ |
739 | 789 | |
740 | 790 | | Code | Type | Model | Message | |
741 | 791 | |-----|-----|-----|-----| |
742 | -| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | Name名称;Describe介绍;OpenHours营业时间;Picture最上面图片;ShopAdPicture商城列表页图片;ItemScenicPicture项目场次照片;ActivityPicture活动照片;VideoList视频(VideoPicture=首桢图片);InvestigationUrl问券调查的url;RangeLocation景区范围(多个坐标点) | | |
792 | +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | Name名称;Describe介绍;OpenHours营业时间;Picture最上面图片;ShopAdPicture商城列表页图片;ItemScenicPicture项目场次照片;ActivityPicture活动照片;VideoList视频(VideoPicture=首桢图片);InvestigationUrl问券调查的url;RangeLocation景区范围(多个坐标点)ZoomForIOS地图的缩放大小(IOS);ZoomForAndroidMin地图的缩放大小(Android最小);ZoomForAndroidMax地图的缩放大小(Android最大);Rotation旋转角度;OpenTiles否开启地图切片;ColorTiles切片底色(#FFFFFF) | | |
743 | 793 | | 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | |
744 | 794 | |
745 | 795 | |
... | ... | @@ -1079,7 +1129,27 @@ |
1079 | 1129 | |
1080 | 1130 | | Code | Type | Model | Message | |
1081 | 1131 | |-----|-----|-----|-----| |
1082 | -| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | Name名称;Describe介绍;OpenHours营业时间;Picture最上面图片;ShopAdPicture商城列表页图片;ItemScenicPicture项目场次照片;ActivityPicture活动照片;VideoList视频(VideoPicture=首桢图片);InvestigationUrl问券调查的url;RangeLocation景区范围(多个坐标点) | | |
1132 | +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | Name名称;Describe介绍;OpenHours营业时间;Picture最上面图片;ShopAdPicture商城列表页图片;ItemScenicPicture项目场次照片;ActivityPicture活动照片;VideoList视频(VideoPicture=首桢图片);InvestigationUrl问券调查的url; | | |
1133 | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | | |
1134 | + | |
1135 | + | |
1136 | + | |
1137 | +<a name="updatescenicsenior-post"></a> | |
1138 | + | |
1139 | +#### /UpdateScenicSenior (POST) | |
1140 | + | |
1141 | + | |
1142 | +更新景区基础信息-高级 | |
1143 | + | |
1144 | +| Param Name | Example | Data Type | Description | Required? | | |
1145 | +|-----|-----|-----|-----|-----| | |
1146 | +| id | 5dfb03070a9ac17ac7a82054 | string | 景区id | Yes | | |
1147 | +| Token | wgergejfwe | string | 用户token | Yes | | |
1148 | + | |
1149 | + | |
1150 | +| Code | Type | Model | Message | | |
1151 | +|-----|-----|-----|-----| | |
1152 | +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | RangeLocation景区范围(多个坐标点)ZoomForIOS地图的缩放大小(IOS);ZoomForAndroidMin地图的缩放大小(Android最小);ZoomForAndroidMax地图的缩放大小(Android最大);Rotation旋转角度;OpenTiles否开启地图切片;ColorTiles切片底色(#FFFFFF) | | |
1083 | 1153 | | 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | |
1084 | 1154 | |
1085 | 1155 | ... | ... |
Version.md
... | ... | @@ -66,13 +66,24 @@ |
66 | 66 | } |
67 | 67 | ``` |
68 | 68 | |
69 | - | |
69 | +12. /ScenicInfo景区信息接口增加新属性 | |
70 | + | |
71 | + ``` | |
72 | + ZoomForIOS //地图的缩放大小(IOS) | |
73 | + ZoomForAndroidMin //地图的缩放大小(Android最小) | |
74 | + ZoomForAndroidMax //地图的缩放大小(Android最大) | |
75 | + Rotation //旋转角度 | |
76 | + OpenTiles //否开启地图切片 | |
77 | + ColorTiles //切片底色(FFFFFF) | |
78 | + ``` | |
79 | + | |
80 | +13. /AllScenic增加Display=all参数。意思是显示所有数据,默认情况不显示隐藏信息 | |
70 | 81 | |
71 | 82 | |
72 | 83 | |
73 | 84 | ##### 数据结构变更: |
74 | 85 | |
75 | -1、标签表 | |
86 | +1、标签表、设施信息中的所属标签 | |
76 | 87 | |
77 | 88 | 2、平台广告表初始数据 |
78 | 89 | |
... | ... | @@ -93,6 +104,13 @@ |
93 | 104 | 1. 提交APP代码到git(v1.1分支) |
94 | 105 | 2. 使用 “测试环境地址” 打包内测版本至TestFlight |
95 | 106 | 3. 升级 ”生产环境“ 接口至v1.1 |
107 | + 1. 打包上传程序文件main_v1.1 | |
108 | + 2. 修改config.json配置文件 | |
109 | + 3. 运行程序 | |
110 | + 4. nginx增加/api/v1.1路径支持 | |
111 | + 5. 上传后台页面 | |
112 | + 6. 更新root用户模块权限数据 | |
113 | + 7. 修改数据结构变更及数据缺失(广告,标签等。。) | |
96 | 114 | 4. 使用 “生产环境地址” 打包公测版本至TestFlight |
97 | 115 | 5. 发布至商店 |
98 | 116 | ... | ... |
main.go
... | ... | @@ -120,6 +120,7 @@ func main() { |
120 | 120 | InitController("GET", "/ItemInfo", Api.ItemInfo, &DB.SModel{}) |
121 | 121 | InitController("GET", "/CommodityInfo", Api.CommodityInfo, &DB.SModel{}) |
122 | 122 | InitController("POST", "/CreateComplaint", Api.CreateComplaint, &DB.SModel{}) |
123 | + InitController("POST", "/HandleComplaint", Api.HandleComplaint, &DB.SModel{"投诉建议", "处理投诉"}) | |
123 | 124 | InitController("GET", "/AllComplaint", Api.AllComplaint, &DB.SModel{"投诉建议", "查看所有"}) |
124 | 125 | //InitController("/CreateUser", Api.CreateUser) |
125 | 126 | InitController("POST", "/LoginUser", Api.LoginUser, &DB.SModel{}) |
... | ... | @@ -137,6 +138,7 @@ func main() { |
137 | 138 | InitController("POST", "/UpdateCommodity", Api.UpdateCommodity, &DB.SModel{"商品管理", "修改"}) |
138 | 139 | InitController("POST", "/UpdateLine", Api.UpdateLine, &DB.SModel{"线路管理", "修改"}) |
139 | 140 | InitController("POST", "/UpdateScenic", Api.UpdateScenic, &DB.SModel{"景区管理", "修改"}) |
141 | + InitController("POST", "/UpdateScenicSenior", Api.UpdateScenicSenior, &DB.SModel{"景区管理", "修改-高级"}) | |
140 | 142 | InitController("POST", "/UpdateItemTime", Api.UpdateItemTime, &DB.SModel{"项目管理", "修改等候时间"}) |
141 | 143 | InitController("GET", "/AllScenic", Api.AllScenic, &DB.SModel{}) |
142 | 144 | InitController("POST", "/UserLog", Api.UserLog, &DB.SModel{}) |
... | ... | @@ -178,6 +180,8 @@ func main() { |
178 | 180 | InitController("GET", "/SysAds/List", Api.SysAdsList, &DB.SModel{}) |
179 | 181 | InitController("POST", "/SysAds/Modify", Api.ModifySysAds, &DB.SModel{"平台广告", "修改"}) |
180 | 182 | |
183 | + InitController("GET", "/Analysls/Count", Api.Analysls, &DB.SModel{"平台数据统计","查询"}) | |
184 | + | |
181 | 185 | Gin.GET("/AllModules", Auth.Modules) |
182 | 186 | //InitController("/ws", Api.WsPage) |
183 | 187 | ... | ... |