Commit 135d4ad5 authored by 黄奎's avatar 黄奎

新增接口

parent a16a667d
using Edu.Common.API; using Edu.Common.API;
using Edu.Common.Plugin;
using Edu.Model.ViewModel.Course; using Edu.Model.ViewModel.Course;
using Edu.Module.Course; using Edu.Module.Course;
using Edu.WebApi.Filter; using Edu.WebApi.Filter;
...@@ -66,5 +67,74 @@ namespace Edu.WebApi.Controllers.Course ...@@ -66,5 +67,74 @@ namespace Edu.WebApi.Controllers.Course
} }
return flag ? ApiResult.Success() : ApiResult.Failed(); return flag ? ApiResult.Success() : ApiResult.Failed();
} }
/// <summary>
/// 获取课程单词列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetCourseWordsList()
{
var query = new RB_Course_Words_Extend()
{
CourseId = base.ParmJObj.GetInt("CourseId"),
ChapterId = base.ParmJObj.GetInt("ChapterId"),
};
query.Group_Id = base.UserInfo.Group_Id;
var list = courseWordsModule.GetCourseWordsListModule(query);
return ApiResult.Success(data: list);
}
/// <summary>
/// 添加修改课程单词
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetCourseWords()
{
var extModel = new RB_Course_Words_Extend()
{
Id = base.ParmJObj.GetInt("Id"),
CourseId = base.ParmJObj.GetInt("CourseId"),
ChapterId = base.ParmJObj.GetInt("ChapterId"),
WordType = base.ParmJObj.GetStringValue("WordType"),
WordContent = base.ParmJObj.GetStringValue("WordContent"),
WordTone = base.ParmJObj.GetStringValue("WordTone"),
WordWrite = base.ParmJObj.GetStringValue("WordWrite"),
ChineseMean = base.ParmJObj.GetStringValue("ChineseMean"),
FileUrl = base.ParmJObj.GetStringValue("FileUrl"),
};
extModel.CreateTime = DateTime.Now;
extModel.CreateBy = UserInfo.Id;
extModel.UpdateBy = UserInfo.Id;
extModel.UpdateTime = DateTime.Now;
extModel.Group_Id = this.UserInfo.Group_Id;
bool flag = courseWordsModule.SetCourseWordsModule(extModel);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 根据编号获取单词详情
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetCourseWords()
{
var Id = base.ParmJObj.GetInt("Id", 0);
var extModel = courseWordsModule.GetCourseWordsModule(Id);
return ApiResult.Success(data: extModel);
}
/// <summary>
/// 根据编号删除单词
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult RemoveCourseWords()
{
var Id = base.ParmJObj.GetInt("Id", 0);
var flag = courseWordsModule.RemoveCourseWordsModule(Id);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment