// userMusic/detail/1698984095609106434
import request from '@/helpers/request';

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

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

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

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

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

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

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

/** 授权验证 */
export const api_verification = (params: any): Promise<any> => {
  return request.post('/edu-app/open/user/verification', {
    data: params
  });
};

// POST http://127.0.0.1:7093/userMusic/remove?id=1698984095609106434
// Content-Type: application/json
// Authorization: {{student}}
// ### 点赞/取消点赞

// POST http://127.0.0.1:7093/userMusicStar/star
// Authorization: {{student}}
// Content-Type: application/json

// {
//   "userMusicId": "1698984095609106434",
//   "star": true
// }
// ### 点赞分页

// POST http://127.0.0.1:7093/userMusicStar/page
// Authorization: {{student}}
// Content-Type: application/json

// {
//   "userMusicId": "1698984095609106434"
// }

// ### 分页查询

// POST http://127.0.0.1:7093/userMusic/page
// Content-Type: application/json
// Authorization: {{student}}

// {
//   "keyword": "",
//   "type": "FORMAL"
// }

// ###保存草稿/发布作品

// POST http://127.0.0.1:7093/userMusic/save
// Content-Type: application/json
// Authorization: {{student}}

// {
//   "id": "1698984095609106434",
//   "musicPracticeRecordId": 1698983103032250369,
//   "type": "FORMAL",
//   "img": "",
//   "videoUrl": "www.baidu.com",
//   "jsonConfig": "{\"test\": \"test\"}"
// }### 删除作品

// POST http://127.0.0.1:7093/userMusic/remove?id=1698984095609106434
// Content-Type: application/json
// Authorization: {{student}}
// ### 详情/分享

// GET http://127.0.0.1:7093/userMusic/detail/1698984095609106434
// Content-Type: application/json
// Authorization: {{student}}
