Commit 556057a645874ccdd0903fce4d4e7de130da52c1

Authored by aarongao
1 parent 2d46a000
Exists in v1.2 and in 2 other branches master, v1.1

.

Showing 3 changed files with 29 additions and 33 deletions   Show diff stats
API/UserLog.go
@@ -12,8 +12,8 @@ import ( @@ -12,8 +12,8 @@ import (
12 // @Description 增加访问日志 12 // @Description 增加访问日志
13 // @Accept json 13 // @Accept json
14 // @Produce json 14 // @Produce json
15 -// @Param Type 访问页面 string true "安装;卸载;访问页面;使用功能;缩放地图"  
16 -// @Param SubType 景区详情 string true "推荐;景区详情;登陆;商城;投诉建议;问券调查...." 15 +// @Param Type 访问页面 string true "安装;卸载;访问页面;使用功能;缩放地图;进入景区"
  16 +// @Param SubType 景区详情 string true "推荐;景区详情;登陆;商城;投诉建议;问券调查....(app中能点的都加上)"
17 // @Param ScenicId 5dfb03070a9ac17ac7a82054 string true "景区id" 17 // @Param ScenicId 5dfb03070a9ac17ac7a82054 string true "景区id"
18 // @Param UserId 5dfb03070a9ac17ac7a82054 string true "用户ID" 18 // @Param UserId 5dfb03070a9ac17ac7a82054 string true "用户ID"
19 // @Param UserName Aaron string true "用户名称" 19 // @Param UserName Aaron string true "用户名称"
@@ -32,35 +32,32 @@ func UserLog(c *gin.Context) { @@ -32,35 +32,32 @@ func UserLog(c *gin.Context) {
32 c.Header("Access-Control-Allow-Origin", c.Request.Header.Get("Origin")) 32 c.Header("Access-Control-Allow-Origin", c.Request.Header.Get("Origin"))
33 c.Header("Access-Control-Allow-Credentials", "true") 33 c.Header("Access-Control-Allow-Credentials", "true")
34 34
35 - if c.Request.Method == "post" { 35 + var Location DB.SLocation
  36 + json.Unmarshal([]byte(c.PostForm("Location")), &Location)
36 37
37 - var Location DB.SLocation  
38 - json.Unmarshal([]byte(c.PostForm("Location")), &Location) 38 + DB.CUserLog.Insert(DB.SUserLog{
  39 + c.PostForm("Type"),
  40 + c.PostForm("SubType"),
  41 + c.PostForm("ScenicId"),
  42 + c.PostForm("UserId"),
  43 + c.PostForm("UserName"),
  44 + time.Now().Unix(),
  45 + Location,
  46 + c.PostForm("Remarks"),
  47 + c.PostForm("Source"),
  48 + DB.SDevice{
  49 + c.Request.Header.Get("DeviceId"),
  50 + c.Request.Host,
  51 + c.Request.Header.Get("Mac"),
  52 + c.Request.Header.Get("SystemType"),
  53 + c.Request.Header.Get("SystemVersion"),
  54 + c.Request.Header.Get("SystemModel"),
  55 + },
  56 + })
39 57
40 - DB.CUserLog.Insert(DB.SUserLog{  
41 - c.PostForm("Type"),  
42 - c.PostForm("SubType"),  
43 - c.PostForm("ScenicId"),  
44 - c.PostForm("UserId"),  
45 - c.PostForm("UserName"),  
46 - time.Now().Unix(),  
47 - Location,  
48 - c.PostForm("Remarks"),  
49 - c.PostForm("Source"),  
50 - DB.SDevice{  
51 - c.Request.Header.Get("DeviceId"),  
52 - c.Request.Host,  
53 - c.Request.Header.Get("Mac"),  
54 - c.Request.Header.Get("SystemType"),  
55 - c.Request.Header.Get("SystemVersion"),  
56 - c.Request.Header.Get("SystemModel"),  
57 - },  
58 - })  
59 -  
60 - c.JSON(200, tools.ResponseSeccess{  
61 - 0,  
62 - "ok",  
63 - })  
64 - } 58 + c.JSON(200, tools.ResponseSeccess{
  59 + 0,
  60 + "ok",
  61 + })
65 62
66 } 63 }
@@ -640,8 +640,8 @@ @@ -640,8 +640,8 @@
640 640
641 | Param Name | Example | Data Type | Description | Required? | 641 | Param Name | Example | Data Type | Description | Required? |
642 |-----|-----|-----|-----|-----| 642 |-----|-----|-----|-----|-----|
643 -| Type | 访问页面 | string | 安装;卸载;访问页面;使用功能;缩放地图 | Yes |  
644 -| SubType | 景区详情 | string | 推荐;景区详情;登陆;商城;投诉建议;问券调查.... | Yes | 643 +| Type | 访问页面 | string | 安装;卸载;访问页面;使用功能;缩放地图;进入景区 | Yes |
  644 +| SubType | 景区详情 | string | 推荐;景区详情;登陆;商城;投诉建议;问券调查....(app中能点的都加上) | Yes |
645 | ScenicId | 5dfb03070a9ac17ac7a82054 | string | 景区id | Yes | 645 | ScenicId | 5dfb03070a9ac17ac7a82054 | string | 景区id | Yes |
646 | UserId | 5dfb03070a9ac17ac7a82054 | string | 用户ID | Yes | 646 | UserId | 5dfb03070a9ac17ac7a82054 | string | 用户ID | Yes |
647 | UserName | Aaron | string | 用户名称 | Yes | 647 | UserName | Aaron | string | 用户名称 | Yes |
@@ -92,7 +92,6 @@ func main() { @@ -92,7 +92,6 @@ func main() {
92 r.POST("/UpdateItemTime", Api.UpdateItemTime) 92 r.POST("/UpdateItemTime", Api.UpdateItemTime)
93 r.GET("/AllScenic", Api.AllScenic) 93 r.GET("/AllScenic", Api.AllScenic)
94 r.POST("/UserLog", Api.UserLog) 94 r.POST("/UserLog", Api.UserLog)
95 - r.GET("/UserLog", Api.UserLog)  
96 r.POST("/Sms/Send", Api.Send) 95 r.POST("/Sms/Send", Api.Send)
97 r.POST("/Investigation/Save", Api.SaveInvestigation) 96 r.POST("/Investigation/Save", Api.SaveInvestigation)
98 r.GET("/Investigation/List", Api.AllInvestigation) 97 r.GET("/Investigation/List", Api.AllInvestigation)