import service from '@/utils/request'

export const getBookDetails = (id: number) => {
	return service.get('/maku/t_book/' + id)
}
export const useT_bookSubmitApi = (dataForm: any) => {
	if (dataForm.id) {
		return service.put('/maku/t_book', dataForm)
	} else {
		return service.post('/maku/t_book', dataForm)
	}
}

/*
 * 获取图书列表大全
 * */
export const bookList = () => {
	return service.get('maku/t_book/list')
}

/*
 * 搜索图书
 * */
export const bookSearchList = (name: string) => {
	return service.get('/maku/t_book/list/search?name=' + name)
}

export interface bookEntity {
	id: number
	bookName: string
	author: string
	price: number
	bookCover: string
	introduction: string
	description: string
	store: number
	createTime: string
	updateTime: string
}
