Example #1
0
        public async Task <WeixinResponse> WeixinSign(string url)
        {
            var response = new WeixinResponse();

            if (url.IsNullOrEmpty())
            {
                response.Message = "未提供URL";
                return(response);
            }

            response = await url.WeixinSignResponse();

            return(response);
        }
Example #2
0
        public string GetRspForSearch(HttpSessionStateBase session, HttpRequestBase request, LibrarySearchOption option)
        {
            WeixinResponse rsp = null;
            object         error;
            var            libStopwatch = Stopwatch.StartNew();
            var            result       = Library.GetInstance().SearchBooksFor(session, option, out error);

            if (error == null)
            {
                libStopwatch.Stop();
                rsp = LibrarySearchResponse.Create(request, result);
                ApplicationLogger.GetLogger().Info(String.Format("(" + session.SessionID + ")"
                                                                 + "search library with " + option.Keyword + " consume " + libStopwatch.ElapsedMilliseconds));
            }
            else
            {
                rsp = new TextResponse(option.User, String.Format("查询出错: {0}", error));
            }
            return(rsp.ToString());
        }