commit
4e6f8c9c84
|
|
@ -117,11 +117,11 @@ namespace Learn.Archives.API.Controllers
|
||||||
return e.Id;
|
return e.Id;
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 设置角色菜单
|
/// 获取学生列表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public new async Task<PageResult<StudentInfoRes>> PageList()
|
public new async Task<PageResult<StudentInfoRes>> PageList(object data)
|
||||||
{
|
{
|
||||||
var apiRes =await _userCenterService.CallAPI_GetPageUserList(_httpContextAccessor.HttpContext);
|
var apiRes =await _userCenterService.CallAPI_GetPageUserList(_httpContextAccessor.HttpContext);
|
||||||
var res= new PageResult<StudentInfoRes>() { Data = new List<StudentInfoRes>() };
|
var res= new PageResult<StudentInfoRes>() { Data = new List<StudentInfoRes>() };
|
||||||
|
|
|
||||||
|
|
@ -153,7 +153,7 @@ namespace Learn.Archives.API.Expand
|
||||||
//特殊处理:ResultIgnore,不进行返回结果包装,原样输出
|
//特殊处理:ResultIgnore,不进行返回结果包装,原样输出
|
||||||
var endpoint = context.GetEndpoint();
|
var endpoint = context.GetEndpoint();
|
||||||
// 直接返回原始结果,不封装
|
// 直接返回原始结果,不封装
|
||||||
if (endpoint?.Metadata.GetMetadata<HttpLogEnable>() == null) return;
|
if (endpoint?.Metadata.GetMetadata<HttpLogEnable>() == null&& e is null) return;
|
||||||
|
|
||||||
string request = null;
|
string request = null;
|
||||||
var logId = Yitter.IdGenerator.YitIdHelper.NextId();
|
var logId = Yitter.IdGenerator.YitIdHelper.NextId();
|
||||||
|
|
@ -233,8 +233,6 @@ namespace Learn.Archives.API.Expand
|
||||||
/// <param name="context"></param>
|
/// <param name="context"></param>
|
||||||
public override async void OnActionExecuted(ActionExecutedContext context)
|
public override async void OnActionExecuted(ActionExecutedContext context)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
BaseReturn<object>? res = ApiResultFormatting(context);
|
BaseReturn<object>? res = ApiResultFormatting(context);
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,8 @@
|
||||||
},
|
},
|
||||||
"DB": {
|
"DB": {
|
||||||
"ConnectionString": "AllowLoadLocalInfile=true;Server=58.17.132.2;User ID=marking;Password=qwe123!@#;Database=learn.archives;CharSet=utf8mb4;Port=43306;pooling=true;SslMode=None;",
|
"ConnectionString": "AllowLoadLocalInfile=true;Server=58.17.132.2;User ID=marking;Password=qwe123!@#;Database=learn.archives;CharSet=utf8mb4;Port=43306;pooling=true;SslMode=None;",
|
||||||
|
//正式库
|
||||||
|
//"ConnectionString": "AllowLoadLocalInfile=true;Server=rm-2vc20nd3d11g0oh6g2o.rwlb.cn-chengdu.rds.aliyuncs.com;User ID=marking;Password=poiuytPOIUYT098765)(*&^%;Port=3306;Database=learn.archives;CharSet=utf8mb4;pooling=true;SslMode=None",
|
||||||
"SqlType": "MySql",
|
"SqlType": "MySql",
|
||||||
"UpdateTable": false
|
"UpdateTable": false
|
||||||
},
|
},
|
||||||
|
|
@ -24,12 +26,14 @@
|
||||||
},
|
},
|
||||||
"UserCenterService": {
|
"UserCenterService": {
|
||||||
"API": "https://dca.w.23544.com:8843/api"
|
"API": "https://dca.w.23544.com:8843/api"
|
||||||
|
//"API": "https://dcb.23544.com/api"
|
||||||
},
|
},
|
||||||
"OtherDBArr": [
|
"OtherDBArr": [
|
||||||
{
|
{
|
||||||
"ConfigId": 1001, //用户中心
|
"ConfigId": 1001, //用户中心
|
||||||
//"ConnectionString": "AllowLoadLocalInfile=true;Server=192.168.2.9;User ID=root;Password=qwe123!@#;Port=3306;Database=usercenter;CharSet=utf8mb4;pooling=true;SslMode=None;",
|
|
||||||
"ConnectionString": "AllowLoadLocalInfile=true;Server=58.17.132.2;User ID=marking;Password=qwe123!@#;Port=3306;Database=usercenter_v1;CharSet=utf8mb4;Port=43306;pooling=true;SslMode=None;",
|
"ConnectionString": "AllowLoadLocalInfile=true;Server=58.17.132.2;User ID=marking;Password=qwe123!@#;Port=3306;Database=usercenter_v1;CharSet=utf8mb4;Port=43306;pooling=true;SslMode=None;",
|
||||||
|
//"ConnectionString": "AllowLoadLocalInfile=true;Server=usercenter-mysql.23544.com;User ID=usercenter;Password=MPsSSNuvFO7wBqADXC9zweh9tdOPNwm6;Port=3306;Database=usercenter_v1;CharSet=utf8mb4;pooling=true;SslMode=None",
|
||||||
|
|
||||||
"SqlType": "MySql"
|
"SqlType": "MySql"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,16 @@ namespace Learn.Archives.Core.Common
|
||||||
throw new OhException(message, code);
|
throw new OhException(message, code);
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// 抛出 异常
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message"></param>
|
||||||
|
/// <param name="code"></param>
|
||||||
|
/// <exception cref="OhException"></exception>
|
||||||
|
public static T Error<T>(string message, int code = 500)
|
||||||
|
{
|
||||||
|
throw new OhException(message, code);
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
/// 抛出 模型校验异常
|
/// 抛出 模型校验异常
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="message"></param>
|
/// <param name="message"></param>
|
||||||
|
|
|
||||||
|
|
@ -71,8 +71,19 @@ namespace Learn.Archives.Core.Common
|
||||||
requestMessage.Content = new StringContent(data.ToJson(), Encoding.UTF8, "application/json");
|
requestMessage.Content = new StringContent(data.ToJson(), Encoding.UTF8, "application/json");
|
||||||
|
|
||||||
var responseMessage = await httpClient.SendAsync(requestMessage, HttpCompletionOption.ResponseHeadersRead);
|
var responseMessage = await httpClient.SendAsync(requestMessage, HttpCompletionOption.ResponseHeadersRead);
|
||||||
var resStr = await responseMessage.Content?.ReadAsStringAsync();
|
var resStr = string.Empty;
|
||||||
var res = JsonSerializer.Deserialize<BaseReturn<UserImportRes>>(resStr);
|
try
|
||||||
|
{
|
||||||
|
resStr= await responseMessage?.Content?.ReadAsStringAsync();
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return Oh.Error<UserImportRes>($"请求用户中心出现异常 {resStr} {ex.Message}");
|
||||||
|
}
|
||||||
|
if(string.IsNullOrEmpty(resStr))
|
||||||
|
return Oh.Error<UserImportRes>($"请求用户中心出现异常 返回了空数据");
|
||||||
|
var res = JsonSerializer.Deserialize<BaseReturn<UserImportRes>>(resStr);
|
||||||
if (res == null || res.Code != 200)
|
if (res == null || res.Code != 200)
|
||||||
Oh.Error(res.Message, res.Code);
|
Oh.Error(res.Message, res.Code);
|
||||||
return res.Data;
|
return res.Data;
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,6 @@
|
||||||
<PackageReference Include="SqlSugar.IOC" Version="2.0.0" />
|
<PackageReference Include="SqlSugar.IOC" Version="2.0.0" />
|
||||||
<PackageReference Include="SqlSugarCore" Version="5.1.4.170" />
|
<PackageReference Include="SqlSugarCore" Version="5.1.4.170" />
|
||||||
<PackageReference Include="System.Net.Http" Version="4.3.4" />
|
<PackageReference Include="System.Net.Http" Version="4.3.4" />
|
||||||
<PackageReference Include="UserCenter.Model" Version="1.4.4" />
|
<PackageReference Include="UserCenter.Model" Version="1.4.9" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
||||||
|
|
@ -578,6 +578,6 @@ namespace Learn.Archives.Core.Model.Dto
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 职位状态
|
/// 职位状态
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool Status { get; set; }
|
public object Status { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue