123
using System;
using System.Collections.Generic;
using System.Text;
using um_client_net.sao;
using um_client_net.dto.Hash;
using um_client_net.dto;
using System.Collections;
namespace um_client_net.services
{
public class UMSelfService
{
private SelfServiceSAO selfServiceSAO;
public UMSelfService(SelfServiceSAO selfServiceSAO)
{
this.selfServiceSAO = selfServiceSAO;
}
/// <summary>
/// 发起一个新UM的授权或者取消权限请求
/// </summary>
/// <param name="action">请求的服务</param>
/// <param name="para">请求的参数</param>
/// <returns></returns>
public IUMClientResponse execute(string action, Hashtable para)
{
if (string.IsNullOrEmpty(action))
{
throw new Exception("The argument is empty![action=" + action + "]");
}
IUMClientResponse iresponse = this.selfServiceSAO.execute(action, para);
if (iresponse.ReturnCode == -1)
{
Console.WriteLine(iresponse.ReturnMsg);
throw (new UMException(iresponse.ReturnMsg));
}
return iresponse;
}
}
}