using AlibabaCloud.SDK.Vod20170321.Models; using Learn.Archives.API.Controllers.Dto; using Learn.Archives.API.Expand; using Learn.Archives.Core.Common; using Learn.Archives.Core.Model; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using System.Diagnostics; using System.Security.Claims; using UserCenter.Model; namespace Learn.Archives.API.Controllers { /// /// 年级控制器 /// public class ExamController : BackController { readonly Repository baseService; readonly Repository examClassInfoService; readonly Repository examUserInfoService; readonly LiveUserInfo userInfo; public ExamController(Repository baseService, LiveUserInfo userInfo, Repository examClassInfoService, Repository examUserInfoService) : base(baseService) { this.baseService = baseService; this.userInfo = userInfo; this.examClassInfoService = examClassInfoService; this.examUserInfoService = examUserInfoService; } public override async Task Del([FromBody] params long[] ids) { if (ids.Length > 1) Oh.ModelError("同时只允许删除一场考试"); var id= ids.First(); var dCount = await examClassInfoService.AsDeleteable().Where(s => s.ExamId == id) .ExecuteCommandAsync(); var dCount1 = await examUserInfoService.AsDeleteable().Where(s => s.ExamId == id) .ExecuteCommandAsync(); return await base.Del(ids); } } }