添加收藏茶室接口和完善茶室详情
This commit is contained in:
91
src/api/tea-room.ts
Normal file
91
src/api/tea-room.ts
Normal file
@ -0,0 +1,91 @@
|
||||
import { http } from '@/http/alova'
|
||||
import type { IHomeTeaRoomListResult, IOpenCityListResult, ITeaRoomDetailResult } from '@/api/types/tea-room'
|
||||
|
||||
/**
|
||||
* 获取茶室列表
|
||||
*/
|
||||
export interface IHomeTeaRoomListParams {
|
||||
page: number
|
||||
size: number
|
||||
search: string
|
||||
latitude: number
|
||||
longitude: number
|
||||
}
|
||||
|
||||
export function getHomeTeaRoomList(data: any) {
|
||||
return http.Post<IHomeTeaRoomListResult>('/api/teaStore/teaStoreLists',
|
||||
data,
|
||||
{
|
||||
meta: { ignoreAuth: true }
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取茶室开通城市列表
|
||||
*/
|
||||
export function getOpenCityList() {
|
||||
return http.Post<IOpenCityListResult>('/api/teaStore/teaStoreCity',
|
||||
{
|
||||
meta: { ignoreAuth: true }
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 茶室搜索历史
|
||||
*/
|
||||
export function getTeaRoomSearchHistory() {
|
||||
return http.Post<{ list: Array<string> }>('/api/teaStore/teaStoreSearchHistory')
|
||||
}
|
||||
|
||||
/**
|
||||
* 清除茶室搜索历史
|
||||
*/
|
||||
export function clearTeaRoomSearchHistory() {
|
||||
return http.Post('/api/teaStore/delTeaStoreSearchHistory', null)
|
||||
}
|
||||
|
||||
/**
|
||||
* 茶室详情
|
||||
*/
|
||||
export interface IRoomDetailParams {
|
||||
id: number
|
||||
latitude: number
|
||||
longitude: number
|
||||
user_id: number
|
||||
}
|
||||
|
||||
export function getTeaRoomDetail(data: IRoomDetailParams) {
|
||||
return http.Post<ITeaRoomDetailResult>('/api/teaStore/teaStoreDetails',
|
||||
data
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 收藏茶室
|
||||
*/
|
||||
export interface ICollectTeaRoomParams {
|
||||
id: number
|
||||
status: number // 1:收藏 0:取消收藏
|
||||
}
|
||||
|
||||
export function collectTeaRoom(data: ICollectTeaRoomParams) {
|
||||
return http.Post('/api/teaStore/teaStoreCollect',
|
||||
data
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 收藏的茶室列表
|
||||
*/
|
||||
export interface ICollectTeaRoomListParams {
|
||||
page: number
|
||||
size: number
|
||||
}
|
||||
|
||||
export function getCollectTeaRoomList(data: ICollectTeaRoomListParams) {
|
||||
return http.Post<IHomeTeaRoomListResult>('/api/teaStore/teaStoreCollectList',
|
||||
data
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user