This commit is contained in:
tanglong 2025-08-06 14:51:33 +08:00
parent 0117f475d3
commit 7f5f5c5c33
17 changed files with 15430 additions and 22 deletions

View File

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VOL.Core.BaseProvider;
using VOL.Core.Extensions.AutofacManager;
using VOL.Entity.DomainModels;
namespace VOL.Ai.IRepositories
{
/// <summary>
/// App版本信息
/// </summary>
public interface IAiAppVersionRepository : IDependency, IRepository<Ai_AppVersion>
{
}
}

View File

@ -218,6 +218,13 @@ namespace VOL.Ai.IServices
/// <returns></returns> /// <returns></returns>
Task<bool> LogOut(LoginOutDto paramDto); Task<bool> LogOut(LoginOutDto paramDto);
/// <summary>
/// 获取版本号
/// </summary>
/// <param name="paramDto"></param>
/// <returns></returns>
Task<Ai_AppVersionDto> AiAppVersion(Ai_AppVersionRequest paramDto);
/// <summary> /// <summary>
/// 获取课堂记录列表 /// 获取课堂记录列表
/// </summary> /// </summary>

View File

@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VOL.Ai.IRepositories;
using VOL.Core.BaseProvider;
using VOL.Core.EFDbContext;
using VOL.Core.Extensions.AutofacManager;
using VOL.Entity.DomainModels;
namespace VOL.Ai.Repositories
{
/// <summary>
/// App版本信息
/// </summary>
public class AiAppVersionRepository : RepositoryBase<Ai_AppVersion>, IAiAppVersionRepository
{
public AiAppVersionRepository(VOLContext dbContext)
: base(dbContext)
{
}
public static IAiAppVersionRepository Instance
{
get { return AutofacContainerModule.GetService<IAiAppVersionRepository>(); }
}
}
}

View File

@ -36,6 +36,7 @@ namespace VOL.Ai.Services
private readonly IN_SportsTestCategoryRepository _sportsTestCategoryRepository; private readonly IN_SportsTestCategoryRepository _sportsTestCategoryRepository;
private readonly IN_HealthStandardsRepository _healthStandardsRepository; private readonly IN_HealthStandardsRepository _healthStandardsRepository;
private readonly IScanCodeLoginRepository _scanCodeLoginRepository; private readonly IScanCodeLoginRepository _scanCodeLoginRepository;
private readonly IAiAppVersionRepository _aiAppVersionRepository;
private readonly IN_SportsTrainingCategoryRepository _sportsTrainingCategoryRepository; private readonly IN_SportsTrainingCategoryRepository _sportsTrainingCategoryRepository;
private readonly IClassRoomRecordRepository _classRoomRecordRepository; private readonly IClassRoomRecordRepository _classRoomRecordRepository;
private readonly IHeartRateDataRepository _heartRateDataRepository; private readonly IHeartRateDataRepository _heartRateDataRepository;
@ -67,7 +68,8 @@ namespace VOL.Ai.Services
IFastJumpRopeDataRepository fastJumpRopeDataRepository, IFastJumpRopeDataRepository fastJumpRopeDataRepository,
ISys_UserRepository userRepository, ISys_UserRepository userRepository,
IClassroomStageRepository classroomStageRepository, IClassroomStageRepository classroomStageRepository,
IClassroomSettingRepository classroomSettingRepository IClassroomSettingRepository classroomSettingRepository,
IAiAppVersionRepository aiAppVersionRepository
) )
{ {
_mapper = mapper; _mapper = mapper;
@ -88,6 +90,7 @@ namespace VOL.Ai.Services
_userRepository = userRepository; _userRepository = userRepository;
_classroomStageRepository = classroomStageRepository; _classroomStageRepository = classroomStageRepository;
_classroomSettingRepository = classroomSettingRepository; _classroomSettingRepository = classroomSettingRepository;
_aiAppVersionRepository = aiAppVersionRepository;
} }
#region New #region New
@ -1006,6 +1009,7 @@ namespace VOL.Ai.Services
{ {
GroupId = x.GroupId, GroupId = x.GroupId,
ModeType = x.ModeType, ModeType = x.ModeType,
//ModelName = x.ModeType.GetDescription(),
ModelName = x.ModelName, ModelName = x.ModelName,
MotionDuration = x.MotionDuration, MotionDuration = x.MotionDuration,
ScoreTime = x.ScoreTime, ScoreTime = x.ScoreTime,
@ -1252,7 +1256,7 @@ namespace VOL.Ai.Services
if (loginInfo == null) if (loginInfo == null)
return new Ai_TeacherFaceInfo(); return new Ai_TeacherFaceInfo();
var res = await _teacherRepository.FindAsIQueryable(x => x.SchoolCode == paramDto.SchoolCode && x.TeacherStatus != TeacherStatus.Depart && x.TeacherPhoneNo == loginInfo.TeacherPhoneNo && x.Id == loginInfo.TeacherId) var res = await _teacherRepository.FindAsIQueryable(x => x.SchoolCode == paramDto.SchoolCode && x.TeacherStatus != TeacherStatus.Depart && x.TeacherPhoneNo == loginInfo.TeacherPhoneNo)
.Select(x => .Select(x =>
new Ai_TeacherFaceInfo() new Ai_TeacherFaceInfo()
{ {
@ -1281,6 +1285,9 @@ namespace VOL.Ai.Services
res.GradeAndClassList = grades; res.GradeAndClassList = grades;
_scanCodeLoginRepository.Delete(loginInfo);
await _scanCodeLoginRepository.SaveChangesAsync();
return res; return res;
} }
@ -1343,6 +1350,28 @@ namespace VOL.Ai.Services
return await _teacherRepository.SaveChangesAsync() > 0; return await _teacherRepository.SaveChangesAsync() > 0;
} }
/// <summary>
/// 获取版本号
/// </summary>
/// <param name="paramDto"></param>
/// <returns></returns>
public async Task<Ai_AppVersionDto> AiAppVersion(Ai_AppVersionRequest paramDto)
{
var res = await _aiAppVersionRepository.FindAsIQueryable(x => x.AppType == paramDto.AppType)
.Select(x => new Ai_AppVersionDto()
{
Id = x.Id,
AppType = x.AppType,
Remarks = x.Remarks,
Version = x.Version,
Url = x.Url,
CreateDate = x.CreateDate
}).OrderByDescending(x => x.CreateDate)
.FirstOrDefaultAsync();
return res ?? new Ai_AppVersionDto();
}
/// <summary> /// <summary>
/// 获取课堂记录列表 /// 获取课堂记录列表
/// </summary> /// </summary>
@ -1364,8 +1393,9 @@ namespace VOL.Ai.Services
.Take(paramDto.PageSize) .Take(paramDto.PageSize)
.Select(x => new Ai_ClassRoomRecordPageListDto .Select(x => new Ai_ClassRoomRecordPageListDto
{ {
ClassRoomRecordId = x.Id,
GradeAndClassName = $"{x.GradeName}-{x.ClassName}", GradeAndClassName = $"{x.GradeName}-{x.ClassName}",
StartEndTime = $"{x.StartTime.ToString("yyyy-MM-dd HH:mm")}-{x.EndTime.ToString("yyyy-MM-dd HH:mm")}", StartEndTime = x.EndTime == null || x.EndTime == DateTime.MinValue ? $"{x.StartTime:yyyy-MM-dd HH:mm}" : $"{x.StartTime:yyyy-MM-dd HH:mm} 至 {x.EndTime:yyyy-MM-dd HH:mm}",
TeacherName = x.TeacherName TeacherName = x.TeacherName
}).ToListAsync(); }).ToListAsync();

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,56 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace VOL.Core.Migrations
{
public partial class _20250804v1 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<int>(
name: "Rank",
table: "Ai_FastJumpRopeData",
type: "int",
nullable: true,
comment: "等级",
oldClrType: typeof(string),
oldType: "nvarchar(100)",
oldNullable: true,
oldComment: "等级");
migrationBuilder.CreateTable(
name: "Ai_AppVersion",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false, comment: "Id")
.Annotation("SqlServer:Identity", "1, 1"),
AppType = table.Column<int>(type: "int", nullable: false, comment: "AppType"),
Remarks = table.Column<string>(type: "nvarchar(2000)", nullable: true, comment: "备注"),
Version = table.Column<string>(type: "nvarchar(200)", nullable: true, comment: "版本号"),
Url = table.Column<string>(type: "nvarchar(2000)", nullable: true, comment: "下载地址")
},
constraints: table =>
{
table.PrimaryKey("PK_Ai_AppVersion", x => x.Id);
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Ai_AppVersion");
migrationBuilder.AlterColumn<string>(
name: "Rank",
table: "Ai_FastJumpRopeData",
type: "nvarchar(100)",
nullable: true,
comment: "等级",
oldClrType: typeof(int),
oldType: "int",
oldNullable: true,
oldComment: "等级");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,28 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace VOL.Core.Migrations
{
public partial class _20250804v2 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<DateTime>(
name: "CreateDate",
table: "Ai_AppVersion",
type: "datetime",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
comment: "创建时间");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "CreateDate",
table: "Ai_AppVersion");
}
}
}

View File

@ -184,6 +184,40 @@ namespace VOL.Core.Migrations
b.ToTable("Ai_ActivitiestData"); b.ToTable("Ai_ActivitiestData");
}); });
modelBuilder.Entity("VOL.Entity.DomainModels.Ai_AppVersion", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasComment("Id");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
b.Property<int>("AppType")
.HasColumnType("int")
.HasComment("AppType");
b.Property<DateTime>("CreateDate")
.HasColumnType("datetime")
.HasComment("创建时间");
b.Property<string>("Remarks")
.HasColumnType("nvarchar(2000)")
.HasComment("备注");
b.Property<string>("Url")
.HasColumnType("nvarchar(2000)")
.HasComment("下载地址");
b.Property<string>("Version")
.HasColumnType("nvarchar(200)")
.HasComment("版本号");
b.HasKey("Id");
b.ToTable("Ai_AppVersion");
});
modelBuilder.Entity("VOL.Entity.DomainModels.Ai_ClassRoomRecord", b => modelBuilder.Entity("VOL.Entity.DomainModels.Ai_ClassRoomRecord", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
@ -539,8 +573,8 @@ namespace VOL.Core.Migrations
.HasColumnType("int") .HasColumnType("int")
.HasComment("运动时长/秒"); .HasComment("运动时长/秒");
b.Property<string>("Rank") b.Property<int?>("Rank")
.HasColumnType("nvarchar(100)") .HasColumnType("int")
.HasComment("等级"); .HasComment("等级");
b.Property<int>("RankEnum") b.Property<int>("RankEnum")

View File

@ -0,0 +1,65 @@
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VOL.Entity.Enum;
using VOL.Entity.SystemModels;
namespace VOL.Entity.DomainModels
{
[Table("Ai_AppVersion")]
[Entity(TableCnName = "AiApp版本号", TableName = "Ai_AppVersion")]
public class Ai_AppVersion : BaseEntity
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
[Display(Description = "主键Id")]
[Comment("Id")]
public int Id { get; set; }
/// <summary>
///AppType
/// </summary>
[Display(Name = "AppType")]
[Comment("AppType")]
[Column(TypeName = "int")]
public int AppType { get; set; }
/// <summary>
///备注
/// </summary>
[Display(Name = "备注")]
[Comment("备注")]
[Column(TypeName = "nvarchar(2000)")]
public string Remarks { get; set; }
/// <summary>
/// 版本号
/// </summary>
[Display(Name = "版本号")]
[Comment("版本号")]
[Column(TypeName = "nvarchar(200)")]
public string Version { get; set; }
/// <summary>
/// 下载地址
/// </summary>
[Display(Name = "下载地址")]
[Comment("下载地址")]
[Column(TypeName = "nvarchar(2000)")]
public string Url { get; set; }
/// <summary>
///创建时间
/// </summary>
[Display(Name = "创建时间")]
[Comment("创建时间")]
[Column(TypeName = "datetime")]
[Editable(true)]
public DateTime CreateDate { get; set; }
}
}

View File

@ -13,15 +13,15 @@ namespace VOL.Entity.Enum
public enum Ai_FastJumpRopeModeEnum public enum Ai_FastJumpRopeModeEnum
{ {
/// <summary> /// <summary>
/// 随堂模式 /// 集体跳
/// </summary> /// </summary>
[Description("随堂模式")] [Description("集体跳")]
FollowMode = 1, FollowMode = 1,
/// <summary> /// <summary>
/// 标准模式 /// 分组跳
/// </summary> /// </summary>
[Description("标准模式")] [Description("分组跳")]
StandardMode = 2 StandardMode = 2
} }
} }

View File

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VOL.Model.Ai.Request
{
/// <summary>
/// 获取APP版本信息
/// </summary>
public class Ai_AppVersionRequest : Ai_Request
{
/// <summary>
/// app类型
/// </summary>
public int AppType { get; set; }
}
}

View File

@ -76,7 +76,7 @@ namespace VOL.Model.Ai.Request
/// <summary> /// <summary>
/// 课堂设置列表 /// 课堂设置列表
/// </summary> /// </summary>
public List<ClassroomSettingDto> ClassroomSettingList { get; set; } public List<ClassroomSettingDto> ClassroomSettingList { get; set; } = new List<ClassroomSettingDto>();
} }
/// <summary> /// <summary>

View File

@ -0,0 +1,44 @@
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VOL.Model.Ai.Response
{
/// <summary>
/// app版本信息
/// </summary>
public class Ai_AppVersionDto
{
public int Id { get; set; }
/// <summary>
///AppType
/// </summary>
public int AppType { get; set; }
/// <summary>
///备注
/// </summary>
public string Remarks { get; set; }
/// <summary>
/// 版本号
/// </summary>
public string Version { get; set; }
/// <summary>
/// 下载地址
/// </summary>
public string Url { get; set; }
/// <summary>
///创建时间
/// </summary>
public DateTime CreateDate { get; set; }
}
}

View File

@ -11,6 +11,11 @@ namespace VOL.Model.Ai.Response
/// </summary> /// </summary>
public class Ai_ClassRoomRecordPageListDto public class Ai_ClassRoomRecordPageListDto
{ {
/// <summary>
/// 课堂记录Id
/// </summary>
public int ClassRoomRecordId { get; set; }
/// <summary> /// <summary>
/// 年级班级名称 /// 年级班级名称
/// </summary> /// </summary>

View File

@ -479,6 +479,17 @@ namespace VOL.WebApi.Controllers
return result; return result;
} }
/// <summary>
/// 获取版本号
/// </summary>
[HttpGet(nameof(AiAppVersion))]
[ServiceFilter(typeof(ValidateDeviceFilter))]
public async Task<Ai_AppVersionDto> AiAppVersion([FromQuery] Ai_AppVersionRequest paramDto)
{
var result = await _aiAppService.AiAppVersion(paramDto);
return result;
}
/// <summary> /// <summary>
/// 获取课堂记录列表 /// 获取课堂记录列表
/// </summary> /// </summary>

View File

@ -318,18 +318,18 @@ namespace VOL.WebApi
//配置HttpContext //配置HttpContext
app.UseStaticHttpContext(); app.UseStaticHttpContext();
app.UseSwagger(); //app.UseSwagger();
app.UseSwaggerUI(c => //app.UseSwaggerUI(c =>
{ //{
//2个下拉框选项 选择对应的文档 // //2个下拉框选项 选择对应的文档
//c.SwaggerEndpoint("/swagger/v1/swagger.json", "VOL.Core后台Api"); // //c.SwaggerEndpoint("/swagger/v1/swagger.json", "VOL.Core后台Api");
//c.SwaggerEndpoint("/swagger/v2/swagger.json", "测试第三方Api"); // //c.SwaggerEndpoint("/swagger/v2/swagger.json", "测试第三方Api");
//c.SwaggerEndpoint("/swagger/v3/swagger.json", "SmartSportsServer-Api"); // //c.SwaggerEndpoint("/swagger/v3/swagger.json", "SmartSportsServer-Api");
//c.SwaggerEndpoint("/swagger/v4/swagger.json", "物联网-Api"); // //c.SwaggerEndpoint("/swagger/v4/swagger.json", "物联网-Api");
//c.SwaggerEndpoint("/swagger/v5/swagger.json", "Ai-Api"); // //c.SwaggerEndpoint("/swagger/v5/swagger.json", "Ai-Api");
c.SwaggerEndpoint("/swagger/v6/swagger.json", "AiApp-Api"); // c.SwaggerEndpoint("/swagger/v6/swagger.json", "AiApp-Api");
c.RoutePrefix = ""; // c.RoutePrefix = "";
}); //});
app.UseRouting(); app.UseRouting();
app.UseCors(); app.UseCors();