| | |
| | | [HttpPost] |
| | | public long Insert([Required] AddDmaSiteInput input) |
| | | { |
| | | if (!string.IsNullOrEmpty(input.Code)) |
| | | { |
| | | if (_service.IsExistCode(input.Code)) |
| | | { |
| | | throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.V001, $"Code:{input.Code}", "编码已存在"); |
| | | } |
| | | } |
| | | if (!string.IsNullOrEmpty(input.TagName)) |
| | | { |
| | | if (_service.IsExistTagName(input.TagName)) |
| | |
| | | if (model == null) |
| | | { |
| | | throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.D001, $"ID:{input.ID} 数据不存在"); |
| | | } |
| | | if (!string.IsNullOrEmpty(input.Code)) |
| | | { |
| | | if (_service.IsExistCodeExceptID(input.Code, input.ID)) |
| | | { |
| | | throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.V001, $"Code:{input.Code}", "编码已存在"); |
| | | } |
| | | } |
| | | if (!string.IsNullOrEmpty(input.TagName)) |
| | | { |
| | |
| | | #endregion |
| | | |
| | | #region Exist |
| | | |
| | | /// <summary> |
| | | /// 判断 Code 是否存在 |
| | | /// </summary> |
| | | [Route("IsExistCode@V1.0")] |
| | | [HttpGet] |
| | | public bool IsExistCode([FromQuery][Required] CodeInput input) |
| | | { |
| | | var bol = _service.IsExistCode(input.Code); |
| | | return bol; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 判断 Code 是否存在 ExceptID |
| | | /// </summary> |
| | | [Route("IsExistCodeExceptID@V1.0")] |
| | | [HttpGet] |
| | | public bool IsExistCodeExceptID([FromQuery][Required] CodeExceptInput input) |
| | | { |
| | | var bol = _service.IsExistCodeExceptID(input.Code, input.ExceptID); |
| | | return bol; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 判断TagName是否存在 |