lixiaojun
2024-05-21 dc5bfa19ffc92dada57bdd6b052de6dfd25a010a
Yw.Application.Unit.Core/01-lang/SysUnitLang_Controller.cs
ÎļþÃû´Ó Yw.Application.Unit.Core/01-sys-unit-lang/SysUnitLang_Controller.cs ÐÞ¸Ä
@@ -80,14 +80,14 @@
        [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);
@@ -118,6 +118,23 @@
            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