54 lines
1.7 KiB
C#
Raw Normal View History

2026-01-29 11:51:47 +08:00
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
2025-07-08 14:57:45 +08:00
using YD_WeChatApplet.Api.Services.Interface;
using YD_WeChatApplet.Commons.Dto.HomeWork;
2026-02-03 16:07:59 +08:00
using YD_WeChatApplet.Commons.Dto.JingShiTiJiao;
2025-07-08 14:57:45 +08:00
using YD_WeChatApplet.Commons.Dto.Patriarch;
using YD_WeChatApplet.Services;
namespace YD_WeChatApplet.Api.Controllers
{
/// <summary>
/// 公共接口
/// </summary>
[ApiController]
[ApiExplorerSettings(GroupName = "v1")]
[Route("[controller]")]
2026-01-29 11:51:47 +08:00
[AllowAnonymous]
2025-07-08 14:57:45 +08:00
public class FrameworkController : ControllerBase
{
private readonly IFrameworkService _frameworkService;
public FrameworkController(IFrameworkService frameworkService)
{
_frameworkService = frameworkService;
}
/// <summary>
2025-07-16 10:17:47 +08:00
/// Ai一体机扫描登录
2025-07-08 14:57:45 +08:00
/// </summary>
2026-02-03 16:07:59 +08:00
/// <param name="request"></param>
2025-07-08 14:57:45 +08:00
/// <returns></returns>
[HttpPost("ScanCodeLogin")]
2026-02-03 16:07:59 +08:00
public async Task<bool> ScanCodeLogin(ScanCodeLoginRequest request)
2025-07-08 14:57:45 +08:00
{
2026-02-03 16:07:59 +08:00
if (request==null)
{
throw new Exception("参数为空!");
}
if (string.IsNullOrWhiteSpace(request.Code))
{
throw new Exception("设备编号为空!");
}
if (string.IsNullOrWhiteSpace(request.SchoolCode))
{
throw new Exception("学校编号为空!");
}
if (string.IsNullOrWhiteSpace(request.TeacherNo))
{
throw new Exception("老师编号为空!");
}
return await _frameworkService.ScanCodeLogin(request);
2025-07-08 14:57:45 +08:00
}
}
}