134 lines
4.7 KiB
C#
134 lines
4.7 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
||
using RIZO.Model.Mes.Dto.PassWord;
|
||
using RIZO.Model.Mes.PassWord;
|
||
using RIZO.Model.System.Dto;
|
||
using RIZO.Service.Mes.IMesService.PassWord;
|
||
|
||
//创建时间:2025-11-12
|
||
namespace RIZO.Admin.WebApi.Controllers.Mes.PassWord
|
||
{
|
||
/// <summary>
|
||
/// 密码信息表(存储密码值及类型)
|
||
/// </summary>
|
||
[Route("mes/PasswordInfo")]
|
||
[AllowAnonymous]
|
||
public class PasswordInfoController : BaseController
|
||
{
|
||
/// <summary>
|
||
/// 密码信息表(存储密码值及类型)接口
|
||
/// </summary>
|
||
private readonly IPasswordInfoService _PasswordInfoService;
|
||
|
||
public PasswordInfoController(IPasswordInfoService PasswordInfoService)
|
||
{
|
||
_PasswordInfoService = PasswordInfoService;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 查询密码信息表(存储密码值及类型)列表
|
||
/// </summary>
|
||
/// <param name="parm"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("list")]
|
||
[ActionPermissionFilter(Permission = "passwordinfo:list")]
|
||
public IActionResult QueryPasswordInfo([FromQuery] PasswordInfoQueryDto parm)
|
||
{
|
||
var response = _PasswordInfoService.GetList(parm);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
|
||
/// <summary>
|
||
/// 查询密码信息表(存储密码值及类型)详情
|
||
/// </summary>
|
||
/// <param name="Id"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("{Id}")]
|
||
[ActionPermissionFilter(Permission = "passwordinfo:query")]
|
||
public IActionResult GetPasswordInfo(long Id)
|
||
{
|
||
var response = _PasswordInfoService.GetInfo(Id);
|
||
|
||
var info = response.Adapt<PasswordInfoDto>();
|
||
return SUCCESS(info);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 添加密码信息表(存储密码值及类型)
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost]
|
||
[ActionPermissionFilter(Permission = "passwordinfo:add")]
|
||
[Log(Title = "密码信息表(存储密码值及类型)", BusinessType = BusinessType.INSERT)]
|
||
public IActionResult AddPasswordInfo([FromBody] PasswordInfoDto parm)
|
||
{
|
||
var modal = parm.Adapt<PasswordInfo>().ToCreate(HttpContext);
|
||
|
||
var response = _PasswordInfoService.AddPasswordInfo(modal);
|
||
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 更新密码信息表(存储密码值及类型)
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPut]
|
||
[ActionPermissionFilter(Permission = "passwordinfo:edit")]
|
||
[Log(Title = "密码信息表(存储密码值及类型)", BusinessType = BusinessType.UPDATE)]
|
||
public IActionResult UpdatePasswordInfo([FromBody] PasswordInfoDto parm)
|
||
{
|
||
var modal = parm.Adapt<PasswordInfo>().ToUpdate(HttpContext);
|
||
var response = _PasswordInfoService.UpdatePasswordInfo(modal);
|
||
|
||
return ToResponse(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 删除密码信息表(存储密码值及类型)
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost("delete/{ids}")]
|
||
[ActionPermissionFilter(Permission = "passwordinfo:delete")]
|
||
[Log(Title = "密码信息表(存储密码值及类型)", BusinessType = BusinessType.DELETE)]
|
||
public IActionResult DeletePasswordInfo([FromRoute]string ids)
|
||
{
|
||
var idArr = Tools.SplitAndConvert<long>(ids);
|
||
|
||
return ToResponse(_PasswordInfoService.Delete(idArr));
|
||
}
|
||
|
||
/// <summary>
|
||
/// 重置首检密码
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpGet("resetFirstInspectionPwd")]
|
||
[Log(Title = "重置密码", BusinessType = BusinessType.UPDATE)]
|
||
public IActionResult ResetFirstInspectionPwd()
|
||
{
|
||
int result = _PasswordInfoService.ResetFirstInspectionPwd();
|
||
return ToResponse(result);
|
||
}
|
||
|
||
//更改首检密码
|
||
[HttpPost("changeFirstInspectionPwd")]
|
||
[Log(Title = "更改首检密码", BusinessType = BusinessType.UPDATE)]
|
||
public IActionResult ChangeFirstInspectionPwd([FromBody] ChangePwdRequest pwd)
|
||
{
|
||
var response = _PasswordInfoService.ChangeFirstInspectionPwd(pwd.OldPwd, pwd.NewPwd);
|
||
return ToResponse(response);
|
||
}
|
||
|
||
|
||
////校验首检密码
|
||
[HttpPost("checkFirstInspectionPwd")]
|
||
[Log(Title = "校验首检密码", BusinessType = BusinessType.UPDATE)]
|
||
public IActionResult CheckFirstInspectionPwd([FromQuery] string password)
|
||
{
|
||
var response = _PasswordInfoService.CheckFirstInspectionPwd(password);
|
||
return ToResponse(response);
|
||
}
|
||
|
||
|
||
}
|
||
} |