|
@@ -0,0 +1,91 @@
|
|
|
+using Exam.Application.Interface.Exam;
|
|
|
+using Exam.Infrastructure.Data.Entity;
|
|
|
+using Exam.Infrastructure.Data.Extensions;
|
|
|
+using Exam.Share.ViewResponses.Sourceware;
|
|
|
+using Hotline.Application.Exam.Constants;
|
|
|
+using Hotline.Application.Exam.Constants.ApiRoutes;
|
|
|
+using Hotline.Share.Dtos.ExamManages;
|
|
|
+using Hotline.Share.Dtos.Sourcewares;
|
|
|
+using Hotline.Share.Requests.Exam;
|
|
|
+using Hotline.Share.Requests.Sourceware;
|
|
|
+using Hotline.Share.ViewResponses.Exam;
|
|
|
+using Microsoft.AspNetCore.Mvc;
|
|
|
+using XF.Domain.Authentications;
|
|
|
+
|
|
|
+namespace Hotline.Api.Controllers.Exam
|
|
|
+{
|
|
|
+ public class ExamTagController : BaseController
|
|
|
+ {
|
|
|
+ private IExamTagService _examTagService;
|
|
|
+ private ISessionContext _sessionContext;
|
|
|
+ public ExamTagController(IExamTagService examTagService,ISessionContext sessionContext)
|
|
|
+ {
|
|
|
+ _examTagService = examTagService;
|
|
|
+ _sessionContext = sessionContext;
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 新增课件类型
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="examTagDto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost(ExamTagApiRoute.Add)]
|
|
|
+ public async Task Add([FromBody] ExamTagDto examTagDto)
|
|
|
+ {
|
|
|
+ examTagDto.InitRequest(_sessionContext);
|
|
|
+ await _examTagService.AddAsync(examTagDto, HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 修改课件类型
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="examTagDto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPut(ExamTagApiRoute.Update)]
|
|
|
+ public async Task Update([FromBody] ExamTagDto examTagDto)
|
|
|
+ {
|
|
|
+ examTagDto.InitRequest(_sessionContext);
|
|
|
+ await _examTagService.UpdateAsync(examTagDto, HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 删除课件类型
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="entityQueryRequest"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpDelete(ExamTagApiRoute.Delete)]
|
|
|
+
|
|
|
+ public async Task Delete(EntityQueryRequest entityQueryRequest)
|
|
|
+ {
|
|
|
+ await _examTagService.DeleteAsync(entityQueryRequest, HttpContext.RequestAborted);
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 获取树形列表
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpPost(ExamTagApiRoute.GetTreeList)]
|
|
|
+ public async Task<List<ExamTagViewResponse>> GetTreeList([FromBody] ExamTagRequest examTagRequest)
|
|
|
+ {
|
|
|
+ var examTags = await _examTagService.GetTreeAsync(examTagRequest);
|
|
|
+
|
|
|
+ return examTags;
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 获取课件分类
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="id"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpGet(ExamTagApiRoute.Get)]
|
|
|
+ public async Task<ExamTagDto> Get(string id)
|
|
|
+ {
|
|
|
+ var examTagDto = await _examTagService.GetAsync(new EntityQueryRequest
|
|
|
+ {
|
|
|
+ Id = id
|
|
|
+ });
|
|
|
+
|
|
|
+ return examTagDto;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|