Exemplo n.º 1
0
        public async Task <ActionResult <BaseResponse> > GetByIdAsync(int typeId, int Id)
        {
            var control = await _tmcs.IsExistCheck(a => a.Id == Id);

            if (control.IsExist == false)
            {
                return(new BaseResponse {
                    Success = false, Message = "输入的控制数据编号不存在"
                });
            }
            #region 检查模块是否存在
            var exist = await _tms.IsExist(a => a.Id == control.ModuleId && a.TypeId == typeId);

            if (!exist)
            {
                return(new BaseResponse {
                    Success = false, Message = $"该类型下不存在控制数据编号为{Id}的模块"
                });
            }
            #endregion
            var rm = await _tmcs.GetTypeModuleControlsByIdAsync(Id);

            return(rm);
        }