lixiaojun
2024-03-30 e9c15d84b7f5edc9fee0c1998e21877d24290d71
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
namespace Yw.Application
{
    /// <summary>
    /// BimfaceTool
    /// </summary>
    [Route("Bimface/Tool")]
    [ApiDescriptionSettings("Bimface", Name = "工具(Std)", Order = 10000)]
    public class BimfaceTool_Controller : IDynamicApiController
    {
 
        /// <summary>
        /// 获取账号
        /// </summary>
        [Route("GetAccount@V1.0")]
        [HttpGet]
        public BimfaceAccountDto GetAccount()
        {
            return new BimfaceAccountDto() { AppKey = ConfigHelper.AppKey, AppSecret = ConfigHelper.AppSecret };
        }
 
        /// <summary>
        /// 获取ViewToken
        /// </summary>
        [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);
        }
    }
}