wangfei 6 年前
父节点
当前提交
6b95fe6f8c
共有 4 个文件被更改,包括 42 次插入4 次删除
  1. 1
    1
      conf/log.conf
  2. 2
    2
      controllers/course/order.go
  3. 36
    0
      log/common.log
  4. 3
    1
      routers/wechat.go

+ 1
- 1
conf/log.conf 查看文件

@@ -1,4 +1,4 @@
1 1
 [common]
2
-filename="E:\\GoProjects\\src\\spaceofcheng\\services\\log\\common.log"
2
+filename="E:\\GoProject\\src\\spaceofcheng\\services\\log\\common.log"
3 3
 # log level "emergency", "alert", "critical", "error", "warning", "notice", "info", "debug"
4 4
 level="debug"

+ 2
- 2
controllers/course/order.go 查看文件

@@ -15,7 +15,7 @@ func (c *CourseController) PostOrder() {
15 15
 	}
16 16
 
17 17
 	// 订单优惠券
18
-	coupon := c.GetString("coupon")
18
+	coupons := c.GetString("coupons")
19 19
 
20 20
 	//
21 21
 	var orderInfo model.TaCourseOrders
@@ -26,7 +26,7 @@ func (c *CourseController) PostOrder() {
26 26
 		c.ResponseError(errors.New("下单数据格式不正确"))
27 27
 	}
28 28
 
29
-	if err := json.Unmarshal([]byte(coupon), &orderCoupon); err != nil {
29
+	if err := json.Unmarshal([]byte(coupons), &orderCoupon); err != nil {
30 30
 		utils.LogError("下单优惠转换JSON失败: " + err.Error())
31 31
 		c.ResponseError(errors.New("优惠数据格式不正确"))
32 32
 	}

+ 36
- 0
log/common.log 查看文件

@@ -74,3 +74,39 @@
74 74
 2018/08/26 16:17:50 [I] 接口返回结果: %!(EXTRA map[string]interface {}=map[access_token:13_hezlnSFBORaBwf5SdwfaSZEoGO35hkS4XL7D2SKqDSUwryGZpP6lFh9fVUDjFQzwv0oH3wZnP5ANT4rE1nQEeBgZTHIPo5Qzu5KpHhVFQNc_0bb6XGAFm-ugPf9iKI2tVA4SIfILsf6VunDeLZUeAAAVJE expires_in:7200])
75 75
 2018/09/05 14:05:44.496 [E]  不存在营销信息!
76 76
 2018/09/05 16:08:13.236 [E]  没有对应的营销活动
77
+2018/09/05 20:46:22 [E] 解密 Base64 字串失败: illegal base64 data at input byte 1
78
+2018/09/05 20:46:22 [E] 获取组织信息失败: 没有查询到机构信息
79
+2018/09/05 20:46:22 [I] 请求远程接口: %!(EXTRA string=https://api.weixin.qq.com/cgi-bin/token?appid=wx7320287e057bbeee&grant_type=client_credential&secret=6e844dc2ade439545c47569ba1707673)
80
+2018/09/05 20:46:22 [E] 下单转换JSON失败: json: cannot unmarshal number into Go struct field TaCourseOrders.CustomerId of type string
81
+2018/09/05 20:46:22 [I] 远程请求结果:%!(EXTRA string={"access_token":"13_40wwMDxnHi_pYFr00yd2aut_EFTLarqBafPHqwv8R183qUqb_YaeFDTKjy41RrX3fcayrs1zAx5M_6V9ZD3sDSlU-y6F6AUbjV9EPZKOwIASwWYXHIjgt0sFtaWVB0WGhgDUSTKjiN-xejmBZGFcACAQXW","expires_in":7200})
82
+2018/09/05 20:46:22 [I] 接口返回结果: %!(EXTRA map[string]interface {}=map[expires_in:7200 access_token:13_40wwMDxnHi_pYFr00yd2aut_EFTLarqBafPHqwv8R183qUqb_YaeFDTKjy41RrX3fcayrs1zAx5M_6V9ZD3sDSlU-y6F6AUbjV9EPZKOwIASwWYXHIjgt0sFtaWVB0WGhgDUSTKjiN-xejmBZGFcACAQXW])
83
+2018/09/05 20:47:15 [E] 解密 Base64 字串失败: illegal base64 data at input byte 1
84
+2018/09/05 20:47:15 [E] 获取组织信息失败: 没有查询到机构信息
85
+2018/09/05 20:47:17 [E] 解密 Base64 字串失败: illegal base64 data at input byte 1
86
+2018/09/05 20:47:17 [E] 获取组织信息失败: 没有查询到机构信息
87
+2018/09/05 20:47:17 [E] 下单优惠转换JSON失败: unexpected end of JSON input
88
+2018/09/05 20:48:57 [E] 解密 Base64 字串失败: illegal base64 data at input byte 1
89
+2018/09/05 20:48:57 [E] 获取组织信息失败: 没有查询到机构信息
90
+2018/09/05 20:48:57 [I] 请求远程接口: %!(EXTRA string=https://api.weixin.qq.com/cgi-bin/token?appid=wx7320287e057bbeee&grant_type=client_credential&secret=6e844dc2ade439545c47569ba1707673)
91
+2018/09/05 20:48:58 [I] 远程请求结果:%!(EXTRA string={"access_token":"13_cODCqx4ygv6jVXcnJpx7FaGHTMbuGAJ0c3XHxHJvQHXHMcBcaodYjJY5tRxxoe2Gsd0-sIBbBj-q0CgP4zyVQamH4N5Y7ea4MaPEMRdM52tJMfsGeDrmO1679DHdpl-gxcPMGdTSgm_Sn5SHNLLcAFAQOO","expires_in":7200})
92
+2018/09/05 20:48:58 [I] 接口返回结果: %!(EXTRA map[string]interface {}=map[access_token:13_cODCqx4ygv6jVXcnJpx7FaGHTMbuGAJ0c3XHxHJvQHXHMcBcaodYjJY5tRxxoe2Gsd0-sIBbBj-q0CgP4zyVQamH4N5Y7ea4MaPEMRdM52tJMfsGeDrmO1679DHdpl-gxcPMGdTSgm_Sn5SHNLLcAFAQOO expires_in:7200])
93
+2018/09/05 20:49:18 [E] 解密 Base64 字串失败: illegal base64 data at input byte 1
94
+2018/09/05 20:49:18 [E] 获取组织信息失败: 没有查询到机构信息
95
+2018/09/05 20:49:23 [E] 解密 Base64 字串失败: illegal base64 data at input byte 1
96
+2018/09/05 20:49:23 [E] 获取组织信息失败: 没有查询到机构信息
97
+2018/09/05 20:49:27 [E] 解密 Base64 字串失败: illegal base64 data at input byte 1
98
+2018/09/05 20:49:27 [E] 获取组织信息失败: 没有查询到机构信息
99
+2018/09/05 20:49:44 [E] 解密 Base64 字串失败: illegal base64 data at input byte 1
100
+2018/09/05 20:49:44 [E] 获取组织信息失败: 没有查询到机构信息
101
+2018/09/05 20:50:00 [E] 解密 Base64 字串失败: illegal base64 data at input byte 1
102
+2018/09/05 20:50:00 [E] 获取组织信息失败: 没有查询到机构信息
103
+2018/09/05 20:50:00 [I] 请求远程接口: %!(EXTRA string=https://api.weixin.qq.com/cgi-bin/token?appid=wx7320287e057bbeee&grant_type=client_credential&secret=6e844dc2ade439545c47569ba1707673)
104
+2018/09/05 20:50:01 [I] 远程请求结果:%!(EXTRA string={"access_token":"13_Kx2YTe2o_Xlqu7XwXF_SmuGSs0pzMKdzTxBVOrdW9Y406UB_OAbuy181N3cqFQVOoZodH7DHkEddPsPgIPU2vlxzXwkW3W5yafkaNSYtFWE80lWE4u8-HpRsU2pSqlplcPZH4hkcqMDFbuJ3NAUaAHAJWQ","expires_in":7200})
105
+2018/09/05 20:50:01 [I] 接口返回结果: %!(EXTRA map[string]interface {}=map[expires_in:7200 access_token:13_Kx2YTe2o_Xlqu7XwXF_SmuGSs0pzMKdzTxBVOrdW9Y406UB_OAbuy181N3cqFQVOoZodH7DHkEddPsPgIPU2vlxzXwkW3W5yafkaNSYtFWE80lWE4u8-HpRsU2pSqlplcPZH4hkcqMDFbuJ3NAUaAHAJWQ])
106
+2018/09/05 20:50:06 [E] 解密 Base64 字串失败: illegal base64 data at input byte 1
107
+2018/09/05 20:50:06 [E] 获取组织信息失败: 没有查询到机构信息
108
+2018/09/05 20:50:10 [E] 解密 Base64 字串失败: illegal base64 data at input byte 1
109
+2018/09/05 20:50:10 [E] 获取组织信息失败: 没有查询到机构信息
110
+2018/09/05 20:50:45 [I] 请求远程接口: %!(EXTRA string=https://api.weixin.qq.com/cgi-bin/token?appid=wx7320287e057bbeee&grant_type=client_credential&secret=6e844dc2ade439545c47569ba1707673)
111
+2018/09/05 20:50:45 [I] 远程请求结果:%!(EXTRA string={"access_token":"13_JBzudKpFiCtAdYE0Rouc5sin8BHZTUcYQXNEZsXSd7xj7A9OfXnnywRVpAcdwjR2-Bz6OzGkl3lfVl23L7XvGYVU8dj3cjI8qLLW93vaXgz1qE3dPhDt2xqHTTYOv8Ajh4rofEGTmnXP9iX1UAXaAGADJG","expires_in":7200})
112
+2018/09/05 20:50:45 [I] 接口返回结果: %!(EXTRA map[string]interface {}=map[access_token:13_JBzudKpFiCtAdYE0Rouc5sin8BHZTUcYQXNEZsXSd7xj7A9OfXnnywRVpAcdwjR2-Bz6OzGkl3lfVl23L7XvGYVU8dj3cjI8qLLW93vaXgz1qE3dPhDt2xqHTTYOv8Ajh4rofEGTmnXP9iX1UAXaAGADJG expires_in:7200])

+ 3
- 1
routers/wechat.go 查看文件

@@ -1,6 +1,7 @@
1 1
 package routers
2 2
 
3 3
 import (
4
+	"spaceofcheng/services/controllers/course"
4 5
 	"spaceofcheng/services/controllers/customer"
5 6
 	"spaceofcheng/services/controllers/goods"
6 7
 
@@ -15,6 +16,7 @@ func getWechatRoutes() beego.LinkNamespace {
15 16
 		beego.NSRouter("/customer", &customer.CustomerController{}, "get:GetCustWXByID"),
16 17
 
17 18
 		// 下单
18
-		beego.NSRouter("/order", &goods.GoodsController{}, "post:PostOrder"),
19
+		beego.NSRouter("/order/goods", &goods.GoodsController{}, "post:PostOrder"),
20
+		beego.NSRouter("/order/course", &course.CourseController{}, "post:PostOrder"),
19 21
 	)
20 22
 }