|
@@ -14,11 +14,14 @@ using TEAMModelOS.SDK.Extension;
|
|
|
using Top.Api;
|
|
|
using TEAMModelOS.SDK.Models.Cosmos.Student;
|
|
|
|
|
|
-namespace TEAMModelOS.Controllers
|
|
|
+namespace TEAMModelOS.Controllers.OpenApi.Business
|
|
|
{
|
|
|
- [Route("portrait")]
|
|
|
+ /// <summary>
|
|
|
+ /// 企业定制接口
|
|
|
+ /// </summary>
|
|
|
+ [Route("business")]
|
|
|
[ApiController]
|
|
|
- public class PortraitController : ControllerBase
|
|
|
+ public class BizCustomizeController : ControllerBase
|
|
|
{
|
|
|
public AzureCosmosFactory _azureCosmos;
|
|
|
private readonly AzureStorageFactory _azureStorage;
|
|
@@ -28,7 +31,7 @@ namespace TEAMModelOS.Controllers
|
|
|
private readonly IConfiguration _configuration;
|
|
|
private readonly CoreAPIHttpService _coreAPIHttpService;
|
|
|
private readonly AzureServiceBusFactory _serviceBus;
|
|
|
- public PortraitController(AzureCosmosFactory azureCosmos, AzureStorageFactory azureStorage, AzureRedisFactory azureRedis, AzureServiceBusFactory serviceBus, DingDing dingDing, CoreAPIHttpService coreAPIHttpService, IOptionsSnapshot<Option> option, IConfiguration configuration)
|
|
|
+ public BizCustomizeController(AzureCosmosFactory azureCosmos, AzureStorageFactory azureStorage, AzureRedisFactory azureRedis, AzureServiceBusFactory serviceBus, DingDing dingDing, CoreAPIHttpService coreAPIHttpService, IOptionsSnapshot<Option> option, IConfiguration configuration)
|
|
|
{
|
|
|
_azureCosmos = azureCosmos;
|
|
|
_azureStorage = azureStorage;
|
|
@@ -47,13 +50,12 @@ namespace TEAMModelOS.Controllers
|
|
|
/// <param name="portrait"></param>
|
|
|
/// <returns></returns>
|
|
|
[ProducesDefaultResponseType]
|
|
|
- [HttpPost("set-info")]
|
|
|
- public async Task<IActionResult> SetInfo(JsonElement jsonElement)
|
|
|
+ [HttpPost("upsert-student-portrait")]
|
|
|
+ public async Task<IActionResult> UpsertStudentPortrait(JsonElement jsonElement)
|
|
|
{
|
|
|
ResponseData<dynamic> responseData = null;
|
|
|
-
|
|
|
- if (!jsonElement.TryGetProperty("schoolCode", out JsonElement schoolCode)) return Ok(responseData = new() { code = RespondCode.ParamsError,msg = "schoolCode为空!" });
|
|
|
- if (!jsonElement.TryGetProperty("studentId", out JsonElement studentId)) return Ok(responseData = new() { code = RespondCode.ParamsError, msg = "studentId为空!" });
|
|
|
+ if (!jsonElement.TryGetProperty("schoolCode", out JsonElement schoolCode)) return Ok(responseData = new() { code = RespondCode.ParamsError, msg = "schoolCode为空!" });
|
|
|
+ if (!jsonElement.TryGetProperty("studentId", out JsonElement studentId)) return Ok(responseData = new() { code = RespondCode.ParamsError, msg = "studentId为空!" });
|
|
|
if (!jsonElement.TryGetProperty("name", out JsonElement name)) return Ok(responseData = new() { code = RespondCode.ParamsError, msg = "name为空!" });
|
|
|
if (!jsonElement.TryGetProperty("classId", out JsonElement classId)) return Ok(responseData = new() { code = RespondCode.ParamsError, msg = "classId为空!" });
|
|
|
if (!jsonElement.TryGetProperty("periodId", out JsonElement periodId)) return Ok(responseData = new() { code = RespondCode.ParamsError, msg = "periodId为空!" });
|
|
@@ -64,7 +66,7 @@ namespace TEAMModelOS.Controllers
|
|
|
|
|
|
|
|
|
|
|
|
- return Ok(responseData =new() { code = RespondCode.Ok, msg = "成功" });
|
|
|
+ return Ok(responseData = new() { code = RespondCode.Ok, msg = "成功" });
|
|
|
}
|
|
|
|
|
|
|