53 lines
944 B
JavaScript
53 lines
944 B
JavaScript
const http = require('../utils/request')
|
|
|
|
/**
|
|
* 教练登录(账号密码)
|
|
*/
|
|
function login(username, password) {
|
|
return http.post('/auth/login', { username, password })
|
|
}
|
|
|
|
/**
|
|
* 获取教练负责的团课列表
|
|
*/
|
|
function getCoachCourses(coachId) {
|
|
return http.get('/coach/' + coachId + '/courses')
|
|
}
|
|
|
|
/**
|
|
* 教练手动开课
|
|
*/
|
|
function startCourse(courseId) {
|
|
return http.post('/coach/courses/' + courseId + '/start')
|
|
}
|
|
|
|
/**
|
|
* 教练手动结课
|
|
*/
|
|
function endCourse(courseId) {
|
|
return http.post('/coach/courses/' + courseId + '/end')
|
|
}
|
|
|
|
/**
|
|
* 获取团课详情
|
|
*/
|
|
function getCourseDetail(courseId) {
|
|
return http.get('/groupCourse/' + courseId + '/detail')
|
|
}
|
|
|
|
/**
|
|
* 获取教练违规记录
|
|
*/
|
|
function getCoachViolations(coachId) {
|
|
return http.get('/coach/' + coachId + '/violations')
|
|
}
|
|
|
|
module.exports = {
|
|
login,
|
|
getCoachCourses,
|
|
startCourse,
|
|
endCourse,
|
|
getCourseDetail,
|
|
getCoachViolations
|
|
}
|