基线 SVN r240
SVN-Revision: r240
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Lskj.Push.Common.Resp
|
||||
{
|
||||
public class APIConnectionException:Exception
|
||||
{
|
||||
public APIConnectionException(String message):base(message)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Lskj.Push.Common.Resp
|
||||
{
|
||||
public class BooleanResult : DefaultResult
|
||||
{
|
||||
public bool result;
|
||||
new public static BooleanResult fromResponse(ResponseWrapper responseWrapper)
|
||||
{
|
||||
BooleanResult tagListResult = new BooleanResult();
|
||||
if (responseWrapper.isServerResponse())
|
||||
{
|
||||
tagListResult = JsonConvert.DeserializeObject<BooleanResult>(responseWrapper.responseContent);
|
||||
}
|
||||
tagListResult.ResponseResult = responseWrapper;
|
||||
return tagListResult;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Lskj.Push.Common.Resp
|
||||
{
|
||||
public class DefaultResult:BaseResult
|
||||
{
|
||||
|
||||
public static DefaultResult fromResponse(ResponseWrapper responseWrapper)
|
||||
{
|
||||
DefaultResult result = null;
|
||||
|
||||
if (responseWrapper.isServerResponse())
|
||||
{
|
||||
result = new DefaultResult();
|
||||
}
|
||||
|
||||
result.ResponseResult=responseWrapper;
|
||||
|
||||
return result;
|
||||
}
|
||||
public override bool isResultOK()
|
||||
{
|
||||
if (Equals(ResponseResult.responseCode, HttpStatusCode.OK))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user