using DS.Module.Core;
using DS.Module.Core.Data;
using DS.WMS.Core.Sys.Dtos;
using DS.WMS.Core.Sys.Interface;
using Microsoft.AspNetCore.Mvc;
namespace DS.WMS.MainApi.Controllers;
///
/// 组织机构模块
///
public class OrgController : ApiController
{
private readonly ISysOrgService _invokeService;
///
/// 构造函数
///
///
public OrgController(ISysOrgService invokeService)
{
_invokeService = invokeService;
}
///
/// 列表
///
///
///
[HttpPost]
[Route("GetOrgList")]
public DataResult> GetOrgList([FromBody] PageRequest request)
{
var res = _invokeService.GetListByPage(request);
return res;
}
///
/// 编辑
///
///
///
[HttpPost]
[Route("EditOrg")]
public DataResult EditOrg([FromBody] SysOrgReq model)
{
var res = _invokeService.EditOrg(model);
return res;
}
///
/// 详情
///
///
///
[HttpGet]
[Route("GetOrgInfo")]
public DataResult GetOrgInfo([FromQuery] string id)
{
var res = _invokeService.GetOrgInfo(id);
return res;
}
///
/// 获取树型机构
///
///
[HttpGet]
[Route("GetOrgTree")]
public DataResult> GetOrgTree()
{
var res = _invokeService.GetOrgTree();
return res;
}
///
/// 批量删除
///
///
///
[HttpPost]
[Route("BatchDelOrg")]
public DataResult BatchDelOrg([FromBody] IdModel req)
{
var res = _invokeService.BatchDelOrg(req);
return res;
}
///
/// 获取树型机构用户
///
///
[HttpGet]
[Route("GetOrgUserTree")]
public DataResult> GetOrgUserTree()
{
var res = _invokeService.GetOrgUserTree();
return res;
}
}