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.
61 lines
1.9 KiB
61 lines
1.9 KiB
2 years ago
|
using Microsoft.AspNetCore.Authorization;
|
||
|
using Microsoft.AspNetCore.Mvc;
|
||
|
using System.Collections.Generic;
|
||
|
using System.ComponentModel.DataAnnotations;
|
||
|
using System.Threading.Tasks;
|
||
|
using Znyc.Recruitment.Common.Output;
|
||
|
using Znyc.Recruitment.Service;
|
||
|
|
||
|
namespace Znyc.Recruitment.Controllers
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// 数据字典
|
||
|
/// </summary>
|
||
|
public class DictionaryController : BaseController
|
||
|
{
|
||
|
private readonly IDictionaryService _dictionaryServices;
|
||
|
public DictionaryController(IDictionaryService dictionaryServices)
|
||
|
{
|
||
|
_dictionaryServices = dictionaryServices;
|
||
|
}
|
||
|
|
||
|
/// <summary>
|
||
|
/// 根据Id获取字典
|
||
|
/// </summary>
|
||
|
/// <param name="id"></param>
|
||
|
/// <returns></returns>
|
||
|
[HttpGet]
|
||
|
[AllowAnonymous]
|
||
|
[Route("api/v1/dict/{id}")]
|
||
|
public async Task<IResponseOutput<DictionaryListOutput>> GetByIdAsync([Required] int id)
|
||
|
{
|
||
|
return await _dictionaryServices.GetByIdAsync(id);
|
||
|
}
|
||
|
|
||
|
///// <summary>
|
||
|
///// 根据pid查询字典列表
|
||
|
///// </summary>
|
||
|
///// <param name="pid"></param>
|
||
|
///// <returns></returns>
|
||
|
//[HttpGet]
|
||
|
//[AllowAnonymous]
|
||
|
//[Route("api/v1/dict/{pid}")]
|
||
|
//public async Task<IResponseOutput<List<DictionaryListOutput>>> GetListByParentIdAsync([Required] long pid)
|
||
|
//{
|
||
|
// return await _dictionaryServices.GetListByParentIdAsync(pid);
|
||
|
//}
|
||
|
|
||
|
/// <summary>
|
||
|
///
|
||
|
/// </summary>
|
||
|
/// <param name="code"></param>
|
||
|
/// <returns></returns>
|
||
|
[HttpGet]
|
||
|
[AllowAnonymous]
|
||
|
[Route("api/v1/dict/code/{code}")]
|
||
|
public async Task<IResponseOutput<List<DictionaryListOutput>>> GetListByCodeAsync(string code)
|
||
|
{
|
||
|
return await _dictionaryServices.GetListByCodeAsync(code);
|
||
|
}
|
||
|
}
|
||
|
}
|