ÎļþÃû´Ó Yw.Application.Unit.Core/01-sys-unit-lang/SysUnitLang_Controller.cs ÐÞ¸Ä |
| | |
| | | [HttpPut] |
| | | public bool Update([Required] UpdateSysUnitLangInput input) |
| | | { |
| | | if (_service.IsExistCodeExceptID(input.Code, input.ID)) |
| | | { |
| | | throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.V001, $"Code:{input.Code} ç¼ç å·²åå¨"); |
| | | } |
| | | var model = _service.GetByID(input.ID); |
| | | if (model == null) |
| | | { |
| | | throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.D001, $"ID:{input.ID} æ°æ®ä¸åå¨"); |
| | | } |
| | | if (_service.IsExistCodeExceptID(input.Code, input.ID)) |
| | | { |
| | | throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.V001, $"Code:{input.Code} ç¼ç å·²åå¨"); |
| | | } |
| | | var rhs = new Model.SysUnitLang(model); |
| | | input.Adapt(rhs); |
| | |
| | | return bol; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ´æ°ç¼ç |
| | | /// </summary> |
| | | [Route("UpdateCode@V1.0")] |
| | | [HttpPut] |
| | | public bool UpdateCode([Required] UpdateCodeInput input) |
| | | { |
| | | if (_service.IsExistCodeExceptID(input.Code, input.ID)) |
| | | { |
| | | throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.V001, $"Code:{input.Code} ç¼ç å·²åå¨"); |
| | | } |
| | | var bol = _service.UpdateCode(input.ID, input.Code); |
| | | return bol; |
| | | } |
| | | |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #region Exist |