Beispiel #1
0
        public ActionRes Delete([FromBody] Ids_Input model)
        {
            if (model.ids.Count == 0)
            {
                throw new Exception("参数错误,ids is null");
            }
            foreach (var id in model.ids)
            {
                var instance = AllServices.SysInterfaceWhiteListService.GetByKey(id);
                if (instance == null)
                {
                    throw new Exception($"没有找到指定的数据[{id}]");
                }
            }

            var res = AllServices.SysInterfaceWhiteListService.Delete(model.ids);

            return(ActionRes.Success($"已成功删除{res}条数据"));
        }
        public ActionRes Delete([FromBody] Ids_Input model)
        {
            if (model.ids.Count == 0)
            {
                throw new Exception("参数错误,ids is null");
            }
            foreach (var id in model.ids)
            {
                var instance = AllServices.SysAccountService.GetByKey(id);
                if (instance == null)
                {
                    throw new Exception($"没有找到指定的用户[{id}]");
                }
                if (instance.User_Id == base.CurUserId)
                {
                    throw new Exception("你傻啦,怎么可以自己删自己的账号");
                }
                CheckPression(instance);
            }

            var res = AllServices.SysAccountService.Delete(model.ids);

            return(ActionRes.Success($"已成功删除{res}条数据"));
        }