123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- using System.Collections.Generic;
- using System.Threading.Tasks;
- using GxPress.Common.Page;
- using GxPress.Repository.Interface.Organization;
- using GxPress.Result.Organization;
- using Microsoft.AspNetCore.Authorization;
- using Microsoft.AspNetCore.Mvc;
- namespace GxPress.Api.AdminControllers
- {
- [Route("api/admin/organization")]
- [ApiController]
- [Authorize]
- public class AdminOrganizationController : Controller
- {
- private readonly IOrganizationRepository repository;
- public AdminOrganizationController(IOrganizationRepository repository)
- {
- this.repository = repository;
- }
- /// <summary>
- /// 机构列表
- /// </summary>
- /// <param name="request"></param>
- /// <returns></returns>
- [HttpPost]
- public async Task<PagedList<Entity.tede2.Organization.Organization>> GetAllAsync(OrganizationListRequest request)
- {
- return await repository.GetAllAsync(request);
- }
- /// <summary>
- /// 修改
- /// </summary>
- /// <param name="request"></param>
- /// <returns></returns>
- [HttpPut]
- public async Task<bool> UpdateAsync(OrganizationUpdateRequest request)
- {
- return await repository.UpdateAsync(request);
- }
- /// <summary>
- /// 删除
- /// </summary>
- /// <param name="ids"></param>
- /// <returns></returns>
- [HttpDelete]
- public async Task<bool> DeleteAsync(List<int> ids)
- {
- return await repository.DeleteAsync(ids);
- }
- /// <summary>
- /// 修改
- /// </summary>
- /// <param name="request"></param>
- /// <returns></returns>
- [HttpPut("update")]
- public async Task<bool> UpdateIsDisableAsync(OrganizationUpdateDisableRequest request)
- {
- return await repository.UpdateIsDisableAsync(request);
- }
- /// <summary>
- /// 添加
- /// /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- [HttpPost("add")]
- public async Task<bool> InsertAsync(Entity.tede2.Organization.Organization model)
- {
- return await repository.InsertAsync(model);
- }
- }
- }
|