You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

190 lines
4.7 KiB
C#

12 months ago
using DS.Module.Core;
using DS.Module.Core.Extensions;
using DS.WMS.Core.System.Dtos;
using DS.WMS.Core.System.Interface;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using SqlSugar;
12 months ago
namespace DS.WMS.MainApi.Controllers;
/// <summary>
/// 公共模块
/// </summary>
public class CommonController : ApiController
{
private readonly ICommonService _invokeService;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="invokeService"></param>
public CommonController(ICommonService invokeService)
{
_invokeService = invokeService;
}
12 months ago
/// <summary>
/// 登出
/// </summary>
/// <returns></returns>
[HttpPost]
[Route("Logout")]
public DataResult<string> Logout()
{
return DataResult<string>.Success("");
}
10 months ago
/// <summary>
/// 用户登录-客户端
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpPost]
[AllowAnonymous]
[Route("ClientUserLogin")]
public DataResult<string> ClientUserLogin([FromBody] UserLoginModel model)
{
var res = _invokeService.ClientUserLogin(model);
return res;
}
10 months ago
/// <summary>
/// 客户端刷新Token
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("ClientUserRefreshToken")]
public DataResult<RefreshTokenRes> ClientUserRefreshToken()
{
var res = _invokeService.ClientUserRefreshToken();
return res;
}
10 months ago
10 months ago
/// <summary>
/// 更换机构
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("ChangeOrg")]
public DataResult<RefreshTokenRes> ChangeOrg([FromQuery]string id)
{
var res = _invokeService.ChangeOrg(id);
return res;
}
10 months ago
/// <summary>
/// 获取用户-客户端
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("GetClientUserInfo")]
public DataResult<CurrentUserViewModel> GetClientUserInfo()
{
var res = _invokeService.GetClientUserInfo();
return res;
}
/// <summary>
/// 查询用户拥有的菜单权限-客户端
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("GetClientUserPermissionByToken")]
public DataResult<List<RouteItem>> GetClientUserPermissionByToken()
{
var res = _invokeService.GetClientUserPermissionByToken();
return res;
}
12 months ago
/// <summary>
/// 获取角色下拉选项
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("GetRoleList")]
public DataResult<List<ApiSelectViewModel>> GetRoleList()
{
var res = _invokeService.GetRoleList();
return res;
}
/// <summary>
/// 修改密码
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpPost]
[Route("ChangePassword")]
11 months ago
public DataResult ChangePassword([FromBody] ChangePasswordReq model)
12 months ago
{
var res = _invokeService.ChangePassword(model);
return res;
}
/// <summary>
/// 企业用户注册
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[AllowAnonymous]
[HttpPost]
[Route("TenantRegister")]
public DataResult TenantRegister([FromBody] TenantRegisterReq model)
{
var res = _invokeService.TenantRegister(model);
return res;
}
10 months ago
/// <summary>
/// 获取权限树列表-客户端
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("GetClientPermissionTreeList")]
public DataResult<List<PermissionTreeList>> GetClientPermissionTreeList()
{
var res = _invokeService.GetClientPermissionTreeList();
return res;
}
12 months ago
/// <summary>
/// 获取数据权限字段
/// </summary>
/// <param name="permissionId"></param>
/// <returns></returns>
[HttpGet]
[AllowAnonymous]
[Route("GetDataRuleEntityFields")]
public DataResult<List<EntityFieldProperty>> GetDataRuleEntityFields([FromQuery] string permissionId)
{
var res = _invokeService.GetDataRuleEntityFields(permissionId);
return res;
}
/// <summary>
/// 获取数据库表及视图名
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("GetTables")]
public DataResult<List<DbTableInfo>> GetTables()
{
var res = _invokeService.GetTables();
return res;
}
/// <summary>
/// 获取数据库表及视图名
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("GetColumns")]
public DataResult<List<DbColumnInfo>> GetColumns([FromQuery] string tableViewName)
{
var res = _invokeService.GetColumns(tableViewName);
return res;
}
12 months ago
}