
import request from './request.js'
import { CHAT_TYPE, PAY_TYPE } from '@/common/enum.js'
const FormData = require('./formData.js')

/**
 * 画图接口
 * desc 描述信息
 */
export function draw(sid, desc) {
	return request({
		url: 'draw/do',
		method: 'POST',
		data: {
			description: desc,
			sessionId: sid
		}
	})
}

/**
 * 重绘接口
 * 上次id
 */
export function redraw(id) {
	return request({
		url: 'draw/redo',
		method: 'POST',
		data: {
			id
		}
	})
}


/**
 * 获取绘图进度
 */
export function getGrawResult(id) {
	return request({
		url: `draw/check?id=${id}`,
		method: 'GET'
	})
}


/**
 * 获取历史绘图
 */
export function getGrawHistory(sid, size = 100) {
	return request({
		url: `draw/history?cursor=&size=${size}&sessionId=${sid}`,
		method: 'GET'
	})
}



/**
 * 画图点赞
 */
export function drawLike(id) {
	return request({
		url: `draw/like`,
		method: 'POST',
		data: {
			id
		}
	})
}

/**
 * 画图点灭
 */
export function drawDislike(id) {
	return request({
		url: `draw/dislike`,
		method: 'POST',
		data: {
			id
		}
	})
}