z8018
2 天以前 d8dc91f9c1fece5711e38edd1b1274cb9e579015
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
37
38
39
40
41
42
43
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using WIDESEA_Core;
using WIDESEA_Core.BaseController;
using WIDESEA_DTO.BasicInfo;
using WIDESEA_IBasicInfoServices;
using WIDESEA_Model.Models;
 
namespace WIDESEA_ProductMgmtServer.Controllers.BasicInfo
{
    [Route("api/[controller]")]
    [ApiController]
    public class ProductsController : ApiBaseController<IProductsService, Dt_Products>
    {
        public ProductsController(IProductsService service) : base(service)
        {
        }
 
        /// <summary>
        /// 验证激活请求的API接口
        /// </summary>
        /// <param name="activationModel">包含激活信息的DTO对象</param>
        /// <returns>包含验证结果的WebResponseContent对象</returns>
        [HttpPost("ValidateActivation"), AllowAnonymous]
        public WebResponseContent ValidateActivation([FromBody] ActivationDTO activationModel)
        {
            return Service.ValidateActivation(activationModel);
        }
 
        /// <summary>
        /// 获取指定产品名称和设备ID的激活信息。
        /// </summary>
        /// <param name="productName">产品名称。</param>
        /// <param name="deviceId">设备ID。</param>
        /// <returns>包含激活信息的WebResponseContent对象。</returns>
        [HttpGet("GetActivationInfo/{productName}/{deviceId}"), AllowAnonymous]
        public WebResponseContent GetActivationInfo(string deviceId, string productName)
        {
            return Service.GetActivationInfo(deviceId, productName);
        }
    }
}