using System;
|
using System.Collections.Generic;
|
using System.Dynamic;
|
using Microsoft.AspNetCore.Mvc;
|
using MES.Service.service;
|
using MES.Service.Dto.webApi;
|
using MES.Service.util;
|
|
namespace MESApplication.Controllers
|
{
|
[ApiController]
|
[Route("api/[controller]")]
|
public class UserController : ControllerBase
|
{
|
private readonly SysUserService _sysUserService = new SysUserService();
|
|
/// <summary>
|
/// 查询权限
|
/// </summary>
|
/// <param name="userno">用户Id</param>
|
/// <returns>权限信息</returns>
|
[HttpPost("queryPurview")]
|
public ResponseResult QueryPurview([FromQuery] string userno)
|
{
|
try
|
{
|
List<Dictionary<string, object>> userForBase = _sysUserService.QueryPurview(userno);
|
|
if (userForBase.Count == 0)
|
{
|
return new ResponseResult
|
{
|
status = 1,
|
message = "权限不存在!"
|
};
|
}
|
else
|
{
|
dynamic resultInfos = new ExpandoObject();
|
resultInfos.tbBillList = userForBase;
|
|
return new ResponseResult
|
{
|
status = 0,
|
message = "查询权限成功!",
|
data = resultInfos
|
};
|
}
|
}
|
catch (Exception ex)
|
{
|
Console.WriteLine(ex.ToString());
|
return new ResponseResult
|
{
|
status = 1,
|
message = "查询权限失败!"
|
};
|
}
|
}
|
}
|
}
|