|
@@ -4,6 +4,7 @@ using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.AspNetCore.Http;
|
|
using Microsoft.AspNetCore.Http;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
+using Org.BouncyCastle.Ocsp;
|
|
using TEAMModelOS.SDK.Context.Exception;
|
|
using TEAMModelOS.SDK.Context.Exception;
|
|
using TEAMModelOS.SDK.Extension.DataResult.JsonRpcRequest;
|
|
using TEAMModelOS.SDK.Extension.DataResult.JsonRpcRequest;
|
|
using TEAMModelOS.SDK.Extension.DataResult.JsonRpcResponse;
|
|
using TEAMModelOS.SDK.Extension.DataResult.JsonRpcResponse;
|
|
@@ -60,16 +61,22 @@ namespace TEAMModelOS.Controllers.Courses
|
|
public async Task<BaseJosnRPCResponse> DeleteCourse (JosnRPCRequest<Dictionary<string, object>> request)
|
|
public async Task<BaseJosnRPCResponse> DeleteCourse (JosnRPCRequest<Dictionary<string, object>> request)
|
|
{
|
|
{
|
|
JsonRPCResponseBuilder builder = JsonRPCResponseBuilder.custom();
|
|
JsonRPCResponseBuilder builder = JsonRPCResponseBuilder.custom();
|
|
- Dictionary<string, object> dict = request.@params;
|
|
|
|
- List<Course> Course = await _cosmos.FindByDict<Course>(dict);
|
|
|
|
- await _cosmos.DeleteAll<Course>(Course);
|
|
|
|
- if (Course.Count > 0)
|
|
|
|
|
|
+ if (request.@params.Keys.Count > 0)
|
|
{
|
|
{
|
|
- builder.Data("删除成功");
|
|
|
|
|
|
+
|
|
|
|
+ List<Course> Course = await _cosmos.FindByDict<Course>(request.@params);
|
|
|
|
+ await _cosmos.DeleteAll<Course>(Course);
|
|
|
|
+ if (Course.Count > 0)
|
|
|
|
+ {
|
|
|
|
+ builder.Data("删除成功");
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ throw new BizException("删除失败", ResponseCode.FAILED);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- else
|
|
|
|
- {
|
|
|
|
- throw new BizException("删除失败", ResponseCode.FAILED);
|
|
|
|
|
|
+ else {
|
|
|
|
+ throw new BizException("参数未定义", ResponseCode.FAILED);
|
|
}
|
|
}
|
|
return builder.build();
|
|
return builder.build();
|
|
}
|
|
}
|