京师后台更改
This commit is contained in:
parent
0cf17d7587
commit
c163efa10e
@ -5,7 +5,6 @@ using VOL.Core.Configuration;
|
||||
using VOL.Core.Extensions.AutofacManager;
|
||||
using VOL.Core.Utilities;
|
||||
using VOL.Model.JingShiTiJiao;
|
||||
using static Microsoft.EntityFrameworkCore.DbLoggerCategory;
|
||||
|
||||
namespace VOL.Ai.Services
|
||||
{
|
||||
|
||||
@ -24,11 +24,6 @@ namespace VOL.Model
|
||||
/// </summary>
|
||||
public string GradeName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 性质名称
|
||||
/// </summary>
|
||||
//public string NatureName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 班级集合
|
||||
/// </summary>
|
||||
|
||||
@ -6,6 +6,8 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using VOL.Ai.IServices;
|
||||
using VOL.Ai.Services;
|
||||
using VOL.Business.IServices;
|
||||
using VOL.Business.IServices.Training;
|
||||
using VOL.Core.Filters;
|
||||
@ -29,12 +31,16 @@ namespace VOL.WebApi.Controllers.JingShiTiJiao
|
||||
#region 初始化
|
||||
|
||||
private readonly IS_HomeWorkService _homeWorkService;
|
||||
private readonly IJingShiTiJiaoService _jingShiTiJiaoService;
|
||||
|
||||
|
||||
private readonly II_TrainingDataService _trainingDataService;
|
||||
public JingShiTiJiaoController(
|
||||
IS_HomeWorkService homeWorkService, II_TrainingDataService trainingDataService)
|
||||
IS_HomeWorkService homeWorkService, II_TrainingDataService trainingDataService,IJingShiTiJiaoService jingShiTiJiaoService)
|
||||
{
|
||||
_homeWorkService = homeWorkService;
|
||||
_trainingDataService = trainingDataService;
|
||||
_jingShiTiJiaoService = jingShiTiJiaoService;
|
||||
}
|
||||
|
||||
#endregion
|
||||
@ -109,15 +115,39 @@ namespace VOL.WebApi.Controllers.JingShiTiJiao
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取所有年级名称
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet(nameof(GetGradeNames))]
|
||||
public async Task<List<GradeNameModel>> GetGradeNames()
|
||||
/// <summary>
|
||||
/// 获取年级列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet(nameof(GetGradeList))]
|
||||
public async Task<List<GradeNameModel>> GetGradeList(string schoolCode)
|
||||
{
|
||||
|
||||
if (string.IsNullOrWhiteSpace(schoolCode))
|
||||
return new List<GradeNameModel>();
|
||||
|
||||
// 1️⃣ 调用京师接口获取年级班级
|
||||
var schoolClass = await _jingShiTiJiaoService.GetClassBySchoolAsync(schoolCode);
|
||||
|
||||
if (schoolClass == null || schoolClass.Grades == null || !schoolClass.Grades.Any())
|
||||
return new List<GradeNameModel>();
|
||||
|
||||
// 2️⃣ 将接口结果映射为 GradeNameModel
|
||||
var result = schoolClass.Grades.Select(g => new GradeNameModel
|
||||
{
|
||||
Id = 0, // 如果数据库中没有对应Id,可先填0或后续映射数据库Id
|
||||
GradeName = g.GradeName,
|
||||
Class = g.Classes?.Select(c => new ClassNameModel
|
||||
{
|
||||
Id = 0, // 同理,暂时填0
|
||||
ClassName = c.ClassName
|
||||
}).ToList() ?? new List<ClassNameModel>()
|
||||
}).ToList();
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -115,6 +115,15 @@
|
||||
"ExpirationDate": 30,
|
||||
"DataSyncCallBackUrl": "https://test.gonbat.com/aims-api/physicalfitnessthirdparty/yuedong/school/callBack"
|
||||
},
|
||||
|
||||
"JingShiTiJiao": {
|
||||
"Channel": "sk-yuedong",
|
||||
"SecretKey": "JSTJ-kGfs6J7bkgdxr9mz",
|
||||
"BaseUrl": "https://api-test.aitibao.com",
|
||||
"SchoolCode": "202512240056",
|
||||
"SportsItem": "JS010000"
|
||||
},
|
||||
|
||||
"QuartzAccessKey": "65EC9387355E4717899C552963CE59FF", //定时任务的值,请自行修改
|
||||
"OriginalPwd": "000000" //初始密码
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user