import http from '../utils/http.js'

const login = (data) => {
    return http.post("/login", data);
};
const getProjectList = (data) => {
    return http.get("/project/page", data);
};
const getProjectDetail = (id) => {
    return http.get("/project/"+id);
};
const getCaseList = (data) => {
    return http.get("/case/page", data);
};
const getCaseDetail = (id) => {
    return http.get("/case/"+id);
};
const getCaseResult = (id) => {
    return http.get("/case/question/select/"+id);
};

const getCommentList = (data) => {
    return http.get("/comment/page", data);
};
const addComment= (data) => {
    return http.post("/comment", data);
};
const like= (id) => {
    return http.post("/comment/like/"+id);
};
const cancleLike= (id) => {
    return http.del("/comment/like/"+id);
};

const getScore=(data)=>{
    return http.get("/user/score",data)
}
const getConfig=(data)=>{
    return http.get("/project/platform",data);
}
const completeCase=(id,data)=>{
    return http.post("/case/finish/"+id,data,'application/json')
}
const behaviorRecord=(data)=>{
    return http.post("/record/user/behavior",data)
}


export default {
    login,
    getProjectList,
    getCaseList,
    getCaseDetail,
    getCaseResult,
    getCommentList,
    addComment,
    like,
    cancleLike,
    getScore,
    getConfig,
    completeCase,
    behaviorRecord,
    getProjectDetail
}