import request from '@/utils/request'

const api = {
    ScanRepo: '/AI/ScanRepo',
    GetScanTaskList: '/AI/GetScanTaskList',
    GetScanTaskDetail: '/AI/GetScanTaskDetail',
    GetCommitSummary: '/AI/GetCommitSummary',
    SummaryCommit: '/AI/SummaryCommit',
    SummaryFile: '/AI/SummaryFile',
    GetFileSummary: '/AI/GetFileSummary',
    GetAIChatMessages: '/AI/GetAIChatMessages',
    GetAIChatMessage: '/AI/GetAIChatMessage',
    DeleteAIChatMessages: '/AI/DeleteAIChatMessages',
    AIChat: '/AI/Chat'
}

export function ScanRepo(parameter) {
    return request({
        url: api.ScanRepo,
        method: 'get',
        params: parameter
    })
}

export function GetScanTaskList(parameter) {
    return request({
        url: api.GetScanTaskList,
        method: 'get',
        params: parameter
    })
}

export function GetScanTaskDetail(parameter) {
    return request({
        url: api.GetScanTaskDetail,
        method: 'get',
        params: parameter
    })
}

export function GetCommitSummary(parameter) {
    return request({
        url: api.GetCommitSummary,
        method: 'get',
        params: parameter
    })
}

export function SummaryCommit(parameter) {
    return request({
        url: api.SummaryCommit,
        method: 'get',
        params: parameter
    })
}

export function SummaryFile(parameter) {
    return request({
        url: api.SummaryFile,
        method: 'get',
        params: parameter
    })
}

export function GetFileSummary(parameter) {
    return request({
        url: api.GetFileSummary,
        method: 'get',
        params: parameter
    })
}

export function GetAIChatMessages(parameter) {
    return request({
        url: api.GetAIChatMessages,
        method: 'get',
        params: parameter
    })
}

export function GetAIChatMessage(parameter) {
    return request({
        url: api.GetAIChatMessage,
        method: 'get',
        params: parameter
    })
}

export function DeleteAIChatMessages(parameter) {
    return request({
        url: api.DeleteAIChatMessages,
        method: 'get',
        params: parameter
    })
}

export function AIChat(parameter) {
    return request({
        url: api.AIChat,
        method: 'post',
        data: parameter
    })
}
