// userMusic/detail/1698984095609106434
import request from '@/helpers/request'
import { state } from '@/state'
const apiFix =
  state.platformType === 'STUDENT' ? '/api-student' : '/api-teacher'

/** 详情 */
export const api_userMusicDetail = (params: any): Promise<any> => {
  return request.get(apiFix + `/userMusic/detail/${params}`)
}

/** 开放详情 */
export const api_openUserMusicDetail = (params: any): Promise<any> => {
  return request.get(`/api-student/open/userMusic/detail/${params}`)
}

/**  点赞分页 */
export const api_userMusicStarPage = (params: any): Promise<any> => {
  return request.post(apiFix + `/userMusicStar/page`, {
    data: params
  })
}

/**  分享推荐作品 */
export const api_openUserMusicPage = (params: any): Promise<any> => {
  return request.post(`/api-student/open/userMusic/page`, {
    data: params
  })
}

/** 点赞 */
export const api_userMusicStar = (params: any): Promise<any> => {
  return request.post('/api-student/userMusicStar/star', {
    data: params
  })
}

/** 保存草稿/发布作品 */
export const api_userMusicSave = (params: any): Promise<any> => {
  return request.post(apiFix + '/userMusic/save', {
    data: params
  })
}

/** 删除 */
export const api_userMusicRemove = (params: any): Promise<any> => {
  return request.post(apiFix + '/userMusic/remove', {
    requestType: 'form',
    params
  })
}

/** 授权验证 */
export const api_verification = (params: any): Promise<any> => {
  return request.get('/api-auth/checkToken', {
    headers: {
      'content-type': 'application/x-www-form-urlencoded'
    }
  })
}
