79 lines
2.4 KiB
TypeScript
79 lines
2.4 KiB
TypeScript
|
|
import {Injectable} from '@angular/core';
|
||
|
|
import {HttpClient, HttpEvent, HttpRequest} from '@angular/common/http';
|
||
|
|
import {ApiService} from '../../app.api.service';
|
||
|
|
import { CourseType } from 'src/app/_models/LearningManagement/course-type';
|
||
|
|
import { EnumStatus } from 'src/app/_models/enums';
|
||
|
|
import { Courses } from 'src/app/_models/LearningManagement/courses';
|
||
|
|
import { CourseProgress } from 'src/app/_models/LearningManagement/course-progress';
|
||
|
|
|
||
|
|
@Injectable({
|
||
|
|
providedIn: 'root'
|
||
|
|
})
|
||
|
|
export class LMSService {
|
||
|
|
|
||
|
|
constructor(public apiService: ApiService,
|
||
|
|
private http: HttpClient) {
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
//#region Course Type
|
||
|
|
saveCourseType(param: any) {
|
||
|
|
return this.apiService.httpPost<CourseType>('/LMS/saveCourseType', param);
|
||
|
|
}
|
||
|
|
deleteCourseType(id : number) {
|
||
|
|
return this.apiService.httpGet('/LMS/deleteCourseType/' + id);
|
||
|
|
}
|
||
|
|
GetCourseTypeByStatus(status : EnumStatus) {
|
||
|
|
return this.apiService.httpGet<CourseType[]>('/LMS/getByStatus/' + status);
|
||
|
|
}
|
||
|
|
GetAllCourseType() {
|
||
|
|
return this.apiService.httpGet<CourseType[]>('/LMS/getAllCourseType');
|
||
|
|
}
|
||
|
|
getByParentID(parentID : number) {
|
||
|
|
return this.apiService.httpGet<CourseType[]>('/LMS/getAllCourseType/'+parentID);
|
||
|
|
}
|
||
|
|
//#endregion
|
||
|
|
|
||
|
|
//#region Courses
|
||
|
|
saveCourses(param: any) {
|
||
|
|
return this.apiService.httpPost<Courses>('/LMS/saveCourses', param);
|
||
|
|
}
|
||
|
|
deleteCourses(id : number) {
|
||
|
|
return this.apiService.httpGet('/LMS/deleteCourses/' + id);
|
||
|
|
}
|
||
|
|
GetCoursesByStatus(status : EnumStatus) {
|
||
|
|
return this.apiService.httpGet<Courses[]>('/LMS/getCoursesByStatus/' + status);
|
||
|
|
}
|
||
|
|
GetCourse(ID : number) {
|
||
|
|
return this.apiService.httpGet<Courses>('/LMS/getCourse/' + ID);
|
||
|
|
}
|
||
|
|
GetCourseForUser(ID : number) {
|
||
|
|
return this.apiService.httpGet<Courses>('/LMS/GetCourseForUser/' + ID);
|
||
|
|
}
|
||
|
|
GetCourseForEnrollment(ID : number) {
|
||
|
|
return this.apiService.httpGet<Courses>('/LMS/GetCourseForEnrollment/' + ID);
|
||
|
|
}
|
||
|
|
GetAllCourses() {
|
||
|
|
return this.apiService.httpGet<Courses[]>('/LMS/getAllCourses');
|
||
|
|
}
|
||
|
|
//#endregion
|
||
|
|
|
||
|
|
//#region Lessons
|
||
|
|
deleteLessons(id : number) {
|
||
|
|
return this.apiService.httpGet('/LMS/deleteLessons/' + id);
|
||
|
|
}
|
||
|
|
//#endregion
|
||
|
|
|
||
|
|
//#region Lesson Content
|
||
|
|
deleteLessonContent(id : number) {
|
||
|
|
return this.apiService.httpGet('/LMS/deleteLessonContent/' + id);
|
||
|
|
}
|
||
|
|
//#endregion
|
||
|
|
|
||
|
|
//#region LESSON Progress
|
||
|
|
UserCourseProgress(param: any) {
|
||
|
|
return this.apiService.httpPost<Courses>('/LMS/UserCourseProgress', param);
|
||
|
|
}
|
||
|
|
//#endregion
|
||
|
|
}
|