/// <summary>
        /// Assembles a GetStoryResponse object from a story string and a story ID
        /// </summary>
        /// <param name="storyText"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public static GetStoryResponse Assemble(string storyText, int id)
        {
            GetStoryResponse getStoryResponse = new GetStoryResponse();

            getStoryResponse.Story = StoryAssembler.Assemble(storyText, id);

            return(getStoryResponse);
        }
예제 #2
0
파일: Program.cs 프로젝트: xjie06109334/SOP
        // 标准用法
        private static void TestGet()
        {
            // 创建请求对象
            GetStoryRequest request = new GetStoryRequest();
            // 请求参数
            GetStoryModel model = new GetStoryModel();

            model.Name       = "白雪公主";
            request.BizModel = model;

            // 发送请求
            GetStoryResponse response = client.Execute(request);

            if (response.IsSuccess())
            {
                // 返回结果
                Console.WriteLine("成功!response:{0}\n响应原始内容:{1}", JsonUtil.ToJSONString(response), response.Body);
            }
            else
            {
                Console.WriteLine("错误, code:{0}, msg:{1}, subCode:{2}, subMsg:{3}",
                                  response.Code, response.Msg, response.SubCode, response.SubMsg);
            }
        }