* Created by buddy on 2021/2/18.
*/
import http from '@/utils/http'
export const getEventList = (uid: string, limit = 40, lasttime = -1) =>
http.get('/api/user/event', {
params: {
uid,
limit,
lasttime
}
})
export const getFollowList = (uid: string, offset = 0, limit = 40) =>
http.get('/api/user/follows', {
params: {
uid,
offset,
limit
}
})
export const getFansList = (uid: string, limit = 40, lasttime = -1) =>
http.get('/api/user/followeds', {
params: {
uid,
limit,
lasttime
}
})
export const uploadAvatar = (file: any) => {
const data = new FormData()
data.append('imgFile', file)
return http.post(`/api/avatar/upload?imgSize=1024`, data, {
headers: {
['Content-Type']: 'multipart/form-data'
}
})
}
interface ProfileData {
gender: number
signature: string
city: string
province: string
nickname: string
birthday: number
}
export const updateProfile = (params: ProfileData) =>
http.get('/api/user/update', {
params
})
export const getPlayList = (uid: string) =>
http.get('/api/user/playlist', {
params: {
uid
}
})
export const getPlayRecord = (uid: string, type = 0) =>
http.get('/api/user/record', {
params: {
uid,
type
}
})
export const getTopicSublist = (limit = 20, offset = 0) =>
http.get('/api/topic/sublist', {
params: {
limit,
offset
}
})