using Tiobon.Core.Model.ViewModels.Extend;

namespace Tiobon.Core.Api.Controllers;

/// <summary>
/// 简历模板(Controller)
/// </summary>
[Route("api/[controller]")]
[ApiController, GlobalActionFilter]
[Authorize(Permissions.Name), ApiExplorerSettings(GroupName = Grouping.GroupName_Ghrh)]
public class Ghrh_ResumeTemplateController : BaseController<IGhrh_ResumeTemplateServices, Ghrh_ResumeTemplate, Ghrh_ResumeTemplateDto, InsertGhrh_ResumeTemplateInput, EditGhrh_ResumeTemplateInput>
{
    public Ghrh_ResumeTemplateController(IGhrh_ResumeTemplateServices service) : base(service)
    {
    }

    #region 是否开启
    /// <summary>
    /// 是否开启
    /// </summary> 
    /// <param name="id"></param>
    /// <param name="isPublish"></param>
    /// <returns></returns>
    [HttpPost("SwitchPublish/{id}/{isPublish}")]
    public async Task<ServiceResult> SwitchPublish(long id, int? isPublish) => await _service.SwitchPublish(id, isPublish);
    #endregion

    #region 获取分组数据
    /// <summary>
    /// 获取分组数据
    /// </summary>
    /// <param name="filter"></param>
    /// <returns></returns>
    [HttpPost("QueryGroup")]
    public async Task<ServiceResult<List<Ghrh_ResumeInfoGroupDto>>> QueryGroup([FromBody] QueryForm filter) => await _service.QueryGroup(filter);

    #endregion

    #region 切换照片类型
    /// <summary>
    /// 切换照片类型
    /// </summary> 
    /// <param name="id"></param>
    /// <param name="photoType"></param>
    /// <returns></returns>
    [HttpPost("PhotoSwitch/{id}/{photoType}")]
    public async Task<ServiceResult> PhotoSwitch(long id, int? photoType) => await _service.PhotoSwitch(id, photoType);
    #endregion

    #region 模板栏位异动
    /// <summary>
    /// 模板栏位异动
    /// </summary> 
    /// <param name="id"></param>
    /// <param name="columns"></param>
    /// <returns></returns>
    [HttpPost("ColumnMove/{id}")]
    public async Task<ServiceResult> ColumnMove(long id, [FromBody] List<ResumeTemplateColumnMove> columns) => await _service.ColumnMove(id, columns);
    #endregion

    #region 获取分组数据
    /// <summary>
    /// 获取分组数据
    /// </summary>
    /// <param name="filter"></param>
    /// <returns></returns>
    [HttpPost("QueryTemplateColumn")]
    public async Task<ServiceResult<List<ResumeTemplateGroupColumn>>> QueryTemplateColumn([FromBody] QueryForm filter) => await _service.QueryTemplateColumn(filter);

    #endregion

    #region 执行分组列栏位操作
    /// <summary>
    /// 执行分组列栏位操作
    /// </summary>
    /// <param name="filter"></param>
    /// <returns></returns>
    [HttpPost("ExceteTemplateColumnChange")]
    public async Task<ServiceResult> ExceteTemplateColumnChange([FromBody] QueryForm filter) => await _service.ExceteTemplateColumnChange(filter);

    #endregion

    #region 查询模板栏位
    /// <summary>
    /// 查询模板栏位
    /// </summary>
    /// <param name="filter"></param>
    /// <returns></returns>
    [HttpPost("QueryTemplateColumnSingle")]
    public async Task<ServiceResult<Ghrh_ResumeInfoColumnDto>> QueryTemplateColumnSingle([FromBody] QueryForm filter) => await _service.QueryTemplateColumnSingle(filter);

    #endregion

    #region 查询模板栏位
    /// <summary>
    /// 查询模板栏位
    /// </summary>
    /// <param name="filter"></param>
    /// <returns></returns>
    [HttpPost("PT_GHR30_StaffTemplate_IUD")]
    public async Task<ServiceResult> PT_GHR30_StaffTemplate_IUD([FromBody] QueryForm1 filter) => await _service.PT_GHR30_StaffTemplate_IUD(filter);

    #endregion
}