43 lines
1.2 KiB
C#
43 lines
1.2 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using Zxd.Core.Domain.Dto.Wework;
|
|
|
|
namespace Zxd.Core.WebApi.Controllers
|
|
{
|
|
[ApiSignatureFilterForbid]
|
|
public class DeptmentController : BaseController
|
|
{
|
|
private readonly IDeptmentDomain _deptDomain;
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="deptDomain"></param>
|
|
public DeptmentController(IDeptmentDomain deptDomain)
|
|
{
|
|
_deptDomain = deptDomain;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取事业部
|
|
/// </summary>
|
|
/// <param name="IsDept"></param>
|
|
/// <returns></returns>
|
|
[HttpGet("Depts")]
|
|
public async Task<List<DeptmentDto>> GetDeptments(bool? IsDept = null)
|
|
{
|
|
return await _deptDomain.GetDeptments(IsDept);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据渠道号获取事业部
|
|
/// </summary>
|
|
/// <param name="channel"></param>
|
|
/// <returns></returns>
|
|
[HttpGet("Dept")]
|
|
public async Task<DeptmentDto?> GetDeptmentByChannel([Required] int channel)
|
|
{
|
|
return await _deptDomain.GetDeptmentByChannel(channel);
|
|
}
|
|
}
|
|
} |