Ejemplo n.º 1
0
        public void DownloadEmoticon(int nodeid, int id)
        {
            EmoticonFacade facade = new EmoticonFacade();
            var            result = facade.DownloadEmoticon(nodeid, id);

            if (result.Item1)
            {
                var    s     = new FileStream(result.Item3, FileMode.Open);
                var    type  = System.IO.Path.GetExtension(result.Item3);
                byte[] array = new byte[s.Length];
                s.Read(array, 0, array.Length);
                s.Seek(0L, SeekOrigin.Begin);
                s.Dispose();
                HttpContext.Response.ContentType = "application/octet-stream";
                HttpContext.Response.AddHeader("Content-Disposition", "attachment; filename=" + HttpUtility.UrlEncode(result.Item2 + type, System.Text.Encoding.UTF8));
                HttpContext.Response.BinaryWrite(array);
            }
            else
            {
                var data = new Respbase {
                    Result = facade.PromptInfo.Result, Message = facade.PromptInfo.Message
                };
                HttpContext.Response.StatusCode  = 500;
                HttpContext.Response.ContentType = "application/json";
                HttpContext.Response.BinaryWrite(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(data)));
            }

            HttpContext.Response.Flush();
            HttpContext.Response.End();
        }
Ejemplo n.º 2
0
        public Respbase CreateShowNameFile(CreateShowReq req)
        {
            EmoticonFacade facade = new EmoticonFacade();

            facade.CreateShowNameFile(req);
            return(new Respbase {
                Result = facade.PromptInfo.Result, Message = facade.PromptInfo.Message
            });
        }
Ejemplo n.º 3
0
        public Respbase <List <EmoticonsDto> > SearchEmoticons(SearchEmoticonsReq req)
        {
            EmoticonFacade facade = new EmoticonFacade();
            var            result = facade.SearchEmoticons(req);

            if (result != null)
            {
                return(new Respbase <List <EmoticonsDto> > {
                    Result = 1, Message = "获取成功", Data = result
                });
            }
            return(new Respbase <List <EmoticonsDto> > {
                Result = facade.PromptInfo.Result, Message = facade.PromptInfo.Message, Data = null
            });
        }
Ejemplo n.º 4
0
        public Respbase <List <EmoticonsDto> > GetSingleEmoticons(PageBase req)
        {
            EmoticonFacade facade = new EmoticonFacade();
            var            result = facade.GetSingleEmoticons(req);

            if (result != null)
            {
                return(new Respbase <List <EmoticonsDto> > {
                    Result = 1, Message = "获取成功", Data = result
                });
            }
            return(new Respbase <List <EmoticonsDto> > {
                Result = facade.PromptInfo.Result, Message = facade.PromptInfo.Message, Data = null
            });
        }
Ejemplo n.º 5
0
        public Respbase <List <string> > GetHotEmoticons(HotEmoticonsReq req)
        {
            EmoticonFacade facade = new EmoticonFacade();
            var            result = facade.GetHotEmoticons(req);

            if (result != null)
            {
                return(new Respbase <List <string> > {
                    Result = 1, Message = "获取成功", Data = result
                });
            }
            return(new Respbase <List <string> > {
                Result = facade.PromptInfo.Result, Message = facade.PromptInfo.Message, Data = null
            });
        }
Ejemplo n.º 6
0
        public Respbase VerifyPayResult(VerifyPayReq req)
        {
            EmoticonFacade facade = new EmoticonFacade();
            var            result = facade.VerifyPayResult(req);

            if (result)
            {
                return(new Respbase {
                    Result = 1, Message = "支付成功"
                });
            }
            return(new Respbase {
                Result = facade.PromptInfo.Result, Message = facade.PromptInfo.Message
            });
        }
Ejemplo n.º 7
0
        public Respbase <List <EmoticonDetailDto> > GetEmoticonMaterialDetail(EmoticonMaterialDetailReq req)
        {
            EmoticonFacade facade = new EmoticonFacade();
            var            result = facade.GetEmoticonMaterialDetail(req);

            if (result != null)
            {
                return(new Respbase <List <EmoticonDetailDto> > {
                    Result = 1, Message = "成功", Data = result
                });
            }
            return(new Respbase <List <EmoticonDetailDto> > {
                Result = facade.PromptInfo.Result, Message = facade.PromptInfo.Message
            });
        }
Ejemplo n.º 8
0
        public Respbase <OpenInfUeoDto> BuyEmoticon(DownloadEmoticonReq req)
        {
            EmoticonFacade facade = new EmoticonFacade();
            var            result = facade.BuyEmoticon(req);

            if (result.Item1)
            {
                return(new Respbase <OpenInfUeoDto> {
                    Result = facade.PromptInfo.Result, Message = facade.PromptInfo.Message, Data = result.Item2
                });
            }
            return(new Respbase <OpenInfUeoDto> {
                Result = facade.PromptInfo.Result, Message = facade.PromptInfo.Message
            });
        }