|
@@ -1,20 +1,12 @@
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
-using System.Linq;
|
|
|
using System.Threading.Tasks;
|
|
|
-using GxPress.Auth;
|
|
|
using GxPress.Common.Page;
|
|
|
using GxPress.Entity;
|
|
|
using GxPress.Repository.Interface;
|
|
|
-using GxPress.Request.Admin;
|
|
|
-using GxPress.Request.AppVersion;
|
|
|
using GxPress.Request.Thesaurus;
|
|
|
-using GxPress.Result.Admin;
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
-using Microsoft.AspNetCore.Http;
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
-using Microsoft.Extensions.Logging;
|
|
|
-using Microsoft.Extensions.Options;
|
|
|
|
|
|
namespace GxPress.Api.AdminControllers
|
|
|
{
|
|
@@ -26,9 +18,7 @@ namespace GxPress.Api.AdminControllers
|
|
|
[Authorize]
|
|
|
public class AdminThesaurusController : ControllerBase
|
|
|
{
|
|
|
-
|
|
|
private readonly IThesaurusRepository _thesaurusRepository;
|
|
|
-
|
|
|
public AdminThesaurusController(IThesaurusRepository thesaurusRepository)
|
|
|
{
|
|
|
_thesaurusRepository = thesaurusRepository;
|
|
@@ -39,7 +29,6 @@ namespace GxPress.Api.AdminControllers
|
|
|
/// <param name="request">参数</param>
|
|
|
/// <returns></returns>
|
|
|
[HttpPut("add")]
|
|
|
- [AllowAnonymous]
|
|
|
public async Task<bool> InThesaurus([FromBody] ThesaurusInRequest request)
|
|
|
{
|
|
|
if (!string.IsNullOrEmpty(request.ThesaurusName) && request.ThesaurusName.Length > 500)
|
|
@@ -56,8 +45,7 @@ namespace GxPress.Api.AdminControllers
|
|
|
/// <param name="request"></param>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost("page")]
|
|
|
- [AllowAnonymous]
|
|
|
- public async Task<PagedList<Thesaurus>> GetPagedList([FromBody]ThesaurusPageSearchRequest request)
|
|
|
+ public async Task<PagedList<Thesaurus>> GetPagedList([FromBody] ThesaurusPageSearchRequest request)
|
|
|
{
|
|
|
return await _thesaurusRepository.GetPageList(request);
|
|
|
}
|
|
@@ -73,6 +61,16 @@ namespace GxPress.Api.AdminControllers
|
|
|
return await _thesaurusRepository.DeleteAsync(id);
|
|
|
}
|
|
|
/// <summary>
|
|
|
+ /// 删除
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="ids"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ [HttpDelete("delete")]
|
|
|
+ public async Task<bool> Deletes(List<int> ids)
|
|
|
+ {
|
|
|
+ return await _thesaurusRepository.DeleteAsync(ids);
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
/// 详情
|
|
|
/// </summary>
|
|
|
/// <param name="id"></param>
|
|
@@ -90,7 +88,7 @@ namespace GxPress.Api.AdminControllers
|
|
|
/// <param name="request"></param>
|
|
|
/// <returns></returns>
|
|
|
[HttpPut("{id}")]
|
|
|
- public async Task<bool> Update(int id, [FromBody] Thesaurus request)
|
|
|
+ public async Task<bool> Update(int id, [FromBody] ThesaurusUpdateRequest request)
|
|
|
{
|
|
|
if (!string.IsNullOrEmpty(request.ThesaurusName) && request.ThesaurusName.Length > 500)
|
|
|
{
|