Skip to content

Commit

Permalink
Merge pull request #188 from zzzzzzzzyt/master
Browse files Browse the repository at this point in the history
优化项目
  • Loading branch information
Yin-Hongwei authored Aug 7, 2022
2 parents b4967b3 + 8c50e98 commit 1eac48d
Show file tree
Hide file tree
Showing 150 changed files with 3,599 additions and 3,791 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
.DS_Store
.idea

/img

/song
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,3 +165,4 @@ npm run serve // 启动后台管理项目

Copyright (c) 2018 Yin-Hongwei


398 changes: 398 additions & 0 deletions logs/MusicWebsite-2022-06-10.log

Large diffs are not rendered by default.

564 changes: 564 additions & 0 deletions logs/MusicWebsite-2022-06-11.log

Large diffs are not rendered by default.

88 changes: 37 additions & 51 deletions music-client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 28 additions & 15 deletions music-client/src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ import { getBaseURL, get, post, deletes } from "./request";
const HttpManager = {
// 获取图片信息
attachImageUrl: (url) => url ? `${getBaseURL()}/${url}` : "https://cube.elemecdn.com/e/fd/0fc7d20532fdaf769a25683617711png.png",
// =======================> 用户 API
// =======================> 用户 API 完成
// 登录
signIn: (params) => post(`user/login/status`, params),
signIn: ({username,password}) => post(`user/login/status`, {username,password}),
// 注册
SignUp: (params) => post(`user/add`, params),
SignUp: ({username,password,sex,phoneNum,email,birth,introduction,location}) => post(`user/add`, {username,password,sex,phoneNum,email,birth,introduction,location}),
// 删除用户
deleteUser: (id) => get(`user/delete?id=${id}`),
// 更新用户信息
updateUserMsg: (params) => post(`user/update`, params),
updateUserPassword: (params) => post(`user/updatePassword`, params),
updateUserMsg: ({id,username,sex,phoneNum,email,birth,introduction,location}) => post(`user/update`, {id,username,sex,phoneNum,email,birth,introduction,location}),
updateUserPassword: ({id,username,oldPassword,password}) => post(`user/updatePassword`, {id,username,oldPassword,password}),
// 返回指定ID的用户
getUserOfId: (id) => get(`user/detail?id=${id}`),
// 更新用户头像
uploadUrl: (userId) => `${getBaseURL()}/user/avatar/update?id=${userId}`,

// =======================> 歌单 API
// =======================> 歌单 API 完成
// 获取全部歌单
getSongList: () => get("songList"),
// 获取歌单类型
Expand All @@ -28,37 +28,37 @@ const HttpManager = {
// 返回歌单里指定歌单ID的歌曲
getListSongOfSongId: (songListId) => get(`listSong/detail?songListId=${songListId}`),

// =======================> 歌手 API
// =======================> 歌手 API 完成
// 返回所有歌手
getAllSinger: () => get("singer"),
// 通过性别对歌手分类
getSingerOfSex: (sex) => get(`singer/sex/detail?sex=${sex}`),

// =======================> 收藏 API
// =======================> 收藏 API 完成
// 返回的指定用户ID的收藏列表
getCollectionOfUser: (userId) => get(`collection/detail?userId=${userId}`),
// 添加收藏的歌曲 type: 0 代表歌曲, 1 代表歌单
setCollection: (params) => post(`collection/add`, params),
setCollection: ({userId,type,songId}) => post(`collection/add`,{userId,type,songId}),

deleteCollection: (userId, songId) => deletes(`collection/delete?userId=${userId}&&songId=${songId}`),

isCollection: (params) => post(`collection/status`, params),
isCollection: ({userId, type, songId}) => post(`collection/status`, {userId, type, songId}),

// =======================> 评分 API
// =======================> 评分 API 完成
// 提交评分
setRank: (params) => post(`rankList/add`, params),
setRank: ({songListId,consumerId,score}) => post(`rankList/add`, {songListId,consumerId,score}),
// 获取指定歌单的评分
getRankOfSongListId: (songListId) => get(`rankList?songListId=${songListId}`),
// 获取指定用户的歌单评分
getUserRank: (consumerId, songListId) => get(`/rankList/user?consumerId=${consumerId}&songListId=${songListId}`),

// =======================> 评论 API
// =======================> 评论 API 完成
// 添加评论
setComment: (params) => post(`comment/add`, params),
setComment: ({userId,content,songId,songListId,nowType}) => post(`comment/add`, {userId,content,songId,songListId,nowType}),
// 删除评论
deleteComment: (id) => get(`comment/delete?id=${id}`),
// 点赞
setSupport: (params) => post(`comment/like`, params),
setSupport: ({id,up}) => post(`comment/like`, {id,up}),
// 返回所有评论
getAllComment: (type, id) => {
let url = "";
Expand All @@ -79,6 +79,19 @@ const HttpManager = {
getSongOfSingerName: (keywords) => get(`song/singerName/detail?name=${keywords}`),
// 下载音乐
downloadMusic: (url) => get(url, { responseType: "blob" }),

//======================> 点赞api的优化 避免有些是重复的点赞!新增数据表了得

testAlreadySupport:({commentId,userId}) => post(`userSupport/test`, {commentId,userId}),

deleteUserSupport:({commentId,userId}) => post(`userSupport/delete`, {commentId,userId}),

insertUserSupport:({commentId,userId}) => post(`userSupport/insert`, {commentId,userId}),

//获取所有的海报
getBannerList: () => get("banner/getAllBanner")
};



export { HttpManager };
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 1eac48d

Please sign in to comment.