220 lines
7.0 KiB
C#
220 lines
7.0 KiB
C#
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Http;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using YD_XinWei.Api.Services.Impl;
|
|
using YD_XinWei.Api.Services.Interface;
|
|
using YD_XinWei.Commons.Dto.Common;
|
|
using YD_XinWei.Commons.Dto.HomeWork;
|
|
using YD_XinWei.Commons.Dto.Open;
|
|
using YD_XinWei.Commons.Dto.School;
|
|
|
|
namespace YD_XinWei.Api.Controllers
|
|
{
|
|
/// <summary>
|
|
/// 芯未
|
|
/// </summary>
|
|
[ApiVersion("1.0")]
|
|
[AllowAnonymous]
|
|
public class XinWeiController : ControllerBase
|
|
{
|
|
private readonly IXinWeiService _xinWeiService;
|
|
public XinWeiController(IXinWeiService xinWeiService)
|
|
{
|
|
_xinWeiService = xinWeiService;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取设备信息
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
[Route("/basic/{apiVersion}/device/open/getDeviceInfo")]
|
|
public async Task<DeviceInfoDto> GetDeviceInfo(string deviceSerial)
|
|
{
|
|
var res = await _xinWeiService.DeviceInfo(deviceSerial);
|
|
return res;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取项目模式列表
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
[Route("/sports/{apiVersion}/common/getSportsModelTypeList")]
|
|
public async Task<List<ProjectModeDto>> GetSportsModelTypeList()
|
|
{
|
|
var res = await _xinWeiService.SportsModelTypeList();
|
|
return res;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取体育项目列表
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
[Route("/sports/{apiVersion}/common/getOrgSportsProjectList")]
|
|
public async Task<List<TestingProjectDto>> GetOrgSportsProjectList(int orgId)
|
|
{
|
|
var res = await _xinWeiService.OrgSportsProjectList(orgId);
|
|
return res;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取学生信息
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
[Route("/sports/{apiVersion}/roster/getMinimumOfStudentInfoList")]
|
|
public async Task<List<StudentInfoDto>> GetMinimumOfStudentInfoList(int orgId)
|
|
{
|
|
var res = await _xinWeiService.MinimumOfStudentInfoList(orgId);
|
|
return res;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取名单列表
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
[Route("/sports/{apiVersion}/roster/getSportsRosterList")]
|
|
public async Task<List<SportsRosterDto>> GetSportsRosterList(int orgId, int userId)
|
|
{
|
|
var res = await _xinWeiService.SportsRosterList(orgId, userId);
|
|
return res;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取人脸信息
|
|
/// </summary>
|
|
/// <param name="dto"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
[Route("/basic/{apiVersion}/open/getFaceListOfDevicePage")]
|
|
public async Task<FaceListOfDevicePageDto> GetFaceListOfDevicePage([FromQuery] FaceListOfDeviceDto dto)
|
|
{
|
|
var res = await _xinWeiService.FaceListOfDevicePage(dto);
|
|
return res;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 查询训练评分规则
|
|
/// </summary>
|
|
/// <param name="orgId"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
[Route("/sports/{apiVersion}/project/getScoreRules")]
|
|
public async Task<List<ScoreRuleDto>> GetScoreRules(int orgId)
|
|
{
|
|
var res = await _xinWeiService.ScoreRules(orgId);
|
|
return res;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 新增训练
|
|
/// </summary>
|
|
/// <param name="dto"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("/sports/{apiVersion}/train/addTrain")]
|
|
public async Task<TrainDto> AddTrain([FromBody] AddTrainDto dto)
|
|
{
|
|
Console.WriteLine("开始上传");
|
|
var res = await _xinWeiService.AddTrain(dto);
|
|
return res;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 年级排名
|
|
/// </summary>
|
|
/// <param name="studentId"></param>
|
|
/// <param name="trainId"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
[Route("/sports/{apiVersion}/trainAnalysis/gradeRankingGet")]
|
|
public async Task<GradeRankingVo> GradeRankingGet(int studentId, int trainId)
|
|
{
|
|
var res = await _xinWeiService.GradeRankingGet(studentId, trainId);
|
|
return res;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 全部历史记录
|
|
/// </summary>
|
|
/// <param name="dto"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
[Route("/sports/{apiVersion}/trainAnalysis/history/get")]
|
|
public async Task<TrainHistoryResponseDto> HistoryGet(HistoryGetDto dto)
|
|
{
|
|
var res = await _xinWeiService.HistoryGet(dto);
|
|
return res;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 历史记录详细
|
|
/// </summary>
|
|
/// <param name="dto"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
[Route("/sports/{apiVersion}/trainAnalysis/history/detail")]
|
|
public async Task<TrainAnalusisVo> TrainAnalysisHistoryDetail(HistoryDetailRequestDto dto)
|
|
{
|
|
var res = await _xinWeiService.TrainAnalysisHistoryDetail(dto);
|
|
return res;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 个人历史记录-历史成绩
|
|
/// </summary>
|
|
/// <param name="dto"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
[Route("/sports/{apiVersion}/trainAnalysis/history/person/get")]
|
|
public async Task<TrainHistoryPersonVo> HistoryPersonGet(HistoryPersonGetDto dto)
|
|
{
|
|
var res = await _xinWeiService.HistoryPersonGet(dto);
|
|
return res;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 个人历史记录-记录列表
|
|
/// </summary>
|
|
/// <param name="dto"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
[Route("/sports/{apiVersion}/trainAnalysis/history/person/list")]
|
|
public async Task<TableDataPersonAnalysisVo> HistoryPersonListGet(HistoryPersonListDto dto)
|
|
{
|
|
var res = await _xinWeiService.HistoryPersonListGet(dto);
|
|
return res;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 成绩榜-年级列表
|
|
/// </summary>
|
|
/// <param name="orgId"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
[Route("/basic/{apiVersion}/open/getGradeListByOrg")]
|
|
public async Task<List<GradeVo>> GetGradeListByOrg(int orgId)
|
|
{
|
|
var res = await _xinWeiService.GetGradeListByOrg(orgId);
|
|
return res;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 个人历史记录-榜单列表
|
|
/// </summary>
|
|
/// <param name="dto"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
[Route("/sports/{apiVersion}/trainAnalysis/scoreRanking/list")]
|
|
public async Task<ScoreRankingVo> ScoreRanking(ScoreRankingDto dto)
|
|
{
|
|
var res = await _xinWeiService.ScoreRanking(dto);
|
|
return res;
|
|
}
|
|
}
|
|
}
|