import request from '@/utils/request2'

export function getHomeHeaderData() {
  return request({
    url: '/core/home/getHomeHeader',
    method: 'get'
  })
}

export function getContractList(query) {
  return request({
    url: '/core/chat/messages?query='+query,
    method: 'get'
  })
}


export function sendChatMessageStream(data) {
  return request({
    url: '/core/chat/sendChatMessageStream',
    method: 'post',
    data
  })
}
export function stopChatMessage(query) {
  return request({
    url: `/core/chat/stopChatMessage/${query}`,
    method: 'get',
  })
}

// ---start 工作台
export function getQueNumLineGraph(query) {
  return request({
    url: '/core/home/getQueNumLineGraph/'+query,
    method: 'get'
  })
}
export function getQueTypePieChart() {
  return request({
    url: '/core/home/getQueTypePieChart',
    method: 'get'
  })
}
// ---end 工作台

// ---start 问卷管理
export function getQuestionnaireList(query) {
  return request({
    url: '/core/questionnaire/page',
    method: 'get',
    params: query
  })
}
export function addQuestionnaire(data) {
  return request({
    url: '/core/questionnaire',
    method: 'post',
    data
  })
}
export function updateQuestionnaire(data) {
  return request({
    url: '/core/questionnaire',
    method: 'put',
    data
  })
}
export function getQuestionnaireInfo(query) {
  return request({
    url: '/core/questionnaire/'+query,
    method: 'get'
  })
}
export function deleteQuestionnaire(id) {
  return request({
    url: `/core/questionnaire/${id}`,
    method: 'delete'
  })
}
export function getQuestionnaireQA(id) {
  return request({
    url: `/core/questionnaire/${id}`,
    method: 'get'
  })
}
export function getTeamQuestionnaireList(query) {
  return request({
    url: '/core/team/questionnaire/page',
    method: 'get',
    params: query
  })
}
export function getQuestionnaireSchedule(teamQuestionnaireId) {
  return request({
    url: `/core/teammember/que/listByTeam/${teamQuestionnaireId}`,
    method: 'get'
  })
}

export function genTeamReportById(teamQuestionnaireId) {
  return request({
    url: `/core/team/questionnaire/genTeamReport/${teamQuestionnaireId}`,
    method: 'get'
  })
}
export function getPersonQueList(query) {
  return request({
    url: `/core/teammember/que/getQueList`,
    method: 'get',
    params: query
  })
}

export function deleteQuestionnaireOne(id) {
  return request({
    url: `/core/team/questionnaire/deleteOne/${id}`,
    method: 'delete'
  })
}
export function getQuestionnairePublishInfo(id) {
  return request({
    url: `/core/team/questionnaire/${id}`,
    method: 'get'
  })
}
export function publishQuestionnaireConfirm(id) {
  return request({
    url: `/core/team/questionnaire/publish/${id}`,
    method: 'post'
  })
}
export function updateQuestionnairePublish(data) {
  return request({
    url: '/core/team/questionnaire',
    method: 'put',
    data
  })
}

// ---end 问卷管理

// ---start 项目管理
export function getProgramList(query) {
  return request({
    url: '/core/program/page',
    method: 'get',
    params: query
  })
}
export function addProgram(data) {
  return request({
    url: '/core/program',
    method: 'post',
    data
  })
}
export function updateProgram(data) {
  return request({
    url: '/core/program',
    method: 'put',
    data
  })
}
export function getProgramInfo(query) {
  return request({
    url: `core/program/${query}`,
    method: 'get'
  })
}
export function deleteProgram(data) {
  return request({
    url: `/core/program`,
    method: 'delete',
    data
  })
}
// ---end 项目管理

// ---start 公司管理
export function getCoachProgramList(query) {
  return request({
    url: '/core/project/list',
    method: 'get',
    params: query
  })
}
export function addCoachProgram(data) {
  return request({
    url: '/core/project',
    method: 'post',
    data
  })
}
export function updateCoachProgram(data) {
  return request({
    url: '/core/project',
    method: 'put',
    data
  })
}
export function getCoachProgramInfo(query) {
  return request({
    url: `core/project/${query}`,
    method: 'get'
  })
}
export function deleteCoachProgram(query) {
  return request({
    url: `/core/project/deleteOneById/${query}`,
    method: 'delete'
  })
}


export function getProgramProgressList(query) {
  return request({
    url: '/core/project/progress/progressList',
    method: 'get',
    params: query
  })
}
export function addProgramProgress(data) {
  return request({
    url: '/core/project/progress',
    method: 'post',
    data
  })
}
export function updateProgramProgress(data) {
  return request({
    url: '/core/project/progress',
    method: 'put',
    data
  })
}
export function getProgramProgressInfo(query) {
  return request({
    url: `core/project/progress/${query}`,
    method: 'get'
  })
}
export function deleteProgramProgress(data) {
  return request({
    url: `/core/project/progress`,
    method: 'delete',
    data
  })
}
// ---end 项目管理

// ---start 团队管理
export function getTeamListById(query) {
  return request({
    url: '/core/team/teamList',
    method: 'get',
    params: query
  })
}
export function addProgramTeam(data) {
  return request({
    url: '/core/team',
    method: 'post',
    data
  })
}
export function updateProgramTeam(data) {
  return request({
    url: '/core/team',
    method: 'put',
    data
  })
}
export function getProgramTeamInfo(query) {
  return request({
    url: `core/team/${query}`,
    method: 'get'
  })
}
export function deleteProgramTeam(query) {
  return request({
    url: `/core/team/deleteOneById/${query}`,
    method: 'delete'
  })
}
export function sendQuestionnaire(data) {
  return request({
    url: '/core/team/questionnaire',
    method: 'post',
    data
  })
}
// ---end 团队管理

// ---start 教练管理
export function getCoachList(query) {
  return request({
    url: '/sys/user/page',
    method: 'get',
    params: query
  })
}
export function addCoach(data) {
  return request({
    url: '/sys/user',
    method: 'post',
    data
  })
}
export function updateCoach(data) {
  return request({
    url: '/sys/user',
    method: 'put',
    data
  })
}
export function getCoachInfo(query) {
  return request({
    url: `/sys/user/${query}`,
    method: 'get'
  })
}
export function deleteCoach(data) {
  return request({
    url: '/sys/user',
    method: 'delete',
    data
  })
}
export function updateUserPwd(data) {
  return request({
    url: '/sys/user/password',
    method: 'put',
    data
  })
}
// ---end 教练管理

// ---start 知识库管理
export function getKnowledgeList(query) {
  return request({
    url: '/core/knowledgebase/page',
    method: 'get',
    params: query
  })
}
export function addKnowledge(data) {
  return request({
    url: '/core/knowledgebase',
    method: 'post',
    data
  })
}
export function updateKnowledge(data) {
  return request({
    url: '/core/knowledgebase',
    method: 'put',
    data
  })
}
export function getKnowledgeInfo(query) {
  return request({
    url: '/core/knowledgebase/'+query,
    method: 'get'
  })
}
export function deleteKnowledge(id) {
  return request({
    url: `/core/knowledgebase/delete/${id}`,
    method: 'delete'
  })
}

export function getKnowledgeFileList(query) {
  return request({
    url: '/core/knowledgedata/list',
    method: 'get',
    params: query
  })
}
export function addKnowledgeFile(data) {
  return request({
    url: '/core/knowledgedata',
    method: 'post',
    data
  })
}
export function deleteKnowledgeFile(id) {
  return request({
    url: `/core/knowledgedata/delete/${id}`,
    method: 'delete'
  })
}
// ---end 知识库管理

// ---start 报告管理
export function getReportPdfData(id) {
  return request({
    url: '/core/report/team/member/previewReport/'+id,
    method: 'get'
  })
}
export function updateReportPdfUrl(data) {
  return request({
    url: '/core/report/team/member',
    method: 'put',
    data
  })
}
export function getTeamReportWjList(relationId) {
  return request({
    url: `/core/report/team/member/reportList/team/${relationId}`,
    method: 'get'
  })
}
export function getPersonReportWjList(relationId) {
  return request({
    url: `/core/report/team/member/reportList/member/${relationId}`,
    method: 'get'
  })
}
export function deleteTeamReportWj(data) {
  return request({
    url: '/core/report/team/member',
    method: 'delete',
    data
  })
}
export function sendReportById(id) {
  return request({
    url: `/core/report/team/member/send/${id}`,
    method: 'get'
  })
}
export function sendReportUserById(id,userId) {
  return request({
    url: `/core/report/team/member/send/${id}/${userId}`,
    method: 'get'
  })
}
export function sendReportUsers(data) {
  return request({
    url: `/core/report/team/member/send`,
    method: 'post',
    data
  })
}
export function reCreateReport(id) {
  return request({
    url: `/core/report/team/member/retryGen/${id}`,
    method: 'get'
  })
}
export function getReportList() {
  return request({
    url: `/core/report/team/member/getList`,
    method: 'get'
  })
}
export function genPersonReport(data) {
  return request({
    url: `/core/teammember/que/genMemberReport`,
    method: 'post',
    data
  })
}
// ---end 报告管理


// ---start 邮件管理
export function getEmailModelList(query) {
  return request({
    url: '/sys/mailtemplate/page',
    method: 'get',
    params: query
  })
}
export function saveEmailModel(data) {
  return request({
    url: `/sys/mailtemplate`,
    method: 'post',
    data
  })
}
export function updateEmailModel(data) {
  return request({
    url: `/sys/mailtemplate`,
    method: 'put',
    data
  })
}
export function deleteEmailModel(data) {
  return request({
    url: `/sys/mailtemplate`,
    method: 'delete',
    data
  })
}
export function getEmailModelById(id) {
  return request({
    url: `/sys/mailtemplate/${id}`,
    method: 'get',
  })
}
export function getEmailModelConfig() {
  return request({
    url: `/sys/mailtemplate/config`,
    method: 'get',
  })
}
export function saveEmailModelConfig(data) {
  return request({
    url: `/sys/mailtemplate/saveConfig`,
    method: 'post',
    data
  })
}
export function sendEmail(data) {
  return request({
    url: `/sys/mailtemplate/send`,
    method: 'post',
    data
  })
}
export function sendEmailToUser(data) {
  return request({
    url: `/sys/user/sendBatchCode`,
    method: 'post',
    data
  })
}

export function getSendRecordList(query) {
  return request({
    url: '/sys/maillog/page',
    method: 'get',
    params: query
  })
}
export function deleteSendRecord(data) {
  return request({
    url: `/sys/maillog`,
    method: 'delete',
    data
  })
}
// ---end 邮件管理