- 完善学生Excel导入的文件、行数据和重复学号校验,并返回实际导入数量 - 调整学生导出字段名称与排列顺序,移除学籍号字段 - 规范单张及ZIP批量人脸导入校验,限制格式、大小、数量和解压总量 - 批量人脸导入返回总数、成功数、失败数及详细失败原因 - 新增作业按作业、班级、完成状态等条件批量导出,每名学生一条记录
87 lines
2.6 KiB
C#
87 lines
2.6 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
|
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
using VOL.Business.IServices.Device;
|
|
using VOL.Core.Filters;
|
|
using VOL.Entity.Enum;
|
|
using VOL.Model;
|
|
using VOL.Model.Device.Request;
|
|
using VOL.Model.Device.Response;
|
|
|
|
namespace VOL.WebApi.Controllers.Business
|
|
{
|
|
/// <summary>
|
|
/// 学校设备管理。
|
|
/// </summary>
|
|
[Route("api/[controller]")]
|
|
[ApiController]
|
|
[ApiExplorerSettings(GroupName = "v3")]
|
|
[TypeFilter(typeof(CustomApiResponseFilter))]
|
|
public class DeviceManageController : ControllerBase
|
|
{
|
|
private readonly IDeviceManageService _deviceManageService;
|
|
|
|
public DeviceManageController(IDeviceManageService deviceManageService)
|
|
{
|
|
_deviceManageService = deviceManageService;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取设备分页列表。
|
|
/// </summary>
|
|
[HttpGet(nameof(GetPageList))]
|
|
public Task<PageDataDto<DeviceManageModel>> GetPageList([FromQuery] DevicePageListParam param)
|
|
{
|
|
return _deviceManageService.GetPageList(param);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取当前账号可管理的学校。
|
|
/// </summary>
|
|
[HttpGet(nameof(GetSchoolOptions))]
|
|
public Task<List<DeviceSchoolOption>> GetSchoolOptions([FromQuery] string keyword = null)
|
|
{
|
|
return _deviceManageService.GetSchoolOptions(keyword);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取设备详情。
|
|
/// </summary>
|
|
[HttpGet(nameof(Details))]
|
|
public Task<DeviceManageModel> Details([FromQuery] long id, [FromQuery] DeviceSourceType sourceType)
|
|
{
|
|
return _deviceManageService.Details(id, sourceType);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 新增并绑定设备。
|
|
/// </summary>
|
|
[HttpPost(nameof(Add))]
|
|
public async Task<ActionResult> Add([FromBody] SaveDeviceParam param)
|
|
{
|
|
await _deviceManageService.Add(param);
|
|
return Ok("新增成功");
|
|
}
|
|
|
|
/// <summary>
|
|
/// 修改设备及学校绑定。
|
|
/// </summary>
|
|
[HttpPost(nameof(Update))]
|
|
public async Task<ActionResult> Update([FromBody] SaveDeviceParam param)
|
|
{
|
|
await _deviceManageService.Update(param);
|
|
return Ok("修改成功");
|
|
}
|
|
|
|
/// <summary>
|
|
/// 删除设备。
|
|
/// </summary>
|
|
[HttpPost(nameof(Delete))]
|
|
public async Task<ActionResult> Delete([FromBody] DeleteDeviceParam param)
|
|
{
|
|
await _deviceManageService.Delete(param);
|
|
return Ok("删除成功");
|
|
}
|
|
}
|
|
}
|