Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Education
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄奎
Education
Commits
135d4ad5
Commit
135d4ad5
authored
Jan 06, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增接口
parent
a16a667d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
71 additions
and
1 deletion
+71
-1
CourseWordsController.cs
Edu.WebApi/Controllers/Course/CourseWordsController.cs
+71
-1
No files found.
Edu.WebApi/Controllers/Course/CourseWordsController.cs
View file @
135d4ad5
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment