using DS.Module.Core;
using DS.Module.Core.Extensions;
using DS.WMS.Core.Code.Dtos;
using DS.WMS.Core.Sys.Dtos;
using DS.WMS.Core.Sys.Entity;
using DS.WMS.Core.Sys.Interface;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using SqlSugar;
namespace DS.WMS.MainApi.Controllers;
///
/// 公共模块
///
public class CommonController : ApiController
{
private readonly ICommonService _invokeService;
///
/// 构造函数
///
///
public CommonController(ICommonService invokeService)
{
_invokeService = invokeService;
}
///
/// 登出
///
///
[HttpPost]
[Route("Logout")]
public DataResult Logout()
{
return DataResult.Success("");
}
///
/// 用户登录-客户端
///
///
///
[HttpPost]
[AllowAnonymous]
[Route("ClientUserLogin")]
public async Task> ClientUserLogin([FromBody] UserLoginModel model)
{
var res = await _invokeService.ClientUserLogin(model);
return res;
}
///
/// 用户登录-邮箱
///
///
///
[HttpPost]
[AllowAnonymous]
[Route("ClientUserEmailLogin")]
public async Task> ClientUserEmailLogin([FromBody] UserEmailLoginModel model)
{
var res = await _invokeService.ClientUserEmailLogin(model);
return res;
}
///
/// 用户登录-手机号
///
///
///
[HttpPost]
[AllowAnonymous]
[Route("ClientUserPhoneLogin")]
public async Task> ClientUserPhoneLogin([FromBody] UserPhoneLoginModel model)
{
var res = await _invokeService.ClientUserPhoneLogin(model);
return res;
}
///
/// 客户端刷新Token
///
///
[HttpGet]
[Route("ClientUserRefreshToken")]
[AllowAnonymous]
public DataResult ClientUserRefreshToken()
{
var res = _invokeService.ClientUserRefreshToken();
return res;
}
///
/// 更换机构
///
///
[HttpGet]
[Route("ChangeOrg")]
public DataResult ChangeOrg([FromQuery] string id)
{
var res = _invokeService.ChangeOrg(id);
return res;
}
///
/// 获取用户-客户端
///
///
[HttpGet]
[Route("GetClientUserInfo")]
public async Task> GetClientUserInfo()
{
var res = await _invokeService.GetClientUserInfo();
return res;
}
///
/// 查询用户拥有的菜单权限-客户端
///
///
[HttpGet]
[Route("GetClientUserPermissionByToken")]
public async Task>> GetClientUserPermissionByToken()
{
var res = await _invokeService.GetClientUserPermissionByToken();
return res;
}
///
/// 获取客户端按钮权限
///
///
[HttpGet]
[Route("GetClientUserPermissionCode")]
public async Task> GetClientUserPermissionCode()
{
var res = await _invokeService.GetClientUserPermissionCode();
return res;
}
///
/// 获取角色下拉选项
///
///
[HttpGet]
[Route("GetRoleList")]
public DataResult> GetRoleList()
{
var res = _invokeService.GetRoleList();
return res;
}
///
/// 获取用户下拉选项
///
///
[HttpGet]
[Route("GetUserList")]
public DataResult> GetUserList([FromQuery]string queryKey = "")
{
var res = _invokeService.GetUserList(queryKey);
return res;
}
///
/// 获取机构下拉选项
///
///
[HttpGet]
[Route("GetOrgList")]
public DataResult> GetOrgList([FromQuery] string queryKey = "")
{
var res = _invokeService.GetOrgList(queryKey);
return res;
}
///
/// 获取商品类型下拉选项
///
///
[HttpGet]
[Route("GetGoodsTypeList")]
public DataResult> GetGoodsTypeList()
{
var res = _invokeService.GetGoodsTypeList();
return res;
}
///
/// 获取商品类型下拉选项-客户端
///
///
[HttpGet]
[Route("GetClientGoodsTypeList")]
public DataResult> GetClientGoodsTypeList()
{
var res = _invokeService.GetClientGoodsTypeList();
return res;
}
///
/// 获取国家信息下拉选项
///
///
[HttpGet]
[Route("GetCountrySelectList")]
public DataResult> GetCountrySelectList()
{
var res = _invokeService.GetCountrySelectList();
return res;
}
///
/// 获取国家信息下拉列表-客户端
///
///
[HttpGet]
[Route("GetClientCountrySelectList")]
public DataResult> GetClientCountrySelectList()
{
var res = _invokeService.GetClientCountrySelectList();
return res;
}
///
/// 获取航线信息下拉选项
///
///
[HttpGet]
[Route("GetLanesSelectList")]
public DataResult> GetLanesSelectList()
{
var res = _invokeService.GetLanesSelectList();
return res;
}
///
/// 获取航线信息下拉列表-客户端
///
///
[HttpGet]
[Route("GetClientLanesSelectList")]
public DataResult> GetClientLanesSelectList()
{
var res = _invokeService.GetClientLanesSelectList();
return res;
}
///
/// 获取港口信息下拉选项
///
///
[HttpGet]
[Route("GetPortSelectList")]
public DataResult> GetPortSelectList()
{
var res = _invokeService.GetPortSelectList();
return res;
}
///
/// 获取港口信息下拉列表-客户端
///
///
[HttpGet]
[Route("GetClientPortSelectList")]
public async Task>> GetClientPortSelectList([FromQuery] string queryKey = "")
{
var res = await _invokeService.GetClientPortSelectList(queryKey);
return res;
}
///
/// 获取付费方式下拉列表-客户端
///
///
[HttpGet]
[Route("GetClientFrtSelectList")]
public DataResult> GetClientFrtSelectList()
{
var res = _invokeService.GetClientFrtSelectList();
return res;
}
///
/// 获取结算方式下拉列表-客户端
///
///
[HttpGet]
[Route("GetClientStlModeSelectList")]
public DataResult> GetClientStlModeSelectList()
{
var res = _invokeService.GetClientStlModeSelectList();
return res;
}
///
/// 获取业务来源下拉列表-客户端
///
///
[HttpGet]
[Route("GetClientSourceSelectList")]
public DataResult> GetClientSourceSelectList()
{
var res = _invokeService.GetClientSourceSelectList();
return res;
}
///
/// 获取业务来源明细下拉列表-客户端
///
///
[HttpGet]
[Route("GetClientSourceDetailSelectList")]
public DataResult> GetClientSourceDetailSelectList([FromQuery] string id)
{
var res = _invokeService.GetClientSourceDetailSelectList(id);
return res;
}
///
/// 修改密码
///
///
///
[HttpPost]
[Route("ChangePassword")]
public DataResult ChangePassword([FromBody] ChangePasswordReq model)
{
var res = _invokeService.ChangePassword(model);
return res;
}
///
/// 企业用户注册
///
///
///
[AllowAnonymous]
[HttpPost]
[Route("TenantRegister")]
public DataResult TenantRegister([FromBody] TenantRegisterReq model)
{
var res = _invokeService.TenantRegister(model);
return res;
}
///
/// 获取权限树列表-客户端
///
///
[HttpGet]
[Route("GetClientPermissionTreeList")]
public DataResult> GetClientPermissionTreeList()
{
var res = _invokeService.GetClientPermissionTreeList();
return res;
}
///
/// 获取数据权限字段
///
///
///
[HttpGet]
[AllowAnonymous]
[Route("GetDataRuleEntityFields")]
public DataResult> GetDataRuleEntityFields([FromQuery] string permissionId)
{
var res = _invokeService.GetDataRuleEntityFields(permissionId);
return res;
}
///
/// 获取客户数据权限列表
///
///
[HttpGet]
[Route("GetClientPermissionList")]
public DataResult> GetClientPermissionList()
{
var res = _invokeService.GetClientPermissionList();
return res;
}
///
/// 获取数据库表及视图名
///
///
[HttpGet]
[Route("GetTables")]
public DataResult> GetTables()
{
var res = _invokeService.GetTables();
return res;
}
///
/// 获取数据库表及视图名
///
///
[HttpGet]
[Route("GetColumns")]
public DataResult> GetColumns([FromQuery] string tableViewName)
{
var res = _invokeService.GetColumns(tableViewName);
return res;
}
///
/// 获取数据库表及视图名-客户端
///
///
[HttpGet]
[Route("GetTablesByClient")]
public DataResult> GetTablesByClient()
{
var res = _invokeService.GetTablesByClient();
return res;
}
///
/// 获取数据库表及视图名-客户端
///
///
[HttpGet]
[Route("GetColumnsByClient")]
public DataResult> GetColumnsByClient([FromQuery] string tableViewName)
{
var res = _invokeService.GetColumnsByClient(tableViewName);
return res;
}
///
/// 获取用户字段设置
///
///
/// 标识序号
///
[HttpGet]
[Route("GetUserFieldSet")]
public DataResult GetUserFieldSet([FromQuery] string permissionId, int tagNo = 0)
{
var res = _invokeService.GetUserFieldSet(permissionId, tagNo);
return res;
}
///
/// 批量获取任务台用户字段设置
///
[HttpPost]
[Route("GetUserTaskPlatFieldSet")]
public async Task>> GetUserTaskPlatFieldSet([FromBody] SysFieldSetTaskPlatQueryDto query)
{
var res = await _invokeService.GetUserTaskPlatFieldSet(query);
return res;
}
///
/// 更新用户字段设置
///
///
///
[HttpPost]
[Route("UpdateUserFieldSet")]
public DataResult UpdateUserFieldSet([FromBody] UserFieldSetUpdateReq req)
{
var res = _invokeService.UpdateUserFieldSet(req);
return res;
}
///
/// 更新任务台用户字段设置
///
[HttpPost]
[Route("UpdateUserTaskPlatFieldSet")]
public async Task UpdateUserTaskPlatFieldSet([FromBody] UserFieldSetUpdateReq req)
{
var res = await _invokeService.UpdateUserTaskPlatFieldSet(req);
return res;
}
///
/// 获取字典下拉明细
///
///
///
[HttpPost]
[Route("GetDictTypeDropDown")]
public DataResult GetDictTypeDropDown([FromBody] DropDownDictTypeInput model)
{
var res = _invokeService.GetDictTypeDropDown(model);
return res;
}
///
/// 批量获取字典值
///
///
///
[HttpPost]
[Route("GetDictOptions")]
public DataResult> GetDictOptions([FromBody] DropDownDictTypeInput model)
{
var res = _invokeService.GetDictOptions(model);
return res;
}
}