|
@@ -156,6 +156,36 @@ func MsgTxtHandler(w ResponseWriter, r *Request) {
|
|
|
w.ReplyText(config.Sysconfig["policysupport"].(string))
|
|
|
} else if r.Content == "2017政策" {
|
|
|
w.ReplyText(config.Sysconfig["2017policy"].(string))
|
|
|
+ } else if r.Content == "1" || r.Content == "2" || r.Content == "3" {
|
|
|
+ webdomain := config.Sysconfig["webdomain"].(string)
|
|
|
+ replyUrl := config.Sysconfig["replyUrl"].(string)
|
|
|
+ brt := *util.ObjToMap(config.Sysconfig["bigmemberReplyText"])
|
|
|
+ BRTArray := []string{}
|
|
|
+ switch r.Content {
|
|
|
+ case "1":
|
|
|
+ BRTArray = util.ObjArrToStringArr(brt["EntUrl"].([]interface{}))
|
|
|
+ case "2":
|
|
|
+ BRTArray = util.ObjArrToStringArr(brt["BuyerUrl"].([]interface{}))
|
|
|
+ case "3":
|
|
|
+ BRTArray = util.ObjArrToStringArr(brt["ReportUrl"].([]interface{}))
|
|
|
+ }
|
|
|
+ id := tools.MGLOG.Save(config.Sysconfig["bmwxrcoll"].(string), &map[string]interface{}{
|
|
|
+ "s_openid": r.FromUserName,
|
|
|
+ "s_msg": r.Content,
|
|
|
+ "l_timestamp": now.Unix(),
|
|
|
+ "isICRP": 0, //是否进入留资页面
|
|
|
+ "isICRW": 0, //是否提交留资信息
|
|
|
+ "isCRW": 0, //是否点击回复
|
|
|
+ })
|
|
|
+ go func() {
|
|
|
+ redis.Put("other", fmt.Sprintf("digitalreplay_%s", r.FromUserName), id, 24*60*60)
|
|
|
+ }()
|
|
|
+ w.ReplyNews([]Article{Article{
|
|
|
+ Title: BRTArray[0],
|
|
|
+ PicUrl: webdomain + BRTArray[2],
|
|
|
+ Description: BRTArray[1],
|
|
|
+ Url: webdomain + replyUrl + fmt.Sprintf(BRTArray[3], id),
|
|
|
+ }})
|
|
|
} else if len(autoReply_reg.FindStringIndex(r.Content)) == 2 {
|
|
|
rContent := strings.TrimSpace(r.Content)
|
|
|
fastSubscribeText := config.Sysconfig["fastSubscribe"].(map[string]interface{})
|
|
@@ -408,8 +438,8 @@ func saveUser(u *UserInfo, source, pre, RSource, CSource string) (bool, string,
|
|
|
newUser["s_province"] = u.Province
|
|
|
newUser["s_city"] = u.City
|
|
|
newUser["i_applystatus"] = 1
|
|
|
- if len(strings.Split(source, "_")) >2 {
|
|
|
- if (strings.Split(source, "_")[2] == "GX") {
|
|
|
+ if len(strings.Split(source, "_")) > 2 {
|
|
|
+ if strings.Split(source, "_")[2] == "GX" {
|
|
|
disStr := strings.Split(source, "_")[0] + "_" + strings.Split(source, "_")[1][1:] + "_" + strings.Split(source, "_")[2]
|
|
|
log.Println("disStr", disStr)
|
|
|
diswordStr := redis.Get("other", disStr)
|
|
@@ -913,7 +943,7 @@ func Subscribe(w ResponseWriter, r *Request) {
|
|
|
ek := strings.SplitN(r.EventKey, "_", 3)[2]
|
|
|
log.Println("ek:", ek)
|
|
|
encry := ek[:1]
|
|
|
- if (len(strings.Split(ek, "_"))>1){
|
|
|
+ if len(strings.Split(ek, "_")) > 1 {
|
|
|
suffix := strings.Split(ek, "_")[1]
|
|
|
fmt.Println(r.EventKey, ek, suffix)
|
|
|
if suffix == "GX" {
|
|
@@ -1093,7 +1123,7 @@ func ScanHandler(w ResponseWriter, r *Request) {
|
|
|
if strings.Contains(r.EventKey, "DIS_") {
|
|
|
ek := strings.Split(r.EventKey, "_")[1]
|
|
|
encry := ek[:1]
|
|
|
- if (len(strings.Split(r.EventKey, "_"))>2){
|
|
|
+ if len(strings.Split(r.EventKey, "_")) > 2 {
|
|
|
suffix := strings.Split(r.EventKey, "_")[2]
|
|
|
if suffix == "GX" {
|
|
|
encry = "G"
|