Commit a4680f1ea006e1f3f3ed6f155c02d42ae7d48b71
1 parent
58410c9c
Exists in
v1.2
and in
2 other branches
.
Showing
7 changed files
with
44 additions
and
10 deletions
Show diff stats
API/Icon.go
... | ... | @@ -53,7 +53,7 @@ func UpdateIcon(c *gin.Context) { |
53 | 53 | if ScenicId == "" || ScenicId == "undefined" { |
54 | 54 | c.JSON(200, tools.ResponseError{ |
55 | 55 | 1, |
56 | - "缺少scenicid(景区id)", | |
56 | + "缺少ScenicId(景区id)", | |
57 | 57 | }) |
58 | 58 | return |
59 | 59 | } |
... | ... | @@ -97,7 +97,7 @@ func AllIcons(c *gin.Context) { |
97 | 97 | if ScenicId == "" || ScenicId == "undefined" { |
98 | 98 | c.JSON(200, tools.ResponseError{ |
99 | 99 | 1, |
100 | - "缺少scenicid(景区id)", | |
100 | + "缺少ScenicId(景区id)", | |
101 | 101 | }) |
102 | 102 | return |
103 | 103 | } | ... | ... |
API/Scenic.go
... | ... | @@ -71,6 +71,9 @@ func UpdateScenic(c *gin.Context) { |
71 | 71 | var id bson.ObjectId |
72 | 72 | if pid := c.PostForm("id"); pid == "null" { |
73 | 73 | id = bson.NewObjectId() |
74 | + | |
75 | + // 新景区,初始化 | |
76 | + initScenic(id.Hex()) | |
74 | 77 | } else { |
75 | 78 | id = bson.ObjectIdHex(pid) |
76 | 79 | } |
... | ... | @@ -100,6 +103,28 @@ func UpdateScenic(c *gin.Context) { |
100 | 103 | |
101 | 104 | } |
102 | 105 | |
106 | +func initScenic(id string){ | |
107 | + | |
108 | + | |
109 | + DB.CTags.Insert(DB.STag{ | |
110 | + id, | |
111 | + "type", | |
112 | + "服务设施", | |
113 | + },DB.STag{ | |
114 | + id, | |
115 | + "type", | |
116 | + "游乐设施", | |
117 | + },DB.STag{ | |
118 | + id, | |
119 | + "type", | |
120 | + "餐饮", | |
121 | + },DB.STag{ | |
122 | + id, | |
123 | + "type", | |
124 | + "购物", | |
125 | + }) | |
126 | +} | |
127 | + | |
103 | 128 | // @Title 所有景区基础信息 |
104 | 129 | // @Description 所有景区基础信息 |
105 | 130 | // @Accept json | ... | ... |
API/Tag.go
... | ... | @@ -187,6 +187,15 @@ func RemoveTag(c *gin.Context) { |
187 | 187 | return |
188 | 188 | } |
189 | 189 | |
190 | + | |
191 | + if c.PostForm("TagGroup") == "type" { | |
192 | + c.JSON(200, tools.ResponseError{ | |
193 | + 1, | |
194 | + "此类型只能加不能删", | |
195 | + }) | |
196 | + return | |
197 | + } | |
198 | + | |
190 | 199 | DB.CTags.Remove(bson.M{"ScenicId": ScenicId,"Name":c.PostForm("TagName"),"Type":c.PostForm("TagGroup")}) |
191 | 200 | |
192 | 201 | DB.Redis.Delete("Tags_" + ScenicId) | ... | ... |
API/Trajectory.go
API/UserLog.go
Lib/LeYouTu/tools.go
... | ... | @@ -18,9 +18,9 @@ func GetScenicId(c *gin.Context) (ScenicId string, error error) { |
18 | 18 | if ScenicId == "" || ScenicId == "undefined" { |
19 | 19 | c.JSON(200, tools.ResponseError{ |
20 | 20 | 1, |
21 | - "缺少scenicid(景区id)", | |
21 | + "缺少ScenicId(景区id)", | |
22 | 22 | }) |
23 | - return "", errors.New("缺少scenicid(景区id)") | |
23 | + return "", errors.New("缺少ScenicId(景区id)") | |
24 | 24 | } else { |
25 | 25 | return ScenicId, nil |
26 | 26 | } | ... | ... |
README.md
... | ... | @@ -34,7 +34,7 @@ |
34 | 34 | 1. [发送短信验证码](#sms-send-post) |
35 | 35 | 1. [标签 - 增加标签](#tag-create-post) |
36 | 36 | 1. [标签 - 删除标签](#tag-remove-post) |
37 | -1. [保存用户移动轨迹](#trajectory-save-post) | |
37 | +1. [保存用户移动轨迹(5分钟提交一次)](#trajectory-save-post) | |
38 | 38 | 1. [更新商品](#updatecommodity-post) |
39 | 39 | 1. [设备管理 - 更新设施](#updateitem-post) |
40 | 40 | 1. [设备管理 - 更新等待时间](#updateitemtime-post) |
... | ... | @@ -43,7 +43,7 @@ |
43 | 43 | 1. [用户管理 - 修改用户信息](#updateuser-post) |
44 | 44 | 1. [上传](#upload-post) |
45 | 45 | 1. [用户管理 - 获取用户信息](#userinfo-get) |
46 | -1. [增加访问日志](#userlog-post) | |
46 | +1. [增加用户行为日志](#userlog-post) | |
47 | 47 | |
48 | 48 | |
49 | 49 | |
... | ... | @@ -539,7 +539,7 @@ |
539 | 539 | #### /Trajectory/Save (POST) |
540 | 540 | |
541 | 541 | |
542 | -保存用户移动轨迹 | |
542 | +保存用户移动轨迹(5分钟提交一次) | |
543 | 543 | |
544 | 544 | | Param Name | Example | Data Type | Description | Required? | |
545 | 545 | |-----|-----|-----|-----|-----| |
... | ... | @@ -704,7 +704,7 @@ |
704 | 704 | #### /UserLog (POST) |
705 | 705 | |
706 | 706 | |
707 | -增加访问日志 | |
707 | +增加用户行为日志 | |
708 | 708 | |
709 | 709 | | Param Name | Example | Data Type | Description | Required? | |
710 | 710 | |-----|-----|-----|-----|-----| | ... | ... |