You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.4 KiB
48 lines
1.4 KiB
using Tiobon.Core.Common.DB.Dapper.Extensions;
|
|
|
|
namespace Tiobon.Core.Api.Controllers;
|
|
|
|
/// <summary>
|
|
/// 培训证书规则(Controller)
|
|
/// </summary>
|
|
[Route("api/[controller]")]
|
|
[ApiController, GlobalActionFilter]
|
|
[Authorize(Permissions.Name), ApiExplorerSettings(GroupName = Grouping.GroupName_Ghre)]
|
|
public class Ghre_CertificateRuleController : BaseController<IGhre_CertificateRuleServices, Ghre_CertificateRule, Ghre_CertificateRuleDto, InsertGhre_CertificateRuleInput, EditGhre_CertificateRuleInput>
|
|
{
|
|
public Ghre_CertificateRuleController(IGhre_CertificateRuleServices service) : base(service)
|
|
{
|
|
}
|
|
|
|
#region 证书预览
|
|
/// <summary>
|
|
/// 证书预览
|
|
/// </summary>
|
|
/// <param name="id"></param>
|
|
[HttpPost, Route("Preview/{id}")]
|
|
public virtual async Task<ServiceResult<Ghre_CertificateRuleDto>> Preview(long id)
|
|
{
|
|
return await _service.Preview(id);
|
|
}
|
|
#endregion
|
|
|
|
|
|
|
|
#region 保存到模板
|
|
/// <summary>
|
|
/// 根据条件查询数据
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[HttpPost("SaveTemplate/{Id}")]
|
|
public async Task<ServiceResult> SaveTemplate(long Id, [FromBody] EditGhre_CertificateRuleInput body)
|
|
{
|
|
var data = Success("更新成功");
|
|
var flag = await _service.SaveTemplate(Id, body);
|
|
if (!flag)
|
|
return Failed("更新失败");
|
|
return data;
|
|
|
|
}
|
|
|
|
#endregion
|
|
} |