// 文件模块相关接口
import { moduleRequest } from '@/utils/reSourceRequest'

const request = moduleRequest(`/api/webapp/`)

// 获取课程详情
export const getCourseDetail = (p) => request('disk/courseinfo/detail', p, 'get')
// 获取章节全部列表
export const getChapterAllList = (p) => request('disk/chapter/allList', p, 'get')
//课程-修改状态
export const updateCourseStatus = (p) => request('disk/courseinfo/updateStatus', p, 'post')
//删除课程
export const deleteCourse = (p) => request('disk/courseinfo/delete', p, 'post')
// 部门与成员 mock 数据
export const mockDepartments = [
	{
		id: 1,
		name: '总裁办',
		members: [
			{ id: 101, name: '张小刚' },
			{ id: 102, name: '李小红' },
			{ id: 103, name: '王小明' },
			{ id: 104, name: '周小伟' }
		]
	},
	{
		id: 2,
		name: '技术部',
		members: [
			{ id: 201, name: '技术A' },
			{ id: 202, name: '技术B' }
		]
	},
	{
		id: 3,
		name: '销售部',
		members: [
			{ id: 301, name: '销售A' },
			{ id: 302, name: '销售B' }
		]
	},
	{
		id: 4,
		name: '人事部',
		members: [
			{ id: 401, name: '人事A' },
			{ id: 402, name: '人事B' }
		]
	},
	{
		id: 5,
		name: '财务部',
		members: [
			{ id: 501, name: '财务A' },
			{ id: 502, name: '财务B' }
		]
	},
	{
		id: 6,
		name: '市场部',
		members: [
			{ id: 601, name: '市场A' },
			{ id: 602, name: '市场B' }
		]
	}
]

// 获取部门与成员的 mock 方法
export function getDepartmentMembers() {
	return Promise.resolve(mockDepartments)
}

// 学生详情 mock 数据
export const mockStudentDetail = {
	id: '20208447466',
	name: '张三',
	phone: '18088889999',
	gender: '男',
	college: '院系名称',
	className: '班级名称',
	birthday: '1984年6月22日',
	city: '黑龙江省哈尔滨市',
	educationStatus: '正常',
	onlineStatus: '离线',
	registerTime: '2017-07-24 17:25:38',
	lastLogin: '2020-11-24 10:00:00'
}

// 获取学生详情的 mock 方法
export function getStudentDetail() {
	return Promise.resolve(mockStudentDetail)
}
