app 呼叫介面

大樹2發表於2018-07-19

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": ""}

相關文章