学号
This commit is contained in:
parent
2278bfc8a7
commit
975088da26
@ -63,7 +63,7 @@ namespace YD_WeChatApplet.Api.Controllers
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("StudentReport")]
|
||||
public async Task<StudentReportDto> StudentReport(string studentNo)
|
||||
public async Task<StudentReportDto> StudentReport(string? studentNo)
|
||||
{
|
||||
var res = await _patriarchService.StudentReport(studentNo);
|
||||
return res;
|
||||
|
||||
@ -184,15 +184,20 @@ namespace YD_WeChatApplet.Api.Services.Impl
|
||||
/// 学生报告
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<StudentReportDto> StudentReport(string studentNo)
|
||||
public async Task<StudentReportDto> StudentReport(string? studentNo)
|
||||
{
|
||||
var res = new StudentReportDto();
|
||||
|
||||
// 若参数为空,则尝试从登录上下文获取当前用户编号
|
||||
if (string.IsNullOrWhiteSpace(studentNo))
|
||||
{
|
||||
studentNo = UserLoginContext.Current.UserNo;
|
||||
}
|
||||
|
||||
// 最终编号仍为空,则直接返回空结果
|
||||
if (string.IsNullOrWhiteSpace(studentNo))
|
||||
return res;
|
||||
|
||||
//var studentNo = UserLoginContext.Current.UserNo;
|
||||
|
||||
var student = await _sportsContext.Student.Where(x => x.StudentNo == studentNo).FirstOrDefaultAsync();
|
||||
|
||||
if (student == null)
|
||||
|
||||
@ -42,7 +42,7 @@ namespace YD_WeChatApplet.Services
|
||||
/// 学生报告
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<StudentReportDto> StudentReport(string studentNo);
|
||||
Task<StudentReportDto> StudentReport(string? studentNo);
|
||||
|
||||
/// <summary>
|
||||
/// 训练记录
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user