diff --git a/YD_YiLu.Commons/Dto/DeviceSync/DeviceSyncUserPageRequestDto.cs b/YD_YiLu.Commons/Dto/DeviceSync/DeviceSyncUserPageRequestDto.cs index dcab30a..ca0afb0 100644 --- a/YD_YiLu.Commons/Dto/DeviceSync/DeviceSyncUserPageRequestDto.cs +++ b/YD_YiLu.Commons/Dto/DeviceSync/DeviceSyncUserPageRequestDto.cs @@ -53,11 +53,12 @@ namespace YD_YiLu.Commons.Dto.DeviceSync /// public class DeviceSyncUserPageResponseDto { - public long SyncId { get; set; } - public int Current { get; set; } - public int Pages { get; set; } - public int Total { get; set; } + public long? SyncId { get; set; } public List UserList { get; set; } = new List(); + public int Total { get; set; } + public int Size { get; set; } + public int Pages { get; set; } + public int Current { get; set; } } /// @@ -68,16 +69,23 @@ namespace YD_YiLu.Commons.Dto.DeviceSync public int UserId { get; set; } public int UserType { get; set; } public string Username { get; set; } + public string Password { get; set; } public string Nickname { get; set; } public int OrganizationId { get; set; } public string OrganizationName { get; set; } + public int GradeId { get; set; } public string GradeName { get; set; } public string FacePictureUrl { get; set; } public string Identity { get; set; } public string Gender { get; set; } public string Birthday { get; set; } public string UserSerial { get; set; } - public List TrainLimitValues { get; set; } = new List(); + public string Height { get; set; } + public string Weight { get; set; } + public List TrainLimitValues { get; set; } + public int Classification { get; set; } + public int IsActive { get; set; } + public int IsDelete { get; set; } } public class TrainLimitValueDto diff --git a/YD_YiLu/Program.cs b/YD_YiLu/Program.cs index 2699c22..1583e41 100644 --- a/YD_YiLu/Program.cs +++ b/YD_YiLu/Program.cs @@ -19,7 +19,7 @@ namespace YD_YiLu.Api { serverOptions.Limits.MaxRequestBodySize = 10485760; }); - webBuilder.UseKestrel().UseUrls("http://*:9997"); + webBuilder.UseKestrel().UseUrls("http://*:8001"); webBuilder.UseIIS(); webBuilder.UseStartup(); }).UseServiceProviderFactory(new AutofacServiceProviderFactory()); diff --git a/YD_YiLu/Services/Impl/DeviceSyncService.cs b/YD_YiLu/Services/Impl/DeviceSyncService.cs index a6999d9..2a43eac 100644 --- a/YD_YiLu/Services/Impl/DeviceSyncService.cs +++ b/YD_YiLu/Services/Impl/DeviceSyncService.cs @@ -56,7 +56,8 @@ namespace YD_YiLu.Api.Services.Impl { UserId = s.Id, UserType = 2, - Username = s.StudentNo, + Username = null, + Password = null, Nickname = s.StudentName, GradeName = "", OrganizationId = s.ClassId ?? 0, @@ -66,6 +67,12 @@ namespace YD_YiLu.Api.Services.Impl Gender = s.Sex == 1 ? "男" : "女", Birthday = s.Birthday.HasValue ? s.Birthday.Value.ToString("yyyy-MM-dd") : "", UserSerial = s.StudentNo, + Height = null, + Weight = null, + TrainLimitValues = null, + Classification = 2, + IsActive = 1, + IsDelete = 0 }) .ToListAsync(); @@ -75,17 +82,19 @@ namespace YD_YiLu.Api.Services.Impl if (c != null) { u.OrganizationName = FormatOrganizationName(c, u.OrganizationName); + u.GradeId = c.GradeId; u.GradeName = c.GradeName ?? ""; } } return new DeviceSyncUserPageResponseDto { - SyncId = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(), - Current = fullSync ? 1 : pageIndex, - Pages = fullSync ? 1 : (total == 0 ? 0 : (int)Math.Ceiling(total / (double)Math.Max(pageSize, 1))), + SyncId = null, + UserList = list, Total = total, - UserList = list + Size = pageSize, + Pages = fullSync ? 1 : (total == 0 ? 0 : (int)Math.Ceiling(total / (double)Math.Max(pageSize, 1))), + Current = fullSync ? 1 : pageIndex }; } @@ -792,7 +801,8 @@ namespace YD_YiLu.Api.Services.Impl Identity = "", // 可选 Gender = st == null ? "" : (st.Sex == 1 ? "男" : "女"), Birthday = st?.Birthday?.ToString("yyyy-MM-dd") ?? "", - UserSerial = serial + UserSerial = serial, + TrainLimitValues = new List() }; // 👉 构造 trainLimitValues