namespace Yw.Application
{
///
/// BimfaceTool
///
[Route("Bimface/Tool")]
[ApiDescriptionSettings("Bimface", Name = "工具(Std)", Order = 10000)]
public class BimfaceTool_Controller : IDynamicApiController
{
///
/// 获取账号
///
[Route("GetAccount@V1.0")]
[HttpGet]
public BimfaceAccountDto GetAccount()
{
return new BimfaceAccountDto() { AppKey = ConfigHelper.AppKey, AppSecret = ConfigHelper.AppSecret };
}
///
/// 获取ViewToken
///
[Route("GetViewToken@V1.0")]
[HttpGet]
public string GetViewToken([FromQuery][Required] GetViewTokenInput input)
{
var client = Yw.BimfaceClient.GetClient(ConfigHelper.AppKey, ConfigHelper.AppSecret);
if (client == null)
{
throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.V001, "Bimface 账户错误");
}
return client.GetViewToken(input.BimfaceId, input.ModelIdType);
}
}
}