├── music-server
├── README.md
├── .mvn
│ └── wrapper
│ │ ├── maven-wrapper.jar
│ │ └── maven-wrapper.properties
└── src
│ └── main
│ ├── java
│ └── com
│ │ └── xs
│ │ ├── service
│ │ ├── TestService.java
│ │ ├── RedisService.java
│ │ ├── LogoutService.java
│ │ ├── RankService.java
│ │ ├── AdminService.java
│ │ ├── RecentSongService.java
│ │ ├── impl
│ │ │ ├── RedisServiceImpl.java
│ │ │ ├── LogoutServiceImpl.java
│ │ │ ├── AdminServiceImpl.java
│ │ │ ├── TestServiceImpl.java
│ │ │ └── RankServiceImpl.java
│ │ ├── ListSongService.java
│ │ ├── ConsumerService.java
│ │ ├── CollectService.java
│ │ ├── CommentService.java
│ │ ├── SongService.java
│ │ ├── SongListService.java
│ │ └── SingerService.java
│ │ ├── MusicApplication.java
│ │ ├── exception
│ │ ├── NotFoundException.java
│ │ ├── BadRequestException.java
│ │ ├── PersistenceException.java
│ │ └── BizException.java
│ │ ├── strategy
│ │ ├── UploadStrategy.java
│ │ ├── context
│ │ │ └── UploadStrategyContext.java
│ │ └── impl
│ │ │ └── AbstractUploadStrategyImpl.java
│ │ ├── vo
│ │ ├── LoginVo.java
│ │ ├── SingerVo.java
│ │ ├── SongListVo.java
│ │ ├── SearchVo.java
│ │ ├── SongVo.java
│ │ ├── CollectVo.java
│ │ ├── ListSongVo.java
│ │ ├── CommentVo.java
│ │ └── RecentSongVo.java
│ │ ├── dto
│ │ ├── SingerDto.java
│ │ ├── ConsumerDto.java
│ │ ├── LoginInfoDto.java
│ │ ├── ListSongDto.java
│ │ ├── SearchDto.java
│ │ ├── ListSongByNameDto.java
│ │ ├── CommentDto.java
│ │ ├── CollectDto.java
│ │ └── SongDto.java
│ │ ├── mapper
│ │ ├── AdminMapper.java
│ │ ├── ConsumerMapper.java
│ │ ├── RanksMapper.java
│ │ ├── RecentSongMapper.java
│ │ ├── ListSongMapper.java
│ │ ├── SongListMapper.java
│ │ ├── SingerMapper.java
│ │ ├── SongMapper.java
│ │ ├── CollectMapper.java
│ │ └── CommentMapper.java
│ │ ├── controller
│ │ ├── CheckLoginStateController.java
│ │ ├── admin
│ │ │ ├── LogoutAdminController.java
│ │ │ ├── ListSongAdminController.java
│ │ │ └── ConsumerAdminController.java
│ │ ├── RankController.java
│ │ ├── UploadController.java
│ │ ├── RecentSongController.java
│ │ ├── CollectController.java
│ │ └── CommentController.java
│ │ ├── config
│ │ ├── MybatisPlusConfig.java
│ │ ├── MyAuthenticationEntryPoint.java
│ │ ├── CrossConfig.java
│ │ └── RedisConfig.java
│ │ ├── domain
│ │ ├── ListSong.java
│ │ ├── SongList.java
│ │ ├── Ranks.java
│ │ ├── Singer.java
│ │ ├── Collect.java
│ │ ├── RecentSong.java
│ │ ├── Comment.java
│ │ ├── Song.java
│ │ ├── Consumer.java
│ │ └── Admin.java
│ │ ├── enums
│ │ ├── UploadModeEnum.java
│ │ ├── FilePathEnum.java
│ │ ├── StatusCodeEnum.java
│ │ └── FileExtEnum.java
│ │ ├── handler
│ │ └── MyMetaObjectHandler.java
│ │ ├── common
│ │ └── Result.java
│ │ └── util
│ │ ├── JacksonUtils.java
│ │ └── FastJsonRedisSerializer.java
│ └── resources
│ ├── mapper
│ ├── AdminMapper.xml
│ ├── RanksMapper.xml
│ ├── ListSongMapper.xml
│ ├── SongListMapper.xml
│ ├── SingerMapper.xml
│ └── ConsumerMapper.xml
│ └── application.yml
├── music-view
├── src
│ ├── assets
│ │ ├── css
│ │ │ ├── song-audio.scss
│ │ │ ├── search-songs.scss
│ │ │ ├── search-song-Lists.scss
│ │ │ ├── swiper.scss
│ │ │ ├── app.scss
│ │ │ ├── the-footer.scss
│ │ │ ├── 404.scss
│ │ │ ├── logo.scss
│ │ │ ├── login-logo.scss
│ │ │ ├── upload.scss
│ │ │ ├── home.scss
│ │ │ ├── search.scss
│ │ │ ├── sign-up.scss
│ │ │ ├── global.scss
│ │ │ ├── index.scss
│ │ │ ├── login-in.scss
│ │ │ ├── song-list.scss
│ │ │ ├── info.scss
│ │ │ ├── singer.scss
│ │ │ ├── scroll-top.scss
│ │ │ ├── album-content.scss
│ │ │ ├── setting.scss
│ │ │ ├── singer-album.scss
│ │ │ ├── leader-board.scss
│ │ │ ├── comment.scss
│ │ │ ├── song-comment.scss
│ │ │ ├── content-list.scss
│ │ │ ├── the-aside.scss
│ │ │ ├── var.scss
│ │ │ ├── song-list-album.scss
│ │ │ ├── my-music.scss
│ │ │ └── lyric.scss
│ │ └── data
│ │ │ ├── consumerList.js
│ │ │ ├── user.js
│ │ │ ├── singer.js
│ │ │ ├── header.js
│ │ │ ├── swiper.js
│ │ │ └── form.js
│ ├── api
│ │ ├── login.js
│ │ ├── Rank.js
│ │ ├── RecentSong.js
│ │ ├── Comment.js
│ │ ├── ListSong.js
│ │ ├── Collect.js
│ │ ├── Consumer.js
│ │ ├── Singer.js
│ │ ├── SongList.js
│ │ └── Song.js
│ ├── utils
│ │ └── get-page-title.js
│ ├── plugins
│ │ ├── validate.js
│ │ └── axios.js
│ ├── store
│ │ ├── index.js
│ │ └── user.js
│ ├── components
│ │ ├── LoginLogo.vue
│ │ ├── Logo.vue
│ │ ├── ScrollTop.vue
│ │ ├── search
│ │ │ ├── SearchSongs.vue
│ │ │ └── SearchSongLists.vue
│ │ ├── TheFooter.vue
│ │ ├── TheAside.vue
│ │ ├── ContentList.vue
│ │ ├── Swiper.vue
│ │ └── AlbumContent.vue
│ ├── main.js
│ ├── settings.js
│ ├── pages
│ │ ├── Setting.vue
│ │ ├── LeaderBoard.vue
│ │ ├── Search.vue
│ │ └── SingerAlbum.vue
│ └── App.vue
├── public
│ ├── favicon.ico
│ └── index.html
├── babel.config.js
├── README.md
└── package.json
└── music-admin
├── babel.config.js
├── public
├── favicon.ico
└── index.html
├── src
├── assets
│ ├── js
│ │ ├── bus.js
│ │ ├── iconfont.js
│ │ └── city.js
│ └── css
│ │ └── main.css
├── utils
│ └── get-page-title.js
├── plugins
│ ├── validate.js
│ └── axios.js
├── App.vue
├── api
│ ├── login.js
│ ├── Collect.js
│ ├── Comment.js
│ ├── ListSong.js
│ ├── Consumer.js
│ ├── Song.js
│ ├── Singer.js
│ └── SongList.js
├── main.js
├── settings.js
├── components
│ ├── Home.vue
│ ├── SongAudio.vue
│ └── TheAside.vue
└── store
│ └── store.js
├── README.md
└── package.json
/music-server/README.md:
--------------------------------------------------------------------------------
1 | # music
2 | SpringBoot+Vue开发的在线音乐网站
3 |
--------------------------------------------------------------------------------
/music-view/src/assets/css/song-audio.scss:
--------------------------------------------------------------------------------
1 | audio {
2 | display: none;
3 | }
4 |
--------------------------------------------------------------------------------
/music-view/src/assets/css/search-songs.scss:
--------------------------------------------------------------------------------
1 | .search-songs {
2 | min-height: 300px;
3 | }
4 |
--------------------------------------------------------------------------------
/music-view/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xs669/personal-music-website/HEAD/music-view/public/favicon.ico
--------------------------------------------------------------------------------
/music-admin/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | compact: false,
3 | presets: ["@vue/cli-plugin-babel/preset"],
4 | };
5 |
--------------------------------------------------------------------------------
/music-admin/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xs669/personal-music-website/HEAD/music-admin/public/favicon.ico
--------------------------------------------------------------------------------
/music-view/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | compact: false,
3 | presets: ["@vue/cli-plugin-babel/preset"],
4 | };
5 |
--------------------------------------------------------------------------------
/music-view/src/assets/css/search-song-Lists.scss:
--------------------------------------------------------------------------------
1 |
2 | .search-song-Lists{
3 | min-height: 300px;
4 | margin-top: 50px;
5 | }
6 |
--------------------------------------------------------------------------------
/music-admin/src/assets/js/bus.js:
--------------------------------------------------------------------------------
1 | import Vue from "vue";
2 |
3 | // 使用 Event Bus
4 | const bus = new Vue();
5 |
6 | export default bus;
7 |
--------------------------------------------------------------------------------
/music-view/src/assets/css/swiper.scss:
--------------------------------------------------------------------------------
1 | .swiper {
2 | width: 90%;
3 | margin: 40px auto auto;
4 | img {
5 | width: 100%;
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/music-server/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xs669/personal-music-website/HEAD/music-server/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/service/TestService.java:
--------------------------------------------------------------------------------
1 | package com.xs.service;
2 |
3 | public interface TestService {
4 |
5 | void changeUrl();
6 | }
7 |
--------------------------------------------------------------------------------
/music-view/src/assets/data/consumerList.js:
--------------------------------------------------------------------------------
1 | const menuList = [
2 | { name: "设置", path: "/setting" },
3 | { name: "退出", path: 0 },
4 | ];
5 |
6 | export default menuList;
7 |
--------------------------------------------------------------------------------
/music-view/src/assets/data/user.js:
--------------------------------------------------------------------------------
1 | const loginMsg = [
2 | { name: "登录", path: "/login" },
3 | { name: "注册", path: "/register" },
4 | ];
5 |
6 | export default loginMsg;
7 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/service/RedisService.java:
--------------------------------------------------------------------------------
1 | package com.xs.service;
2 |
3 | import com.xs.common.Result;
4 |
5 | public interface RedisService {
6 |
7 | Result checkLoginState(String username);
8 | }
9 |
--------------------------------------------------------------------------------
/music-view/src/assets/data/singer.js:
--------------------------------------------------------------------------------
1 | const singerStyle = [
2 | { name: "全部歌手", type: -1 },
3 | { name: "男歌手", type: 1 },
4 | { name: "女歌手", type: 0 },
5 | { name: "组合歌手", type: 2 },
6 | ];
7 |
8 | export default singerStyle;
9 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/service/LogoutService.java:
--------------------------------------------------------------------------------
1 | package com.xs.service;
2 |
3 | import com.xs.common.Result;
4 |
5 | public interface LogoutService {
6 |
7 | /**
8 | * 退出登录
9 | */
10 | Result logout();
11 | }
12 |
--------------------------------------------------------------------------------
/music-view/src/assets/css/app.scss:
--------------------------------------------------------------------------------
1 | @import "var.scss";
2 | @import "global.scss";
3 |
4 | #app {
5 | background-color: $theme-background-color;
6 | @include layout(flex-start, stretch, column);
7 | }
8 |
9 | .music-content {
10 | flex: 1;
11 | }
12 |
--------------------------------------------------------------------------------
/music-view/src/api/login.js:
--------------------------------------------------------------------------------
1 | import axios from "../plugins/axios";
2 |
3 | export function login(loginInfoDto) {
4 | return axios({
5 | url: "admin/login/status",
6 | method: "POST",
7 | data: {
8 | ...loginInfoDto,
9 | },
10 | });
11 | }
12 |
--------------------------------------------------------------------------------
/music-server/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.6/apache-maven-3.8.6-bin.zip
2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar
3 |
--------------------------------------------------------------------------------
/music-admin/src/utils/get-page-title.js:
--------------------------------------------------------------------------------
1 | import defaultSettings from '@/settings'
2 |
3 | const title = defaultSettings.title
4 |
5 | export default function getPageTitle(pageTitle) {
6 | if (pageTitle) {
7 | return `${pageTitle} - ${title}`
8 | }
9 | return `${title}`
10 | }
11 |
--------------------------------------------------------------------------------
/music-view/src/assets/data/header.js:
--------------------------------------------------------------------------------
1 | const navMsg = [
2 | { name: "首页", path: "/" },
3 | { name: "歌单", path: "/songList" },
4 | { name: "歌手", path: "/singer" },
5 | { name: "排行榜", path: "/leaderBoard" },
6 | { name: "我的音乐", path: "/myMusic" },
7 | ];
8 |
9 | export default navMsg;
10 |
--------------------------------------------------------------------------------
/music-view/src/utils/get-page-title.js:
--------------------------------------------------------------------------------
1 | import defaultSettings from "@/settings";
2 |
3 | const title = defaultSettings.title;
4 |
5 | export default function getPageTitle(pageTitle) {
6 | if (pageTitle) {
7 | return `${pageTitle} - ${title}`;
8 | }
9 | return `${title}`;
10 | }
11 |
--------------------------------------------------------------------------------
/music-view/src/assets/css/the-footer.scss:
--------------------------------------------------------------------------------
1 | @import "var.scss";
2 | @import "global.scss";
3 |
4 | .the-footer {
5 | width: 100%;
6 | height: $footer-height;
7 | background-color: $theme-footer-color;
8 | @include layout(center, center, column);
9 | p {
10 | height: 30px;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/music-view/src/plugins/validate.js:
--------------------------------------------------------------------------------
1 | export function isEmail(s) {
2 | return /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((.[a-zA-Z0-9_-]{2,3}){1,2})$/.test(
3 | s
4 | );
5 | }
6 |
7 | export function isPhoneNum(s) {
8 | return /^(13[0-9]{9})|(15[0-9]{9})|(17[0-9]{9})|(18[0-9]{9})|(19[0-9]{9})$/.test(
9 | s
10 | );
11 | }
12 |
--------------------------------------------------------------------------------
/music-admin/src/plugins/validate.js:
--------------------------------------------------------------------------------
1 | export function isEmail(s) {
2 | return /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((.[a-zA-Z0-9_-]{2,3}){1,2})$/.test(
3 | s
4 | );
5 | }
6 |
7 | export function isPhoneNum(s) {
8 | return /^(13[0-9]{9})|(15[0-9]{9})|(17[0-9]{9})|(18[0-9]{9})|(19[0-9]{9})$/.test(
9 | s
10 | );
11 | }
12 |
--------------------------------------------------------------------------------
/music-view/src/assets/css/404.scss:
--------------------------------------------------------------------------------
1 | @import "var.scss";
2 | @import "global.scss";
3 |
4 | .error-page {
5 | @include layout(center);
6 | width: 100%;
7 | height: 100%;
8 | padding: 11rem 0;
9 | box-sizing: border-box;
10 |
11 | .error-code {
12 | font-size: 250px;
13 | font-weight: bolder;
14 | color: $theme-color;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/music-view/src/store/index.js:
--------------------------------------------------------------------------------
1 | import Vue from "vue";
2 | import Vuex from "vuex";
3 | import configure from "./configure";
4 | import song from "./song";
5 | import user from "./user";
6 | Vue.use(Vuex);
7 |
8 | const store = new Vuex.Store({
9 | modules: {
10 | configure,
11 | song,
12 | user,
13 | },
14 | });
15 |
16 | export default store;
17 |
--------------------------------------------------------------------------------
/music-admin/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/music-admin/src/api/login.js:
--------------------------------------------------------------------------------
1 | import axios from "../plugins/axios";
2 |
3 | export function login(Admin) {
4 | return axios({
5 | url: "login",
6 | method: "POST",
7 | data: {
8 | ...Admin,
9 | },
10 | });
11 | }
12 |
13 | export function logout() {
14 | return axios({
15 | url: "logout",
16 | method: "POST",
17 | });
18 | }
19 |
--------------------------------------------------------------------------------
/music-admin/README.md:
--------------------------------------------------------------------------------
1 | # music-admin
2 |
3 | ## Project setup
4 | ```
5 | yarn install
6 | ```
7 |
8 | ### Compiles and hot-reloads for development
9 | ```
10 | yarn serve
11 | ```
12 |
13 | ### Compiles and minifies for production
14 | ```
15 | yarn build
16 | ```
17 |
18 |
19 | ### Customize configuration
20 | See [Configuration Reference](https://cli.vuejs.org/config/).
21 |
--------------------------------------------------------------------------------
/music-view/README.md:
--------------------------------------------------------------------------------
1 | # music-view
2 |
3 | ## Project setup
4 | ```
5 | yarn install
6 | ```
7 |
8 | ### Compiles and hot-reloads for development
9 | ```
10 | yarn serve
11 | ```
12 |
13 | ### Compiles and minifies for production
14 | ```
15 | yarn build
16 | ```
17 |
18 |
19 | ### Customize configuration
20 | See [Configuration Reference](https://cli.vuejs.org/config/).
21 |
--------------------------------------------------------------------------------
/music-view/src/components/LoginLogo.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 |
9 |
14 |
15 |
18 |
--------------------------------------------------------------------------------
/music-view/src/assets/css/logo.scss:
--------------------------------------------------------------------------------
1 | @import "var.scss";
2 | @import "global.scss";
3 |
4 | .login-logo {
5 | background-color: $color-blue-light;
6 | height: 75vh;
7 | width: 50vw;
8 | min-width: 650px;
9 | overflow: hidden;
10 | @include layout(center, center);
11 | .icon {
12 | @include icon(6.5em, $color-blue-dark);
13 | transform: rotate(-30deg);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/music-view/src/assets/css/login-logo.scss:
--------------------------------------------------------------------------------
1 | @import "var.scss";
2 | @import "global.scss";
3 |
4 | .login-logo {
5 | background-color: $color-blue-light;
6 | height: 170vh;
7 | width: 50vw;
8 | min-width: 650px;
9 | overflow: hidden;
10 | @include layout(center, center);
11 | .icon {
12 | @include icon(6.5em, $color-blue-dark);
13 | transform: rotate(-30deg);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/music-view/src/api/Rank.js:
--------------------------------------------------------------------------------
1 | import axios from "../plugins/axios";
2 |
3 | export function addRank(Rank) {
4 | return axios({
5 | url: "rank/add",
6 | method: "POST",
7 | data: {
8 | ...Rank,
9 | },
10 | });
11 | }
12 |
13 | export function getRankAvgScore(songListId) {
14 | return axios({
15 | url: `rank/getAvgScore/${songListId}`,
16 | method: "GET",
17 | });
18 | }
19 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/MusicApplication.java:
--------------------------------------------------------------------------------
1 | package com.xs;
2 |
3 | import org.springframework.boot.SpringApplication;
4 | import org.springframework.boot.autoconfigure.SpringBootApplication;
5 |
6 | @SpringBootApplication
7 | public class MusicApplication {
8 |
9 | public static void main(String[] args) {
10 | SpringApplication.run(MusicApplication.class, args);
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/music-view/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | <%= htmlWebpackPlugin.options.title %>
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/music-admin/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | <%= htmlWebpackPlugin.options.title %>
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/music-view/src/components/Logo.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 |
9 |
15 |
16 |
19 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/exception/NotFoundException.java:
--------------------------------------------------------------------------------
1 | package com.xs.exception;
2 |
3 | /**
4 | * 404异常
5 | */
6 |
7 | public class NotFoundException extends RuntimeException {
8 | public NotFoundException() {
9 | }
10 |
11 | public NotFoundException(String message) {
12 | super(message);
13 | }
14 |
15 | public NotFoundException(String message, Throwable cause) {
16 | super(message, cause);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/exception/BadRequestException.java:
--------------------------------------------------------------------------------
1 | package com.xs.exception;
2 |
3 | /**
4 | * 非法请求异常
5 | */
6 |
7 | public class BadRequestException extends RuntimeException {
8 | public BadRequestException() {
9 | }
10 |
11 | public BadRequestException(String message) {
12 | super(message);
13 | }
14 |
15 | public BadRequestException(String message, Throwable cause) {
16 | super(message, cause);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/music-view/src/assets/css/upload.scss:
--------------------------------------------------------------------------------
1 | @import "var.scss";
2 | @import "global.scss";
3 |
4 | .upload {
5 | width: 100%;
6 | .title {
7 | height: 50px;
8 | line-height: 50px;
9 | padding-left: 20px;
10 | font-size: 20px;
11 | font-weight: 600;
12 | color: $color-black;
13 | }
14 | hr {
15 | width: 98%;
16 | }
17 | .section {
18 | height: 400px;
19 | @include layout(center, center);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/exception/PersistenceException.java:
--------------------------------------------------------------------------------
1 | package com.xs.exception;
2 |
3 | /**
4 | * 持久化异常
5 | */
6 |
7 | public class PersistenceException extends RuntimeException {
8 | public PersistenceException() {
9 | }
10 |
11 | public PersistenceException(String message) {
12 | super(message);
13 | }
14 |
15 | public PersistenceException(String message, Throwable cause) {
16 | super(message, cause);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/strategy/UploadStrategy.java:
--------------------------------------------------------------------------------
1 | package com.xs.strategy;
2 |
3 | import org.springframework.web.multipart.MultipartFile;
4 |
5 | /**
6 | * 上传策略
7 | */
8 | public interface UploadStrategy {
9 |
10 | /**
11 | * 上传文件
12 | *
13 | * @param file 文件
14 | * @param path 上传路径
15 | * @return {@link String} 文件地址
16 | */
17 | String uploadFile(MultipartFile file, String path);
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/vo/LoginVo.java:
--------------------------------------------------------------------------------
1 | package com.xs.vo;
2 |
3 | import lombok.Data;
4 |
5 | import java.io.Serial;
6 | import java.io.Serializable;
7 |
8 | @Data
9 | public class LoginVo implements Serializable {
10 |
11 | /**
12 | * 用户名
13 | */
14 | private String username;
15 |
16 | /**
17 | * 密码
18 | */
19 | private String password;
20 |
21 | @Serial
22 | private static final long serialVersionUID = 1L;
23 | }
24 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/dto/SingerDto.java:
--------------------------------------------------------------------------------
1 | package com.xs.dto;
2 |
3 | import lombok.Data;
4 |
5 | import java.io.Serial;
6 | import java.io.Serializable;
7 |
8 | @Data
9 | public class SingerDto implements Serializable {
10 |
11 | /**
12 | * 歌手性别
13 | */
14 | private Integer sex;
15 |
16 | /**
17 | * 按歌手性别统计的数量
18 | */
19 | private Integer number;
20 |
21 | @Serial
22 | private static final long serialVersionUID = 1L;
23 | }
24 |
--------------------------------------------------------------------------------
/music-view/src/components/ScrollTop.vue:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
17 |
18 |
21 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/dto/ConsumerDto.java:
--------------------------------------------------------------------------------
1 | package com.xs.dto;
2 |
3 | import lombok.Data;
4 |
5 | import java.io.Serial;
6 | import java.io.Serializable;
7 |
8 | @Data
9 | public class ConsumerDto implements Serializable {
10 |
11 | /**
12 | * 用户性别
13 | */
14 | private Integer sex;
15 |
16 | /**
17 | * 按用户性别统计的数量
18 | */
19 | private Integer number;
20 |
21 | @Serial
22 | private static final long serialVersionUID = 1L;
23 | }
24 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/vo/SingerVo.java:
--------------------------------------------------------------------------------
1 | package com.xs.vo;
2 |
3 | import lombok.Data;
4 |
5 | import java.io.Serial;
6 | import java.io.Serializable;
7 |
8 | @Data
9 | public class SingerVo implements Serializable {
10 |
11 | /**
12 | * 歌手所在地区
13 | */
14 | private String location;
15 |
16 | /**
17 | * 按地区分组查询歌手数量
18 | */
19 | private Integer number;
20 |
21 | @Serial
22 | private static final long serialVersionUID = 1L;
23 | }
24 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/vo/SongListVo.java:
--------------------------------------------------------------------------------
1 | package com.xs.vo;
2 |
3 | import lombok.Builder;
4 | import lombok.Data;
5 |
6 | import java.io.Serial;
7 | import java.io.Serializable;
8 |
9 | @Data
10 | @Builder
11 | public class SongListVo implements Serializable {
12 |
13 | /**
14 | * 歌单类型
15 | */
16 | private String style;
17 |
18 | /**
19 | * 按歌单类型分组查询的歌单数量
20 | */
21 | private Integer number;
22 |
23 | @Serial
24 | private static final long serialVersionUID = 1L;
25 | }
26 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/dto/LoginInfoDto.java:
--------------------------------------------------------------------------------
1 | package com.xs.dto;
2 |
3 | import lombok.Data;
4 | import lombok.NoArgsConstructor;
5 |
6 | import java.io.Serial;
7 | import java.io.Serializable;
8 |
9 | /**
10 | * 登录账号密码
11 | */
12 | @NoArgsConstructor
13 | @Data
14 | public class LoginInfoDto implements Serializable {
15 |
16 | /**
17 | * 用户名
18 | */
19 | private String username;
20 |
21 | /**
22 | * 密码
23 | */
24 | private String password;
25 |
26 | @Serial
27 | private static final long serialVersionUID = 1L;
28 | }
29 |
--------------------------------------------------------------------------------
/music-view/src/components/search/SearchSongs.vue:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
18 |
19 |
22 |
--------------------------------------------------------------------------------
/music-view/src/assets/css/home.scss:
--------------------------------------------------------------------------------
1 | @import "var.scss";
2 |
3 | .home {
4 | margin-top: $header-height - 10px;
5 | .section {
6 | width: 100%;
7 | margin-top: 20px;
8 | padding: $content-padding;
9 | background-color: $color-white;
10 | box-sizing: border-box;
11 | .section-title {
12 | height: 60px;
13 | line-height: 60px;
14 | padding-top: 10px;
15 | font-size: 28px;
16 | font-weight: 500;
17 | text-align: center;
18 | color: $color-black;
19 | box-sizing: border-box;
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/service/RankService.java:
--------------------------------------------------------------------------------
1 | package com.xs.service;
2 |
3 | import com.xs.common.Result;
4 | import com.xs.domain.Ranks;
5 | import com.baomidou.mybatisplus.extension.service.IService;
6 |
7 | /**
8 | * @author xs
9 | * description 针对表【rank(评价)】的数据库操作Service
10 | * createDate 2022-10-11 16:16:20
11 | */
12 | public interface RankService extends IService {
13 |
14 | /**
15 | * 添加歌单评价
16 | */
17 | Result addRanks(Ranks ranks);
18 |
19 | /**
20 | * 获取指定歌单的平均分
21 | */
22 | Result getRanksAvgScore(Long id);
23 | }
24 |
--------------------------------------------------------------------------------
/music-view/src/components/search/SearchSongLists.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
19 |
20 |
23 |
--------------------------------------------------------------------------------
/music-view/src/assets/css/search.scss:
--------------------------------------------------------------------------------
1 | @import "var.scss";
2 | @import "global.scss";
3 |
4 | .search{
5 | margin: auto;
6 | margin-top: $header-height + 20px;
7 | background-color: $color-white;
8 | border-radius: 12px;
9 | width: 900px;
10 | position: relative;
11 | }
12 |
13 | .searchList-nav {
14 | @include layout(space-around);
15 | margin-top: 20px;
16 | font-size: 1.5rem;
17 | color: $color-black;
18 | span {
19 | line-height: 50px;
20 | cursor: pointer;
21 | }
22 | }
23 |
24 | .isActive {
25 | font-weight: 600;
26 | border-bottom:5px solid $color-black;
27 | }
28 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/mapper/AdminMapper.java:
--------------------------------------------------------------------------------
1 | package com.xs.mapper;
2 |
3 | import com.xs.domain.Admin;
4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5 | import org.apache.ibatis.annotations.Mapper;
6 | import org.springframework.stereotype.Repository;
7 |
8 | /**
9 | * @author xs
10 | * description 针对表【admin(管理员)】的数据库操作Mapper
11 | * createDate 2022-10-03 16:22:14
12 | * Entity com.xs.domain.Admin
13 | */
14 | @Repository
15 | @Mapper
16 | public interface AdminMapper extends BaseMapper {
17 |
18 | Admin findByUsername(String username);
19 | }
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/music-view/src/assets/data/swiper.js:
--------------------------------------------------------------------------------
1 | const swiperList = [
2 | { picImg: "https://www.freemusic.ltd/img/swiper/a.jpg" },
3 | { picImg: "https://www.freemusic.ltd/img/swiper/b.jpg" },
4 | { picImg: "https://www.freemusic.ltd/img/swiper/c.jpg" },
5 | { picImg: "https://www.freemusic.ltd/img/swiper/d.jpg" },
6 | { picImg: "https://www.freemusic.ltd/img/swiper/e.jpg" },
7 | { picImg: "https://www.freemusic.ltd/img/swiper/f.jpg" },
8 | { picImg: "https://www.freemusic.ltd/img/swiper/g.jpg" },
9 | { picImg: "https://www.freemusic.ltd/img/swiper/h.jpg" },
10 | ];
11 |
12 | export default swiperList;
13 |
--------------------------------------------------------------------------------
/music-admin/src/main.js:
--------------------------------------------------------------------------------
1 | import Vue from "vue";
2 | import App from "./App";
3 | import router from "./router/index";
4 | import ElementUI from "element-ui";
5 | import "element-ui/lib/theme-chalk/index.css";
6 | import "./assets/css/main.css";
7 | import { VePie, VeHistogram, VeRing} from "v-charts/lib/index.esm";
8 | import store from "./store/store";
9 |
10 | Vue.use(ElementUI);
11 | Vue.component(VePie.name, VePie);
12 | Vue.component(VeHistogram.name, VeHistogram);
13 | Vue.component(VeRing.name, VeRing);
14 |
15 | // eslint-disable-next-line no-new
16 | new Vue({
17 | el: "#app",
18 | router,
19 | store,
20 | render: (h) => h(App),
21 | });
22 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/vo/SearchVo.java:
--------------------------------------------------------------------------------
1 | package com.xs.vo;
2 |
3 | import com.fasterxml.jackson.databind.annotation.JsonSerialize;
4 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
5 | import lombok.Data;
6 |
7 | import java.io.Serializable;
8 |
9 | @Data
10 | public class SearchVo implements Serializable {
11 |
12 | /**
13 | * 指定字段id
14 | */
15 | @JsonSerialize(using = ToStringSerializer.class)
16 | private Long id;
17 |
18 | /**
19 | * 搜索关键字
20 | */
21 | private String keyWord;
22 |
23 | /**
24 | * id类型 (0:用户, 1:歌曲, 2:歌单)
25 | */
26 | private Integer type;
27 | }
28 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/dto/ListSongDto.java:
--------------------------------------------------------------------------------
1 | package com.xs.dto;
2 |
3 | import com.fasterxml.jackson.databind.annotation.JsonSerialize;
4 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
5 | import lombok.Data;
6 |
7 | import java.io.Serial;
8 | import java.io.Serializable;
9 |
10 | @Data
11 | public class ListSongDto implements Serializable {
12 |
13 | /**
14 | * 歌曲id
15 | */
16 | @JsonSerialize(using = ToStringSerializer.class)
17 | private Long songId;
18 |
19 | /**
20 | * 歌曲名称
21 | */
22 | private String songName;
23 |
24 | @Serial
25 | private static final long serialVersionUID = 1L;
26 | }
27 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/dto/SearchDto.java:
--------------------------------------------------------------------------------
1 | package com.xs.dto;
2 |
3 | import com.fasterxml.jackson.databind.annotation.JsonSerialize;
4 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
5 | import lombok.Data;
6 |
7 | import java.io.Serial;
8 | import java.io.Serializable;
9 |
10 | @Data
11 | public class SearchDto implements Serializable {
12 |
13 | /**
14 | * 指定用户id
15 | */
16 | @JsonSerialize(using = ToStringSerializer.class)
17 | private Long id;
18 |
19 | /**
20 | * 搜索关键字
21 | */
22 | private String keyWord;
23 |
24 | @Serial
25 | private static final long serialVersionUID = 1L;
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/dto/ListSongByNameDto.java:
--------------------------------------------------------------------------------
1 | package com.xs.dto;
2 |
3 | import com.fasterxml.jackson.databind.annotation.JsonSerialize;
4 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
5 | import lombok.Data;
6 |
7 | import java.io.Serial;
8 | import java.io.Serializable;
9 |
10 | @Data
11 | public class ListSongByNameDto implements Serializable {
12 |
13 | /**
14 | * 歌单id
15 | */
16 | @JsonSerialize(using = ToStringSerializer.class)
17 | private Long songListId;
18 |
19 | /**
20 | * 歌单歌曲搜索关键词
21 | */
22 | private String name;
23 |
24 | @Serial
25 | private static final long serialVersionUID = 1L;
26 | }
27 |
--------------------------------------------------------------------------------
/music-view/src/main.js:
--------------------------------------------------------------------------------
1 | import Vue from "vue";
2 | import App from "./App";
3 | import router from "./router";
4 | import "./assets/css/index.scss";
5 | import ElementUI from "element-ui";
6 | import "element-ui/lib/theme-chalk/index.css";
7 | import "@/assets/js/iconfont.js";
8 | import "@/assets/js/iconfont1.js";
9 | import "@/assets/js/iconfont2.js";
10 | import "@/assets/js/iconfont3.js";
11 | import "@/assets/js/iconfont4.js";
12 | import store from "./store";
13 |
14 | Vue.use(ElementUI);
15 |
16 | Vue.config.productionTip = false;
17 |
18 | /* eslint-disable no-new */
19 | new Vue({
20 | el: "#app",
21 | router,
22 | store,
23 | components: { App },
24 | render: (h) => h(App),
25 | });
26 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/dto/CommentDto.java:
--------------------------------------------------------------------------------
1 | package com.xs.dto;
2 |
3 | import com.fasterxml.jackson.databind.annotation.JsonSerialize;
4 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
5 | import lombok.Builder;
6 | import lombok.Data;
7 |
8 | import java.io.Serial;
9 | import java.io.Serializable;
10 |
11 | @Data
12 | @Builder
13 | public class CommentDto implements Serializable {
14 |
15 | /**
16 | * 主键
17 | */
18 | @JsonSerialize(using = ToStringSerializer.class)
19 | private Long id;
20 |
21 | /**
22 | * 点赞数
23 | */
24 | private Integer up;
25 |
26 | @Serial
27 | private static final long serialVersionUID = 1L;
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/music-admin/src/settings.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | /**
3 | * @type {string}
4 | * @description page title
5 | */
6 | title: '音乐网站后台',
7 |
8 | /**
9 | * @type {string}
10 | * @description logo URL
11 | */
12 | logo: 'https://wpimg.wallstcn.com/69a1c46c-eb1c-4b46-8bd4-e9e686ef5251.png',
13 |
14 | /**
15 | * @type {boolean} true | false
16 | * @description Whether fix the header
17 | */
18 | fixedHeader: true,
19 |
20 | /**
21 | * @type {boolean} true | false
22 | * @description Whether show the logo in sidebar
23 | */
24 | sidebarLogo: true,
25 |
26 | /**
27 | * @type {Array}
28 | * @description 默认展开的父级菜单
29 | */
30 | defaultOpeneds: ['/example']
31 | }
32 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/service/AdminService.java:
--------------------------------------------------------------------------------
1 | package com.xs.service;
2 |
3 | import com.baomidou.mybatisplus.extension.service.IService;
4 | import com.xs.domain.Admin;
5 | import org.springframework.security.core.userdetails.UserDetails;
6 | import org.springframework.security.core.userdetails.UserDetailsService;
7 | import org.springframework.security.core.userdetails.UsernameNotFoundException;
8 |
9 | /**
10 | * @author xs
11 | * description 针对表【admin(管理员)】的数据库操作Service
12 | * createDate 2022-10-03 16:22:14
13 | */
14 | public interface AdminService extends IService, UserDetailsService {
15 |
16 | UserDetails loadUserByUsername(String username) throws UsernameNotFoundException;
17 | }
18 |
--------------------------------------------------------------------------------
/music-view/src/settings.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | /**
3 | * @type {string}
4 | * @description page title
5 | */
6 | title: "音乐网站前台",
7 |
8 | /**
9 | * @type {string}
10 | * @description logo URL
11 | */
12 | logo: "https://wpimg.wallstcn.com/69a1c46c-eb1c-4b46-8bd4-e9e686ef5251.png",
13 |
14 | /**
15 | * @type {boolean} true | false
16 | * @description Whether fix the header
17 | */
18 | fixedHeader: true,
19 |
20 | /**
21 | * @type {boolean} true | false
22 | * @description Whether show the logo in sidebar
23 | */
24 | sidebarLogo: true,
25 |
26 | /**
27 | * @type {Array}
28 | * @description 默认展开的父级菜单
29 | */
30 | defaultOpeneds: ["/example"],
31 | };
32 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/vo/SongVo.java:
--------------------------------------------------------------------------------
1 | package com.xs.vo;
2 |
3 | import com.fasterxml.jackson.databind.annotation.JsonSerialize;
4 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
5 | import lombok.Data;
6 |
7 | import java.io.Serial;
8 | import java.io.Serializable;
9 |
10 | @Data
11 | public class SongVo implements Serializable {
12 |
13 | /**
14 | * 歌手id
15 | */
16 | @JsonSerialize(using = ToStringSerializer.class)
17 | private Long id;
18 |
19 | /**
20 | * 歌曲搜索关键字
21 | */
22 | private String name;
23 |
24 | /**
25 | * 播放量
26 | */
27 | private Integer playCount;
28 |
29 | @Serial
30 | private static final long serialVersionUID = 1L;
31 | }
32 |
--------------------------------------------------------------------------------
/music-admin/src/api/Collect.js:
--------------------------------------------------------------------------------
1 | import axios from "../plugins/axios";
2 |
3 | export function getAllCollectByUserId(userId) {
4 | return axios({
5 | url: `collect/collectOfUserId/${userId}`,
6 | method: "GET",
7 | });
8 | }
9 |
10 | export function delCollect(id) {
11 | return axios({
12 | url: `collect/del/${id}`,
13 | method: "DELETE",
14 | });
15 | }
16 |
17 | export function delAllCollect(ids) {
18 | return axios({
19 | url: `collect/delAll/${ids}`,
20 | method: "DELETE",
21 | });
22 | }
23 |
24 | export function searchCollectByUserId(searchDto) {
25 | return axios({
26 | url: "collect/searchOfUserId",
27 | method: "POST",
28 | data: {
29 | ...searchDto,
30 | },
31 | });
32 | }
33 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/controller/CheckLoginStateController.java:
--------------------------------------------------------------------------------
1 | package com.xs.controller;
2 |
3 | import com.xs.common.Result;
4 | import com.xs.service.RedisService;
5 | import org.springframework.web.bind.annotation.GetMapping;
6 | import org.springframework.web.bind.annotation.PathVariable;
7 | import org.springframework.web.bind.annotation.RestController;
8 |
9 | import javax.annotation.Resource;
10 |
11 | @RestController
12 | public class CheckLoginStateController {
13 |
14 | @Resource
15 | private RedisService redisService;
16 |
17 | @GetMapping("/checkLoginState/{username}")
18 | public Result checkLoginState(@PathVariable String username) {
19 | return redisService.checkLoginState(username);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/music-view/src/assets/css/sign-up.scss:
--------------------------------------------------------------------------------
1 | @import "var.scss";
2 | @import "global.scss";
3 |
4 | .box {
5 | display: flex;
6 |
7 | .img {
8 | margin-top: 24px;
9 | width: 880px;
10 | height: 580px;
11 | }
12 |
13 | .signUp {
14 | margin: 70px auto 0;
15 | background-color: $color-white;
16 | border-radius: 10px;
17 | width: 350px;
18 | height: 474px;
19 | padding: 30px 30px;
20 |
21 | .signUp-head {
22 | text-align: center;
23 | margin-bottom: 10px;
24 | font-size: 20px;
25 | font-weight: 600;
26 | }
27 |
28 | .login-btn {
29 | @include layout(space-between);
30 | button {
31 | display: block;
32 | width: 50%;
33 | }
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/config/MybatisPlusConfig.java:
--------------------------------------------------------------------------------
1 | package com.xs.config;
2 |
3 | import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
4 | import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
5 | import org.springframework.context.annotation.Bean;
6 | import org.springframework.context.annotation.Configuration;
7 |
8 | @Configuration
9 | public class MybatisPlusConfig {
10 |
11 | @Bean
12 | public MybatisPlusInterceptor mybatisPlusInterceptor() {
13 | MybatisPlusInterceptor mybatisPlusInterceptor = new MybatisPlusInterceptor();
14 | mybatisPlusInterceptor.addInnerInterceptor(new PaginationInnerInterceptor());
15 | return mybatisPlusInterceptor;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/music-view/src/api/RecentSong.js:
--------------------------------------------------------------------------------
1 | import axios from "../plugins/axios";
2 |
3 | export function addRecentSong(RecentSong) {
4 | return axios({
5 | url: "recentSong/add",
6 | method: "POST",
7 | data: {
8 | ...RecentSong,
9 | },
10 | });
11 | }
12 |
13 | export function getRecentSongByUserId(id) {
14 | return axios({
15 | url: `recentSong/recentSongOfUserId/${id}`,
16 | method: "GET",
17 | });
18 | }
19 |
20 | export function recommendSongList(id) {
21 | return axios({
22 | url: `recentSong/recommendSongList/${id}`,
23 | method: "GET",
24 | });
25 | }
26 |
27 | export function recommendSinger(id) {
28 | return axios({
29 | url: `recentSong/recommendSinger/${id}`,
30 | method: "GET",
31 | });
32 | }
33 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/controller/admin/LogoutAdminController.java:
--------------------------------------------------------------------------------
1 | package com.xs.controller.admin;
2 |
3 | import com.xs.common.Result;
4 | import com.xs.service.LogoutService;
5 | import org.springframework.web.bind.annotation.PostMapping;
6 | import org.springframework.web.bind.annotation.RequestMapping;
7 | import org.springframework.web.bind.annotation.RestController;
8 |
9 | import javax.annotation.Resource;
10 |
11 | @RestController
12 | @RequestMapping("/admin")
13 | public class LogoutAdminController {
14 |
15 | @Resource
16 | private LogoutService logoutService;
17 |
18 | /**
19 | * 退出登录
20 | */
21 | @PostMapping("/logout")
22 | public Result logout() {
23 | return logoutService.logout();
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/music-view/src/assets/css/global.scss:
--------------------------------------------------------------------------------
1 | @import "var.scss";
2 |
3 | // 上下左右居中
4 | @mixin layout(
5 | $justify-content: flex-start,
6 | $align-items: stretch,
7 | $flex-direction: row,
8 | $flex-wrap: nowrap
9 | ) {
10 | display: flex;
11 | justify-content: $justify-content;
12 | align-items: $align-items;
13 | flex-direction: $flex-direction;
14 | flex-wrap: $flex-wrap;
15 | }
16 |
17 | // 图标
18 | @mixin icon($size: 1.5em, $color: $color-black) {
19 | width: $size;
20 | height: $size;
21 | font-size: $size;
22 | color: $color;
23 | fill: currentColor;
24 | overflow: hidden;
25 | position: relative;
26 | }
27 |
28 | @mixin box-shadow($box-shadow) {
29 | -webkit-box-shadow: $box-shadow;
30 | -moz-box-shadow: $box-shadow;
31 | box-shadow: $box-shadow;
32 | }
33 |
--------------------------------------------------------------------------------
/music-view/src/assets/css/index.scss:
--------------------------------------------------------------------------------
1 | @import "var.scss";
2 |
3 | * {
4 | padding: 0;
5 | margin: 0;
6 | }
7 |
8 | ul,
9 | li {
10 | list-style: none;
11 | display: inline-block;
12 | }
13 |
14 | html {
15 | min-width: 1200px;
16 | font-size: 14px;
17 | }
18 |
19 | div {
20 | box-sizing: content-box;
21 | }
22 |
23 | /*表单*/
24 | .el-select-dropdown__item {
25 | display: block !important;
26 | }
27 |
28 | /*轮播图*/
29 | .el-scrollbar__view,
30 | .el-select-dropdown__list {
31 | width: 100% !important;
32 | text-align: center;
33 | }
34 |
35 | .el-carousel__indicators,
36 | .el-carousel__indicators--outside {
37 | display: inline-block;
38 | margin-left: 500px !important;
39 | }
40 |
41 | .el-slider__runway {
42 | background-color: $color-blue !important;
43 | }
44 |
--------------------------------------------------------------------------------
/music-view/src/assets/css/login-in.scss:
--------------------------------------------------------------------------------
1 | @import "var.scss";
2 | @import "global.scss";
3 |
4 | .box {
5 | display: flex;
6 | margin-bottom: 50px;
7 |
8 | .img {
9 | margin-top: 24px;
10 | width: 880px;
11 | height: 580px;
12 | }
13 |
14 | .login {
15 | margin: 70px auto 0;
16 | width: 300px;
17 | height: 474px;
18 | padding: 30px 50px;
19 | border-radius: 10px;
20 | background-color: #fff;
21 |
22 | .login-head {
23 | text-align: center;
24 | margin-top: 70px;
25 | margin-bottom: 10px;
26 | font-size: 20px;
27 | font-weight: 600;
28 | }
29 |
30 | .login-btn {
31 | @include layout(space-between);
32 | button {
33 | display: block;
34 | width: 50%;
35 | }
36 | }
37 | }
38 | }
39 |
40 |
41 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/service/RecentSongService.java:
--------------------------------------------------------------------------------
1 | package com.xs.service;
2 |
3 | import com.xs.common.Result;
4 | import com.xs.domain.RecentSong;
5 | import com.baomidou.mybatisplus.extension.service.IService;
6 |
7 | /**
8 | * @author xs
9 | * description 针对表【recent_song】的数据库操作Service
10 | * createDate 2022-10-30 10:18:56
11 | */
12 | public interface RecentSongService extends IService {
13 |
14 | /**
15 | * 添加歌曲最近播放记录
16 | */
17 | Result addRecentSong(RecentSong recentSong);
18 |
19 | /**
20 | * 获取当前用户最近播放列表
21 | */
22 | Result getRecentSongByUserId(Long id);
23 |
24 | /**
25 | * 推荐歌单
26 | */
27 | Result recommendSongList(Long id);
28 |
29 | /**
30 | * 推荐歌手
31 | */
32 | Result recommendSinger(Long id);
33 | }
34 |
--------------------------------------------------------------------------------
/music-view/src/plugins/axios.js:
--------------------------------------------------------------------------------
1 | import axios from "axios";
2 | import { Message } from "element-ui";
3 |
4 | const request = axios.create({
5 | baseURL: "/api",
6 | timeout: 30000,
7 | });
8 |
9 | // 响应拦截
10 | request.interceptors.response.use(
11 | (response) => {
12 | const res = response;
13 | if (res.data.code !== 200) {
14 | if (res.data.code === 500 && res.data.data === null) {
15 | console.log("暂无数据");
16 | } else {
17 | let msg = res.data.msg || "Error";
18 | Message.error(msg);
19 | return Promise.reject(new Error(msg));
20 | }
21 | }
22 | return res;
23 | },
24 | (error) => {
25 | console.info(error);
26 | Message.error(error.message);
27 | return Promise.reject(error);
28 | }
29 | );
30 |
31 | export default request;
32 |
--------------------------------------------------------------------------------
/music-admin/src/components/Home.vue:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/service/impl/RedisServiceImpl.java:
--------------------------------------------------------------------------------
1 | package com.xs.service.impl;
2 |
3 | import com.xs.common.Result;
4 | import com.xs.domain.Admin;
5 | import com.xs.service.RedisService;
6 | import com.xs.util.RedisCache;
7 | import org.springframework.stereotype.Service;
8 |
9 | import javax.annotation.Resource;
10 | import java.util.Objects;
11 |
12 | @Service
13 | public class RedisServiceImpl implements RedisService {
14 |
15 | @Resource
16 | private RedisCache redisCache;
17 |
18 | @Override
19 | public Result checkLoginState(String username) {
20 | Admin admin = redisCache.getCacheObject(username);
21 | if (Objects.nonNull(admin)) {
22 | return Result.ok("token生效中", true);
23 | } else {
24 | return Result.ok("凭证已失效", false);
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/exception/BizException.java:
--------------------------------------------------------------------------------
1 | package com.xs.exception;
2 |
3 | import com.xs.enums.StatusCodeEnum;
4 | import lombok.AllArgsConstructor;
5 | import lombok.Getter;
6 |
7 | import static com.xs.enums.StatusCodeEnum.FAIL;
8 |
9 | /**
10 | * 业务异常
11 | */
12 | @Getter
13 | @AllArgsConstructor
14 | public class BizException extends RuntimeException {
15 |
16 | /**
17 | * 错误码
18 | */
19 | private Integer code = FAIL.getCode();
20 |
21 | /**
22 | * 错误信息
23 | */
24 | private final String message;
25 |
26 | public BizException(String message) {
27 | this.message = message;
28 | }
29 |
30 | public BizException(StatusCodeEnum statusCodeEnum) {
31 | this.code = statusCodeEnum.getCode();
32 | this.message = statusCodeEnum.getDesc();
33 | }
34 |
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/controller/RankController.java:
--------------------------------------------------------------------------------
1 | package com.xs.controller;
2 |
3 | import com.xs.common.Result;
4 | import com.xs.domain.Ranks;
5 | import com.xs.service.RankService;
6 | import org.springframework.web.bind.annotation.*;
7 |
8 | import javax.annotation.Resource;
9 |
10 | @RestController
11 | @RequestMapping("/rank")
12 | public class RankController {
13 |
14 | @Resource
15 | private RankService rankService;
16 |
17 | /**
18 | * 添加歌单评价
19 | */
20 | @PostMapping("/add")
21 | public Result addRank(@RequestBody Ranks ranks) {
22 | return rankService.addRanks(ranks);
23 | }
24 |
25 | /**
26 | * 获取指定歌单的平均分
27 | */
28 | @GetMapping("/getAvgScore/{id}")
29 | public Result getRanksAvgScore(@PathVariable Long id) {
30 | return rankService.getRanksAvgScore(id);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/music-view/src/assets/css/song-list.scss:
--------------------------------------------------------------------------------
1 | @import "var.scss";
2 | @import "global.scss";
3 |
4 | .song-list {
5 | position: relative;
6 | margin: 30px 150px;
7 | margin-top: $header-height + 20px;
8 | padding-bottom: 50px;
9 | min-width: 800px;
10 | background-color: $color-white;
11 | }
12 |
13 | .song-list-header {
14 | width: 100%;
15 | padding: 0 40px;
16 | li {
17 | display: inline-block;
18 | line-height: 40px;
19 | margin: 40px 20px 15px 20px;
20 | font-size: 20px;
21 | font-weight: 400;
22 | color: $color-grey;
23 | border-bottom: none;
24 | cursor: pointer;
25 | }
26 | li.active {
27 | color: $color-black;
28 | font-weight: 600;
29 | border-bottom: 4px solid $color-black;
30 | }
31 | }
32 |
33 | .pagination {
34 | position: absolute;
35 | bottom: 10px;
36 | left: 35%;
37 | @include layout;
38 | }
39 |
--------------------------------------------------------------------------------
/music-view/src/assets/css/info.scss:
--------------------------------------------------------------------------------
1 | @import "var.scss";
2 | @import "global.scss";
3 |
4 | .info {
5 | padding-bottom: 30px;
6 | .title {
7 | height: 50px;
8 | line-height: 50px;
9 | padding-left: 20px;
10 | font-size: 20px;
11 | font-weight: 600;
12 | color: $color-black;
13 | }
14 |
15 | hr {
16 | width: 98%;
17 | }
18 |
19 | .personal {
20 | padding-right: 50px;
21 | padding-top: 40px;
22 | }
23 |
24 | .btn {
25 | width: 100%;
26 | height: 40px;
27 | margin-left: 40px;
28 | @include layout(center, center);
29 | cursor: pointer;
30 | div {
31 | display: inline-block;
32 | width: 100px;
33 | height: 30px;
34 | line-height: 30px;
35 | text-align: center;
36 | background-color: $color-blue-active;
37 | margin: 0 20px;
38 | color: $color-white;
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/domain/ListSong.java:
--------------------------------------------------------------------------------
1 | package com.xs.domain;
2 |
3 | import com.fasterxml.jackson.databind.annotation.JsonSerialize;
4 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
5 | import lombok.Data;
6 |
7 | import java.io.Serial;
8 | import java.io.Serializable;
9 |
10 | /**
11 | * 歌单包含歌曲列表
12 | * TableName list_song
13 | */
14 | @Data
15 | public class ListSong implements Serializable {
16 |
17 | /**
18 | * 主键
19 | */
20 | @JsonSerialize(using = ToStringSerializer.class)
21 | private Long id;
22 |
23 | /**
24 | * 歌曲id
25 | */
26 | @JsonSerialize(using = ToStringSerializer.class)
27 | private Long songId;
28 |
29 | /**
30 | * 歌单id
31 | */
32 | @JsonSerialize(using = ToStringSerializer.class)
33 | private Long songListId;
34 |
35 | @Serial
36 | private static final long serialVersionUID = 1L;
37 | }
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/enums/UploadModeEnum.java:
--------------------------------------------------------------------------------
1 | package com.xs.enums;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Getter;
5 |
6 | /**
7 | * 上传模式枚举
8 | */
9 | @Getter
10 | @AllArgsConstructor
11 | public enum UploadModeEnum {
12 | /**
13 | * 本地
14 | */
15 | LOCAL("local", "localUploadStrategyImpl");
16 |
17 | /**
18 | * 模式
19 | */
20 | private final String mode;
21 |
22 | /**
23 | * 策略
24 | */
25 | private final String strategy;
26 |
27 | /**
28 | * 获取策略
29 | *
30 | * @param mode 模式
31 | * @return {@link String} 搜索策略
32 | */
33 | public static String getStrategy(String mode) {
34 | for (UploadModeEnum value : UploadModeEnum.values()) {
35 | if (value.getMode().equals(mode)) {
36 | return value.getStrategy();
37 | }
38 | }
39 | return null;
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/vo/CollectVo.java:
--------------------------------------------------------------------------------
1 | package com.xs.vo;
2 |
3 | import com.fasterxml.jackson.databind.annotation.JsonSerialize;
4 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
5 | import lombok.Data;
6 |
7 | import java.io.Serial;
8 | import java.io.Serializable;
9 |
10 | @Data
11 | public class CollectVo implements Serializable {
12 |
13 | /**
14 | * 用户id
15 | */
16 | @JsonSerialize(using = ToStringSerializer.class)
17 | private Long userId;
18 |
19 | /**
20 | * 收藏类型
21 | */
22 | private Integer type;
23 |
24 | /**
25 | * 歌曲id
26 | */
27 | @JsonSerialize(using = ToStringSerializer.class)
28 | private Long songId;
29 |
30 | /**
31 | * 歌曲id
32 | */
33 | @JsonSerialize(using = ToStringSerializer.class)
34 | private Long songListId;
35 |
36 | @Serial
37 | private static final long serialVersionUID = 1L;
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/music-view/src/assets/css/singer.scss:
--------------------------------------------------------------------------------
1 | @import "var.scss";
2 | @import "global.scss";
3 |
4 | div,
5 | ul,
6 | li {
7 | box-sizing: border-box;
8 | }
9 |
10 | .singer {
11 | position: relative;
12 | margin: 30px 10%;
13 | margin-top: $header-height + 20px;
14 | padding-bottom: 50px;
15 | background-color: $color-white;
16 | .singer-header {
17 | width: 100%;
18 | padding: 0 40px;
19 | li {
20 | display: inline-block;
21 | line-height: 40px;
22 | margin: 40px 20px 15px 20px;
23 | font-size: 20px;
24 | font-weight: 400;
25 | color: $color-grey;
26 | border-bottom: none;
27 | cursor: pointer;
28 | }
29 | li.active {
30 | color: $color-black;
31 | font-weight: 600;
32 | border-bottom: 4px solid $color-black;
33 | }
34 | }
35 | }
36 |
37 | .pagination {
38 | position: absolute;
39 | left: 35%;
40 | bottom: 10px;
41 | @include layout;
42 | }
43 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/domain/SongList.java:
--------------------------------------------------------------------------------
1 | package com.xs.domain;
2 |
3 | import com.fasterxml.jackson.databind.annotation.JsonSerialize;
4 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
5 | import lombok.Data;
6 |
7 | import java.io.Serial;
8 | import java.io.Serializable;
9 |
10 | /**
11 | * 歌单
12 | * TableName song_list
13 | */
14 | @Data
15 | public class SongList implements Serializable {
16 |
17 | /**
18 | * 主键
19 | */
20 | @JsonSerialize(using = ToStringSerializer.class)
21 | private Long id;
22 |
23 | /**
24 | * 标题
25 | */
26 | private String title;
27 |
28 | /**
29 | * 歌单图片
30 | */
31 | private String pic;
32 |
33 | /**
34 | * 歌单简介
35 | */
36 | private String introduction;
37 |
38 | /**
39 | * 风格
40 | */
41 | private String style;
42 |
43 | @Serial
44 | private static final long serialVersionUID = 1L;
45 | }
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/service/impl/LogoutServiceImpl.java:
--------------------------------------------------------------------------------
1 | package com.xs.service.impl;
2 |
3 | import com.xs.common.Result;
4 | import com.xs.service.LogoutService;
5 | import com.xs.util.RedisCache;
6 | import org.springframework.security.core.Authentication;
7 | import org.springframework.security.core.context.SecurityContextHolder;
8 | import org.springframework.stereotype.Service;
9 |
10 | import javax.annotation.Resource;
11 |
12 | @Service
13 | public class LogoutServiceImpl implements LogoutService {
14 |
15 | @Resource
16 | private RedisCache redisCache;
17 |
18 | /**
19 | * 退出登录
20 | */
21 | @Override
22 | public Result logout() {
23 | Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
24 | String username = (String) authentication.getPrincipal();
25 | redisCache.deleteObject(username);
26 | return Result.ok("退出登录成功");
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/vo/ListSongVo.java:
--------------------------------------------------------------------------------
1 | package com.xs.vo;
2 |
3 | import com.fasterxml.jackson.databind.annotation.JsonSerialize;
4 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
5 | import lombok.Data;
6 |
7 | import java.io.Serial;
8 | import java.io.Serializable;
9 |
10 | @Data
11 | public class ListSongVo implements Serializable {
12 |
13 | /**
14 | * 主键
15 | */
16 | @JsonSerialize(using = ToStringSerializer.class)
17 | private Long id;
18 |
19 | /**
20 | * 歌曲id
21 | */
22 | @JsonSerialize(using = ToStringSerializer.class)
23 | private Long songId;
24 |
25 | /**
26 | * 歌单id
27 | */
28 | @JsonSerialize(using = ToStringSerializer.class)
29 | private Long songListId;
30 |
31 | /**
32 | * 歌手名-歌曲名
33 | */
34 | private String singerNameAndsongName;
35 |
36 | @Serial
37 | private static final long serialVersionUID = 1L;
38 | }
39 |
--------------------------------------------------------------------------------
/music-server/src/main/resources/mapper/AdminMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/domain/Ranks.java:
--------------------------------------------------------------------------------
1 | package com.xs.domain;
2 |
3 | import java.io.Serial;
4 | import java.io.Serializable;
5 |
6 | import com.fasterxml.jackson.databind.annotation.JsonSerialize;
7 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
8 | import lombok.Data;
9 |
10 | /**
11 | * 评价
12 | * TableName ranks
13 | */
14 | @Data
15 | public class Ranks implements Serializable {
16 |
17 | /**
18 | * 主键
19 | */
20 | @JsonSerialize(using = ToStringSerializer.class)
21 | private Long id;
22 |
23 | /**
24 | * 歌单id
25 | */
26 | @JsonSerialize(using = ToStringSerializer.class)
27 | private Long songListId;
28 |
29 | /**
30 | * 用户id
31 | */
32 | @JsonSerialize(using = ToStringSerializer.class)
33 | private Long consumerId;
34 |
35 | /**
36 | * 评分
37 | */
38 | private Integer score;
39 |
40 | @Serial
41 | private static final long serialVersionUID = 1L;
42 | }
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/enums/FilePathEnum.java:
--------------------------------------------------------------------------------
1 | package com.xs.enums;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Getter;
5 |
6 | /**
7 | * 文件路径枚举
8 | */
9 | @Getter
10 | @AllArgsConstructor
11 | public enum FilePathEnum {
12 | /**
13 | * 头像路径
14 | */
15 | AVATAR("avatar/", "头像路径"),
16 | /**
17 | * 文章图片路径
18 | */
19 | ARTICLE("articles/", "文章图片路径"),
20 | /**
21 | * 音频路径
22 | */
23 | VOICE("voice/", "音频路径"),
24 | /**
25 | * 照片路径
26 | */
27 | PHOTO("photos/", "相册路径"),
28 | /**
29 | * 配置图片路径
30 | */
31 | CONFIG("config/", "配置图片路径"),
32 | /**
33 | * 说说图片路径
34 | */
35 | TALK("talks/", "说说图片路径"),
36 | /**
37 | * md文件路径
38 | */
39 | MD("markdown/", "md文件路径");
40 |
41 | /**
42 | * 路径
43 | */
44 | private final String path;
45 |
46 | /**
47 | * 描述
48 | */
49 | private final String desc;
50 |
51 | }
52 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/handler/MyMetaObjectHandler.java:
--------------------------------------------------------------------------------
1 | package com.xs.handler;
2 |
3 | import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
4 | import org.apache.ibatis.reflection.MetaObject;
5 | import org.springframework.stereotype.Component;
6 |
7 | import java.time.LocalDateTime;
8 |
9 | @Component
10 | public class MyMetaObjectHandler implements MetaObjectHandler {
11 |
12 | @Override
13 | public void insertFill(MetaObject metaObject) {
14 | this.strictInsertFill(metaObject, "createTime", LocalDateTime.class, LocalDateTime.now());
15 | this.strictInsertFill(metaObject, "updateTime", LocalDateTime.class, LocalDateTime.now());
16 | }
17 |
18 | @Override
19 | public void updateFill(MetaObject metaObject) {
20 | this.strictUpdateFill(metaObject, "createTime", LocalDateTime.class, LocalDateTime.now());
21 | this.strictUpdateFill(metaObject, "updateTime", LocalDateTime.class, LocalDateTime.now());
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/music-view/src/pages/Setting.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
设置
5 |
6 | -
11 | {{ item.name }}
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
35 |
36 |
39 |
--------------------------------------------------------------------------------
/music-view/src/assets/css/scroll-top.scss:
--------------------------------------------------------------------------------
1 | @import "var.scss";
2 | @import "global.scss";
3 |
4 | .scroll-top {
5 | position: fixed;
6 | width: 50px;
7 | height: 30px;
8 | right: 10px;
9 | bottom: 80px;
10 | padding-top: 20px;
11 | text-align: center;
12 | background-color: $color-white;
13 | border-radius: 20%;
14 | overflow: hidden;
15 | @include box-shadow(0 0 4px 3px rgba(0, 0, 0, 0.2));
16 | &:hover:before {
17 | top: 50%;
18 | }
19 | &:hover .box-in {
20 | visibility: hidden;
21 | }
22 | &:before {
23 | content: "回到顶部";
24 | position: absolute;
25 | font-weight: bold;
26 | width: 30px;
27 | top: -50%;
28 | left: 50%;
29 | transform: translate(-50%, -50%);
30 | }
31 | }
32 |
33 | .box-in {
34 | visibility: visible;
35 | display: inline-block;
36 | height: 15px;
37 | width: 15px;
38 | border: 1px solid $color-black;
39 | border-color: $color-black transparent transparent $color-black;
40 | transform: rotate(45deg);
41 | }
42 |
--------------------------------------------------------------------------------
/music-admin/src/plugins/axios.js:
--------------------------------------------------------------------------------
1 | import axios from "axios";
2 | import { Message } from "element-ui";
3 |
4 | const request = axios.create({
5 | baseURL: "/apk",
6 | timeout: 5000,
7 | });
8 |
9 | request.interceptors.request.use((config) => {
10 | const token = window.localStorage.getItem("token");
11 | if (token) {
12 | config.headers.Authorization = token;
13 | }
14 | return config;
15 | });
16 |
17 | // 响应拦截
18 | request.interceptors.response.use(
19 | (response) => {
20 | const res = response.data;
21 | if (res.code !== 200) {
22 | if (res.code === 500 && res.data === null) {
23 | console.log("暂无数据");
24 | } else {
25 | let msg = res.msg || "Error";
26 | Message.error(msg);
27 | return Promise.reject(new Error(msg));
28 | }
29 | }
30 | return res;
31 | },
32 | (error) => {
33 | console.info(error);
34 | Message.error(error.message);
35 | return Promise.reject(error);
36 | }
37 | );
38 |
39 | export default request;
40 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/mapper/ConsumerMapper.java:
--------------------------------------------------------------------------------
1 | package com.xs.mapper;
2 |
3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 | import com.xs.domain.Consumer;
5 | import com.xs.dto.ConsumerDto;
6 | import org.apache.ibatis.annotations.Mapper;
7 | import org.springframework.stereotype.Repository;
8 |
9 | import java.util.List;
10 |
11 | /**
12 | * @author xs
13 | * description 针对表【consumer(前端用户)】的数据库操作Mapper
14 | * createDate 2022-10-11 12:58:48
15 | * Entity com.xs.domain.Consumer
16 | */
17 | @Repository
18 | @Mapper
19 | public interface ConsumerMapper extends BaseMapper {
20 |
21 | /**
22 | * 查询所有用户
23 | */
24 | List getAllConsumer();
25 |
26 | /**
27 | * 获取用户总数
28 | */
29 | int getConsumerCount();
30 |
31 | /**
32 | * 按性别统计用户数量
33 | */
34 | List getConsumerCountBySex();
35 |
36 | /**
37 | * 用户登录
38 | */
39 | Consumer login(String username, String password);
40 | }
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/music-view/src/api/Comment.js:
--------------------------------------------------------------------------------
1 | import axios from "../plugins/axios";
2 |
3 | export function addComment(Comment) {
4 | return axios({
5 | url: "comment/add",
6 | method: "POST",
7 | data: {
8 | ...Comment,
9 | },
10 | });
11 | }
12 |
13 | export function updateCommentUp(CommentDto) {
14 | return axios({
15 | url: "comment/updateCommentUp",
16 | method: "PUT",
17 | data: {
18 | ...CommentDto,
19 | },
20 | });
21 | }
22 |
23 | export function cancelCommentUp(CommentDto) {
24 | return axios({
25 | url: "comment/cancelCommentUp",
26 | method: "PUT",
27 | data: {
28 | ...CommentDto,
29 | },
30 | });
31 | }
32 |
33 | export function getAllCommentBySongId(songId) {
34 | return axios({
35 | url: `comment/commentOfSongId/${songId}`,
36 | method: "GET",
37 | });
38 | }
39 |
40 | export function getAllCommentBySongListId(songListId) {
41 | return axios({
42 | url: `comment/commentOfSongListId/${songListId}`,
43 | method: "GET",
44 | });
45 | }
46 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/mapper/RanksMapper.java:
--------------------------------------------------------------------------------
1 | package com.xs.mapper;
2 |
3 | import com.xs.domain.Ranks;
4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5 | import org.apache.ibatis.annotations.Mapper;
6 | import org.springframework.stereotype.Repository;
7 |
8 | import java.util.List;
9 |
10 | /**
11 | * @author xs
12 | * description 针对表【Rank(评价)】的数据库操作Mapper
13 | * createDate 2022-10-11 16:16:20
14 | * Entity com.xs.domain.Rank
15 | */
16 | @Repository
17 | @Mapper
18 | public interface RanksMapper extends BaseMapper {
19 |
20 | /**
21 | * 按歌单id删除评价信息
22 | */
23 | int deleteBySongListId(Long id);
24 |
25 | /**
26 | * 按用户id删除评价信息
27 | */
28 | int deleteByConsumerId(Long id);
29 |
30 | /**
31 | * 获取所有歌单评价
32 | */
33 | List getAllRanks();
34 |
35 | /**
36 | * 获取指定歌单评价总分
37 | */
38 | double[] getAllScore(Long id);
39 |
40 | /**
41 | * 获取指定歌单评价数量
42 | */
43 | int getCountBySongListId(Long id);
44 | }
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/music-view/src/components/TheFooter.vue:
--------------------------------------------------------------------------------
1 |
2 |
24 |
25 |
26 |
31 |
32 |
35 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/strategy/context/UploadStrategyContext.java:
--------------------------------------------------------------------------------
1 | package com.xs.strategy.context;
2 |
3 | import com.xs.strategy.UploadStrategy;
4 | import org.springframework.beans.factory.annotation.Value;
5 | import org.springframework.stereotype.Service;
6 | import org.springframework.web.multipart.MultipartFile;
7 |
8 | import javax.annotation.Resource;
9 | import java.util.Map;
10 |
11 | import static com.xs.enums.UploadModeEnum.getStrategy;
12 |
13 | /**
14 | * 上传策略上下文
15 | */
16 | @Service
17 | public class UploadStrategyContext {
18 | /**
19 | * 上传模式
20 | */
21 | @Value("${upload.mode}")
22 | private String uploadMode;
23 |
24 | @Resource
25 | private Map uploadStrategyMap;
26 |
27 | /**
28 | * 执行上传策略
29 | *
30 | * @param file 文件
31 | * @param path 路径
32 | * @return {@link String} 文件地址
33 | */
34 | public String executeUploadStrategy(MultipartFile file, String path) {
35 | return uploadStrategyMap.get(getStrategy(uploadMode)).uploadFile(file, path);
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/config/MyAuthenticationEntryPoint.java:
--------------------------------------------------------------------------------
1 | package com.xs.config;
2 |
3 | import com.xs.common.Result;
4 | import com.xs.util.JacksonUtils;
5 | import org.springframework.security.core.AuthenticationException;
6 | import org.springframework.security.web.AuthenticationEntryPoint;
7 | import org.springframework.stereotype.Component;
8 |
9 | import javax.servlet.http.HttpServletRequest;
10 | import javax.servlet.http.HttpServletResponse;
11 | import java.io.IOException;
12 | import java.io.PrintWriter;
13 |
14 | /**
15 | * 未登录 拒绝访问
16 | */
17 | @Component
18 | public class MyAuthenticationEntryPoint implements AuthenticationEntryPoint {
19 |
20 | @Override
21 | public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException exception) throws IOException {
22 | response.setContentType("application/json;charset=utf-8");
23 | PrintWriter out = response.getWriter();
24 | Result result = Result.create(403, "请登录");
25 | out.write(JacksonUtils.writeValueAsString(result));
26 | out.flush();
27 | out.close();
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/mapper/RecentSongMapper.java:
--------------------------------------------------------------------------------
1 | package com.xs.mapper;
2 |
3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 | import com.xs.domain.RecentSong;
5 | import com.xs.domain.Singer;
6 | import com.xs.domain.SongList;
7 | import com.xs.vo.RecentSongVo;
8 | import org.apache.ibatis.annotations.Mapper;
9 |
10 | import java.util.List;
11 |
12 | /**
13 | * @author xs
14 | * description 针对表【recent_song】的数据库操作Mapper
15 | * createDate 2022-10-30 10:18:56
16 | * Entity com.xs.domain.RecentSong
17 | */
18 | @Mapper
19 | public interface RecentSongMapper extends BaseMapper {
20 |
21 | /**
22 | * 查询所有播放记录
23 | */
24 | List getAllRecentSong();
25 |
26 | /**
27 | * 获取当前用户最近播放列表
28 | */
29 | List getRecentSongByUserId(Long id);
30 |
31 | /**
32 | * 由最近播放歌曲查询其歌单信息
33 | */
34 | List getSongListByRecentSong(Long userId);
35 |
36 | /**
37 | * 由最近播放歌曲查询其歌手信息
38 | */
39 | List getSingerByRecentSong(Long userId);
40 |
41 | }
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/music-admin/src/api/Comment.js:
--------------------------------------------------------------------------------
1 | import axios from "../plugins/axios";
2 |
3 | export function getAllCommentBySongId(songId) {
4 | return axios({
5 | url: `comment/commentOfSongId/${songId}`,
6 | method: "GET",
7 | });
8 | }
9 |
10 | export function getAllCommentBySongListId(songListId) {
11 | return axios({
12 | url: `comment/commentOfSongListId/${songListId}`,
13 | method: "GET",
14 | });
15 | }
16 |
17 | export function deleteComment(id) {
18 | return axios({
19 | url: `comment/delete/${id}`,
20 | method: "DELETE",
21 | });
22 | }
23 |
24 | export function deleteAllComment(ids) {
25 | return axios({
26 | url: `comment/deleteAll/${ids}`,
27 | method: "DELETE",
28 | });
29 | }
30 |
31 | export function getAllCommentByUserId(userId) {
32 | return axios({
33 | url: `comment/commentOfUserId/${userId}`,
34 | method: "GET",
35 | });
36 | }
37 |
38 | export function searchComment(searchVo) {
39 | return axios({
40 | url: "/comment/searchComment",
41 | method: "POST",
42 | data: {
43 | ...searchVo,
44 | },
45 | });
46 | }
47 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/service/ListSongService.java:
--------------------------------------------------------------------------------
1 | package com.xs.service;
2 |
3 | import com.xs.common.Result;
4 | import com.xs.domain.ListSong;
5 | import com.baomidou.mybatisplus.extension.service.IService;
6 | import com.xs.dto.ListSongByNameDto;
7 | import com.xs.vo.ListSongVo;
8 |
9 | /**
10 | * @author xs
11 | * description 针对表【list_song(歌单包含歌曲列表)】的数据库操作Service
12 | * createDate 2022-10-09 22:19:02
13 | */
14 | public interface ListSongService extends IService {
15 |
16 | /**
17 | * 查找歌手对应的歌曲名称
18 | */
19 | Result getSongNameBySingerId(Long singId);
20 |
21 | /**
22 | * 查询所有歌单歌曲
23 | */
24 | Result getAll(Long id);
25 |
26 | /**
27 | * 添加歌单歌曲
28 | */
29 | Result addListSong(ListSongVo listSongVo);
30 |
31 | /**
32 | * 删除歌单歌曲
33 | */
34 | Result deleteListSong(Long id);
35 |
36 | /**
37 | * 批量删除歌曲
38 | */
39 | Result deleteAllListSong(Long[] ids);
40 |
41 | /**
42 | * 按名称查询歌单歌曲
43 | */
44 | Result getListSongByName(ListSongByNameDto listSongByNameDto);
45 | }
46 |
--------------------------------------------------------------------------------
/music-view/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
39 |
40 |
43 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/config/CrossConfig.java:
--------------------------------------------------------------------------------
1 | package com.xs.config;
2 |
3 | import org.springframework.context.annotation.Bean;
4 | import org.springframework.context.annotation.Configuration;
5 | import org.springframework.web.cors.CorsConfiguration;
6 | import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
7 | import org.springframework.web.filter.CorsFilter;
8 |
9 | @Configuration
10 | public class CrossConfig {
11 |
12 | @Bean
13 | public CorsFilter corsFilter(){
14 | //1. 创建CorsConfiguration对象
15 | CorsConfiguration corsConfiguration = new CorsConfiguration();
16 | corsConfiguration.addAllowedOrigin("*");//设置允许那些域来访问,*是通配符,允许所有域
17 | corsConfiguration.addAllowedHeader("*");//请求头字段
18 | corsConfiguration.addAllowedMethod("*");//请求方式(GET,POST,DELETE,PUT)
19 | //设置source
20 | UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
21 | source.registerCorsConfiguration("/**",corsConfiguration);//1.映射路径 2.传入CorsConfiguration对象
22 | return new CorsFilter(source);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/music-view/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "music-view",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "serve": "vue-cli-service serve",
7 | "build": "vue-cli-service build"
8 | },
9 | "dependencies": {
10 | "axios": "^0.24.0",
11 | "core-js": "^3.6.5",
12 | "element-ui": "^2.15.6",
13 | "normalize.css": "7.0.0",
14 | "nprogress": "^0.2.0",
15 | "webpack": "^4.36.0",
16 | "html-webpack-plugin": "^4.0.0",
17 | "script-ext-html-webpack-plugin": "^2.1.5",
18 | "vue": "^2.6.11",
19 | "vue-router": "^3.5.1",
20 | "vuex": "^3.2.0"
21 | },
22 | "devDependencies": {
23 | "@vue/cli-plugin-babel": "~4.5.0",
24 | "@vue/cli-plugin-router": "~4.5.0",
25 | "@vue/cli-plugin-vuex": "~4.5.0",
26 | "@vue/cli-service": "~4.5.0",
27 | "node-sass": "^6.0.1",
28 | "sass-loader": "^10.0.1",
29 | "vue-template-compiler": "^2.6.11"
30 | },
31 | "eslintConfig": {
32 | "root": true,
33 | "env": {
34 | "node": true
35 | }
36 | },
37 | "browserslist": [
38 | "> 1%",
39 | "last 2 versions"
40 | ]
41 | }
42 |
--------------------------------------------------------------------------------
/music-admin/src/api/ListSong.js:
--------------------------------------------------------------------------------
1 | import axios from "../plugins/axios";
2 |
3 | export function getSongNameBySingerId(singerId) {
4 | return axios({
5 | url: `listSong/songOfName/${singerId}`,
6 | method: "GET",
7 | });
8 | }
9 |
10 | export function getAllListSongBySongListId(id) {
11 | return axios({
12 | url: `listSong/all/${id}`,
13 | method: "GET",
14 | });
15 | }
16 |
17 | export function addListSong(ListSongVo) {
18 | return axios({
19 | url: "listSong/add",
20 | method: "POST",
21 | data: {
22 | ...ListSongVo,
23 | },
24 | });
25 | }
26 |
27 | export function deleteAllListSong(ids) {
28 | return axios({
29 | url: `listSong/deleteAll/${ids}`,
30 | method: "DELETE",
31 | });
32 | }
33 |
34 | export function deleteListSong(id) {
35 | return axios({
36 | url: `listSong/delete/${id}`,
37 | method: "DELETE",
38 | });
39 | }
40 |
41 | export function getListSongByName(ListSongByNameDto) {
42 | return axios({
43 | url: "listSong/listSongOfName",
44 | method: "POST",
45 | data: {
46 | ...ListSongByNameDto,
47 | },
48 | });
49 | }
50 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/domain/Singer.java:
--------------------------------------------------------------------------------
1 | package com.xs.domain;
2 |
3 | import com.fasterxml.jackson.databind.annotation.JsonSerialize;
4 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
5 | import lombok.Data;
6 |
7 | import java.io.Serial;
8 | import java.io.Serializable;
9 | import java.util.Date;
10 |
11 | /**
12 | * 歌手
13 | * TableName singer
14 | */
15 | @Data
16 | public class Singer implements Serializable {
17 |
18 | /**
19 | * 主键
20 | */
21 | @JsonSerialize(using = ToStringSerializer.class)
22 | private Long id;
23 |
24 | /**
25 | * 姓名
26 | */
27 | private String name;
28 |
29 | /**
30 | * 性别(1男0女)
31 | */
32 | private Integer sex;
33 |
34 | /**
35 | * 头像
36 | */
37 | private String pic;
38 |
39 | /**
40 | * 生日
41 | */
42 | private Date birth;
43 |
44 | /**
45 | * 所属地区
46 | */
47 | private String location;
48 |
49 | /**
50 | * 简介
51 | */
52 | private String introduction;
53 |
54 | @Serial
55 | private static final long serialVersionUID = 1L;
56 | }
--------------------------------------------------------------------------------
/music-view/src/api/ListSong.js:
--------------------------------------------------------------------------------
1 | import axios from "../plugins/axios";
2 |
3 | export function getSongNameBySingerId(singerId) {
4 | return axios({
5 | url: `listSong/songOfName/${singerId}`,
6 | method: "GET",
7 | });
8 | }
9 |
10 | export function getAllListSongBySongListId(id) {
11 | return axios({
12 | url: `listSong/all/${id}`,
13 | method: "GET",
14 | });
15 | }
16 |
17 | export function addListSong(ListSongVo) {
18 | return axios({
19 | url: "listSong/add",
20 | method: "POST",
21 | data: {
22 | ...ListSongVo,
23 | },
24 | });
25 | }
26 |
27 | export function deleteAllListSong(ids) {
28 | return axios({
29 | url: `listSong/deleteAll/${ids}`,
30 | method: "DELETE",
31 | });
32 | }
33 |
34 | export function deleteListSong(id) {
35 | return axios({
36 | url: `listSong/delete/${id}`,
37 | method: "DELETE",
38 | });
39 | }
40 |
41 | export function getListSongByName(ListSongByNameDto) {
42 | return axios({
43 | url: "listSong/listSongOfName",
44 | method: "POST",
45 | data: {
46 | ...ListSongByNameDto,
47 | },
48 | });
49 | }
50 |
--------------------------------------------------------------------------------
/music-view/src/pages/LeaderBoard.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |

9 |
10 |
11 |
12 |
13 |
播放量排名前50的歌曲
14 |
15 |
16 | 歌曲排行榜
17 |
18 |
19 |
20 |
21 |
22 |
39 |
40 |
43 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/dto/CollectDto.java:
--------------------------------------------------------------------------------
1 | package com.xs.dto;
2 |
3 | import com.baomidou.mybatisplus.annotation.FieldFill;
4 | import com.baomidou.mybatisplus.annotation.TableField;
5 | import com.fasterxml.jackson.databind.annotation.JsonSerialize;
6 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
7 | import lombok.Builder;
8 | import lombok.Data;
9 |
10 | import java.io.Serial;
11 | import java.io.Serializable;
12 | import java.time.LocalDateTime;
13 |
14 | @Data
15 | @Builder
16 | public class CollectDto implements Serializable {
17 |
18 | /**
19 | * 主键
20 | */
21 | @JsonSerialize(using = ToStringSerializer.class)
22 | private Long id;
23 |
24 | /**
25 | * 用户头像
26 | */
27 | private String avatar;
28 |
29 | /**
30 | * 用户名
31 | */
32 | private String username;
33 |
34 | /**
35 | * 收藏内容
36 | */
37 | private String content;
38 |
39 | /**
40 | * 收藏时间
41 | */
42 | @TableField(fill = FieldFill.INSERT_UPDATE)
43 | private LocalDateTime createTime;
44 |
45 | @Serial
46 | private static final long serialVersionUID = 1L;
47 | }
48 |
--------------------------------------------------------------------------------
/music-view/src/components/TheAside.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
播放列表
5 |
26 |
27 |
28 |
29 |
30 |
42 |
43 |
46 |
--------------------------------------------------------------------------------
/music-admin/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "music-admin",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "serve": "vue-cli-service serve",
7 | "build": "vue-cli-service build"
8 | },
9 | "dependencies": {
10 | "axios": "^0.24.0",
11 | "core-js": "^3.6.5",
12 | "echarts": "^4.8.0",
13 | "element-ui": "^2.15.6",
14 | "normalize.css": "7.0.0",
15 | "nprogress": "^0.2.0",
16 | "script-ext-html-webpack-plugin": "^2.1.5",
17 | "webpack": "^4.0.0",
18 | "html-webpack-plugin": "^4.0.0",
19 | "zrender": "^4.3.1",
20 | "v-charts": "^1.19.0",
21 | "vue-echarts": "^5.0.0-beta.0",
22 | "vue": "^2.6.11",
23 | "vue-router": "^3.5.1",
24 | "vuex": "^3.2.0"
25 | },
26 | "devDependencies": {
27 | "@vue/cli-plugin-babel": "~4.5.0",
28 | "@vue/cli-plugin-router": "~4.5.0",
29 | "@vue/cli-plugin-vuex": "~4.5.0",
30 | "@vue/cli-service": "~4.5.0",
31 | "vue-template-compiler": "^2.6.11"
32 | },
33 | "eslintConfig": {
34 | "root": true,
35 | "env": {
36 | "node": true
37 | }
38 | },
39 | "browserslist": [
40 | "> 1%",
41 | "last 2 versions"
42 | ]
43 | }
44 |
--------------------------------------------------------------------------------
/music-view/src/assets/css/album-content.scss:
--------------------------------------------------------------------------------
1 | @import "var.scss";
2 | @import "global.scss";
3 |
4 | .content {
5 | background-color: $color-white;
6 | border-radius: $border-radius-songlist;
7 | padding: 20px 40px;
8 | min-width: 600px;
9 |
10 | .title {
11 | text-align: center;
12 | }
13 | > ul {
14 | width: 100%;
15 | padding-bottom: 50px;
16 | > li {
17 | border-bottom: 1px solid rgba(0, 0, 0, 0.1);
18 | display: block;
19 | height: 50px;
20 | line-height: 50px;
21 | text-indent: 20px;
22 | cursor: pointer;
23 | }
24 | }
25 | }
26 |
27 | .song-item {
28 | @include layout;
29 | white-space: nowrap;
30 | overflow: hidden;
31 | text-overflow: ellipsis;
32 | .item-index {
33 | width: 5%;
34 | }
35 | .item-title {
36 | width: 25%;
37 | }
38 | .item-name {
39 | width: 25%;
40 | }
41 | .item-intro {
42 | width: 30%;
43 | }
44 | .item-count {
45 | width: 10%;
46 | }
47 | }
48 |
49 | .is-play {
50 | color: $color-blue-active;
51 | font-weight: bold;
52 | }
53 |
54 | .icon {
55 | @include icon(1.3em, $color-blue-active);
56 | vertical-align: -0.3em;
57 | right: 5px;
58 | }
59 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/controller/UploadController.java:
--------------------------------------------------------------------------------
1 | package com.xs.controller;
2 |
3 | import com.xs.enums.FilePathEnum;
4 | import com.xs.strategy.context.UploadStrategyContext;
5 | import com.xs.vo.R;
6 | import org.springframework.web.bind.annotation.PostMapping;
7 | import org.springframework.web.bind.annotation.RequestParam;
8 | import org.springframework.web.bind.annotation.RestController;
9 | import org.springframework.web.multipart.MultipartFile;
10 |
11 | import javax.annotation.Resource;
12 |
13 | @RestController
14 | public class UploadController {
15 |
16 | @Resource
17 | private UploadStrategyContext uploadStrategyContext;
18 |
19 | /**
20 | * 上传头像
21 | */
22 | @PostMapping("/upload")
23 | public R upload(@RequestParam("pic") MultipartFile file) {
24 | return R.ok(uploadStrategyContext.executeUploadStrategy(file, FilePathEnum.AVATAR.getPath()));
25 | }
26 |
27 | /**
28 | * 上传mp3
29 | */
30 | @PostMapping("/uploadAudio")
31 | public R uploadAudio(@RequestParam("mp3") MultipartFile file) {
32 | return R.ok(uploadStrategyContext.executeUploadStrategy(file, FilePathEnum.VOICE.getPath()));
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/mapper/ListSongMapper.java:
--------------------------------------------------------------------------------
1 | package com.xs.mapper;
2 |
3 | import com.xs.domain.ListSong;
4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5 | import com.xs.dto.ListSongDto;
6 | import com.xs.vo.ListSongVo;
7 | import org.apache.ibatis.annotations.Mapper;
8 | import org.springframework.stereotype.Repository;
9 |
10 | import java.util.List;
11 |
12 | /**
13 | * @author xs
14 | * description 针对表【list_song(歌单包含歌曲列表)】的数据库操作Mapper
15 | * createDate 2022-10-09 22:19:02
16 | * Entity com.xs.domain.ListSong
17 | */
18 | @Repository
19 | @Mapper
20 | public interface ListSongMapper extends BaseMapper {
21 |
22 | /**
23 | * 查找歌手对应的歌曲名称
24 | */
25 | List getSongNameBySingerId(Long singerId);
26 |
27 | /**
28 | * 查询所有歌单歌曲
29 | */
30 | List getAll(Long id);
31 |
32 | /**
33 | * 添加歌单歌曲
34 | */
35 | int addListSong(Long songId, Long songListId);
36 |
37 | /**
38 | * 按歌单id删除歌单歌曲信息
39 | */
40 | int deleteBySongListId(Long id);
41 |
42 | /**
43 | * 查询某个歌单中的歌曲信息
44 | */
45 | List getAllListSongBySongListId(Long songListId);
46 |
47 | }
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/mapper/SongListMapper.java:
--------------------------------------------------------------------------------
1 | package com.xs.mapper;
2 |
3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 | import com.xs.domain.SongList;
5 | import com.xs.vo.SongListVo;
6 | import org.apache.ibatis.annotations.Mapper;
7 | import org.springframework.stereotype.Repository;
8 |
9 | import java.util.List;
10 |
11 | /**
12 | * @author xs
13 | * description 针对表【song_list(歌单)】的数据库操作Mapper
14 | * createDate 2022-10-09 16:10:47
15 | * Entity com.xs.domain.SongList
16 | */
17 | @Repository
18 | @Mapper
19 | public interface SongListMapper extends BaseMapper {
20 |
21 | /**
22 | * 查询所有歌单
23 | */
24 | List getAllSongList();
25 |
26 | /**
27 | * 获取歌手总数
28 | */
29 | int getSongListCount();
30 |
31 | /**
32 | * 按歌单类型分组查询的歌单数量
33 | */
34 | List getSongListCountByStyle();
35 |
36 | /**
37 | * 按歌单风格名称查询所有歌单
38 | */
39 | List getSongListByStyle(String style);
40 |
41 | /**
42 | * 获取所有歌单风格
43 | */
44 | String[] getAllStyle();
45 |
46 | /**
47 | * 按风格查询歌单数量
48 | */
49 | Integer getAllSongListCountByStyle(String style);
50 | }
51 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/music-view/src/pages/Search.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
15 |
16 |
17 |
18 |
19 |
40 |
41 |
44 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/vo/CommentVo.java:
--------------------------------------------------------------------------------
1 | package com.xs.vo;
2 |
3 | import com.baomidou.mybatisplus.annotation.FieldFill;
4 | import com.baomidou.mybatisplus.annotation.TableField;
5 | import com.fasterxml.jackson.databind.annotation.JsonSerialize;
6 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
7 | import lombok.Builder;
8 | import lombok.Data;
9 |
10 | import java.io.Serial;
11 | import java.io.Serializable;
12 | import java.time.LocalDateTime;
13 |
14 | @Data
15 | @Builder
16 | public class CommentVo implements Serializable {
17 |
18 | /**
19 | * 主键
20 | */
21 | @JsonSerialize(using = ToStringSerializer.class)
22 | private Long id;
23 |
24 | /**
25 | * 用户头像
26 | */
27 | private String avatar;
28 |
29 | /**
30 | * 用户名
31 | */
32 | private String username;
33 |
34 | /**
35 | * 评论内容
36 | */
37 | private String content;
38 |
39 | /**
40 | * 评论时间
41 | */
42 | @TableField(fill = FieldFill.INSERT_UPDATE)
43 | private LocalDateTime createTime;
44 |
45 | /**
46 | * 评论点赞数
47 | */
48 | private Integer up;
49 |
50 | @Serial
51 | private static final long serialVersionUID = 1L;
52 |
53 | }
54 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/enums/StatusCodeEnum.java:
--------------------------------------------------------------------------------
1 | package com.xs.enums;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Getter;
5 |
6 | /**
7 | * 接口状态码枚举
8 | **/
9 | @Getter
10 | @AllArgsConstructor
11 | public enum StatusCodeEnum {
12 | /**
13 | * 成功
14 | */
15 | SUCCESS(20000, "操作成功"),
16 | /**
17 | * 未登录
18 | */
19 | NO_LOGIN(40001, "用户未登录"),
20 | /**
21 | * 没有操作权限
22 | */
23 | AUTHORIZED(40300, "没有操作权限"),
24 | /**
25 | * 系统异常
26 | */
27 | SYSTEM_ERROR(50000, "系统异常"),
28 | /**
29 | * 失败
30 | */
31 | FAIL(51000, "操作失败"),
32 | /**
33 | * 参数校验失败
34 | */
35 | VALID_ERROR(52000, "参数格式不正确"),
36 | /**
37 | * 用户名已存在
38 | */
39 | USERNAME_EXIST(52001, "用户名已存在"),
40 | /**
41 | * 用户名不存在
42 | */
43 | USERNAME_NOT_EXIST(52002, "用户名不存在"),
44 | /**
45 | * qq登录错误
46 | */
47 | QQ_LOGIN_ERROR(53001, "qq登录错误"),
48 | /**
49 | * 微博登录错误
50 | */
51 | WEIBO_LOGIN_ERROR(53002, "微博登录错误");
52 |
53 | /**
54 | * 状态码
55 | */
56 | private final Integer code;
57 |
58 | /**
59 | * 描述
60 | */
61 | private final String desc;
62 |
63 | }
64 |
--------------------------------------------------------------------------------
/music-server/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | server:
2 | port: 8889
3 |
4 | spring:
5 |
6 | main:
7 | allow-circular-references: true
8 |
9 | jackson:
10 | time-zone: GMT+8
11 |
12 | servlet:
13 | multipart:
14 | max-file-size: 50MB
15 | max-request-size: 100MB
16 |
17 | #在windows本地部署不用配置,可以删掉这段配置
18 | redis:
19 | host: #在服务器上则写上服务器的ip地址
20 | port: 6379
21 | password: #密码(默认没有密码)
22 |
23 | datasource:
24 | druid:
25 | driver-class-name: com.mysql.cj.jdbc.Driver
26 | url: jdbc:mysql://ip地址:端口号(默认为3306)/music?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
27 | username: #用户名
28 | password: #密码
29 |
30 | token:
31 | expireTime: 259200000
32 | secretKey: abcdefghijklmnopqrstuvwxyz
33 |
34 | upload:
35 | mode: local
36 |
37 | local:
38 | # nginx映射本地文件路径
39 | url: http://localhost/
40 | #windows本地:http://localhost/
41 | #服务器:http://ip地址/ 或 https://域名/
42 | # 本地文件存储路径
43 | path: /upload/
44 | #windows本地:nginx默认挂载在C盘 若nginx挂载点在C:/upload路径 则配置为:/upload/
45 | #服务器:若nginx挂载点在/usr/local/upload路径 则配置为:/usr/local/upload/
46 |
47 | mybatis-plus:
48 | global-config:
49 | db-config:
50 | id-type: assign_id
51 |
--------------------------------------------------------------------------------
/music-view/src/api/Collect.js:
--------------------------------------------------------------------------------
1 | import axios from "../plugins/axios";
2 |
3 | export function addCollect(Collect) {
4 | return axios({
5 | url: "collect/add",
6 | method: "POST",
7 | data: {
8 | ...Collect,
9 | },
10 | });
11 | }
12 |
13 | export function cancelCollect(CollectVo) {
14 | return axios({
15 | url: "collect/cancel",
16 | method: "DELETE",
17 | data: {
18 | ...CollectVo,
19 | },
20 | });
21 | }
22 |
23 | export function getCollectBySongId(CollectVo) {
24 | return axios({
25 | url: "collect/getCollectBySongId",
26 | method: "POST",
27 | data: {
28 | ...CollectVo,
29 | },
30 | });
31 | }
32 |
33 | export function getAllCollectByConsumerId(userId) {
34 | return axios({
35 | url: `collect/collectOfConsumerId/${userId}`,
36 | method: "GET",
37 | });
38 | }
39 |
40 | export function getCollectBySongListId(CollectVo) {
41 | return axios({
42 | url: "collect/getCollectBySongListId",
43 | method: "POST",
44 | data: {
45 | ...CollectVo,
46 | },
47 | });
48 | }
49 |
50 | export function getAllCollectSongListByUserId(userId) {
51 | return axios({
52 | url: `collect/collectSongListOfUserId/${userId}`,
53 | method: "GET",
54 | });
55 | }
56 |
--------------------------------------------------------------------------------
/music-view/src/assets/css/setting.scss:
--------------------------------------------------------------------------------
1 | @import "var.scss";
2 | @import "global.scss";
3 |
4 | .setting {
5 | margin: 30px 10%;
6 | margin-top: $header-height + 20px;
7 | min-height: 65vh;
8 | @include layout;
9 | background-color: $color-white;
10 | border-radius: 12px;
11 | }
12 |
13 | /* 左侧导航栏 */
14 | .leftCol {
15 | margin-top: 10px;
16 | padding: 0 20px;
17 | box-sizing: border-box;
18 | width: 200px;
19 |
20 | .settingsMainHeader {
21 | height: 60px;
22 | line-height: 60px;
23 | font-size: 22px;
24 | font-weight: 500;
25 | }
26 | }
27 |
28 | .setting-aside {
29 | width: 100%;
30 | li {
31 | display: block;
32 | height: 40px;
33 | line-height: 40px;
34 | font-size: 18px;
35 | padding: 0 10px;
36 | box-sizing: border-box;
37 | border-radius: 5px;
38 | margin-right: 2px;
39 | cursor: pointer;
40 |
41 | &:hover {
42 | background-color: $color-blue-active;
43 | color: $color-white;
44 | }
45 | &:active {
46 | background-color: $color-blue-shallow;
47 | }
48 | }
49 | }
50 |
51 | .activeColor {
52 | background-color: $color-blue-shallow !important;
53 | color: $color-white;
54 | }
55 |
56 | /* 右边内容 */
57 | .contentCol {
58 | flex: 1;
59 | padding-top: 20px;
60 | }
61 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/vo/RecentSongVo.java:
--------------------------------------------------------------------------------
1 | package com.xs.vo;
2 |
3 | import com.fasterxml.jackson.databind.annotation.JsonSerialize;
4 | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
5 | import lombok.Builder;
6 | import lombok.Data;
7 |
8 | import java.io.Serial;
9 | import java.io.Serializable;
10 |
11 | @Builder
12 | @Data
13 | public class RecentSongVo implements Serializable {
14 |
15 | /**
16 | * 主键
17 | */
18 | @JsonSerialize(using = ToStringSerializer.class)
19 | private Long id;
20 |
21 | /**
22 | * 歌手id
23 | */
24 | @JsonSerialize(using = ToStringSerializer.class)
25 | private Long singerId;
26 |
27 | /**
28 | * 歌名
29 | */
30 | private String name;
31 |
32 | /**
33 | * 歌手名
34 | */
35 | private String singerName;
36 |
37 | /**
38 | * 简介
39 | */
40 | private String introduction;
41 |
42 | /**
43 | * 歌曲图片
44 | */
45 | private String pic;
46 |
47 | /**
48 | * 歌词
49 | */
50 | private String lyric;
51 |
52 | /**
53 | * 歌曲地址
54 | */
55 | private String url;
56 |
57 | /**
58 | * 播放量
59 | */
60 | private Integer playCount;
61 |
62 | @Serial
63 | private static final long serialVersionUID = 1L;
64 | }
65 |
--------------------------------------------------------------------------------
/music-view/src/components/ContentList.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -
9 |
10 |
![头像]()
11 |
12 |
15 |
16 |
17 | {{ item.name }}
18 | {{ item.title }}
19 |
20 |
21 |
22 |
23 |
24 |
40 |
41 |
44 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/mapper/SingerMapper.java:
--------------------------------------------------------------------------------
1 | package com.xs.mapper;
2 |
3 | import com.xs.domain.Singer;
4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5 | import com.xs.dto.SingerDto;
6 | import com.xs.vo.SingerVo;
7 | import org.apache.ibatis.annotations.Mapper;
8 | import org.springframework.stereotype.Repository;
9 |
10 | import java.util.List;
11 |
12 | /**
13 | * @author xs
14 | * description 针对表【singer(歌手)】的数据库操作Mapper
15 | * createDate 2022-10-05 15:08:13
16 | * Entity com.xs.domain.Singer
17 | */
18 | @Repository
19 | @Mapper
20 | public interface SingerMapper extends BaseMapper {
21 |
22 | /**
23 | * 查询所有歌手
24 | */
25 | List selectAllSinger();
26 |
27 | /**
28 | * 按歌手名称查询
29 | */
30 | List getSingerByName(String name);
31 |
32 | /**
33 | * 获取歌手总数
34 | */
35 | int getSingerCount();
36 |
37 | /**
38 | * 按歌手id查询歌手名
39 | */
40 | String getSingerNameById(Long id);
41 |
42 | /**
43 | * 按性别分组查询歌手数量
44 | */
45 | List getSingerCountBySex();
46 |
47 | /**
48 | * 按地区分组查询歌手数量
49 | */
50 | List getSingerCountByLocation();
51 |
52 | /**
53 | * 按性别查询歌手数量
54 | */
55 | Integer getAllSingerCountBySex(Integer sex);
56 | }
57 |
58 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/music-admin/src/api/Consumer.js:
--------------------------------------------------------------------------------
1 | import axios from "../plugins/axios";
2 |
3 | export function getAllConsumer() {
4 | return axios({
5 | url: "consumer/all",
6 | method: "GET",
7 | });
8 | }
9 |
10 | export function updateConsumer(Consumer) {
11 | return axios({
12 | url: "consumer/update",
13 | method: "PUT",
14 | data: {
15 | ...Consumer,
16 | },
17 | });
18 | }
19 |
20 | export function getConsumerByName(name) {
21 | return axios({
22 | url: `consumer/consumerOfName/${name}`,
23 | method: "GET",
24 | });
25 | }
26 |
27 | export function addConsumer(Consumer) {
28 | return axios({
29 | url: "consumer/add",
30 | method: "POST",
31 | data: {
32 | ...Consumer,
33 | },
34 | });
35 | }
36 |
37 | export function deleteConsumer(id) {
38 | return axios({
39 | url: `consumer/delete/${id}`,
40 | method: "DELETE",
41 | });
42 | }
43 |
44 | export function deleteAllConsumer(ids) {
45 | return axios({
46 | url: `consumer/deleteAll/${ids}`,
47 | method: "DELETE",
48 | });
49 | }
50 |
51 | export function getConsumerCount() {
52 | return axios({
53 | url: "consumer/getCount",
54 | method: "GET",
55 | });
56 | }
57 |
58 | export function getConsumerCountBySex() {
59 | return axios({
60 | url: "consumer/getCountBySex",
61 | method: "GET",
62 | });
63 | }
64 |
--------------------------------------------------------------------------------
/music-admin/src/api/Song.js:
--------------------------------------------------------------------------------
1 | import axios from "../plugins/axios";
2 |
3 | export function addSong(Song) {
4 | return axios({
5 | url: "song/add",
6 | method: "POST",
7 | data: {
8 | ...Song,
9 | },
10 | });
11 | }
12 |
13 | export function getAllSongBySingerId(id) {
14 | return axios({
15 | url: `song/allSong/${id}`,
16 | method: "GET",
17 | });
18 | }
19 |
20 | export function getAllSongByName(name) {
21 | return axios({
22 | url: `song/songOfName/${name}`,
23 | method: "GET",
24 | });
25 | }
26 |
27 | export function updateSong(Song) {
28 | return axios({
29 | url: "song/update",
30 | method: "PUT",
31 | data: {
32 | ...Song,
33 | },
34 | });
35 | }
36 |
37 | export function deleteSong(id) {
38 | return axios({
39 | url: `song/delete/${id}`,
40 | method: "DELETE",
41 | });
42 | }
43 |
44 | export function deleteAllSong(ids) {
45 | return axios({
46 | url: `song/deleteAll/${ids}`,
47 | method: "DELETE",
48 | });
49 | }
50 |
51 | export function getSongCount() {
52 | return axios({
53 | url: "song/getCount",
54 | method: "GET",
55 | });
56 | }
57 |
58 | export function getAllSongByNameAndSingerId(SongVo) {
59 | return axios({
60 | url: "song/songOfName",
61 | method: "POST",
62 | data: {
63 | ...SongVo,
64 | },
65 | });
66 | }
67 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/enums/FileExtEnum.java:
--------------------------------------------------------------------------------
1 | package com.xs.enums;
2 |
3 | import lombok.AllArgsConstructor;
4 | import lombok.Getter;
5 |
6 | /**
7 | * 文件扩展名枚举
8 | */
9 | @Getter
10 | @AllArgsConstructor
11 | public enum FileExtEnum {
12 | /**
13 | * jpg文件
14 | */
15 | JPG(".jpg", "jpg文件"),
16 | /**
17 | * png文件
18 | */
19 | PNG(".png", "png文件"),
20 | /**
21 | * Jpeg文件
22 | */
23 | JPEG(".jpeg", "jpeg文件"),
24 | /**
25 | * wav文件
26 | */
27 | WAV(".wav", "wav文件"),
28 | /**
29 | * md文件
30 | */
31 | MD(".md","markdown文件"),
32 | /**
33 | * txt文件
34 | */
35 | TXT(".txt","txt文件"),
36 |
37 | /**
38 | * 音频文件
39 | */
40 | MP3(".mp3", "mp3文件");
41 |
42 | /**
43 | * 获取文件格式
44 | *
45 | * @param extName 扩展名
46 | * @return {@link FileExtEnum} 文件格式
47 | */
48 | public static FileExtEnum getFileExt(String extName) {
49 | for (FileExtEnum value : FileExtEnum.values()) {
50 | if (value.getExtName().equalsIgnoreCase(extName)) {
51 | return value;
52 | }
53 | }
54 | return null;
55 | }
56 |
57 | /**
58 | * 扩展名
59 | */
60 | private final String extName;
61 |
62 | /**
63 | * 描述
64 | */
65 | private final String desc;
66 |
67 | }
68 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/common/Result.java:
--------------------------------------------------------------------------------
1 | package com.xs.common;
2 |
3 | import lombok.Data;
4 | import lombok.NoArgsConstructor;
5 |
6 | import java.io.Serial;
7 | import java.io.Serializable;
8 |
9 | /**
10 | * 封装响应结果
11 | */
12 | @NoArgsConstructor
13 | @Data
14 | public class Result implements Serializable {
15 | private Integer code;
16 | private String msg;
17 | private Object data;
18 |
19 | private Result(Integer code, String msg) {
20 | this.code = code;
21 | this.msg = msg;
22 | this.data = null;
23 | }
24 |
25 | private Result(Integer code, String msg, Object data) {
26 | this.code = code;
27 | this.msg = msg;
28 | this.data = data;
29 | }
30 |
31 | public static Result ok(String msg, Object data) {
32 | return new Result(200, msg, data);
33 | }
34 |
35 | public static Result ok(String msg) {
36 | return new Result(200, msg);
37 | }
38 |
39 | public static Result error(String msg) {
40 | return new Result(500, msg);
41 | }
42 |
43 | public static Result error() {
44 | return new Result(500, "异常错误");
45 | }
46 |
47 | public static Result create(Integer code, String msg, Object data) {
48 | return new Result(code, msg, data);
49 | }
50 |
51 | public static Result create(Integer code, String msg) {
52 | return new Result(code, msg);
53 | }
54 |
55 | @Serial
56 | private static final long serialVersionUID = 1L;
57 | }
58 |
--------------------------------------------------------------------------------
/music-view/src/assets/css/singer-album.scss:
--------------------------------------------------------------------------------
1 | @import "var.scss";
2 |
3 | .singer-album {
4 | margin-top: $header-height;
5 | padding-top: 150px;
6 | background-color: $theme-background-color;
7 |
8 | &::before {
9 | /*背景*/
10 | content: "";
11 | background-color: $theme-color;
12 | position: absolute;
13 | top: 0;
14 | width: 100%;
15 | height: $header-height + 150px;
16 | }
17 | }
18 |
19 | /*左*/
20 | .album-slide {
21 | float: left;
22 | width: 400px;
23 |
24 | .singer-img {
25 | position: relative;
26 | display: inline-block;
27 | height: 300px;
28 | width: 300px;
29 | top: -100px;
30 | left: 50px;
31 | border-radius: 10%;
32 | overflow: hidden;
33 | border: 5px solid $color-white;
34 | background-color: $color-white;
35 | img {
36 | width: 100%;
37 | }
38 | }
39 |
40 | .info {
41 | color: $color-black;
42 | font-size: 20px;
43 | font-weight: 500;
44 | margin-top: -80px;
45 | padding: 30px 40px 30px 60px;
46 | li {
47 | width: 100%;
48 | height: 40px;
49 | }
50 | }
51 | }
52 |
53 | /*右*/
54 | .album-content {
55 | margin-left: 300px;
56 | padding: 30px 100px;
57 | .intro {
58 | font-size: 20px;
59 | span {
60 | color: rgba(0, 0, 0, 0.5);
61 | }
62 | }
63 |
64 | .content {
65 | margin-top: 50px;
66 | }
67 | }
68 |
69 |
--------------------------------------------------------------------------------
/music-view/src/assets/css/leader-board.scss:
--------------------------------------------------------------------------------
1 | @import "var.scss";
2 |
3 | .leader-board-album {
4 | margin-top: $header-height;
5 | padding-top: 150px;
6 | background-color: $theme-background-color;
7 |
8 | &::before {
9 | /*背景*/
10 | content: "";
11 | background-color: $theme-color;
12 | position: absolute;
13 | top: 0;
14 | width: 100%;
15 | height: $header-height + 150px;
16 | }
17 | }
18 |
19 | /*左*/
20 | .album-slide {
21 | float: left;
22 | width: 400px;
23 |
24 | .leader-board-img {
25 | position: relative;
26 | display: inline-block;
27 | height: 300px;
28 | width: 300px;
29 | top: -100px;
30 | left: 50px;
31 | border-radius: 10%;
32 | overflow: hidden;
33 | border: 5px solid $color-white;
34 | background-color: $color-white;
35 | img {
36 | width: 100%;
37 | }
38 | }
39 |
40 | .info {
41 | color: $color-black;
42 | font-size: 20px;
43 | font-weight: 500;
44 | margin-top: -80px;
45 | padding: 30px 40px 30px 60px;
46 | li {
47 | width: 100%;
48 | height: 40px;
49 | }
50 | }
51 | }
52 |
53 | /*右*/
54 | .album-content {
55 | margin-left: 300px;
56 | padding: 30px 100px;
57 | .intro {
58 | font-size: 20px;
59 | span {
60 | color: rgba(0, 0, 0, 0.5);
61 | }
62 | }
63 |
64 | .content {
65 | margin-top: 50px;
66 | }
67 | }
68 |
69 |
--------------------------------------------------------------------------------
/music-view/src/components/Swiper.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
11 |
12 |
13 |
14 |
15 |
16 |
46 |
47 |
50 |
--------------------------------------------------------------------------------
/music-server/src/main/java/com/xs/config/RedisConfig.java:
--------------------------------------------------------------------------------
1 | package com.xs.config;
2 |
3 | import com.xs.util.FastJsonRedisSerializer;
4 | import org.springframework.context.annotation.Bean;
5 | import org.springframework.context.annotation.Configuration;
6 | import org.springframework.data.redis.connection.RedisConnectionFactory;
7 | import org.springframework.data.redis.core.RedisTemplate;
8 | import org.springframework.data.redis.serializer.StringRedisSerializer;
9 |
10 | @Configuration
11 | public class RedisConfig {
12 |
13 | @Bean
14 | @SuppressWarnings(value = { "unchecked", "rawtypes" })
15 | public RedisTemplate