102 lines
3.6 KiB
C#
102 lines
3.6 KiB
C#
|
||
using System;
|
||
using System.Collections.Generic;
|
||
using IRaCIS.Core.Application.Contracts;
|
||
using IRaCIS.Core.Application.Contracts.DTO;
|
||
using IRaCIS.Core.Application.Contracts.RequestAndResponse;
|
||
using Microsoft.AspNetCore.Authorization;
|
||
using Microsoft.AspNetCore.Mvc;
|
||
|
||
namespace IRaCIS.Core.API.Controllers.QA
|
||
{
|
||
/// <summary>
|
||
/// Qa模板管理
|
||
/// </summary>
|
||
[Route("QATemplate")]
|
||
[ApiController, Authorize, ApiExplorerSettings(GroupName = "Image")]
|
||
[AllowAnonymous]
|
||
public class QATemplateController : ControllerBase
|
||
{
|
||
private readonly IQATemplateService _qaTemplateService;
|
||
|
||
public QATemplateController(IQATemplateService qaTemplateService)
|
||
{
|
||
_qaTemplateService = qaTemplateService;
|
||
}
|
||
|
||
[HttpPost, Route("AddOrUpdateQATemplate")]
|
||
public IResponseOutput AddOrUpdateQATemplate(QATemplateCommand qaTemplateCommand)
|
||
{
|
||
return _qaTemplateService.AddOrUpdateQATemplate(qaTemplateCommand);
|
||
}
|
||
|
||
|
||
|
||
/// <summary>
|
||
/// 获取QA模板列表
|
||
/// </summary>
|
||
/// <param name="qaTemplateQuery"></param>
|
||
/// <returns></returns>
|
||
[HttpPost, Route("GetQaTemplateList")]
|
||
public IResponseOutput<PageOutput<QATemplateDTO>> GetQaTemplateList(QATemplateQueryDTO qaTemplateQuery)
|
||
{
|
||
return ResponseOutput.Ok(_qaTemplateService.GetQaTemplateList(qaTemplateQuery));
|
||
}
|
||
|
||
/// <summary>
|
||
/// 添加Qa记录时 需要选择模板 这里是模板 下拉框选择列表
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpGet, Route("GetQaTemplateSelectList")]
|
||
public IResponseOutput<List<QATemplateDTO>> GetQaTemplateSelectList()
|
||
{
|
||
return ResponseOutput.Ok(_qaTemplateService.GetQaTemplateSelectList());
|
||
}
|
||
|
||
/// <summary>
|
||
/// 删除 QA模板
|
||
/// </summary>
|
||
/// <param name="qaTemplateId"></param>
|
||
/// <returns></returns>
|
||
[HttpDelete, Route("DeleteQATemplate/{qaTemplateId:guid}")]
|
||
public IResponseOutput DeleteQATemplate(Guid qaTemplateId)
|
||
{
|
||
return _qaTemplateService.DeleteQATemplate(qaTemplateId);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 获取某一Qa模板已配置项
|
||
/// </summary>
|
||
/// <param name="qaTemplateId"></param>
|
||
/// <returns></returns>
|
||
[HttpGet, Route("GetQaTemplateItemsById/{qaTemplateId:guid}")]
|
||
public IResponseOutput<List<QATemplateItemDTO>> GetQaTemplateItemsById(Guid qaTemplateId)
|
||
{
|
||
return ResponseOutput.Ok(_qaTemplateService.GetQaTemplateItemsById(qaTemplateId));
|
||
}
|
||
|
||
|
||
/// <summary>
|
||
/// 获取某一QA模板 配置列表(拥有得Item IsSelect 为true)
|
||
/// </summary>
|
||
/// <param name="qaTemplateId"></param>
|
||
/// <returns></returns>
|
||
[HttpGet, Route("GetQaTemplateConfigList/{qaTemplateId:guid}")]
|
||
public IResponseOutput<List<QATemplateItemSelect>> GetQaTemplateConfigList(Guid qaTemplateId)
|
||
{
|
||
return ResponseOutput.Ok(_qaTemplateService.GetQaTemplateConfigList(qaTemplateId));
|
||
}
|
||
|
||
/// <summary>
|
||
/// 配置Qa模板 和字典表中基础数据 关联关系 IsSelect 为true 添加 false 删除
|
||
/// </summary>
|
||
/// <param name="qaTemplateConfigCommand"></param>
|
||
/// <returns></returns>
|
||
[HttpPost, Route("ConfigQATemplate")]
|
||
public IResponseOutput ConfigQATemplate(QATemplateConfigCommand qaTemplateConfigCommand)
|
||
{
|
||
return _qaTemplateService.ConfigQATemplate(qaTemplateConfigCommand);
|
||
}
|
||
}
|
||
}
|