app 调用接口

app 调用接口

/// <summary>
/// 是否跳转到活动注册成功页面
/// </summary>
/// <returns></returns>
[HttpGet]
public JsonResult IsActivityRegisterSuccess()
{
string result = string.Empty;
try
{
result = ConfigurationManager.AppSettings["IsActivityRegisterSuccess"] ?? "False";
return Json(
new
{
IsSuccess = true,
Message = "获取是否跳转活动注册成功页面状态值成功",
ResultData = Boolean.Parse(result)
}, JsonRequestBehavior.AllowGet);
}
catch (Exception ex)
{
return Json(
new
{
IsSuccess = false,
Message = "获取是否跳转活动注册成功页面状态值失败 -- " + ex,
ResultData = Boolean.Parse(result)
}, JsonRequestBehavior.AllowGet);
}
}

 

#region 订单相关
/// <summary>
/// 查询订单详情 (新接口)
/// </summary>
public JsonResult QueryNewOrderDetailBySchemeId()
{
try
{
string userToken = CurrentUserLoginInfo.UserToken;

string schemeId = Request["SchemeId"];
if (string.IsNullOrEmpty(schemeId))
throw new ArgumentException("订单号不能为空!");

if (schemeId.StartsWith("CHASE"))
return QueryCHASEOrderDetail(schemeId, userToken);
else if (schemeId.StartsWith("TSM"))
return QueryTMSOrderDetail(schemeId, userToken);
else
return QueryGeneralOrderDetail(schemeId, userToken);
}
catch (ArgumentException ex)
{
return Json(new CommonResult
{
IsSuccess = false,
Message = ex.Message,
ResultCode = (int)ResultCodeEnum.VerifyError,
});
}
catch (Exception ex)
{
return Json(new CommonResult
{
IsSuccess = false,
Message = ex.Message,
ResultCode = (int)ResultCodeEnum.APIError,
});
}
}

 

群发短信1.0版本接口

接口规范

code: 接口状态码(200:成功 其他:后台子定义) message:接口状态信息 data:接口返回数据结构

接口名称:
  1. 注册设备号

    地址: http://*:8080/home/TaskLogin

    参数:Address(设备号) PhoneNumber(设备手机号码)

    正确的返回格式: {"code": 200,"message": "成功","data": ""}

    错误的返回格式: {"code": 404,"message": "失败原因","data": ""}

  2. 根据手机号获取任务

    地址: http://*:8080/home/GetTaskPhoneNumber

    参数:Address(设备号) PhoneNumber(设备手机号码)

    正确的返回格式:

{"code": 200,"message": "成功","data":{{
                                       "taskToken": "665a834cd9b949ffb1e2a852cb87173e",
                                       "phoneNumber": [
                                           {
                                               "id": 22,
                                               "status": "1",
                                               "fromPhone": "13973123242",
                                               "toPhone": "13973123243",
                                               "sendContent": "不不不不不不",
                                               "sendTime": "2018-08-17 16:57:48"
                                           },
                                           {
                                               "id": 23,
                                               "status": "1",
                                               "fromPhone": "13973123242",
                                               "toPhone": "13973123244",
                                               "sendContent": "不不不不不不",
                                               "sendTime": "2018-08-17 16:57:48"
                                           },
                                           
                                       ]
                                   }
                               } }
错误的返回格式:
{"code": 404,"message": "失败原因","data": null}

  1. 更新每个短信状态

    地址: http://*:8080/home/SMSRefresh

    参数:phoneNumber(接收短信的手机号) taskId(任务 ID) stateCode(发送状态) TaskToken(...)

    正确的返回格式: {"code": 200,"message": "成功","data": ""}

    错误的返回格式: {"code": 404,"message": "失败原因","data": ""}

posted @ 2018-07-19 20:04 大树2 阅读(...) 评论(...) 编辑 收藏