//private UseSeekService user = new UseSeekService(); public ResponseMessageNews GetMapItemShow(BaiYeMapItem item, IRequestMessageBase requestMessage) { ResponseMessageNews arg_70_0 = ResponseMessageBase.CreateFromRequestMessage <ResponseMessageNews>(requestMessage); string text; if (requestMessage is RequestMessageText) { text = ((RequestMessageText)requestMessage).Content; } else { text = "定位结果"; } arg_70_0.Articles.Add(new Article { Description = text, PicUrl = "http://wkshanghai.oss-cn-hangzhou.aliyuncs.com/logo.png", Title = text + "(->时光)", Url = item.TmpPicUrl }); //this.user.SaveUserEner(requestMessage.FromUserName, item.KeyWordId); if (item.POIKey != 0) { var item2 = new Article { Description = text, PicUrl = "http://wkshanghai.oss-cn-hangzhou.aliyuncs.com/logo.png", Title = text + "介绍", Url = "http://wk.kwok.io/poi/info/" + item.POIKey.ToString() }; arg_70_0.Articles.Add(item2); } return(arg_70_0); }
public static void Set(string user, BaiYeMapItem map) { if (UserInfoContext.CurUserMap.ContainsKey(user)) { UserInfoContext.CurUserMap[user] = map; return; } UserInfoContext.CurUserMap.Add(user, map); }
public override IResponseMessageBase OnTextRequest(RequestMessageText requestMessage) { ResponseMessageText responseMessageText = base.CreateResponseMessage <ResponseMessageText>(); StringBuilder stringBuilder = new StringBuilder(); try { string content = requestMessage.Content; _logger.LogInformation($"微信用户输入:{content}"); if (!content.Contains("x")) { if (content == "help" || content == "?") { stringBuilder.Append("欢迎使用,我们正在构建功能更完善的公众号。你可以直接输入地名或地名,系统将会直接返回百业地图,\n 建议输入关键词为详细的地名,包含门牌号或者专有地名等,会提高查询的成功率。 欢迎联系本人提供老照片,老地图,老建筑资料。"); } else { if (content == "w" || content == "s" || content == "e" || content == "n") { IResponseMessageBase result = this.GetNext(content, UserInfoContext.Get(requestMessage.FromUserName), requestMessage); return(result); } bool usehpic = false; BaiYeMapItem mapInfo = this.service.GetMapInfo(content, usehpic).Result; if (mapInfo != null) { ResponseMessageNews mapItemShow = build.GetMapItemShow(mapInfo, requestMessage); if (mapItemShow != null) { //UserInfoContext.Set(requestMessage.FromUserName, mapInfo); IResponseMessageBase result = mapItemShow; return(result); } stringBuilder.Append("未找到地图,望见谅。帮助我们完善数据库请<a href=\"http://wk.kwok.io/poi/newpoi\">点击</a>,"); } else { stringBuilder.Append("未找到地图。来帮助我们完善数据库请<a href=\"http://wk.kwok.io/poi/newpoi\">点击</a>,"); } } } } catch (Exception ex) { stringBuilder.Append("很抱歉,系统出错。" + ex.Message); _logger.LogError(ex, "异常"); } stringBuilder.AppendLine("\r\n#"); responseMessageText.Content = stringBuilder.ToString(); return(responseMessageText); }
public override IResponseMessageBase OnLocationRequest(RequestMessageLocation requestMessage) { BaiYeMapItem mapInfo = this.service.GetMapInfoByGPS("来自用户提交的位置", Convert.ToSingle(requestMessage.Location_Y.ToString()), Convert.ToSingle(requestMessage.Location_X.ToString()), false); StringBuilder stringBuilder = new StringBuilder(); if (mapInfo != null) { return(build.GetMapItemShow(mapInfo, requestMessage)); } stringBuilder.Append("未找到地图,望见谅。建议输入关键词为详细的地名,包含门牌号或者专有地名等,会提高查询的成功率"); ResponseMessageText expr_6D = base.CreateResponseMessage <ResponseMessageText>(); expr_6D.Content = stringBuilder.ToString(); return(expr_6D); }
private IResponseMessageBase GetNext(string str, BaiYeMapItem baiYeMapItem, RequestMessageText requestMessage) { return(null); }