├── .gitignore ├── .mvn └── wrapper │ ├── MavenWrapperDownloader.java │ ├── maven-wrapper.jar │ └── maven-wrapper.properties ├── README.md ├── classes └── production │ └── player-movie │ └── META-INF │ └── player-movie.kotlin_module ├── mvnw ├── mvnw.cmd ├── mysql.png ├── play.sql ├── player-circle ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── player │ │ └── circle │ │ ├── PlayerCircleApplication.java │ │ ├── config │ │ ├── AuthInterceptor.java │ │ ├── Swagger2Configuration.java │ │ └── WebAppConfig.java │ │ ├── controller │ │ └── CircleController.java │ │ ├── entity │ │ ├── CircleEntity.java │ │ ├── HotCommentMovieEntity.java │ │ └── LogCircleEntity.java │ │ ├── mapper │ │ └── CircleMapper.java │ │ └── service │ │ ├── ICircleService.java │ │ └── imp │ │ └── CircleService.java │ └── resources │ ├── application.yml │ ├── log4j.properties │ └── mapper │ └── CircleMapper.xml ├── player-common ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── player │ │ └── common │ │ ├── entity │ │ ├── AuthorEntity.java │ │ ├── CommentEntity.java │ │ ├── LikeEntity.java │ │ ├── LogEntity.java │ │ ├── PasswordEntity.java │ │ ├── ResultEntity.java │ │ ├── ResultUtil.java │ │ ├── SearchHistory.java │ │ └── UserEntity.java │ │ ├── myInterface │ │ └── OperLog.java │ │ └── utils │ │ ├── Common.java │ │ ├── HttpUtils.java │ │ ├── JwtToken.java │ │ ├── OperationType.java │ │ └── ResultCode.java │ └── resources │ └── application.yml ├── player-ebook ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── player │ │ │ └── ebook │ │ │ ├── EbookApplication.java │ │ │ ├── aspect │ │ │ └── LogAspect.java │ │ │ ├── config │ │ │ ├── AuthInterceptor.java │ │ │ ├── Swagger2Configuration.java │ │ │ └── WebAppConfig.java │ │ │ ├── controller │ │ │ └── BookController.java │ │ │ ├── entity │ │ │ ├── BannerEntity.java │ │ │ ├── BookChapterEntity.java │ │ │ ├── BookEntity.java │ │ │ ├── BookLikesEntity.java │ │ │ └── BookRelationEntity.java │ │ │ ├── mapper │ │ │ └── BookMapper.java │ │ │ └── service │ │ │ ├── IBookService.java │ │ │ └── imp │ │ │ └── BookService.java │ └── resources │ │ ├── application.yml │ │ └── mapper │ │ └── BookMapper.xml │ └── test │ └── java │ └── com │ └── player │ └── ebook │ └── EbookApplicationTests.java ├── player-learn ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── player │ │ │ └── learn │ │ │ ├── LearnApplication.java │ │ │ ├── aspect │ │ │ └── LogAspect.java │ │ │ ├── config │ │ │ └── Swagger2Configuration.java │ │ │ ├── controller │ │ │ ├── FileStaticController.java │ │ │ └── LearnController.java │ │ │ ├── dao │ │ │ ├── ChapterDao.java │ │ │ ├── ChapterLogDao.java │ │ │ ├── CourseDao.java │ │ │ ├── CourseLogDao.java │ │ │ └── LogDao.java │ │ │ ├── entity │ │ │ ├── ChapterEntity.java │ │ │ ├── ChapterLogEntity.java │ │ │ ├── CourseEntity.java │ │ │ ├── CourseLogEntity.java │ │ │ └── LogEntity.java │ │ │ └── service │ │ │ ├── IChapterService.java │ │ │ ├── ICourseService.java │ │ │ └── imp │ │ │ ├── ChapterService.java │ │ │ └── CourseService.java │ └── resources │ │ └── application.yml │ └── test │ └── java │ └── com │ └── player │ └── learn │ └── LearnApplicationTests.java ├── player-movie ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── player │ │ └── movie │ │ ├── PlayerMovieApplication.java │ │ ├── config │ │ ├── AuthInterceptor.java │ │ ├── Swagger2Configuration.java │ │ └── WebAppConfig.java │ │ ├── controller │ │ └── MovieController.java │ │ ├── entity │ │ ├── MovieEntity.java │ │ ├── MovieStarEntity.java │ │ └── MovieUrlEntity.java │ │ ├── mapper │ │ └── MovieMapper.java │ │ └── service │ │ ├── IMovieService.java │ │ └── imp │ │ └── MovieService.java │ └── resources │ ├── application.yml │ ├── log4j.properties │ └── mapper │ └── MovieMapper.xml ├── player-music ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── player │ │ └── music │ │ ├── PlayerMusicApplication.java │ │ ├── aspect │ │ └── LogAspect.java │ │ ├── config │ │ ├── AuthInterceptor.java │ │ ├── Swagger2Configuration.java │ │ └── WebAppConfig.java │ │ ├── controller │ │ └── MyMusicController.java │ │ ├── entity │ │ ├── DouyinEntity.java │ │ ├── FavoriteMusicEntity.java │ │ ├── LogEntity.java │ │ ├── MusicAuthorEntity.java │ │ ├── MusicClassifyEntity.java │ │ ├── MyMusiPlayMenuEntity.java │ │ ├── MyMusicAuthorCategoryEntity.java │ │ ├── MyMusicAuthorEntity.java │ │ ├── MyMusicEntity.java │ │ ├── MyMusicFavoriteDirectoryEntity.java │ │ ├── MyMusicFavoriteEntity.java │ │ ├── MyMusicRecordEntity.java │ │ ├── RecordEntity.java │ │ ├── ResultEntity.java │ │ └── UserEntity.java │ │ ├── mapper │ │ └── MyMusicMapper.java │ │ ├── service │ │ ├── IMyMusicService.java │ │ └── imp │ │ │ └── MyMusicService.java │ │ └── utils │ │ ├── CookieUtils.java │ │ └── RedisUitls.java │ └── resources │ ├── application.yml │ ├── log4j.properties │ └── mapper │ └── MyMusicMapper.xml ├── player-parent └── pom.xml ├── player-social ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── player │ │ └── circle │ │ ├── PlayerSocialApplication.java │ │ ├── config │ │ ├── AuthInterceptor.java │ │ ├── Swagger2Configuration.java │ │ └── WebAppConfig.java │ │ ├── controller │ │ └── SocialController.java │ │ ├── mapper │ │ └── SocialMapper.java │ │ └── service │ │ ├── ISocialService.java │ │ └── imp │ │ └── SocialService.java │ └── resources │ ├── application.yml │ ├── log4j.properties │ └── mapper │ └── SocialMapper.xml ├── player-toutiao ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── player │ │ │ └── toutiao │ │ │ ├── PlayerToutiaoApplication.java │ │ │ ├── aspect │ │ │ └── LogAspect.java │ │ │ ├── config │ │ │ ├── AuthInterceptor.java │ │ │ ├── Swagger2Configuration.java │ │ │ └── WebAppConfig.java │ │ │ ├── controller │ │ │ └── ToutiaoController.java │ │ │ ├── entity │ │ │ ├── ArticleEntity.java │ │ │ ├── ChannelEntity.java │ │ │ └── CommentEntity.java │ │ │ ├── mapper │ │ │ └── ToutiaoMapper.java │ │ │ ├── service │ │ │ ├── IToutiaoService.java │ │ │ └── imp │ │ │ │ └── ToutiaoService.java │ │ │ └── utils │ │ │ └── RedisCacheUtil.java │ └── resources │ │ ├── application.yml │ │ └── mapper │ │ └── ToutiaoMapper.xml │ └── test │ └── java │ └── com │ └── player │ └── toutiao │ └── PlayerToutiaoApplicationTests.java ├── player-user ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── player │ │ └── user │ │ ├── PlayerUserApplication.java │ │ ├── config │ │ ├── AuthInterceptor.java │ │ ├── Swagger2Configuration.java │ │ └── WebAppConfig.java │ │ ├── controller │ │ └── UserController.java │ │ ├── entity │ │ ├── MailEntity.java │ │ ├── PasswordEntity.java │ │ └── ResetPasswordEntity.java │ │ ├── mapper │ │ └── UserMapper.java │ │ └── service │ │ ├── IUserService.java │ │ └── imp │ │ └── UserService.java │ └── resources │ ├── application.yml │ └── mapper │ └── UserMapper.xml ├── player-video ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── player │ │ └── video │ │ ├── PlayerVideoApplication.java │ │ ├── aspect │ │ └── LogAspect.java │ │ ├── config │ │ ├── AuthInterceptor.java │ │ ├── Swagger2Configuration.java │ │ └── WebAppConfig.java │ │ ├── controller │ │ └── VideoController.java │ │ ├── entity │ │ ├── ChannelEntity.java │ │ ├── CommentEntity.java │ │ └── VideoEntity.java │ │ ├── mapper │ │ └── VideoMapper.java │ │ └── service │ │ ├── IVideoService.java │ │ └── imp │ │ └── VideoService.java │ └── resources │ ├── application.yml │ └── mapper │ └── VideoMapper.xml ├── pom.xml ├── user.sql ├── 一键提交到gitee.bat ├── 一键提交到github.bat ├── 发说说.jpg ├── 在线音乐app整体预览.jpg ├── 外网映射正常访问提示.png ├── 明日头条app整体效果图(待更新).jpg ├── 明日头条app整体效果图(待更新).jpg.lnk ├── 电影app整体预览.jpg ├── 电影圈.jpg ├── 静态资源.png └── 音乐整体预览图.png /.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuyuanwuhui99/springboot-app-service/3cf924cf4fcc905514c081aa637d871c161b5a1f/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /classes/production/player-movie/META-INF/player-movie.kotlin_module: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /mysql.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuyuanwuhui99/springboot-app-service/3cf924cf4fcc905514c081aa637d871c161b5a1f/mysql.png -------------------------------------------------------------------------------- /player-circle/src/main/java/com/player/circle/PlayerCircleApplication.java: -------------------------------------------------------------------------------- 1 | package com.player.circle; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | @SpringBootApplication(scanBasePackages = "com.player.circle") 8 | @MapperScan("com.player.circle.mapper") 9 | public class PlayerCircleApplication { 10 | public static void main(String[] args) { 11 | SpringApplication.run(PlayerCircleApplication.class, args); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /player-circle/src/main/java/com/player/circle/config/AuthInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.player.circle.config; 2 | 3 | import com.alibaba.fastjson.JSONObject; 4 | import com.player.common.entity.ResultEntity; 5 | import com.player.common.entity.ResultUtil; 6 | import com.player.common.entity.UserEntity; 7 | import com.player.common.utils.JwtToken; 8 | import com.player.common.utils.ResultCode; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.beans.factory.annotation.Value; 11 | import org.springframework.data.redis.core.RedisTemplate; 12 | import org.springframework.web.servlet.HandlerInterceptor; 13 | 14 | import javax.servlet.http.HttpServletRequest; 15 | import javax.servlet.http.HttpServletResponse; 16 | import java.io.IOException; 17 | import java.io.PrintWriter; 18 | 19 | public class AuthInterceptor implements HandlerInterceptor { 20 | @Value("${token.secret}") 21 | private String secret; 22 | 23 | @Autowired 24 | private RedisTemplate redisTemplate; 25 | 26 | @Override 27 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { 28 | String token = request.getHeader("Authorization"); 29 | if (token == null || redisTemplate.opsForValue().get(token) == null) { 30 | renderJson(response, ResultUtil.fail("未通过登录认证", null, ResultCode.LOGOUT)); 31 | return false; 32 | } 33 | UserEntity userEntity = JwtToken.parserToken(token, UserEntity.class,secret); 34 | if (userEntity == null) { 35 | response.setContentType("application/json;charset=UTF-8"); 36 | //设置编码格式 37 | response.setCharacterEncoding("UTF-8"); 38 | response.setStatus(401); 39 | response.getWriter().write("未通过登录认证,请在登录页面登录"); 40 | renderJson(response, ResultUtil.fail("未通过登录认证", ResultCode.LOGOUT)); 41 | return false; 42 | } 43 | return true; 44 | } 45 | 46 | protected void renderJson(HttpServletResponse response, ResultEntity resultEntity) { 47 | String dataJson = JSONObject.toJSONString(resultEntity); 48 | PrintWriter writer; 49 | try { 50 | response.setContentType("application/json; charset=utf-8"); 51 | writer = response.getWriter(); 52 | writer.write(dataJson); 53 | writer.flush(); 54 | return; 55 | } catch (IOException e) { 56 | throw new RuntimeException(e); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /player-circle/src/main/java/com/player/circle/config/Swagger2Configuration.java: -------------------------------------------------------------------------------- 1 | package com.player.circle.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import springfox.documentation.builders.ApiInfoBuilder; 6 | import springfox.documentation.builders.PathSelectors; 7 | import springfox.documentation.builders.RequestHandlerSelectors; 8 | import springfox.documentation.service.ApiInfo; 9 | import springfox.documentation.spi.DocumentationType; 10 | import springfox.documentation.spring.web.plugins.Docket; 11 | import springfox.documentation.swagger2.annotations.EnableSwagger2; 12 | 13 | 14 | @Configuration 15 | @EnableSwagger2 16 | public class Swagger2Configuration { 17 | @Bean 18 | public Docket createRestApi() { 19 | return new Docket(DocumentationType.SWAGGER_2) 20 | .apiInfo(apiInfo()) 21 | .select() 22 | .apis(RequestHandlerSelectors.basePackage("com.player")) 23 | .paths(PathSelectors.any()) 24 | .build(); 25 | } 26 | 27 | private ApiInfo apiInfo() { 28 | return new ApiInfoBuilder() 29 | .title("评论") 30 | .description("电影、电影圈,文章等评论") 31 | .version("1.0") 32 | .build(); 33 | } 34 | 35 | } 36 | 37 | -------------------------------------------------------------------------------- /player-circle/src/main/java/com/player/circle/config/WebAppConfig.java: -------------------------------------------------------------------------------- 1 | package com.player.circle.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.web.servlet.config.annotation.InterceptorRegistration; 6 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; 7 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 8 | 9 | /** 10 | * @Description:拦截器配置 11 | * @author: zk 12 | * @date: 2020年12月25日 21:41 13 | */ 14 | @Configuration 15 | public class WebAppConfig implements WebMvcConfigurer { 16 | @Bean 17 | public AuthInterceptor getAuthInterceptor() { 18 | return new AuthInterceptor(); 19 | } 20 | 21 | @Override 22 | public void addInterceptors(InterceptorRegistry registry) { 23 | //注册TestInterceptor拦截器 24 | InterceptorRegistration registration = registry.addInterceptor(getAuthInterceptor()); 25 | registration.addPathPatterns("/service/circle-getway/**"); //所有路径都被拦截 26 | registration.excludePathPatterns( //添加不拦截路径 27 | "/**/*.html", //html静态资源 28 | "/**/*.js", //js静态资源 29 | "/**/*.css", //css静态资源 30 | "/**/*.woff", 31 | "/**/*.ttf" 32 | ); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /player-circle/src/main/java/com/player/circle/controller/CircleController.java: -------------------------------------------------------------------------------- 1 | package com.player.circle.controller; 2 | 3 | import com.player.circle.entity.CircleEntity; 4 | import com.player.circle.service.ICircleService; 5 | import com.player.common.entity.ResultEntity; 6 | import com.player.common.utils.HttpUtils; 7 | import io.swagger.annotations.Api; 8 | import io.swagger.annotations.ApiOperation; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.web.bind.annotation.*; 11 | 12 | import javax.servlet.http.HttpServletRequest; 13 | 14 | @RequestMapping("/service") 15 | @Api(value = "电影圈", description = "新增,查询,修改,删除电影圈") 16 | @RestController 17 | public class CircleController { 18 | @Autowired 19 | private ICircleService circleService; 20 | 21 | @ApiOperation("获取朋友圈列表") 22 | @GetMapping("/circle/getCircleListByType") 23 | public ResultEntity getCircleListByType( 24 | @RequestParam("pageSize") int pageSize, 25 | @RequestParam("pageNum") int pageNum, 26 | @RequestParam("type") String type 27 | ) { 28 | return circleService.getCircleListByType(pageNum, pageSize, type); 29 | } 30 | 31 | @ApiOperation("获取文章的评论数量,浏览数量,收藏数量") 32 | @GetMapping("/circle/getCircleArticleCount") 33 | public ResultEntity getCircleArticleCount(@RequestParam("id") int id) { 34 | return circleService.getCircleArticleCount(id); 35 | } 36 | 37 | @ApiOperation("获取热门影评") 38 | @GetMapping("/circle/getHotCommentMovie") 39 | public ResultEntity getHotCommentMovie( HttpServletRequest request) { 40 | return circleService.getHotCommentMovie(HttpUtils.getPath(request)); 41 | } 42 | 43 | @ApiOperation("获取最近更新的影片") 44 | @GetMapping("/circle/getLastModifyMovie") 45 | public ResultEntity getLastModifyMovie( HttpServletRequest request) { 46 | return circleService.getLastModifyMovie(HttpUtils.getPath(request)); 47 | } 48 | 49 | @ApiOperation("保存图片和文字") 50 | @PostMapping("/circle-getway/insertCircle") 51 | public ResultEntity saveSay(@RequestBody CircleEntity circleEntity, @RequestHeader("Authorization") String token) { 52 | return circleService.insertCircle(circleEntity,token); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /player-circle/src/main/java/com/player/circle/entity/CircleEntity.java: -------------------------------------------------------------------------------- 1 | package com.player.circle.entity; 2 | 3 | import com.player.common.entity.CommentEntity; 4 | import com.player.common.entity.LikeEntity; 5 | import io.swagger.annotations.ApiModelProperty; 6 | import lombok.Data; 7 | 8 | import javax.persistence.*; 9 | import java.util.Date; 10 | import java.util.List; 11 | 12 | @Data 13 | public class CircleEntity { 14 | 15 | @ApiModelProperty(value = "主键") 16 | @Id 17 | @GeneratedValue(strategy = GenerationType.IDENTITY) 18 | private Long id; 19 | 20 | @ApiModelProperty(value = "关联音乐audio_id或者电影movie_id") 21 | private Long relationId; 22 | 23 | @ApiModelProperty(value = "朋友圈内容") 24 | private String content; 25 | 26 | @ApiModelProperty(value = "朋友圈图片") 27 | private String imgs; 28 | 29 | @ApiModelProperty(value = "类型") 30 | private String type; 31 | 32 | @ApiModelProperty(value = "用户id") 33 | private String userId; 34 | 35 | @ApiModelProperty(value = "用户的昵称") 36 | private String username; 37 | 38 | @ApiModelProperty(value = "用户头像") 39 | private String useravater; 40 | 41 | @ApiModelProperty(value = "权限,0不公开,1公开") 42 | private int permission; 43 | 44 | @ApiModelProperty(value = "创建时间") 45 | private Date createTime; 46 | 47 | @ApiModelProperty(value = "更新时间") 48 | private Date updateTime; 49 | 50 | @ApiModelProperty(value = "歌曲名称") 51 | private String musicSongName; 52 | 53 | @ApiModelProperty(value = "歌曲id") 54 | private String musicAudioId; 55 | 56 | @ApiModelProperty(value = "歌曲作者") 57 | private String musicAuthorName; 58 | 59 | @ApiModelProperty(value = "专辑名称") 60 | private String musicAlbumName; 61 | 62 | @ApiModelProperty(value = "音乐图片") 63 | private String musicCover; 64 | 65 | @ApiModelProperty(value = "音乐播放地址") 66 | private String musicPlayUrl; 67 | 68 | @ApiModelProperty(value = "音乐本地播放地址") 69 | private String musicLocalPlayUrl; 70 | 71 | @ApiModelProperty(value = "歌词") 72 | private String musicLyrics; 73 | 74 | @ApiModelProperty(value = "电影id") 75 | private String movieId; 76 | 77 | @ApiModelProperty(value = "电影名称") 78 | private String movieName; 79 | 80 | @ApiModelProperty(value = "电影导演") 81 | private String movieDirector; 82 | 83 | @ApiModelProperty(value = "电影主演") 84 | private String movieStar; 85 | 86 | @ApiModelProperty(value = "电影类型") 87 | private String movieType; 88 | 89 | @ApiModelProperty(value = "电影上映国家") 90 | private String movieCountryLanguage; 91 | 92 | @ApiModelProperty(value = "电影状态") 93 | private String movieViewingState; 94 | 95 | @ApiModelProperty(value = "上映时间") 96 | private String movieReleaseTime; 97 | 98 | @ApiModelProperty(value = "电影海报") 99 | private String movieImg; 100 | 101 | @ApiModelProperty(value = "电影分类") 102 | private String movieClassify; 103 | 104 | @ApiModelProperty(value = "电影本地图片") 105 | private String movieLocalImg; 106 | 107 | @ApiModelProperty(value = "电影得分") 108 | private String movieScore; 109 | 110 | @ApiModelProperty(value = "喜欢列表") 111 | private List circleLikes; 112 | 113 | @ApiModelProperty(value = "喜欢列表") 114 | private List circleComments; 115 | } 116 | -------------------------------------------------------------------------------- /player-circle/src/main/java/com/player/circle/entity/HotCommentMovieEntity.java: -------------------------------------------------------------------------------- 1 | package com.player.circle.entity; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | 6 | import javax.persistence.*; 7 | import java.io.Serializable; 8 | import java.util.Date; 9 | 10 | @Data 11 | @Entity 12 | @Table(name = "movie_recommend") 13 | public class HotCommentMovieEntity implements Serializable { 14 | @ApiModelProperty(value = "主键") 15 | @Id 16 | @GeneratedValue(strategy = GenerationType.IDENTITY) 17 | @Column(name = "id") 18 | private int id; 19 | 20 | @Column(name = "movie_name") 21 | private String movieName; 22 | 23 | @Column(name = "href") 24 | private String href; 25 | 26 | @Column(name = "label") 27 | private String label; 28 | 29 | @Column(name = "source_url") 30 | private String sourceUrl; 31 | 32 | @Column(name = "rank") 33 | private int rank; 34 | 35 | @Column(name = "classify") 36 | private String classify; 37 | 38 | @Column(name = "create_time") 39 | private Date createTime; 40 | 41 | @Column(name = "update_time") 42 | private Date updateTime; 43 | } 44 | -------------------------------------------------------------------------------- /player-circle/src/main/java/com/player/circle/entity/LogCircleEntity.java: -------------------------------------------------------------------------------- 1 | package com.player.circle.entity; 2 | 3 | public class LogCircleEntity { 4 | private int circleId; 5 | private String userId; 6 | 7 | public int getCircleId() { 8 | return circleId; 9 | } 10 | 11 | public void setCircleId(int circleId) { 12 | this.circleId = circleId; 13 | } 14 | 15 | public String getUserId() { 16 | return userId; 17 | } 18 | 19 | public void setUserId(String userId) { 20 | this.userId = userId; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /player-circle/src/main/java/com/player/circle/mapper/CircleMapper.java: -------------------------------------------------------------------------------- 1 | package com.player.circle.mapper; 2 | 3 | import com.player.circle.entity.CircleEntity; 4 | import com.player.circle.entity.HotCommentMovieEntity; 5 | import org.springframework.stereotype.Repository; 6 | 7 | import java.util.List; 8 | import java.util.Map; 9 | 10 | @Repository 11 | public interface CircleMapper { 12 | 13 | List getCircleListByType(int start, int pageSize,String type); 14 | 15 | Map getCircleArticleCount(int id); 16 | 17 | Long getCircleCount(String type); 18 | 19 | ListgetHotCommentMovie(); 20 | 21 | ListgetLastModifyMovie(); 22 | 23 | Integer insertCircle(CircleEntity circleEntity); 24 | } 25 | -------------------------------------------------------------------------------- /player-circle/src/main/java/com/player/circle/service/ICircleService.java: -------------------------------------------------------------------------------- 1 | package com.player.circle.service; 2 | 3 | import com.player.circle.entity.CircleEntity; 4 | import com.player.common.entity.ResultEntity; 5 | 6 | public interface ICircleService { 7 | 8 | ResultEntity getCircleListByType(int pageNum, int pageSize, String type); 9 | 10 | ResultEntity getCircleArticleCount(int id); 11 | 12 | ResultEntity getHotCommentMovie(String path); 13 | 14 | ResultEntity getLastModifyMovie(String path); 15 | 16 | ResultEntity insertCircle(CircleEntity circleEntity, String token); 17 | } 18 | -------------------------------------------------------------------------------- /player-circle/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | static: 2 | upload-path: F:/static/circle/ 3 | server: 4 | port: 3004 5 | tomcat: 6 | uri-encoding: UTF-8 7 | token: 8 | expiration-time: 2592000000 #token失效时间一个月 1000 * 60 * 60 * 24 * 30 9 | secret: ${SECRET} #token秘钥 10 | app: 11 | appId: com.player.circle 12 | appName: 电影圈 13 | spring: 14 | jackson: 15 | date-format: yyyy-MM-dd HH:mm:ss 16 | time-zone: GMT+8 17 | http: 18 | encoding: 19 | charset: UTF-8 20 | force: true 21 | enabled: true 22 | redis: 23 | database: 0 # Redis数据库索引(默认为0) 24 | host: 127.0.0.1 # Redis服务器地址 25 | port: 6379 # Redis服务器连接端口 26 | password: # Redis服务器连接密码(默认为空) 27 | timeout: 5000 # 连接超时时间(毫秒) 28 | jedis: 29 | pool: 30 | max-active: 8 # 连接池最大连接数(使用负值表示没有限制) 31 | max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制) 32 | max-idle: 8 # 连接池中的最大空闲连接 33 | min-idle: 0 # 连接池中的最小空闲连接 34 | application: 35 | name: player-circle 36 | datasource: 37 | druid: 38 | url: jdbc:mysql://localhost:3306/play?characterEncoding=utf-8 39 | username: root 40 | password: wwq_2021 41 | driverClassName: com.mysql.jdbc.Driver 42 | initialSize: 5 #初始建立连接数量 43 | minIdle: 5 #最小连接数量 44 | maxActive: 20 #最大连接数量 45 | maxWait: 10000 #获取连接最大等待时间,毫秒 46 | testOnBorrow: true #申请连接时检测连接是否有效 47 | testOnReturn: false #归还连接时检测连接是否有效 48 | timeBetweenEvictionRunsMillis: 60000 #配置间隔检测连接是否有效的时间(单位是毫秒) 49 | minEvictableIdleTimeMillis: 300000 #连接在连接池的最小生存时间(毫秒) 50 | #mybatis: 51 | # mapper-locations: classpath:mapper/*Mapper.xml 52 | 53 | mybatis: 54 | mapper-locations: classpath:mapper/*Mapper.xml 55 | type-aliases-package: com.player.circle.entity 56 | configuration: 57 | map-underscore-to-camel-case: true 58 | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl -------------------------------------------------------------------------------- /player-circle/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuyuanwuhui99/springboot-app-service/3cf924cf4fcc905514c081aa637d871c161b5a1f/player-circle/src/main/resources/log4j.properties -------------------------------------------------------------------------------- /player-common/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | com.player.common 7 | player-common 8 | 0.0.1-SNAPSHOT 9 | 10 | 11 | io.jsonwebtoken 12 | jjwt 13 | 14 | 15 | 16 | com.alibaba 17 | fastjson 18 | 19 | 20 | org.projectlombok 21 | lombok 22 | 23 | 24 | io.swagger 25 | swagger-annotations 26 | 27 | 28 | org.slf4j 29 | slf4j-api 30 | 31 | 32 | org.apache.httpcomponents 33 | httpclient 34 | 35 | 36 | org.springframework.boot 37 | spring-boot-starter-web 38 | 39 | 40 | org.apache.tomcat.embed 41 | tomcat-embed-core 42 | 43 | 44 | player-common 45 | player-movie project for Spring Boot 46 | 47 | player-parent 48 | com.player 49 | 1.0-SNAPSHOT 50 | ../player-parent/pom.xml 51 | 52 | 53 | 1.8 54 | UTF-8 55 | UTF-8 56 | 57 | -------------------------------------------------------------------------------- /player-common/src/main/java/com/player/common/entity/AuthorEntity.java: -------------------------------------------------------------------------------- 1 | package com.player.common.entity; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | import lombok.ToString; 6 | 7 | @Data 8 | @ToString 9 | public class AuthorEntity { 10 | @ApiModelProperty(value = "主键") 11 | private Long id;//主键 12 | 13 | @ApiModelProperty(value = "用户id") 14 | private String authorId; 15 | 16 | @ApiModelProperty(value = "用户名称") 17 | private String name; 18 | 19 | @ApiModelProperty(value = "用户签名") 20 | private String authorDesc; 21 | 22 | @ApiModelProperty(value = "头像地址") 23 | private String avatarUrl; 24 | 25 | @ApiModelProperty(value = "用户描述") 26 | private String description; 27 | 28 | @ApiModelProperty(value = "粉丝数量") 29 | private String followersCount; 30 | 31 | @ApiModelProperty(value = "核实内容") 32 | private String verifiedContent; 33 | 34 | @ApiModelProperty(value = "创建时间") 35 | private String createTime; 36 | 37 | @ApiModelProperty(value = "更新时间") 38 | private String updateTime; 39 | 40 | @ApiModelProperty(value = "用户连接地址") 41 | private String authorHref; 42 | } 43 | -------------------------------------------------------------------------------- /player-common/src/main/java/com/player/common/entity/CommentEntity.java: -------------------------------------------------------------------------------- 1 | package com.player.common.entity; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | import lombok.ToString; 6 | 7 | import java.util.Date; 8 | import java.util.List; 9 | 10 | @Data 11 | @ToString 12 | public class CommentEntity { 13 | @ApiModelProperty(value = "主键") 14 | private Long id;//主键 15 | 16 | @ApiModelProperty(value = "评论内容") 17 | private String content; 18 | 19 | @ApiModelProperty(value = "父节点id") 20 | private Long parentId; 21 | 22 | @ApiModelProperty(value = "顶级节点id") 23 | private Long topId; 24 | 25 | @ApiModelProperty(value = "关联的影片id") 26 | private Long relationId; 27 | 28 | @ApiModelProperty(value = "类型,movie,aiqiyi,article") 29 | private String type; 30 | 31 | @ApiModelProperty(value = "创建时间") 32 | private Date createTime; 33 | 34 | @ApiModelProperty(value = "更新时间") 35 | private Date updateTime; 36 | 37 | @ApiModelProperty(value = "回复数量") 38 | private int replyCount; 39 | 40 | @ApiModelProperty(value = "用户id") 41 | private String userId; 42 | 43 | @ApiModelProperty(value = "用户名") 44 | private String username; 45 | 46 | @ApiModelProperty(value = "用户头像") 47 | private String avater; 48 | 49 | @ApiModelProperty(value = "被回复者id") 50 | private String replyUserId; 51 | 52 | @ApiModelProperty(value = "被回复者名称") 53 | private String replyUserName; 54 | 55 | @ApiModelProperty(value = "回复者列表") 56 | private List replyList; 57 | } 58 | -------------------------------------------------------------------------------- /player-common/src/main/java/com/player/common/entity/LikeEntity.java: -------------------------------------------------------------------------------- 1 | package com.player.common.entity; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | import lombok.ToString; 6 | 7 | import java.util.Date; 8 | 9 | @Data 10 | @ToString 11 | public class LikeEntity { 12 | @ApiModelProperty(value = "主键") 13 | private Long id;//主键 14 | 15 | @ApiModelProperty(value = "类型,movie,aiqiyi,article") 16 | private String type; 17 | 18 | @ApiModelProperty(value = "用户id") 19 | private String userId; 20 | 21 | @ApiModelProperty(value = "用户名称") 22 | private String username; 23 | 24 | @ApiModelProperty(value = "关联的影片id") 25 | private Long relationId; 26 | 27 | @ApiModelProperty(value = "创建时间") 28 | private Date createTime; 29 | 30 | @ApiModelProperty(value = "更新时间") 31 | private Date updateTime; 32 | } 33 | -------------------------------------------------------------------------------- /player-common/src/main/java/com/player/common/entity/PasswordEntity.java: -------------------------------------------------------------------------------- 1 | package com.player.common.entity; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | import lombok.ToString; 6 | 7 | @Data 8 | @ToString 9 | public class PasswordEntity { 10 | @ApiModelProperty(value = "用户id") 11 | private String userId; 12 | 13 | @ApiModelProperty(value = "新密码") 14 | private String newPassword; 15 | 16 | @ApiModelProperty(value = "旧密码") 17 | private String oldPassword; 18 | } 19 | -------------------------------------------------------------------------------- /player-common/src/main/java/com/player/common/entity/ResultEntity.java: -------------------------------------------------------------------------------- 1 | package com.player.common.entity; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | 5 | import java.io.Serializable; 6 | 7 | public class ResultEntity implements Serializable { 8 | 9 | @ApiModelProperty(value = "数据") 10 | private Object data; 11 | 12 | @ApiModelProperty(value = "状态") 13 | private String status; 14 | 15 | @ApiModelProperty(value = "信息") 16 | private String msg; 17 | 18 | @ApiModelProperty(value = "总页数") 19 | private Long total; 20 | 21 | @ApiModelProperty(value = "token") 22 | private String token; 23 | 24 | public Object getData() { 25 | return data; 26 | } 27 | 28 | public void setData(Object data) { 29 | this.data = data; 30 | } 31 | 32 | public String getStatus() { 33 | return status; 34 | } 35 | 36 | public void setStatus(String status) { 37 | this.status = status; 38 | } 39 | 40 | public String getMsg() { 41 | return msg; 42 | } 43 | 44 | public void setMsg(String msg) { 45 | this.msg = msg; 46 | } 47 | 48 | public Long getTotal() { 49 | return total; 50 | } 51 | 52 | public void setTotal(Long total) { 53 | this.total = total; 54 | } 55 | 56 | public String getToken() { 57 | return token; 58 | } 59 | 60 | public void setToken(String token) { 61 | this.token = token; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /player-common/src/main/java/com/player/common/entity/ResultUtil.java: -------------------------------------------------------------------------------- 1 | package com.player.common.entity; 2 | 3 | 4 | import com.player.common.entity.ResultEntity; 5 | import com.player.common.utils.ResultCode; 6 | 7 | public class ResultUtil { 8 | /** 9 | * @author: wuwenqiang 10 | * @methodsName: success 11 | * @description: 成功的返回数据 12 | * @return: Object返回数据的data 13 | * @date: 2020-07-25 8:26 14 | */ 15 | public static ResultEntity success(Object object) { 16 | ResultEntity resultEntity = new ResultEntity(); 17 | resultEntity.setData(object); 18 | resultEntity.setStatus(ResultCode.SUCCESS); 19 | return resultEntity; 20 | } 21 | 22 | /** 23 | * @author: wuwenqiang 24 | * @methodsName: success 25 | * @description: 成功的返回数据 26 | * @return: Object返回数据的data 27 | * @date: 2020-07-25 8:26 28 | */ 29 | public static ResultEntity success(Object object, String msg) { 30 | ResultEntity resultEntity = new ResultEntity(); 31 | resultEntity.setData(object); 32 | resultEntity.setMsg(msg); 33 | resultEntity.setStatus(ResultCode.SUCCESS); 34 | return resultEntity; 35 | } 36 | 37 | /** 38 | * @author: wuwenqiang 39 | * @methodsName: success 40 | * @description: 成功的返回数据 41 | * @return: Object返回数据的data 42 | * @date: 2020-07-25 8:26 43 | */ 44 | public static ResultEntity success(Object object, Long total) { 45 | ResultEntity resultEntity = new ResultEntity(); 46 | resultEntity.setData(object); 47 | resultEntity.setTotal(total); 48 | resultEntity.setStatus(ResultCode.SUCCESS); 49 | return resultEntity; 50 | } 51 | 52 | /** 53 | * @author: wuwenqiang 54 | * @methodsName: success 55 | * @description: 成功的返回数据 56 | * @return: Object返回数据的data 57 | * @date: 2020-07-25 8:26 58 | */ 59 | public static ResultEntity success(Object object, String msg, String token) { 60 | ResultEntity resultEntity = new ResultEntity(); 61 | resultEntity.setData(object); 62 | resultEntity.setToken(token); 63 | resultEntity.setMsg(msg); 64 | resultEntity.setStatus(ResultCode.SUCCESS); 65 | return resultEntity; 66 | } 67 | 68 | /** 69 | * @author: wuwenqiang 70 | * @methodsName: fail 71 | * @description: 查询失败的返回数据 72 | * @return: ResultEntity 73 | * @date: 2020-07-25 8:26 74 | */ 75 | public static ResultEntity fail(Object object) { 76 | ResultEntity resultEntity = new ResultEntity(); 77 | resultEntity.setData(object); 78 | resultEntity.setStatus(ResultCode.FAIL); 79 | return resultEntity; 80 | } 81 | 82 | /** 83 | * @author: wuwenqiang 84 | * @methodsName: fail 85 | * @description: 查询失败的返回数据 86 | * @return: ResultEntity 87 | * @date: 2020-07-25 8:26 88 | */ 89 | public static ResultEntity fail(Object object, String msg) { 90 | ResultEntity resultEntity = new ResultEntity(); 91 | resultEntity.setData(object); 92 | resultEntity.setStatus(ResultCode.FAIL); 93 | resultEntity.setMsg(msg); 94 | return resultEntity; 95 | } 96 | 97 | public static ResultEntity fail(Object object, String msg, String status) { 98 | ResultEntity resultEntity = new ResultEntity(); 99 | resultEntity.setData(object); 100 | resultEntity.setStatus(status); 101 | resultEntity.setMsg(msg); 102 | return resultEntity; 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /player-common/src/main/java/com/player/common/entity/SearchHistory.java: -------------------------------------------------------------------------------- 1 | package com.player.common.entity; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | import lombok.ToString; 6 | 7 | import java.util.Date; 8 | 9 | @Data 10 | @ToString 11 | public class SearchHistory { 12 | @ApiModelProperty(value = "主键") 13 | private Long id; 14 | 15 | @ApiModelProperty(value = "类型") 16 | private String type;//类型 17 | 18 | @ApiModelProperty(value = "用户id") 19 | private String userId;//用户id 20 | 21 | @ApiModelProperty(value = "搜索内容") 22 | private String content;//搜索内容 23 | 24 | @ApiModelProperty(value = "创建时间") 25 | private Date createTime; 26 | 27 | @ApiModelProperty(value = "创建时间") 28 | private Date updateTime; 29 | } 30 | -------------------------------------------------------------------------------- /player-common/src/main/java/com/player/common/entity/UserEntity.java: -------------------------------------------------------------------------------- 1 | package com.player.common.entity; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | import lombok.ToString; 6 | 7 | import java.util.Date; 8 | @Data 9 | @ToString 10 | public class UserEntity { 11 | @ApiModelProperty(value = "用户uid") 12 | private String id; 13 | 14 | @ApiModelProperty(value = "用户账号") 15 | private String userAccount; 16 | 17 | @ApiModelProperty(value = "创建日期") 18 | private Date createDate; 19 | 20 | @ApiModelProperty(value = "更新日期") 21 | private Date updateDate; 22 | 23 | @ApiModelProperty(value = "昵称") 24 | private String username; 25 | 26 | @ApiModelProperty(value = "电话号码") 27 | private String telephone; 28 | 29 | @ApiModelProperty(value = "邮箱") 30 | private String email; 31 | 32 | @ApiModelProperty(value = "头像") 33 | private String avater; 34 | 35 | @ApiModelProperty(value = "出生年月日") 36 | private String birthday; 37 | 38 | @ApiModelProperty(value = "性别") 39 | private int sex; 40 | 41 | @ApiModelProperty(value = "角色") 42 | private String role; 43 | 44 | @ApiModelProperty(value = "密码") 45 | private String password; 46 | 47 | @ApiModelProperty(value = "个性签名") 48 | private String sign; 49 | 50 | @ApiModelProperty(value = "地区") 51 | private String region; 52 | 53 | @ApiModelProperty(value = "是否禁用") 54 | private int disabled; 55 | 56 | @ApiModelProperty(value = "权限") 57 | private int permission; 58 | } 59 | -------------------------------------------------------------------------------- /player-common/src/main/java/com/player/common/myInterface/OperLog.java: -------------------------------------------------------------------------------- 1 | package com.player.common.myInterface; 2 | 3 | import java.lang.annotation.*; 4 | 5 | /** 6 | * @author: wuwenqiang 7 | * @description: 自定义日志注解 8 | * @date: 2020-12-30 00:08 9 | */ 10 | @Target(ElementType.METHOD) //注解放置的目标位置,METHOD是可注解在方法级别上 11 | @Retention(RetentionPolicy.RUNTIME) //注解在哪个阶段执行 12 | @Documented //生成文档 13 | public @interface OperLog { 14 | String message(); // 介绍 15 | 16 | String operation(); // 日志类型 17 | } -------------------------------------------------------------------------------- /player-common/src/main/java/com/player/common/utils/JwtToken.java: -------------------------------------------------------------------------------- 1 | package com.player.common.utils; 2 | 3 | import com.alibaba.fastjson.JSONObject; 4 | import io.jsonwebtoken.*; 5 | import javax.crypto.SecretKey; 6 | import javax.crypto.spec.SecretKeySpec; 7 | import javax.xml.bind.DatatypeConverter; 8 | import java.util.Date; 9 | import com.player.common.entity.UserEntity; 10 | import org.springframework.beans.factory.annotation.Value; 11 | import org.springframework.stereotype.Component; 12 | 13 | /** 14 | * @author zengjintao 15 | * @version 1.0 16 | * @create_at 2020/4/19 15:31 17 | */ 18 | public class JwtToken { 19 | 20 | private static Long expirationTime = 2592000000L; 21 | 22 | 23 | /** 24 | * 生成jwt token 25 | * @param value 26 | * @return 27 | */ 28 | public static String createToken(Object value,String secret) { 29 | // 生成SecretKey 对象 30 | SecretKey secretKey = createSecretKey(secret); 31 | String jsonValue = JSONObject.toJSONString(value); 32 | SignatureAlgorithm signatureAlgorithm = SignatureAlgorithm.HS256; 33 | long nowMillis = System.currentTimeMillis(); 34 | Date now = new Date(); 35 | JwtBuilder jwtBuilder = Jwts.builder().setIssuedAt(now).setSubject(jsonValue).signWith(signatureAlgorithm, secretKey); 36 | if (expirationTime > 0L) { 37 | long expMillis = nowMillis + expirationTime; 38 | Date exp = new Date(expMillis); 39 | jwtBuilder.setExpiration(exp); // 设置token过期时间 40 | } 41 | return "Bearer " + jwtBuilder.compact(); 42 | } 43 | 44 | private static SecretKey createSecretKey(String secret) { 45 | byte[] bytes = DatatypeConverter.parseBase64Binary(secret); 46 | return new SecretKeySpec(bytes, 0, bytes.length, "AES"); 47 | } 48 | 49 | /** 50 | * 解析token 51 | * 52 | * @param token 53 | * @param clazz 54 | * @param 55 | * @return 56 | */ 57 | public static T parserToken(String token, Class clazz,String secret) { 58 | token = token.substring(7); 59 | SecretKey secretKey = createSecretKey(secret); 60 | try { 61 | Claims claims = Jwts.parser().setSigningKey(secretKey).parseClaimsJws(token).getBody(); 62 | String subject = claims.getSubject(); 63 | return (T) JSONObject.parseObject(subject, clazz); 64 | } catch (SignatureException | MalformedJwtException e) { 65 | return null; 66 | } catch (ExpiredJwtException e) { 67 | return null; 68 | } catch (Exception e) { 69 | return null; 70 | } 71 | } 72 | 73 | public static String getId(String token,String secret){ 74 | UserEntity userEntity = parserToken(token,UserEntity.class,secret); 75 | if(userEntity != null)return userEntity.getId(); 76 | return null; 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /player-common/src/main/java/com/player/common/utils/OperationType.java: -------------------------------------------------------------------------------- 1 | package com.player.common.utils; 2 | 3 | /** 4 | * @author: wuwenqiang 5 | * @description: 操作类型 6 | * @date: 2020-12-30 00:18 7 | */ 8 | public class OperationType { 9 | 10 | /** 11 | * 添加 12 | */ 13 | public static final String ADD = "ADD"; 14 | /** 15 | * 删除 16 | */ 17 | public static final String DELETE = "DELETE"; 18 | /** 19 | * 更新 20 | */ 21 | public static final String UPDATE = "UPDATE"; 22 | /** 23 | * 查询 24 | */ 25 | public static final String QUERY = "QUERY"; 26 | 27 | /** 28 | * 登录 29 | */ 30 | public static final String LOGIN = "LOGIN"; 31 | 32 | /** 33 | * 退出登录 34 | */ 35 | public static final String LOGOUT = "LOGOUT"; 36 | 37 | } 38 | -------------------------------------------------------------------------------- /player-common/src/main/java/com/player/common/utils/ResultCode.java: -------------------------------------------------------------------------------- 1 | package com.player.common.utils; 2 | 3 | public class ResultCode { 4 | public final static String SUCCESS = "SUCCESS"; 5 | public final static String FAIL = "FAIL"; 6 | public final static String LOGOUT = "LOGOUT"; 7 | } 8 | -------------------------------------------------------------------------------- /player-common/src/main/resources/application.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuyuanwuhui99/springboot-app-service/3cf924cf4fcc905514c081aa637d871c161b5a1f/player-common/src/main/resources/application.yml -------------------------------------------------------------------------------- /player-ebook/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /player-ebook/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuyuanwuhui99/springboot-app-service/3cf924cf4fcc905514c081aa637d871c161b5a1f/player-ebook/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /player-ebook/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /player-ebook/src/main/java/com/player/ebook/EbookApplication.java: -------------------------------------------------------------------------------- 1 | package com.player.ebook; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | @SpringBootApplication(scanBasePackages = "com.player.ebook") 8 | @MapperScan("com.player.ebook.mapper") 9 | public class EbookApplication { 10 | public static void main(String[] args) { 11 | SpringApplication.run(EbookApplication.class, args); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /player-ebook/src/main/java/com/player/ebook/config/AuthInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.player.ebook.config; 2 | 3 | import com.alibaba.fastjson.JSONObject; 4 | import com.player.common.entity.ResultEntity; 5 | import com.player.common.entity.ResultUtil; 6 | import com.player.common.entity.UserEntity; 7 | import com.player.common.utils.JwtToken; 8 | import com.player.common.utils.ResultCode; 9 | import org.springframework.web.servlet.HandlerInterceptor; 10 | 11 | import javax.servlet.http.HttpServletRequest; 12 | import javax.servlet.http.HttpServletResponse; 13 | import java.io.IOException; 14 | import java.io.PrintWriter; 15 | 16 | public class AuthInterceptor implements HandlerInterceptor { 17 | 18 | private JwtToken jwtToken = new JwtToken(); 19 | 20 | @Override 21 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { 22 | String token = request.getHeader("Athorization"); 23 | if (token == null) { 24 | renderJson(response, ResultUtil.fail("未通过登录认证", null, ResultCode.LOGOUT)); 25 | return false; 26 | } 27 | UserEntity userEntity = jwtToken.parserToken(token, UserEntity.class); 28 | if (userEntity == null) { 29 | response.setContentType("application/json;charset=UTF-8"); 30 | //设置编码格式 31 | response.setCharacterEncoding("UTF-8"); 32 | response.setStatus(401); 33 | response.getWriter().write("未通过登录认证,请在登录页面登录"); 34 | renderJson(response, ResultUtil.fail("未通过登录认证", ResultCode.LOGOUT)); 35 | return false; 36 | } 37 | return true; 38 | } 39 | 40 | protected void renderJson(HttpServletResponse response, ResultEntity resultEntity) { 41 | String dataJson = JSONObject.toJSONString(resultEntity); 42 | PrintWriter writer = null; 43 | try { 44 | response.setContentType("application/json; charset=utf-8"); 45 | writer = response.getWriter(); 46 | writer.write(dataJson); 47 | writer.flush(); 48 | return; 49 | } catch (IOException e) { 50 | throw new RuntimeException(e); 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /player-ebook/src/main/java/com/player/ebook/config/Swagger2Configuration.java: -------------------------------------------------------------------------------- 1 | package com.player.ebook.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import springfox.documentation.builders.ApiInfoBuilder; 6 | import springfox.documentation.builders.PathSelectors; 7 | import springfox.documentation.builders.RequestHandlerSelectors; 8 | import springfox.documentation.service.ApiInfo; 9 | import springfox.documentation.spi.DocumentationType; 10 | import springfox.documentation.spring.web.plugins.Docket; 11 | import springfox.documentation.swagger2.annotations.EnableSwagger2; 12 | 13 | 14 | @Configuration 15 | @EnableSwagger2 16 | public class Swagger2Configuration { 17 | @Bean 18 | public Docket createRestApi() { 19 | return new Docket(DocumentationType.SWAGGER_2) 20 | .apiInfo(apiInfo()) 21 | .select() 22 | .apis(RequestHandlerSelectors.basePackage("com.player")) 23 | .paths(PathSelectors.any()) 24 | .build(); 25 | } 26 | 27 | private ApiInfo apiInfo() { 28 | return new ApiInfoBuilder() 29 | .title("电子书") 30 | .description("电子书api文档") 31 | .version("1.0") 32 | .build(); 33 | } 34 | 35 | } 36 | 37 | -------------------------------------------------------------------------------- /player-ebook/src/main/java/com/player/ebook/config/WebAppConfig.java: -------------------------------------------------------------------------------- 1 | package com.player.ebook.config; 2 | 3 | import org.springframework.context.annotation.Configuration; 4 | import org.springframework.web.servlet.config.annotation.InterceptorRegistration; 5 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; 6 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 7 | 8 | /** 9 | * @Description:拦截器配置 10 | * @author: zk 11 | * @date: 2020年12月25日 21:41 12 | */ 13 | @Configuration 14 | public class WebAppConfig implements WebMvcConfigurer { 15 | @Override 16 | public void addInterceptors(InterceptorRegistry registry) { 17 | //注册TestInterceptor拦截器 18 | InterceptorRegistration registration = registry.addInterceptor(new AuthInterceptor()); 19 | registration.addPathPatterns("/service/ebook/getUserMsg"); //所有路径都被拦截 20 | registration.excludePathPatterns( //添加不拦截路径 21 | "/**/*.html", //html静态资源 22 | "/**/*.js", //js静态资源 23 | "/**/*.css", //css静态资源 24 | "/**/*.woff", 25 | "/**/*.ttf" 26 | ); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /player-ebook/src/main/java/com/player/ebook/controller/BookController.java: -------------------------------------------------------------------------------- 1 | package com.player.ebook.controller; 2 | 3 | import com.player.common.entity.ResultEntity; 4 | import com.player.common.myInterface.OperLog; 5 | import com.player.common.utils.HttpUtils; 6 | import com.player.common.utils.OperationType; 7 | import com.player.ebook.service.IBookService; 8 | import io.swagger.annotations.Api; 9 | import io.swagger.annotations.ApiOperation; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.web.bind.annotation.*; 12 | 13 | import javax.servlet.http.HttpServletRequest; 14 | 15 | @RestController 16 | @RequestMapping("/service/ebook") 17 | @Api(value = "电子书查询", description = "电子书查询") 18 | public class BookController { 19 | @Autowired 20 | private IBookService bookService; 21 | 22 | /** 23 | * @author: wuwenqiang 24 | * @description: 查询所有分类信息 25 | * @date: 2021-02-1 21:27 26 | */ 27 | @OperLog(message = "查询所有分类信息", operation = OperationType.QUERY) 28 | @ApiOperation("查询所有分类信息") 29 | @GetMapping("/findAllByClassifyGroup") 30 | public ResultEntity findAllByClassifyGroup(@RequestHeader(value="Authorization",required = false) String token) { 31 | return bookService.findAllByClassifyGroup(token); 32 | } 33 | 34 | @OperLog(message = "查询电子书列表", operation = OperationType.QUERY) 35 | @ApiOperation("查询电子书列表") 36 | @GetMapping("/findBookList") 37 | ResultEntity findBookList( 38 | @RequestParam(required = true,value = "pageSize") Integer pageSize, 39 | @RequestParam(required = true,value = "pageNum") Integer pageNum, 40 | @RequestParam(required = false,value = "classify") String classify, 41 | @RequestParam(required = false,value = "category") String category, 42 | @RequestParam(required = false,value = "keyword") String keyword, 43 | HttpServletRequest request 44 | ){ 45 | String requestURI = request.getRequestURI(); 46 | String queryString = request.getQueryString(); 47 | String path = requestURI + "?" + queryString; 48 | return bookService.findBookList(pageSize,pageNum,classify,category,keyword,path); 49 | } 50 | 51 | /** 52 | * @author: wuwenqiang 53 | * @description: 查询轮播图 54 | * @date: 2021-02-02 20:43 55 | */ 56 | @OperLog(message = "查询轮播图", operation = OperationType.QUERY) 57 | @ApiOperation("查询轮播图") 58 | @GetMapping("/getBanner") 59 | public ResultEntity getBanner(HttpServletRequest request) { 60 | return bookService.getBanner(HttpUtils.getPath(request)); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /player-ebook/src/main/java/com/player/ebook/entity/BannerEntity.java: -------------------------------------------------------------------------------- 1 | package com.player.ebook.entity; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | 5 | import java.util.Date; 6 | 7 | public class BannerEntity { 8 | 9 | @ApiModelProperty(value = "主键") 10 | private Integer id; 11 | 12 | @ApiModelProperty(value = "名称") 13 | private String name; 14 | 15 | @ApiModelProperty(value = "执行的路径") 16 | private String path; 17 | 18 | @ApiModelProperty(value = "本地图片地址") 19 | private String loacalImg; 20 | 21 | @ApiModelProperty(value = "创建时间") 22 | private Date createTime; 23 | 24 | @ApiModelProperty(value = "更新时间") 25 | private Date updateTime; 26 | 27 | @ApiModelProperty(value = "是否使用中") 28 | private String isUsed; 29 | 30 | @ApiModelProperty(value = "排名") 31 | private Integer ranks; 32 | 33 | public Integer getId() { 34 | return id; 35 | } 36 | 37 | public void setId(Integer id) { 38 | this.id = id; 39 | } 40 | 41 | public String getName() { 42 | return name; 43 | } 44 | 45 | public void setName(String name) { 46 | this.name = name; 47 | } 48 | 49 | public String getPath() { 50 | return path; 51 | } 52 | 53 | public void setPath(String path) { 54 | this.path = path; 55 | } 56 | 57 | public String getLoacalImg() { 58 | return loacalImg; 59 | } 60 | 61 | public void setLoacalImg(String loacalImg) { 62 | this.loacalImg = loacalImg; 63 | } 64 | 65 | public Date getCreateTime() { 66 | return createTime; 67 | } 68 | 69 | public void setCreateTime(Date createTime) { 70 | this.createTime = createTime; 71 | } 72 | 73 | public Date getUpdateTime() { 74 | return updateTime; 75 | } 76 | 77 | public void setUpdateTime(Date updateTime) { 78 | this.updateTime = updateTime; 79 | } 80 | 81 | public String getIsUsed() { 82 | return isUsed; 83 | } 84 | 85 | public void setIsUsed(String isUsed) { 86 | this.isUsed = isUsed; 87 | } 88 | 89 | public Integer getRanks() { 90 | return ranks; 91 | } 92 | 93 | public void setRanks(Integer ranks) { 94 | this.ranks = ranks; 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /player-ebook/src/main/java/com/player/ebook/entity/BookChapterEntity.java: -------------------------------------------------------------------------------- 1 | package com.player.ebook.entity; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | 5 | import java.util.Date; 6 | 7 | public class BookChapterEntity { 8 | @ApiModelProperty(value = "主键") 9 | private Integer id; 10 | 11 | @ApiModelProperty(value = "书名") 12 | private String bookName; 13 | 14 | @ApiModelProperty(value = "书籍的id") 15 | private Integer bookId; 16 | 17 | @ApiModelProperty(value = "章节的名称") 18 | private String chapterName; 19 | 20 | @ApiModelProperty(value = "章节的链接地址") 21 | private String chapterUrl; 22 | 23 | @ApiModelProperty(value = "创建时间") 24 | private Date createTime; 25 | 26 | @ApiModelProperty(value = "更新时间") 27 | private Date updateTime; 28 | } 29 | -------------------------------------------------------------------------------- /player-ebook/src/main/java/com/player/ebook/entity/BookLikesEntity.java: -------------------------------------------------------------------------------- 1 | package com.player.ebook.entity; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | 5 | import java.util.Date; 6 | 7 | public class BookLikesEntity { 8 | @ApiModelProperty(value = "主键") 9 | private Integer id; 10 | 11 | @ApiModelProperty(value = "书籍名称") 12 | private String name; 13 | 14 | @ApiModelProperty(value = "书籍的url") 15 | private Integer url; 16 | 17 | @ApiModelProperty(value = "关联的书籍的名称") 18 | private String bookName; 19 | 20 | @ApiModelProperty(value = "关联的书籍的id") 21 | private String bookId; 22 | 23 | @ApiModelProperty(value = "创建时间") 24 | private Date createTime; 25 | 26 | @ApiModelProperty(value = "更新时间") 27 | private Date updateTime; 28 | } 29 | -------------------------------------------------------------------------------- /player-ebook/src/main/java/com/player/ebook/entity/BookRelationEntity.java: -------------------------------------------------------------------------------- 1 | package com.player.ebook.entity; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | 5 | import java.util.Date; 6 | 7 | public class BookRelationEntity { 8 | @ApiModelProperty(value = "主键") 9 | private Integer id; 10 | 11 | @ApiModelProperty(value = "图片地址") 12 | private String img; 13 | 14 | @ApiModelProperty(value = "书名") 15 | private String name; 16 | 17 | @ApiModelProperty(value = "本地图片地址") 18 | private String localImg; 19 | 20 | @ApiModelProperty(value = "链接地址") 21 | private String url; 22 | 23 | @ApiModelProperty(value = "创建时间") 24 | private Date createTime; 25 | 26 | @ApiModelProperty(value = "更新时间") 27 | private Date updateTime; 28 | 29 | @ApiModelProperty(value = "关联的书籍名称") 30 | private String bookName; 31 | 32 | @ApiModelProperty(value = "关联的书籍的id") 33 | private Integer bookId; 34 | } 35 | -------------------------------------------------------------------------------- /player-ebook/src/main/java/com/player/ebook/mapper/BookMapper.java: -------------------------------------------------------------------------------- 1 | package com.player.ebook.mapper; 2 | 3 | import com.player.common.entity.LogEntity; 4 | import com.player.ebook.entity.BannerEntity; 5 | import com.player.ebook.entity.BookEntity; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | import java.util.List; 9 | import java.util.Map; 10 | 11 | public interface BookMapper { 12 | Long log(LogEntity logEntity); 13 | 14 | List findBookList( 15 | @Param("pageSize") Integer pageSize, 16 | @Param("pageNum") Integer pageNum, 17 | @Param("classify") String classify, 18 | @Param("category") String category, 19 | @Param("keyword") String keyword 20 | ); 21 | 22 | Long findBookListTotal( 23 | @Param("classify")String classify, 24 | @Param("category")String category, 25 | @Param("keyword")String keyword 26 | ); 27 | 28 | List>findAllByClassifyGroup(); 29 | 30 | List getBanner(); 31 | } 32 | -------------------------------------------------------------------------------- /player-ebook/src/main/java/com/player/ebook/service/IBookService.java: -------------------------------------------------------------------------------- 1 | package com.player.ebook.service; 2 | 3 | import com.player.common.entity.ResultEntity; 4 | 5 | public interface IBookService { 6 | ResultEntity findBookList( 7 | Integer pageSize, 8 | Integer pageNum, 9 | String classify, 10 | String category, 11 | String keyword, 12 | String path 13 | ); 14 | 15 | ResultEntity findAllByClassifyGroup(String token); 16 | 17 | ResultEntity getBanner(String token); 18 | } 19 | -------------------------------------------------------------------------------- /player-ebook/src/main/java/com/player/ebook/service/imp/BookService.java: -------------------------------------------------------------------------------- 1 | package com.player.ebook.service.imp; 2 | 3 | import com.alibaba.fastjson.JSON; 4 | import com.player.common.entity.ResultEntity; 5 | import com.player.common.entity.ResultUtil; 6 | import com.player.ebook.entity.BookEntity; 7 | import com.player.ebook.mapper.BookMapper; 8 | import com.player.ebook.service.IBookService; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.data.redis.core.RedisTemplate; 11 | import org.springframework.stereotype.Service; 12 | import org.springframework.util.StringUtils; 13 | 14 | import java.util.List; 15 | import java.util.concurrent.TimeUnit; 16 | 17 | @Service 18 | public class BookService implements IBookService { 19 | @Autowired 20 | private BookMapper bookMapper; 21 | 22 | @Autowired 23 | private RedisTemplate redisTemplate; 24 | 25 | /** 26 | * @author: wuwenqiang 27 | * @description: 分页查询电子书接口 28 | * @date: 2021-01-30 20:58 29 | */ 30 | @Override 31 | public ResultEntity findBookList( 32 | Integer pageSize, 33 | Integer pageNum, 34 | String classify, 35 | String category, 36 | String keyword, 37 | String path 38 | ) { 39 | String result = (String) redisTemplate.opsForValue().get(path); 40 | if(result != null && !"".equals(result)){ 41 | ResultEntity resultEntity= JSON.parseObject(result,ResultEntity.class); 42 | return resultEntity; 43 | }else{ 44 | Long listTatal = bookMapper.findBookListTotal(classify,category, keyword); 45 | List bookList = bookMapper.findBookList(pageSize,pageNum,classify,category,keyword); 46 | ResultEntity resultEntity = ResultUtil.success(bookList,listTatal); 47 | redisTemplate.opsForValue().set(path, JSON.toJSONString(resultEntity),1, TimeUnit.DAYS); 48 | return resultEntity; 49 | } 50 | } 51 | 52 | @Override 53 | public ResultEntity findAllByClassifyGroup(String token) { 54 | String path = "/service/ebook/findAllByClassifyGroup"; 55 | String result = (String) redisTemplate.opsForValue().get(path); 56 | if(result != null && !"".equals(result)){ 57 | ResultEntity resultEntity= JSON.parseObject(result,ResultEntity.class); 58 | return resultEntity; 59 | }else{ 60 | ResultEntity resultEntity = ResultUtil.success(bookMapper.findAllByClassifyGroup()); 61 | redisTemplate.opsForValue().set(path, JSON.toJSONString(resultEntity),1, TimeUnit.DAYS); 62 | return resultEntity; 63 | } 64 | } 65 | 66 | @Override 67 | public ResultEntity getBanner(String path) { 68 | String result = (String) redisTemplate.opsForValue().get(path); 69 | if(!StringUtils.isEmpty(result)){ 70 | ResultEntity resultEntity= JSON.parseObject(result,ResultEntity.class); 71 | return resultEntity; 72 | }else{ 73 | ResultEntity resultEntity = ResultUtil.success(bookMapper.getBanner()); 74 | redisTemplate.opsForValue().set(path, JSON.toJSONString(resultEntity),1, TimeUnit.DAYS); 75 | return resultEntity; 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /player-ebook/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | static: 2 | file-path: E:/ 3 | server: 4 | port: 7000 5 | mybatis: 6 | mapper-locations: classpath:mapper/*Mapper.xml 7 | type-aliases-package: com.player.ebook.entity 8 | configuration: 9 | map-underscore-to-camel-case: true 10 | spring: 11 | redis: 12 | database: 0 13 | host: 127.0.0.1 14 | port: 6379 15 | password: 16 | timeout: 5000 17 | jedis: 18 | pool: 19 | max-active: 8 20 | max-wait: -1 21 | max-idle: 8 22 | min-idle: 0 23 | jpa: 24 | show-sql: true 25 | application: 26 | name: player-ebook 27 | datasource: 28 | druid: 29 | url: jdbc:mysql://127.0.0.1:3306/play?characterEncoding=utf-8 30 | username: root 31 | password: wwq_2021 32 | driverClassName: com.mysql.jdbc.Driver 33 | initialSize: 5 34 | minIdle: 5 35 | maxActive: 20 36 | maxWait: 10000 37 | testOnBorrow: true 38 | testOnReturn: false 39 | timeBetweenEvictionRunsMillis: 60000 40 | minEvictableIdleTimeMillis: 300000 41 | 42 | ribbon: 43 | MaxAutoRetries: 2 44 | MaxAutoRetriesNextServer: 3 45 | OkToRetryOnAllOperations: false 46 | ConnectTimeout: 5000 47 | ReadTimeout: 6000 -------------------------------------------------------------------------------- /player-ebook/src/main/resources/mapper/BookMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | AND category = #{category} 8 | 9 | 10 | AND classify = #{classify} 11 | 12 | 13 | AND name LIKE concat('%',#{keyword},'%') 14 | 15 | 16 | 17 | 18 | 23 | 24 | 28 | 29 | 30 | INSERT INTO log(method,url,headers,ip,params,result,start_time,run_time,description,end_time,type,oparation,user_id)VALUES(#{method},#{url},#{headers},#{ip},#{params},#{result},#{startTime},#{runTime},#{description},#{endTime},#{type},#{oparation},#{userId}) 31 | 32 | 33 | 41 | 42 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /player-ebook/src/test/java/com/player/ebook/EbookApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.player.ebook; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class EbookApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /player-learn/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /player-learn/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuyuanwuhui99/springboot-app-service/3cf924cf4fcc905514c081aa637d871c161b5a1f/player-learn/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /player-learn/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /player-learn/src/main/java/com/player/learn/LearnApplication.java: -------------------------------------------------------------------------------- 1 | package com.player.learn; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication(scanBasePackages = "com.player.learn") 7 | public class LearnApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(LearnApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /player-learn/src/main/java/com/player/learn/config/Swagger2Configuration.java: -------------------------------------------------------------------------------- 1 | package com.player.learn.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import springfox.documentation.builders.ApiInfoBuilder; 6 | import springfox.documentation.builders.PathSelectors; 7 | import springfox.documentation.builders.RequestHandlerSelectors; 8 | import springfox.documentation.service.ApiInfo; 9 | import springfox.documentation.spi.DocumentationType; 10 | import springfox.documentation.spring.web.plugins.Docket; 11 | import springfox.documentation.swagger2.annotations.EnableSwagger2; 12 | 13 | 14 | @Configuration 15 | @EnableSwagger2 16 | public class Swagger2Configuration { 17 | @Bean 18 | public Docket createRestApi() { 19 | return new Docket(DocumentationType.SWAGGER_2) 20 | .apiInfo(apiInfo()) 21 | .select() 22 | .apis(RequestHandlerSelectors.basePackage("com.player")) 23 | .paths(PathSelectors.any()) 24 | .build(); 25 | } 26 | 27 | private ApiInfo apiInfo() { 28 | return new ApiInfoBuilder() 29 | .title("视频教程") 30 | .description("视频教程放器api文档") 31 | .version("1.0") 32 | .build(); 33 | } 34 | 35 | } 36 | 37 | -------------------------------------------------------------------------------- /player-learn/src/main/java/com/player/learn/controller/FileStaticController.java: -------------------------------------------------------------------------------- 1 | package com.player.learn.controller; 2 | 3 | import org.apache.commons.io.FileUtils; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.beans.factory.annotation.Value; 6 | import org.springframework.core.io.ResourceLoader; 7 | import org.springframework.http.MediaType; 8 | import org.springframework.http.ResponseEntity; 9 | import org.springframework.web.bind.annotation.GetMapping; 10 | import org.springframework.web.bind.annotation.RestController; 11 | 12 | import javax.servlet.http.HttpServletRequest; 13 | import java.io.File; 14 | import java.net.URL; 15 | 16 | @RestController 17 | public class FileStaticController { 18 | @Autowired 19 | ResourceLoader loader; 20 | 21 | @Value("${static.file-path}") 22 | private String root; 23 | 24 | @GetMapping("/static/**") 25 | public ResponseEntity getFile(HttpServletRequest request) { 26 | try { 27 | String servletPath = request.getServletPath(); 28 | String filePath = root.replace("/","") + servletPath; 29 | File file = new File(filePath); 30 | ResponseEntity.BodyBuilder bodyBuilder = ResponseEntity.ok(); 31 | bodyBuilder.contentLength(file.length()); 32 | // 二进制数据流 33 | bodyBuilder.contentType(MediaType.APPLICATION_OCTET_STREAM); 34 | // 在浏览器中打开 35 | URL url = new URL("file:///" + file); 36 | bodyBuilder.header("Content-Type", url.openConnection().getContentType()); 37 | String fileName = filePath.substring(filePath.lastIndexOf('/') + 1, filePath.length()); 38 | bodyBuilder.header("Content-Disposition", "inline;filename*=UTF-8''" + fileName); 39 | return bodyBuilder.body(FileUtils.readFileToByteArray(file)); 40 | } catch (Exception e) { 41 | return null; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /player-learn/src/main/java/com/player/learn/dao/ChapterDao.java: -------------------------------------------------------------------------------- 1 | package com.player.learn.dao; 2 | 3 | import com.player.learn.entity.ChapterEntity; 4 | import org.springframework.data.domain.Sort; 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | 7 | import java.util.List; 8 | 9 | public interface ChapterDao extends JpaRepository { 10 | /** 11 | * @param :courseName课程名称 12 | * @param :sort排序规则 13 | * @author: wuwenqiang 14 | * @methodsName: findAllByCourseName 15 | * @description: 根据大分类查询课程 16 | * @return: List 17 | * @date: 2021-01-07 22:39 18 | */ 19 | public List findAllByCourseName(String courseName, Sort sort); 20 | } 21 | -------------------------------------------------------------------------------- /player-learn/src/main/java/com/player/learn/dao/ChapterLogDao.java: -------------------------------------------------------------------------------- 1 | package com.player.learn.dao; 2 | 3 | import com.player.learn.entity.ChapterLogEntity; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | 6 | public interface ChapterLogDao extends JpaRepository { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /player-learn/src/main/java/com/player/learn/dao/CourseDao.java: -------------------------------------------------------------------------------- 1 | package com.player.learn.dao; 2 | 3 | import com.player.learn.entity.CourseEntity; 4 | import org.springframework.data.domain.Page; 5 | import org.springframework.data.domain.PageRequest; 6 | import org.springframework.data.domain.Pageable; 7 | import org.springframework.data.domain.Sort; 8 | import org.springframework.data.jpa.repository.JpaRepository; 9 | import org.springframework.data.jpa.repository.Query; 10 | 11 | import java.util.List; 12 | import java.util.Map; 13 | 14 | public interface CourseDao extends JpaRepository{ 15 | 16 | /** 17 | * @param :大分类 18 | * @param :sort排序规则 19 | * @param pageRequest 20 | * @author: wuwenqiang 21 | * @methodsName: findAllByClassify 22 | * @description: 根据大分类查询课程 23 | * @return: List 24 | * @date: 2021-01-07 22:39 25 | */ 26 | Page findAllByClassify(String classify, Pageable pageable); 27 | 28 | /** 29 | * @param :category类别 30 | * @param :sort排序规则 31 | * @author: wuwenqiang 32 | * @methodsName: findAllByCategory 33 | * @description: 根据类别查询课程 34 | * @return: List 35 | * @date: 2021-01-07 22:39 36 | */ 37 | List findAllByCategory(String category, Sort sort); 38 | 39 | /** 40 | * @author: wuwenqiang 41 | * @methodsName: findAllByClassifyGroup 42 | * @description: 查询分组 43 | * @return: List 44 | * @date: 2021-01-07 22:39 45 | */ 46 | @Query(value = "SELECT '推荐' as classify FROM dual UNION ALL"+ 47 | "(SELECT classify FROM course WHERE classify not in ('热门课程','最新课程','轮播') " + 48 | "GROUP BY classify ORDER BY update_time DESC)",nativeQuery = true) 49 | List> findAllByClassifyGroup(); 50 | } 51 | -------------------------------------------------------------------------------- /player-learn/src/main/java/com/player/learn/dao/CourseLogDao.java: -------------------------------------------------------------------------------- 1 | package com.player.learn.dao; 2 | 3 | import com.player.learn.entity.CourseLogEntity; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | 6 | public interface CourseLogDao extends JpaRepository { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /player-learn/src/main/java/com/player/learn/dao/LogDao.java: -------------------------------------------------------------------------------- 1 | package com.player.learn.dao; 2 | 3 | import com.player.learn.entity.LogEntity; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | 6 | public interface LogDao extends JpaRepository { 7 | } 8 | -------------------------------------------------------------------------------- /player-learn/src/main/java/com/player/learn/entity/ChapterEntity.java: -------------------------------------------------------------------------------- 1 | package com.player.learn.entity; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | 6 | import javax.persistence.*; 7 | import java.util.Date; 8 | 9 | @Data 10 | @Entity 11 | @Table(name = "chapter") 12 | public class ChapterEntity { 13 | @ApiModelProperty(value = "主键") 14 | @GeneratedValue(strategy= GenerationType.IDENTITY) 15 | @Id 16 | @Column(name = "c_id") 17 | private Long id; 18 | 19 | @ApiModelProperty(value = "章节名称") 20 | @Column(name = "name") 21 | private String name; 22 | 23 | @ApiModelProperty(value = "访问人数") 24 | @Column(name = "visitors") 25 | private String visitors; 26 | 27 | @ApiModelProperty(value = "目录") 28 | @Column(name = "catalog") 29 | private String catalog; 30 | 31 | @ApiModelProperty(value = "播放地址") 32 | @Column(name = "url") 33 | private String url; 34 | 35 | @ApiModelProperty(value = "课程名称") 36 | @Column(name = "course_name") 37 | private String courseName; 38 | 39 | @ApiModelProperty(value = "课程id") 40 | @Column(name = "course_id") 41 | private String course_id; 42 | 43 | @ApiModelProperty(value = "章节链接") 44 | @Column(name = "href") 45 | private String href; 46 | 47 | @ApiModelProperty(value = "是否需要登录,0:立即观看,1:登录观看,2:支付观看") 48 | @Column(name = "need_pay") 49 | private String needPay; 50 | 51 | @ApiModelProperty(value = "创建时间") 52 | @Column(name = "create_time") 53 | private Date create_time; 54 | 55 | @ApiModelProperty(value = "更新时间") 56 | @Column(name = "update_time") 57 | private Date update_time; 58 | } 59 | -------------------------------------------------------------------------------- /player-learn/src/main/java/com/player/learn/entity/ChapterLogEntity.java: -------------------------------------------------------------------------------- 1 | package com.player.learn.entity; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | 6 | import javax.persistence.*; 7 | import java.util.Date; 8 | 9 | @Data 10 | @Entity 11 | @Table(name = "chapter_log") 12 | public class ChapterLogEntity { 13 | @ApiModelProperty(value = "主键") 14 | @GeneratedValue(strategy= GenerationType.IDENTITY) 15 | @Id 16 | @Column(name = "c_id") 17 | private Long id; 18 | 19 | @ApiModelProperty(value = "章节名称") 20 | @Column(name = "name") 21 | private String name; 22 | 23 | @ApiModelProperty(value = "访问人数") 24 | @Column(name = "visitors") 25 | private String visitors; 26 | 27 | @ApiModelProperty(value = "目录") 28 | @Column(name = "catalog") 29 | private String catalog; 30 | 31 | @ApiModelProperty(value = "播放地址") 32 | @Column(name = "url") 33 | private String url; 34 | 35 | @ApiModelProperty(value = "课程名称") 36 | @Column(name = "course_name") 37 | private String courseName; 38 | 39 | @ApiModelProperty(value = "课程id") 40 | @Column(name = "course_id") 41 | private String courseId; 42 | 43 | @ApiModelProperty(value = "章节链接") 44 | @Column(name = "href") 45 | private String href; 46 | 47 | @ApiModelProperty(value = "是否需要登录,0:立即观看,1:登录观看,2:支付观看") 48 | @Column(name = "need_pay") 49 | private String needPay; 50 | 51 | @ApiModelProperty(value = "创建时间") 52 | @Column(name = "create_time") 53 | private Date createTime; 54 | 55 | @ApiModelProperty(value = "更新时间") 56 | @Column(name = "update_time") 57 | private Date updateTime; 58 | } 59 | -------------------------------------------------------------------------------- /player-learn/src/main/java/com/player/learn/entity/CourseEntity.java: -------------------------------------------------------------------------------- 1 | package com.player.learn.entity; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | 6 | import javax.persistence.*; 7 | import java.util.Date; 8 | 9 | @Data 10 | @Entity 11 | @Table(name = "course") 12 | public class CourseEntity { 13 | @ApiModelProperty(value = "主键") 14 | @GeneratedValue(strategy= GenerationType.IDENTITY) 15 | @Id 16 | @Column(name = "t_id") 17 | private Long id; 18 | 19 | @ApiModelProperty(value = "课程名称") 20 | @Column(name = "name") 21 | private String name; 22 | 23 | @ApiModelProperty(value = "课程简介") 24 | @Column(name = "summary") 25 | private String summary; 26 | 27 | @ApiModelProperty(value = "教程程度") 28 | @Column(name = "level") 29 | private String level; 30 | 31 | @ApiModelProperty(value = "软件版本") 32 | @Column(name = "software_version") 33 | private String softwareVersion; 34 | 35 | @ApiModelProperty(value = "所需基础") 36 | @Column(name = "required_base") 37 | private String requiredBase; 38 | 39 | @ApiModelProperty(value = "适合人群") 40 | @Column(name = "suitable_for_people") 41 | private String suitableForPeople; 42 | 43 | @ApiModelProperty(value = "章节数量") 44 | @Column(name = "total_chapter") 45 | private String totalChapter; 46 | 47 | @ApiModelProperty(value = "学过的人") 48 | @Column(name = "learner") 49 | private String learner; 50 | 51 | @ApiModelProperty(value = "推出时间") 52 | @Column(name = "create_time") 53 | private String createTime; 54 | 55 | @ApiModelProperty(value = "讲师") 56 | @Column(name = "teacher") 57 | private String teacher; 58 | 59 | @ApiModelProperty(value = "讲师资质") 60 | @Column(name = "qualification") 61 | private String qualification; 62 | 63 | @ApiModelProperty(value = "课程描述") 64 | @Column(name = "course_describe") 65 | private String courseDescribe; 66 | 67 | @ApiModelProperty(value = "类别") 68 | @Column(name = "category") 69 | private String category; 70 | 71 | @ApiModelProperty(value = "大类") 72 | @Column(name = "classify") 73 | private String classify; 74 | 75 | @ApiModelProperty(value = "更新时间") 76 | @Column(name = "update_time") 77 | private Date updateTime; 78 | 79 | @ApiModelProperty(value = "源码") 80 | @Column(name = "code") 81 | private String code; 82 | 83 | @ApiModelProperty(value = "素材") 84 | @Column(name = "material") 85 | private String material; 86 | 87 | @ApiModelProperty(value = "板书") 88 | @Column(name = "blackboard") 89 | private String blackboard; 90 | 91 | @ApiModelProperty(value = "课程连接") 92 | @Column(name = "href") 93 | private String href; 94 | 95 | @ApiModelProperty(value = "课程图片地址") 96 | @Column(name = "img") 97 | private String img; 98 | 99 | @ApiModelProperty(value = "来源") 100 | @Column(name = "source") 101 | private String source; 102 | 103 | @ApiModelProperty(value = "本地图片地址") 104 | @Column(name = "local_img") 105 | private String localImg; 106 | } 107 | -------------------------------------------------------------------------------- /player-learn/src/main/java/com/player/learn/entity/CourseLogEntity.java: -------------------------------------------------------------------------------- 1 | package com.player.learn.entity; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | 6 | import javax.persistence.*; 7 | import java.util.Date; 8 | 9 | @Data 10 | @Entity 11 | @Table(name = "course_log") 12 | public class CourseLogEntity { 13 | @ApiModelProperty(value = "主键") 14 | @GeneratedValue(strategy= GenerationType.IDENTITY) 15 | @Id 16 | @Column(name = "t_id") 17 | private Long id; 18 | 19 | @ApiModelProperty(value = "课程名称") 20 | @Column(name = "name") 21 | private String name; 22 | 23 | @ApiModelProperty(value = "课程简介") 24 | @Column(name = "summary") 25 | private String summary; 26 | 27 | @ApiModelProperty(value = "教程程度") 28 | @Column(name = "level") 29 | private String level; 30 | 31 | @ApiModelProperty(value = "软件版本") 32 | @Column(name = "software_version") 33 | private String softwareVersion; 34 | 35 | @ApiModelProperty(value = "所需基础") 36 | @Column(name = "required_base") 37 | private String requiredBase; 38 | 39 | @ApiModelProperty(value = "适合人群") 40 | @Column(name = "suitable_for_people") 41 | private String suitableForPeople; 42 | 43 | @ApiModelProperty(value = "章节数量") 44 | @Column(name = "total_chapter") 45 | private String totalChapter; 46 | 47 | @ApiModelProperty(value = "学过的人") 48 | @Column(name = "learner") 49 | private String learner; 50 | 51 | @ApiModelProperty(value = "推出时间") 52 | @Column(name = "create_time") 53 | private String createTime; 54 | 55 | @ApiModelProperty(value = "讲师") 56 | @Column(name = "teacher") 57 | private String teacher; 58 | 59 | @ApiModelProperty(value = "讲师资质") 60 | @Column(name = "qualification") 61 | private String qualification; 62 | 63 | @ApiModelProperty(value = "课程描述") 64 | @Column(name = "course_describe") 65 | private String courseDescribe; 66 | 67 | @ApiModelProperty(value = "类别") 68 | @Column(name = "category") 69 | private String category; 70 | 71 | @ApiModelProperty(value = "大类") 72 | @Column(name = "classify") 73 | private String classify; 74 | 75 | @ApiModelProperty(value = "更新时间") 76 | @Column(name = "update_time") 77 | private Date updateTime; 78 | 79 | @ApiModelProperty(value = "源码") 80 | @Column(name = "code") 81 | private String code; 82 | 83 | @ApiModelProperty(value = "素材") 84 | @Column(name = "material") 85 | private String material; 86 | 87 | @ApiModelProperty(value = "板书") 88 | @Column(name = "blackboard") 89 | private String blackboard; 90 | 91 | @ApiModelProperty(value = "课程连接") 92 | @Column(name = "href") 93 | private String href; 94 | 95 | @ApiModelProperty(value = "课程图片地址") 96 | @Column(name = "img") 97 | private String img; 98 | 99 | @ApiModelProperty(value = "来源") 100 | @Column(name = "source") 101 | private String source; 102 | 103 | @ApiModelProperty(value = "本地图片地址") 104 | @Column(name = "local_img") 105 | private String localImg; 106 | 107 | @ApiModelProperty(value = "用户id") 108 | @Column(name = "user_id") 109 | private String userId; 110 | } 111 | -------------------------------------------------------------------------------- /player-learn/src/main/java/com/player/learn/entity/LogEntity.java: -------------------------------------------------------------------------------- 1 | package com.player.learn.entity; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | 6 | import javax.persistence.*; 7 | import java.util.Date; 8 | 9 | @Data 10 | @Entity 11 | @Table(name = "log") 12 | public class LogEntity { 13 | @ApiModelProperty(value = "主键") 14 | @GeneratedValue(strategy= GenerationType.IDENTITY) 15 | @Id 16 | @Column(name = "id") 17 | private Long id; 18 | 19 | @ApiModelProperty(value = "请求方法") 20 | @Column(name = "method") 21 | private String method; 22 | 23 | @ApiModelProperty(value = "请求url") 24 | @Column(name = "url") 25 | private String url; 26 | 27 | @ApiModelProperty(value = "请求头") 28 | @Column(name = "headers") 29 | private String headers; 30 | 31 | @ApiModelProperty(value = "ip地址") 32 | @Column(name = "ip") 33 | private String ip; 34 | 35 | @ApiModelProperty(value = "请求参数") 36 | @Column(name = "params") 37 | private String params; 38 | 39 | @ApiModelProperty(value = "请求结果") 40 | @Column(name = "result") 41 | private String result; 42 | 43 | @ApiModelProperty(value = "请求开始时间") 44 | @Column(name = "start_time") 45 | private Date startTime; 46 | 47 | @ApiModelProperty(value = "耗时") 48 | @Column(name = "run_time") 49 | private Long runTime; 50 | 51 | @ApiModelProperty(value = "接口描述") 52 | @Column(name = "description") 53 | private String description; 54 | 55 | @ApiModelProperty(value = "请求结束时间") 56 | @Column(name = "end_time") 57 | private Date endTime; 58 | 59 | @ApiModelProperty(value = "操作类型") 60 | @Column(name = "oparation") 61 | private String oparation; 62 | 63 | @ApiModelProperty(value = "请求类型,get,post,put") 64 | @Column(name = "type") 65 | private String type; 66 | 67 | @ApiModelProperty(value = "url上面的参数") 68 | @Column(name = "query_string") 69 | private String queryString; 70 | 71 | @ApiModelProperty(value = "用户id") 72 | @Column(name = "user_id") 73 | private String userId; 74 | } 75 | -------------------------------------------------------------------------------- /player-learn/src/main/java/com/player/learn/service/IChapterService.java: -------------------------------------------------------------------------------- 1 | package com.player.learn.service; 2 | 3 | import com.player.common.entity.ResultEntity; 4 | import com.player.learn.entity.ChapterLogEntity; 5 | 6 | public interface IChapterService { 7 | 8 | ResultEntity findAllByCourseName(String courseName); 9 | 10 | ResultEntity saveChapterLog(ChapterLogEntity chapterLogEntity, String token); 11 | } 12 | -------------------------------------------------------------------------------- /player-learn/src/main/java/com/player/learn/service/ICourseService.java: -------------------------------------------------------------------------------- 1 | package com.player.learn.service; 2 | 3 | import com.player.common.entity.ResultEntity; 4 | import com.player.learn.entity.ChapterLogEntity; 5 | import com.player.learn.entity.CourseLogEntity; 6 | 7 | public interface ICourseService { 8 | 9 | ResultEntity findAllByClassify(String classify,int pageNum,int pageSize); 10 | 11 | ResultEntity findAllByCategory(String category); 12 | 13 | ResultEntity findAllByClassifyGroup(); 14 | 15 | ResultEntity saveCourseLog(CourseLogEntity courseLogEntity, String token); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /player-learn/src/main/java/com/player/learn/service/imp/ChapterService.java: -------------------------------------------------------------------------------- 1 | package com.player.learn.service.imp; 2 | 3 | import com.player.common.entity.ResultEntity; 4 | import com.player.common.entity.ResultUtil; 5 | import com.player.learn.dao.ChapterDao; 6 | import com.player.learn.dao.ChapterLogDao; 7 | import com.player.learn.entity.ChapterLogEntity; 8 | import com.player.learn.service.IChapterService; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.data.domain.Sort; 11 | import org.springframework.stereotype.Service; 12 | 13 | 14 | @Service 15 | public class ChapterService implements IChapterService { 16 | @Autowired 17 | private ChapterDao chapterDao; 18 | 19 | @Autowired 20 | private ChapterLogDao chapterLogDao; 21 | 22 | @Override 23 | public ResultEntity findAllByCourseName(String courseName) { 24 | return ResultUtil.success(chapterDao.findAllByCourseName(courseName, Sort.by("createTime").descending())); 25 | } 26 | 27 | @Override 28 | public ResultEntity saveChapterLog(ChapterLogEntity chapterLogEntity, String token) { 29 | return ResultUtil.success(chapterLogDao.save(chapterLogEntity)); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /player-learn/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | static: 2 | file-path: E:/ #静态文件的访问的根路径 3 | server: 4 | port: 6000 5 | spring: 6 | redis: 7 | database: 0 # Redis数据库索引(默认为0) 8 | host: 127.0.0.1 # Redis服务器地址 9 | port: 6379 # Redis服务器连接端口 10 | password: # Redis服务器连接密码(默认为空) 11 | timeout: 5000 # 连接超时时间(毫秒) 12 | jedis: 13 | pool: 14 | max-active: 8 # 连接池最大连接数(使用负值表示没有限制) 15 | max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制) 16 | max-idle: 8 # 连接池中的最大空闲连接 17 | min-idle: 0 # 连接池中的最小空闲连接 18 | jpa: 19 | show-sql: true 20 | application: 21 | name: player-learn 22 | datasource: 23 | druid: 24 | url: jdbc:mysql://127.0.0.1:3306/play?characterEncoding=utf-8 25 | username: root 26 | password: wwq_2021 27 | driverClassName: com.mysql.jdbc.Driver 28 | initialSize: 5 #初始建立连接数量 29 | minIdle: 5 #最小连接数量 30 | maxActive: 20 #最大连接数量 31 | maxWait: 10000 #获取连接最大等待时间,毫秒 32 | testOnBorrow: true #申请连接时检测连接是否有效 33 | testOnReturn: false #归还连接时检测连接是否有效 34 | timeBetweenEvictionRunsMillis: 60000 #配置间隔检测连接是否有效的时间(单位是毫秒) 35 | minEvictableIdleTimeMillis: 300000 #连接在连接池的最小生存时间(毫秒) -------------------------------------------------------------------------------- /player-learn/src/test/java/com/player/learn/LearnApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.player.learn; 2 | 3 | import org.junit.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class LearnApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /player-movie/src/main/java/com/player/movie/PlayerMovieApplication.java: -------------------------------------------------------------------------------- 1 | package com.player.movie; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | @SpringBootApplication(scanBasePackages = "com.player.movie") 8 | @MapperScan("com.player.movie.mapper") 9 | public class PlayerMovieApplication { 10 | public static void main(String[] args) { 11 | SpringApplication.run(PlayerMovieApplication.class, args); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /player-movie/src/main/java/com/player/movie/config/AuthInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.player.movie.config; 2 | 3 | import com.alibaba.fastjson.JSONObject; 4 | import com.player.common.entity.ResultEntity; 5 | import com.player.common.entity.ResultUtil; 6 | import com.player.common.entity.UserEntity; 7 | import com.player.common.utils.JwtToken; 8 | import com.player.common.utils.ResultCode; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.beans.factory.annotation.Value; 11 | import org.springframework.data.redis.core.RedisTemplate; 12 | import org.springframework.web.servlet.HandlerInterceptor; 13 | 14 | import javax.servlet.http.HttpServletRequest; 15 | import javax.servlet.http.HttpServletResponse; 16 | import java.io.IOException; 17 | import java.io.PrintWriter; 18 | 19 | public class AuthInterceptor implements HandlerInterceptor { 20 | @Value("${token.secret}") 21 | private String secret; 22 | 23 | @Autowired 24 | private RedisTemplate redisTemplate; 25 | 26 | @Override 27 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { 28 | String token = request.getHeader("Authorization"); 29 | if (token == null || redisTemplate.opsForValue().get(token) == null) { 30 | renderJson(response, ResultUtil.fail("未通过登录认证", null, ResultCode.LOGOUT)); 31 | return false; 32 | } 33 | UserEntity userEntity = JwtToken.parserToken(token, UserEntity.class,secret); 34 | if (userEntity == null) { 35 | response.setContentType("application/json;charset=UTF-8"); 36 | //设置编码格式 37 | response.setCharacterEncoding("UTF-8"); 38 | response.setStatus(401); 39 | response.getWriter().write("未通过登录认证,请在登录页面登录"); 40 | renderJson(response, ResultUtil.fail("未通过登录认证", ResultCode.LOGOUT)); 41 | return false; 42 | } 43 | return true; 44 | } 45 | 46 | protected void renderJson(HttpServletResponse response, ResultEntity resultEntity) { 47 | String dataJson = JSONObject.toJSONString(resultEntity); 48 | PrintWriter writer; 49 | try { 50 | response.setContentType("application/json; charset=utf-8"); 51 | writer = response.getWriter(); 52 | writer.write(dataJson); 53 | writer.flush(); 54 | return; 55 | } catch (IOException e) { 56 | throw new RuntimeException(e); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /player-movie/src/main/java/com/player/movie/config/Swagger2Configuration.java: -------------------------------------------------------------------------------- 1 | package com.player.movie.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import springfox.documentation.builders.ApiInfoBuilder; 6 | import springfox.documentation.builders.PathSelectors; 7 | import springfox.documentation.builders.RequestHandlerSelectors; 8 | import springfox.documentation.service.ApiInfo; 9 | import springfox.documentation.spi.DocumentationType; 10 | import springfox.documentation.spring.web.plugins.Docket; 11 | import springfox.documentation.swagger2.annotations.EnableSwagger2; 12 | 13 | 14 | @Configuration 15 | @EnableSwagger2 16 | public class Swagger2Configuration { 17 | @Bean 18 | public Docket createRestApi() { 19 | return new Docket(DocumentationType.SWAGGER_2) 20 | .apiInfo(apiInfo()) 21 | .select() 22 | .apis(RequestHandlerSelectors.basePackage("com.player")) 23 | .paths(PathSelectors.any()) 24 | .build(); 25 | } 26 | 27 | private ApiInfo apiInfo() { 28 | return new ApiInfoBuilder() 29 | .title("电影") 30 | .description("电影播放器api文档") 31 | .version("1.0") 32 | .build(); 33 | } 34 | 35 | } 36 | 37 | -------------------------------------------------------------------------------- /player-movie/src/main/java/com/player/movie/config/WebAppConfig.java: -------------------------------------------------------------------------------- 1 | package com.player.movie.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.web.servlet.config.annotation.InterceptorRegistration; 6 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; 7 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 8 | 9 | /** 10 | * @Description:拦截器配置 11 | * @author: zk 12 | * @date: 2020年12月25日 21:41 13 | */ 14 | @Configuration 15 | public class WebAppConfig implements WebMvcConfigurer { 16 | @Bean 17 | public AuthInterceptor getAuthInterceptor() { 18 | return new AuthInterceptor(); 19 | } 20 | 21 | @Override 22 | public void addInterceptors(InterceptorRegistry registry) { 23 | //注册TestInterceptor拦截器 24 | InterceptorRegistration registration = registry.addInterceptor(getAuthInterceptor()); 25 | registration.addPathPatterns("/service/movie-getway/**"); //所有路径都被拦截 26 | registration.excludePathPatterns( //添加不拦截路径 27 | "/**/*.html", //html静态资源 28 | "/**/*.js", //js静态资源 29 | "/**/*.css", //css静态资源 30 | "/**/*.woff", 31 | "/**/*.ttf" 32 | ); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /player-movie/src/main/java/com/player/movie/entity/MovieEntity.java: -------------------------------------------------------------------------------- 1 | package com.player.movie.entity; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | import lombok.ToString; 6 | 7 | import java.util.Date; 8 | 9 | @Data 10 | @ToString 11 | public class MovieEntity { 12 | @ApiModelProperty(value = "主键") 13 | private Long id;//主键 14 | 15 | @ApiModelProperty(value = "电影id") 16 | private Long movieId; 17 | 18 | @ApiModelProperty(value = "导演") 19 | private String director;//导演 20 | 21 | @ApiModelProperty(value = "主演") 22 | private String star;//主演 23 | 24 | @ApiModelProperty(value = "类型") 25 | private String type;//类型 26 | 27 | @ApiModelProperty(value = "国家/语言") 28 | private String countryLanguage;//国家/语言 29 | 30 | @ApiModelProperty(value = "观看状态") 31 | private String viewingState;//观看状态 32 | 33 | @ApiModelProperty(value = "上映时间") 34 | private String releaseTime;//上映时间 35 | 36 | @ApiModelProperty(value = "剧情") 37 | private String plot;//剧情 38 | 39 | @ApiModelProperty(value = "更新时间") 40 | private Date updateTime;//更新时间 41 | 42 | @ApiModelProperty(value = "电影名称") 43 | private String movieName;//电影名称 44 | 45 | @ApiModelProperty(value = "是否推荐,0:不推荐,1:推荐") 46 | private String isRecommend;//是否推荐,0:不推荐,1:推荐 47 | 48 | @ApiModelProperty(value = "电影海报") 49 | private String img;//电影海报 50 | 51 | @ApiModelProperty(value = "分类 电影,电视剧,动漫,综艺,新片库,福利,午夜,恐怖,其他") 52 | private String classify;//分类 电影,电视剧,动漫,综艺,新片库,福利,午夜,恐怖,其他 53 | 54 | @ApiModelProperty(value = "来源名称,本地,骑士影院,爱奇艺") 55 | private String sourceName;//来源名称,本地,骑士影院,爱奇艺 56 | 57 | @ApiModelProperty(value = "来源地址") 58 | private String sourceUrl;//来源地址 59 | 60 | @ApiModelProperty(value = "创建时间") 61 | private Date createTime;//创建时间 62 | 63 | @ApiModelProperty(value = "本地图片") 64 | private String localImg;//本地图片 65 | 66 | @ApiModelProperty(value = "播放集数") 67 | private String label;//播放集数 68 | 69 | @ApiModelProperty(value = "源地址") 70 | private String originalHref;//源地址 71 | 72 | @ApiModelProperty(value = "简单描述") 73 | private String description;//简单描述 74 | 75 | @ApiModelProperty(value = "链接地址") 76 | private String targetHref;//链接地址 77 | 78 | @ApiModelProperty(value = "0代表未使用,1表示正在使用,是banner和carousel图的才有") 79 | private String useStatus;//0代表未使用,1表示正在使用,是banner和carousel图的才有 80 | 81 | @ApiModelProperty(value = "评分") 82 | private Double score;//评分 83 | 84 | @ApiModelProperty(value = "类目,值为banner首屏,carousel:滚动轮播") 85 | private String category;//类目,值为banner首屏,carousel:滚动轮播 86 | 87 | @ApiModelProperty(value = "排名") 88 | private String ranks;//排名 89 | 90 | @ApiModelProperty(value = "用户名,这这个表不需要,为了跟记录叫和收藏表的结构一致',") 91 | private String userId;//用户名,这这个表不需要,为了跟记录叫和收藏表的结构一致', 92 | 93 | @ApiModelProperty(value = "豆瓣网的url',") 94 | private String doubanUrl; 95 | 96 | @ApiModelProperty(value = "播放时长") 97 | private int duration; 98 | 99 | @ApiModelProperty(value = "观看权限") 100 | private int privilegeId; 101 | } 102 | -------------------------------------------------------------------------------- /player-movie/src/main/java/com/player/movie/entity/MovieStarEntity.java: -------------------------------------------------------------------------------- 1 | package com.player.movie.entity; 2 | import io.swagger.annotations.ApiModelProperty; 3 | import lombok.Data; 4 | import lombok.ToString; 5 | 6 | import java.util.Date; 7 | 8 | @Data 9 | @ToString 10 | public class MovieStarEntity { 11 | 12 | @ApiModelProperty(value = "主键") 13 | private Long id; 14 | 15 | @ApiModelProperty(value = "演员名称") 16 | private String starName; 17 | 18 | @ApiModelProperty(value = "演员图片地址") 19 | private String img; 20 | 21 | @ApiModelProperty(value = "演员本地本地图片") 22 | private String localImg; 23 | 24 | @ApiModelProperty(value = "创建时间") 25 | private Date createTime; 26 | 27 | @ApiModelProperty(value = "创建时间") 28 | private Date updateTime; 29 | 30 | @ApiModelProperty(value = "电影的id") 31 | private String movieId; 32 | 33 | @ApiModelProperty(value = "角色") 34 | private String role; 35 | 36 | @ApiModelProperty(value = "演员的豆瓣链接地址") 37 | private String href; 38 | 39 | @ApiModelProperty(value = "代表作") 40 | private String works; 41 | } 42 | -------------------------------------------------------------------------------- /player-movie/src/main/java/com/player/movie/entity/MovieUrlEntity.java: -------------------------------------------------------------------------------- 1 | package com.player.movie.entity; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | import lombok.ToString; 6 | 7 | @Data 8 | @ToString 9 | public class MovieUrlEntity { 10 | @ApiModelProperty(value = "主键") 11 | private int id;//主键 12 | 13 | @ApiModelProperty(value = "电影名称") 14 | private String movieName; 15 | 16 | @ApiModelProperty(value = "对应的电影的id") 17 | private int movieId; 18 | 19 | @ApiModelProperty(value = "源地址") 20 | private String href; 21 | 22 | @ApiModelProperty(value = "集数") 23 | private String label; 24 | 25 | @ApiModelProperty(value = "创建时间") 26 | private String createTime; 27 | 28 | @ApiModelProperty(value = "播放地址") 29 | private String updateTime; 30 | 31 | @ApiModelProperty(value = "播放地址") 32 | private String url; 33 | 34 | @ApiModelProperty(value = "播放分组,1, 2") 35 | private String playGroup; 36 | 37 | } 38 | -------------------------------------------------------------------------------- /player-movie/src/main/java/com/player/movie/mapper/MovieMapper.java: -------------------------------------------------------------------------------- 1 | package com.player.movie.mapper; 2 | 3 | import com.player.common.entity.LogEntity; 4 | import com.player.common.entity.SearchHistory; 5 | import com.player.movie.entity.MovieEntity; 6 | import com.player.movie.entity.MovieStarEntity; 7 | import com.player.movie.entity.MovieUrlEntity; 8 | import org.apache.ibatis.annotations.Param; 9 | import org.springframework.stereotype.Repository; 10 | 11 | import java.util.List; 12 | import java.util.Map; 13 | @Repository 14 | public interface MovieMapper { 15 | /** 16 | * @author: wuwenqiang 17 | * @description: 查询电影分类 18 | * @date: 2020-12-21 22:40 19 | */ 20 | List> findClassify(); 21 | 22 | /** 23 | * @author: wuwenqiang 24 | * @description: 查询推荐电影 25 | * @date: 2020-12-24 23:50 26 | */ 27 | MovieEntity getKeyWord(String classify); 28 | 29 | /** 30 | * @author: wuwenqiang 31 | * @description: 查询用户访问记录 32 | * @date: 2020-12-24 23:50 33 | */ 34 | Map getUserMsg(String userId); 35 | 36 | /** 37 | * @author: wuwenqiang 38 | * @description: 按classify大类查询所有catory小类 39 | * @date: 2020-12-25 22:25 40 | */ 41 | List> getAllCategoryByClassify(String classsify); 42 | 43 | /** 44 | * @author: wuwenqiang 45 | * @description: 按页面获取要展示的category小类 46 | * @date: 2020-12-25 22:25 47 | */ 48 | List> getAllCategoryListByPageName(String pageName); 49 | 50 | /** 51 | * @author: wuwenqiang 52 | * @description: 获取大类中的小类 53 | * @date: 2020-12-25 22:25 54 | */ 55 | List getCategoryList(String classify, String category); 56 | 57 | /** 58 | * @author: wuwenqiang 59 | * @description: 根据分类获取前20条数据 60 | * @date: 2021-12-21 23:36 61 | */ 62 | List getTopMovieList(String classify, String category); 63 | 64 | List search(String classify, String category, String label,String star,String director,String keyword,int start,int pageSize); 65 | 66 | Long searchTotal(String classify, String category, String label,String star,String director,String keyword); 67 | 68 | Long log(LogEntity logEntity); 69 | 70 | List getStar(Long movieId); 71 | 72 | List getMovieUrl(Long movieId); 73 | 74 | List getPlayRecord(String userId,int start,int pageSize); 75 | 76 | Long savePlayRecord(MovieEntity movieEntity); 77 | 78 | List getViewRecord(String userId,int start,int pageSize); 79 | 80 | Long saveViewRecord(MovieEntity movieEntity); 81 | 82 | List getFavoriteList(String userId,int start,int pageSize); 83 | 84 | Long saveFavorite(int movieId, String userId); 85 | 86 | Long deleteFavorite(int movieId,String userId); 87 | 88 | Long isFavorite(Long movieId, String userId); 89 | 90 | List getYourLikes(@Param("labels") String[] labels,String classify); 91 | 92 | List getRecommend(String classify); 93 | 94 | MovieEntity getMovieDetail(int movieId); 95 | 96 | List getMovieListByType(@Param("types") String[] types,String classify); 97 | 98 | List getSearchHistory(String userId, int start, int pageSize); 99 | 100 | Long getSearchHistoryTotal(String userId); 101 | } 102 | -------------------------------------------------------------------------------- /player-movie/src/main/java/com/player/movie/service/IMovieService.java: -------------------------------------------------------------------------------- 1 | package com.player.movie.service; 2 | 3 | import com.player.common.entity.ResultEntity; 4 | import com.player.movie.entity.MovieEntity; 5 | 6 | public interface IMovieService { 7 | 8 | ResultEntity findClassify(String redisKey); 9 | 10 | ResultEntity getKeyWord(String classify,String redisKey); 11 | 12 | ResultEntity getUserMsg(String token); 13 | 14 | ResultEntity getAllCategoryByClassify(String classsify,String redisKey); 15 | 16 | ResultEntity getAllCategoryListByPageName(String pageName,String redisKey); 17 | 18 | ResultEntity getCategoryList(String classify, String category,String redisKey); 19 | 20 | ResultEntity getTopMovieList(String classify, String category,String redisKey); 21 | 22 | ResultEntity search(String classify, String category, String label,String star,String director,String keyword,int pageNum,int pageSize,String redisKey); 23 | 24 | ResultEntity getStar(Long movieId,String redisKey); 25 | 26 | ResultEntity getMovieUrl(Long movieId,String redisKey); 27 | 28 | ResultEntity getPlayRecord(String token,int pageNum,int pageSize); 29 | 30 | ResultEntity savePlayRecord(MovieEntity movieEntity,String token); 31 | 32 | ResultEntity getViewRecord(String token,int pageNum,int pageSize); 33 | 34 | ResultEntity saveViewRecord(MovieEntity movieEntity,String token); 35 | 36 | ResultEntity getFavoriteList(String token,int pageNum,int pageSize); 37 | 38 | ResultEntity saveFavorite(int movieId,String token); 39 | 40 | ResultEntity deleteFavorite(int movieId,String token); 41 | 42 | ResultEntity isFavorite(Long movieId, String token); 43 | 44 | ResultEntity getYourLikes(String labels,String classify,String redisKey); 45 | 46 | ResultEntity getRecommend(String classify,String redisKey); 47 | 48 | ResultEntity getMovieDetail(int movieId); 49 | 50 | ResultEntity getMovieListByType(String types,String classify,String redisKey); 51 | 52 | ResultEntity getSearchHistory(String token,int pageNum,int pageSize); 53 | 54 | } 55 | -------------------------------------------------------------------------------- /player-movie/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | static: 2 | file-path: E:/ 3 | server: 4 | port: 3001 5 | tomcat: 6 | uri-encoding: UTF-8 7 | token: 8 | expiration-time: 2592000000 #token失效时间一个月 1000 * 60 * 60 * 24 * 30 9 | secret: ${SECRET} #token秘钥 10 | app: 11 | appId: com.play.movie 12 | appName: flutter在线电影 13 | spring: 14 | http: 15 | encoding: 16 | charset: UTF-8 17 | force: true 18 | enabled: true 19 | redis: 20 | database: 0 # Redis数据库索引(默认为0) 21 | host: 127.0.0.1 # Redis服务器地址 22 | port: 6379 # Redis服务器连接端口 23 | password: # Redis服务器连接密码(默认为空) 24 | timeout: 5000 # 连接超时时间(毫秒) 25 | jedis: 26 | pool: 27 | max-active: 8 # 连接池最大连接数(使用负值表示没有限制) 28 | max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制) 29 | max-idle: 8 # 连接池中的最大空闲连接 30 | min-idle: 0 # 连接池中的最小空闲连接 31 | application: 32 | name: player-movie 33 | datasource: 34 | druid: 35 | url: jdbc:mysql://localhost:3306/play?characterEncoding=utf-8 36 | username: root 37 | password: wwq_2021 38 | driverClassName: com.mysql.jdbc.Driver 39 | initialSize: 5 #初始建立连接数量 40 | minIdle: 5 #最小连接数量 41 | maxActive: 20 #最大连接数量 42 | maxWait: 10000 #获取连接最大等待时间,毫秒 43 | testOnBorrow: true #申请连接时检测连接是否有效 44 | testOnReturn: false #归还连接时检测连接是否有效 45 | timeBetweenEvictionRunsMillis: 60000 #配置间隔检测连接是否有效的时间(单位是毫秒) 46 | minEvictableIdleTimeMillis: 300000 #连接在连接池的最小生存时间(毫秒) 47 | #mybatis: 48 | # mapper-locations: classpath:mapper/*Mapper.xml 49 | 50 | mybatis: 51 | mapper-locations: classpath:mapper/*Mapper.xml 52 | type-aliases-package: com.player.movie.entity 53 | configuration: 54 | map-underscore-to-camel-case: true 55 | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl -------------------------------------------------------------------------------- /player-movie/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuyuanwuhui99/springboot-app-service/3cf924cf4fcc905514c081aa637d871c161b5a1f/player-movie/src/main/resources/log4j.properties -------------------------------------------------------------------------------- /player-music/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | 30 | ### VS Code ### 31 | .vscode/ 32 | -------------------------------------------------------------------------------- /player-music/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuyuanwuhui99/springboot-app-service/3cf924cf4fcc905514c081aa637d871c161b5a1f/player-music/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /player-music/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /player-music/src/main/java/com/player/music/PlayerMusicApplication.java: -------------------------------------------------------------------------------- 1 | package com.player.music; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | @SpringBootApplication 8 | @MapperScan("com.player.music.mapper") 9 | public class PlayerMusicApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(PlayerMusicApplication.class, args); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /player-music/src/main/java/com/player/music/config/AuthInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.player.music.config; 2 | 3 | import com.alibaba.fastjson.JSONObject; 4 | import com.player.common.entity.ResultEntity; 5 | import com.player.common.entity.ResultUtil; 6 | import com.player.common.entity.UserEntity; 7 | import com.player.common.utils.JwtToken; 8 | import com.player.common.utils.ResultCode; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.beans.factory.annotation.Value; 11 | import org.springframework.data.redis.core.RedisTemplate; 12 | import org.springframework.stereotype.Component; 13 | import org.springframework.web.servlet.HandlerInterceptor; 14 | 15 | import javax.servlet.http.HttpServletRequest; 16 | import javax.servlet.http.HttpServletResponse; 17 | import java.io.IOException; 18 | import java.io.PrintWriter; 19 | 20 | @Component 21 | public class AuthInterceptor implements HandlerInterceptor { 22 | @Value("${token.secret}") 23 | private String secret; 24 | 25 | @Autowired 26 | private RedisTemplate redisTemplate; 27 | 28 | @Override 29 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { 30 | String token = request.getHeader("Authorization"); 31 | if (token == null || redisTemplate.opsForValue().get(token) == null) { 32 | renderJson(response, ResultUtil.fail("未通过登录认证", null, ResultCode.LOGOUT)); 33 | return false; 34 | } 35 | UserEntity userEntity = JwtToken.parserToken(token, UserEntity.class,secret); 36 | if (userEntity == null) { 37 | response.setContentType("application/json;charset=UTF-8"); 38 | //设置编码格式 39 | response.setCharacterEncoding("UTF-8"); 40 | response.setStatus(401); 41 | response.getWriter().write("未通过登录认证,请在登录页面登录"); 42 | renderJson(response, ResultUtil.fail("未通过登录认证", ResultCode.LOGOUT)); 43 | return false; 44 | } 45 | return true; 46 | } 47 | 48 | protected void renderJson(HttpServletResponse response, ResultEntity resultEntity) { 49 | String dataJson = JSONObject.toJSONString(resultEntity); 50 | PrintWriter writer; 51 | try { 52 | response.setContentType("application/json; charset=utf-8"); 53 | writer = response.getWriter(); 54 | writer.write(dataJson); 55 | writer.flush(); 56 | return; 57 | } catch (IOException e) { 58 | throw new RuntimeException(e); 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /player-music/src/main/java/com/player/music/config/Swagger2Configuration.java: -------------------------------------------------------------------------------- 1 | package com.player.music.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import springfox.documentation.builders.ApiInfoBuilder; 6 | import springfox.documentation.builders.PathSelectors; 7 | import springfox.documentation.builders.RequestHandlerSelectors; 8 | import springfox.documentation.service.ApiInfo; 9 | import springfox.documentation.spi.DocumentationType; 10 | import springfox.documentation.spring.web.plugins.Docket; 11 | import springfox.documentation.swagger2.annotations.EnableSwagger2; 12 | 13 | 14 | @Configuration 15 | @EnableSwagger2 16 | public class Swagger2Configuration { 17 | @Bean 18 | public Docket createRestApi() { 19 | return new Docket(DocumentationType.SWAGGER_2) 20 | .apiInfo(apiInfo()) 21 | .select() 22 | .apis(RequestHandlerSelectors.basePackage("com.player")) 23 | .paths(PathSelectors.any()) 24 | .build(); 25 | } 26 | 27 | private ApiInfo apiInfo() { 28 | return new ApiInfoBuilder() 29 | .title("抖音音乐") 30 | .description("音乐播放器api文档") 31 | .version("1.0") 32 | .build(); 33 | } 34 | 35 | } 36 | 37 | -------------------------------------------------------------------------------- /player-music/src/main/java/com/player/music/config/WebAppConfig.java: -------------------------------------------------------------------------------- 1 | package com.player.music.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.web.servlet.config.annotation.InterceptorRegistration; 6 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; 7 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 8 | 9 | /** 10 | * @Description:拦截器配置 11 | * @author: zk 12 | * @date: 2020年12月25日 21:41 13 | */ 14 | @Configuration 15 | public class WebAppConfig implements WebMvcConfigurer { 16 | @Bean 17 | public AuthInterceptor getAuthInterceptor() { 18 | return new AuthInterceptor(); 19 | } 20 | 21 | @Override 22 | public void addInterceptors(InterceptorRegistry registry) { 23 | //注册TestInterceptor拦截器 24 | InterceptorRegistration registration = registry.addInterceptor(getAuthInterceptor()); 25 | registration.addPathPatterns("/service/music-getway/**"); //所有路径都被拦截 26 | registration.excludePathPatterns( //添加不拦截路径 27 | "/**/*.html", //html静态资源 28 | "/**/*.js", //js静态资源 29 | "/**/*.css", //css静态资源 30 | "/**/*.woff", 31 | "/**/*.ttf" 32 | ); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /player-music/src/main/java/com/player/music/entity/DouyinEntity.java: -------------------------------------------------------------------------------- 1 | package com.player.music.entity; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | 6 | import javax.persistence.Column; 7 | import javax.persistence.Entity; 8 | import javax.persistence.Id; 9 | import javax.persistence.Table; 10 | import java.io.Serializable; 11 | import java.util.Date; 12 | 13 | @Data 14 | @Entity 15 | @Table(name = "music_douyin") 16 | public class DouyinEntity implements Serializable { 17 | 18 | @ApiModelProperty(value = "主键") 19 | @Id 20 | @Column(name = "id") 21 | private Long id; 22 | 23 | @ApiModelProperty(value = "albummid") 24 | @Column(name = "albummid") 25 | private String albummid; 26 | 27 | @ApiModelProperty(value = "歌曲时长") 28 | @Column(name = "duration") 29 | private Integer duration; 30 | 31 | @ApiModelProperty(value = "歌曲图片") 32 | @Column(name = "image") 33 | private String image; 34 | 35 | @ApiModelProperty(value = "mid") 36 | @Column(name = "mid") 37 | private String mid; 38 | 39 | @ApiModelProperty(value = "歌曲名称") 40 | @Column(name = "name") 41 | private String name; 42 | 43 | @ApiModelProperty(value = "歌手") 44 | @Column(name = "singer") 45 | private String singer; 46 | 47 | @ApiModelProperty(value = "歌曲播放地址,如果play_mode:local时,则使用local_url作为播放地址") 48 | @Column(name = "url") 49 | private String url; 50 | 51 | @ApiModelProperty(value = "创建时间") 52 | @Column(name = "create_time") 53 | private Date createTime; 54 | 55 | @ApiModelProperty(value = "播放次数") 56 | @Column(name = "timer") 57 | private Integer timer; 58 | 59 | @ApiModelProperty(value = "更新时间,按更新时间排序") 60 | @Column(name = "update_time") 61 | private Date updateTime; 62 | 63 | @ApiModelProperty(value = "酷狗播放地址") 64 | @Column(name = "kugou_url") 65 | private String kugouUrl; 66 | 67 | @ApiModelProperty(value = "播放模式,使用酷狗音乐的url或使用QQ音乐的url") 68 | @Column(name = "play_mode") 69 | private String playMode; 70 | 71 | @ApiModelProperty(value = "其他播放地址") 72 | @Column(name = "other_url") 73 | private String otherUrl; 74 | 75 | @ApiModelProperty(value = "本地播放地址") 76 | @Column(name = "local_url") 77 | private String localUrl; 78 | 79 | @ApiModelProperty(value = "是否禁用,1:禁用,0:不禁用") 80 | @Column(name = "disabled") 81 | private String disabled; 82 | 83 | @ApiModelProperty(value = "歌词") 84 | @Column(name = "lyric") 85 | private String lyric; 86 | 87 | @ApiModelProperty(value = "本地歌曲图片") 88 | @Column(name = "local_image") 89 | private String localImage; 90 | } 91 | -------------------------------------------------------------------------------- /player-music/src/main/java/com/player/music/entity/FavoriteMusicEntity.java: -------------------------------------------------------------------------------- 1 | package com.player.music.entity; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | 6 | import javax.persistence.*; 7 | import java.util.Date; 8 | 9 | @Data 10 | @Entity 11 | @Table(name = "music_favorite") 12 | public class FavoriteMusicEntity { 13 | @ApiModelProperty(value = "主键") 14 | @Id 15 | @GeneratedValue(strategy = GenerationType.IDENTITY) 16 | @Column(name = "t_id") 17 | private Long tId; 18 | 19 | @Column(name = "id") 20 | private Long id; 21 | 22 | @ApiModelProperty(value = "albummid") 23 | @Column(name = "albummid") 24 | private String albummid; 25 | 26 | @ApiModelProperty(value = "歌曲时长") 27 | @Column(name = "duration") 28 | private Integer duration; 29 | 30 | @ApiModelProperty(value = "歌曲图片") 31 | @Column(name = "image") 32 | private String image; 33 | 34 | @ApiModelProperty(value = "mid") 35 | @Column(name = "mid") 36 | private String mid; 37 | 38 | @ApiModelProperty(value = "歌曲名称") 39 | @Column(name = "name") 40 | private String name; 41 | 42 | @ApiModelProperty(value = "歌手") 43 | @Column(name = "singer") 44 | private String singer; 45 | 46 | @ApiModelProperty(value = "歌曲播放地址,如果play_mode:local时,则使用local_url作为播放地址") 47 | @Column(name = "url") 48 | private String url; 49 | 50 | @ApiModelProperty(value = "创建时间") 51 | @Column(name = "create_time") 52 | private Date createTime; 53 | 54 | @ApiModelProperty(value = "播放次数") 55 | @Column(name = "timer") 56 | private Integer timer; 57 | 58 | @ApiModelProperty(value = "更新时间,按更新时间排序") 59 | @Column(name = "update_time") 60 | private Date updateTime; 61 | 62 | @ApiModelProperty(value = "酷狗播放地址") 63 | @Column(name = "kugou_url") 64 | private String kugouUrl; 65 | 66 | @ApiModelProperty(value = "播放模式,使用酷狗音乐的url或使用QQ音乐的url") 67 | @Column(name = "play_mode") 68 | private String playMode; 69 | 70 | @ApiModelProperty(value = "其他播放地址") 71 | @Column(name = "other_url") 72 | private String otherUrl; 73 | 74 | @ApiModelProperty(value = "本地播放地址") 75 | @Column(name = "local_url") 76 | private String localUrl; 77 | 78 | @ApiModelProperty(value = "是否禁用,1:禁用,0:不禁用") 79 | @Column(name = "disabled") 80 | private String disabled; 81 | 82 | @ApiModelProperty(value = "用户id") 83 | @Column(name = "user_id") 84 | private String userId; 85 | 86 | @ApiModelProperty(value = "歌词") 87 | @Column(name = "lyric") 88 | private String lyric; 89 | 90 | @ApiModelProperty(value = "本地歌曲图片") 91 | @Column(name = "local_image") 92 | private String localImage; 93 | } 94 | -------------------------------------------------------------------------------- /player-music/src/main/java/com/player/music/entity/LogEntity.java: -------------------------------------------------------------------------------- 1 | package com.player.music.entity; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | 6 | import javax.persistence.*; 7 | import java.util.Date; 8 | 9 | 10 | @Data 11 | @Entity 12 | @Table(name = "log") 13 | public class LogEntity { 14 | 15 | @ApiModelProperty(value = "主键") 16 | @Id 17 | @GeneratedValue(strategy = GenerationType.IDENTITY) 18 | @Column(name = "id") 19 | private int id; 20 | 21 | @ApiModelProperty(value = "请求方法") 22 | @Column(name = "method") 23 | private String method; 24 | 25 | @ApiModelProperty(value = "请求url") 26 | @Column(name = "url") 27 | private String url; 28 | 29 | @ApiModelProperty(value = "请求头") 30 | @Column(name = "headers") 31 | private String headers; 32 | 33 | @ApiModelProperty(value = "ip地址") 34 | @Column(name = "ip") 35 | private String ip; 36 | 37 | @ApiModelProperty(value = "请求参数") 38 | @Column(name = "params") 39 | private String params; 40 | 41 | @ApiModelProperty(value = "url上面的参数") 42 | @Column(name = "query_string") 43 | private String queryString; 44 | 45 | @ApiModelProperty(value = "请求结果") 46 | @Column(name = "result") 47 | private String result; 48 | 49 | @ApiModelProperty(value = "请求开始时间") 50 | @Column(name = "start_time") 51 | private Date startTime; 52 | 53 | @ApiModelProperty(value = "耗时") 54 | @Column(name = "run_time") 55 | private Long runTime; 56 | 57 | @ApiModelProperty(value = "接口描述") 58 | @Column(name = "description") 59 | private String description; 60 | 61 | @ApiModelProperty(value = "请求结束时间") 62 | @Column(name = "end_time") 63 | private Date endTime; 64 | 65 | @ApiModelProperty(value = "操作类型") 66 | @Column(name = "oparation") 67 | private String oparation; 68 | 69 | @ApiModelProperty(value = "请求类型,get,post,put") 70 | @Column(name = "type") 71 | private String type; 72 | 73 | @ApiModelProperty(value = "用户id") 74 | @Column(name = "user_id") 75 | private String userId; 76 | 77 | @ApiModelProperty(value = "应用id") 78 | @Column(name = "app_id") 79 | private String appId; 80 | 81 | @ApiModelProperty(value = "应用名称") 82 | @Column(name = "app_name") 83 | private String appName; 84 | } 85 | -------------------------------------------------------------------------------- /player-music/src/main/java/com/player/music/entity/MusicAuthorEntity.java: -------------------------------------------------------------------------------- 1 | package com.player.music.entity; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | import lombok.ToString; 6 | 7 | import java.util.Date; 8 | 9 | @Data 10 | @ToString 11 | public class MusicAuthorEntity { 12 | 13 | @ApiModelProperty(value = "主键") 14 | private int id; 15 | 16 | @ApiModelProperty(value = "歌手id") 17 | private int authorId; 18 | 19 | @ApiModelProperty(value = "歌手名称") 20 | private String authorName; 21 | 22 | @ApiModelProperty(value = "语言") 23 | private String language; 24 | 25 | @ApiModelProperty(value = "是否发布") 26 | private int isPublish; 27 | 28 | @ApiModelProperty(value = "头像") 29 | private String avatar; 30 | 31 | @ApiModelProperty(value = "类型") 32 | private int type; 33 | 34 | @ApiModelProperty(value = "国家") 35 | private String country; 36 | 37 | @ApiModelProperty(value = "生日") 38 | private String birthday; 39 | 40 | @ApiModelProperty(value = "身份") 41 | private int identity; 42 | 43 | @ApiModelProperty(value = "排名") 44 | private int rank; 45 | 46 | @ApiModelProperty(value = "创建时间") 47 | private Date createTime; 48 | 49 | @ApiModelProperty(value = "更新时间") 50 | private Date updateTime; 51 | 52 | @ApiModelProperty(value = "总数") 53 | private int total; 54 | } 55 | -------------------------------------------------------------------------------- /player-music/src/main/java/com/player/music/entity/MusicClassifyEntity.java: -------------------------------------------------------------------------------- 1 | package com.player.music.entity; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | import lombok.ToString; 6 | 7 | import java.util.Date; 8 | 9 | @Data 10 | @ToString 11 | public class MusicClassifyEntity { 12 | 13 | @ApiModelProperty(value = "主键") 14 | private int id; 15 | 16 | @ApiModelProperty(value = "分类名称") 17 | private String classifyName; 18 | 19 | @ApiModelProperty(value = "权限") 20 | private int permission; 21 | 22 | @ApiModelProperty(value = "分类排名") 23 | private int classifyRank; 24 | 25 | @ApiModelProperty(value = "是否禁用") 26 | private int disabled; 27 | 28 | @ApiModelProperty(value = "创建时间") 29 | private Date createTime; 30 | 31 | @ApiModelProperty(value = "更新时间") 32 | private Date updateTime; 33 | } 34 | -------------------------------------------------------------------------------- /player-music/src/main/java/com/player/music/entity/MyMusiPlayMenuEntity.java: -------------------------------------------------------------------------------- 1 | package com.player.music.entity; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | import lombok.ToString; 6 | 7 | import java.util.Date; 8 | 9 | @Data 10 | @ToString 11 | public class MyMusiPlayMenuEntity { 12 | @ApiModelProperty(value = "主键") 13 | private int id;//主键 14 | 15 | @ApiModelProperty(value = "歌单名称") 16 | private String name; 17 | 18 | @ApiModelProperty(value = "用户id") 19 | private String userId; 20 | 21 | @ApiModelProperty(value = "歌单里面的歌曲总数") 22 | private int total; 23 | 24 | @ApiModelProperty(value = "封面") 25 | private String cover; 26 | 27 | @ApiModelProperty(value = "创建时间") 28 | private Date createTime; 29 | 30 | @ApiModelProperty(value = "更新时间") 31 | private Date updateTime; 32 | } 33 | -------------------------------------------------------------------------------- /player-music/src/main/java/com/player/music/entity/MyMusicAuthorCategoryEntity.java: -------------------------------------------------------------------------------- 1 | package com.player.music.entity; 2 | import io.swagger.annotations.ApiModelProperty; 3 | import lombok.Data; 4 | import lombok.ToString; 5 | 6 | import java.util.Date; 7 | 8 | @Data 9 | @ToString 10 | public class MyMusicAuthorCategoryEntity { 11 | @ApiModelProperty(value = "主键") 12 | private Long id;//主键 13 | 14 | @ApiModelProperty(value = "分类名称") 15 | private String categoryName; 16 | 17 | @ApiModelProperty(value = "排名") 18 | private int rank; 19 | 20 | @ApiModelProperty(value = "是否禁用") 21 | private int disabled; 22 | 23 | @ApiModelProperty(value = "创建时间") 24 | private Date createTime; 25 | 26 | @ApiModelProperty(value = "更新时间") 27 | private Date updateTime; 28 | } 29 | -------------------------------------------------------------------------------- /player-music/src/main/java/com/player/music/entity/MyMusicAuthorEntity.java: -------------------------------------------------------------------------------- 1 | package com.player.music.entity; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | import lombok.ToString; 6 | 7 | import java.util.Date; 8 | 9 | @Data 10 | @ToString 11 | public class MyMusicAuthorEntity { 12 | @ApiModelProperty(value = "主键") 13 | private int id;//主键 14 | 15 | @ApiModelProperty(value = "歌手id") 16 | private String authorId; 17 | 18 | @ApiModelProperty(value = "歌手名称") 19 | private String authorName; 20 | 21 | @ApiModelProperty(value = "歌手头像") 22 | private String avatar; 23 | 24 | @ApiModelProperty(value = "总数") 25 | private int total; 26 | 27 | @ApiModelProperty(value = "是否喜欢") 28 | private int isLike; 29 | 30 | @ApiModelProperty(value = "创建时间") 31 | private Date createTime; 32 | 33 | @ApiModelProperty(value = "更新时间") 34 | private Date updateTime; 35 | } 36 | -------------------------------------------------------------------------------- /player-music/src/main/java/com/player/music/entity/MyMusicEntity.java: -------------------------------------------------------------------------------- 1 | package com.player.music.entity; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | import lombok.ToString; 6 | 7 | import java.util.Date; 8 | 9 | @Data 10 | @ToString 11 | public class MyMusicEntity { 12 | 13 | @ApiModelProperty(value = "主键") 14 | private Long id;//主键 15 | 16 | @ApiModelProperty(value = "专辑id") 17 | private Long albumId; 18 | 19 | @ApiModelProperty(value = "歌曲名称") 20 | private String songName; 21 | 22 | @ApiModelProperty(value = "歌手名称") 23 | private String authorName; 24 | 25 | @ApiModelProperty(value = "歌手id") 26 | private Long authorId; 27 | 28 | @ApiModelProperty(value = "专辑") 29 | private String albumName; 30 | 31 | @ApiModelProperty(value = "版本") 32 | private String version; 33 | 34 | @ApiModelProperty(value = "语言") 35 | private String language; 36 | 37 | @ApiModelProperty(value = "发布时间") 38 | private Date publishDate; 39 | 40 | @ApiModelProperty(value = "未使用字段") 41 | private Long wideAudioId; 42 | 43 | @ApiModelProperty(value = "是否发布") 44 | private Long isPublish; 45 | 46 | @ApiModelProperty(value = "未使用字段") 47 | private Long bigPackId; 48 | 49 | @ApiModelProperty(value = "未使用字段") 50 | private Long finalId; 51 | 52 | @ApiModelProperty(value = "音频id") 53 | private Long audioId; 54 | 55 | @ApiModelProperty(value = "未使用字段") 56 | private Long similarAudioId; 57 | 58 | @ApiModelProperty(value = "是否热门") 59 | private int isHot; 60 | 61 | @ApiModelProperty(value = "音频专辑id") 62 | private Long albumAudioId; 63 | 64 | @ApiModelProperty(value = "歌曲组id") 65 | private Long audioGroupId; 66 | 67 | @ApiModelProperty(value = "歌曲图片") 68 | private String cover; 69 | 70 | @ApiModelProperty(value = "网络播放地址") 71 | private String playUrl; 72 | 73 | @ApiModelProperty(value = "本地播放地址") 74 | private String localPlayUrl; 75 | 76 | @ApiModelProperty(value = "歌曲来源") 77 | private String sourceName; 78 | 79 | @ApiModelProperty(value = "来源地址") 80 | private String sourceUrl; 81 | 82 | @ApiModelProperty(value = "创建时间") 83 | private Date createTime; 84 | 85 | @ApiModelProperty(value = "更新时间") 86 | private Date updateTime; 87 | 88 | @ApiModelProperty(value = "标签") 89 | private String label; 90 | 91 | @ApiModelProperty(value = "歌词") 92 | private String lyrics; 93 | 94 | @ApiModelProperty(value = "播放权限") 95 | private int permission; 96 | 97 | @ApiModelProperty(value = "是否是喜欢,0表示不在喜欢的列表中,1表示在喜欢的列表中") 98 | private int isLike; 99 | 100 | @ApiModelProperty(value = "听过的次数,在获取播放记录的时候才有") 101 | private int times; 102 | } 103 | -------------------------------------------------------------------------------- /player-music/src/main/java/com/player/music/entity/MyMusicFavoriteDirectoryEntity.java: -------------------------------------------------------------------------------- 1 | package com.player.music.entity; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | import lombok.ToString; 6 | 7 | import java.util.Date; 8 | 9 | @Data 10 | @ToString 11 | public class MyMusicFavoriteDirectoryEntity { 12 | 13 | @ApiModelProperty(value = "主键") 14 | private Long id;//主键 15 | 16 | @ApiModelProperty(value = "用户id") 17 | private String userId; 18 | 19 | @ApiModelProperty(value = "收藏夹名称") 20 | private String name; 21 | 22 | @ApiModelProperty(value = "收藏夹总歌曲数据") 23 | private int total; 24 | 25 | @ApiModelProperty(value = "当前这首歌曲是否在这个收藏夹内") 26 | private int checked; 27 | 28 | @ApiModelProperty(value = "封面") 29 | private String cover; 30 | 31 | @ApiModelProperty(value = "创建时间") 32 | private Date createTime; 33 | 34 | @ApiModelProperty(value = "更新时间") 35 | private Date updateTime; 36 | } 37 | -------------------------------------------------------------------------------- /player-music/src/main/java/com/player/music/entity/MyMusicFavoriteEntity.java: -------------------------------------------------------------------------------- 1 | package com.player.music.entity; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | import lombok.ToString; 6 | 7 | import java.util.Date; 8 | 9 | @Data 10 | @ToString 11 | public class MyMusicFavoriteEntity { 12 | 13 | @ApiModelProperty(value = "主键") 14 | private Long id;//主键 15 | 16 | @ApiModelProperty(value = "收藏夹id") 17 | private Long favoriteId; 18 | 19 | @ApiModelProperty(value = "用户id") 20 | private String userId; 21 | 22 | @ApiModelProperty(value = "音乐") 23 | private Long musicId; 24 | 25 | @ApiModelProperty(value = "创建时间") 26 | private Date createTime; 27 | 28 | @ApiModelProperty(value = "更新时间") 29 | private Date updateTime; 30 | } 31 | -------------------------------------------------------------------------------- /player-music/src/main/java/com/player/music/entity/MyMusicRecordEntity.java: -------------------------------------------------------------------------------- 1 | package com.player.music.entity; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | import lombok.ToString; 6 | 7 | import java.util.Date; 8 | 9 | @Data 10 | @ToString 11 | public class MyMusicRecordEntity { 12 | @ApiModelProperty(value = "主键") 13 | private int id;//主键 14 | 15 | @ApiModelProperty(value = "用户id") 16 | private String userId; 17 | 18 | @ApiModelProperty(value = "平台") 19 | private String platform; 20 | 21 | @ApiModelProperty(value = "设备") 22 | private String device; 23 | 24 | @ApiModelProperty(value = "app版本") 25 | private String version; 26 | 27 | @ApiModelProperty(value = "用户id") 28 | private int musicId; 29 | } 30 | -------------------------------------------------------------------------------- /player-music/src/main/java/com/player/music/entity/RecordEntity.java: -------------------------------------------------------------------------------- 1 | package com.player.music.entity; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | 6 | import javax.persistence.*; 7 | import java.util.Date; 8 | 9 | @Data 10 | @Entity 11 | @Table(name = "music_record") 12 | public class RecordEntity { 13 | @ApiModelProperty(value = "主键") 14 | @Id 15 | @GeneratedValue(strategy = GenerationType.IDENTITY) 16 | @Column(name = "record_id") 17 | private Long recordId; 18 | 19 | @ApiModelProperty(value = "歌曲id") 20 | @Column(name = "id") 21 | private Long id; 22 | 23 | @ApiModelProperty(value = "albummid") 24 | @Column(name = "albummid") 25 | private String albummid; 26 | 27 | @ApiModelProperty(value = "歌曲时长") 28 | @Column(name = "duration") 29 | private Integer duration; 30 | 31 | @ApiModelProperty(value = "歌曲图片") 32 | @Column(name = "image") 33 | private String image; 34 | 35 | @ApiModelProperty(value = "mid") 36 | @Column(name = "mid") 37 | private String mid; 38 | 39 | @ApiModelProperty(value = "歌曲名称") 40 | @Column(name = "name") 41 | private String name; 42 | 43 | @ApiModelProperty(value = "歌手") 44 | @Column(name = "singer") 45 | private String singer; 46 | 47 | @ApiModelProperty(value = "歌曲播放地址,如果play_mode:local时,则使用local_url作为播放地址") 48 | @Column(name = "url") 49 | private String url; 50 | 51 | @ApiModelProperty(value = "创建时间") 52 | @Column(name = "create_time") 53 | private Date createTime; 54 | 55 | @ApiModelProperty(value = "user_id") 56 | @Column(name = "user_id") 57 | private String userId; 58 | 59 | @ApiModelProperty(value = "播放次数") 60 | @Column(name = "timer") 61 | private Integer timer; 62 | } 63 | -------------------------------------------------------------------------------- /player-music/src/main/java/com/player/music/entity/ResultEntity.java: -------------------------------------------------------------------------------- 1 | package com.player.music.entity; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | 6 | @Data 7 | public class ResultEntity { 8 | 9 | @ApiModelProperty(value = "数据") 10 | private Object data; 11 | 12 | @ApiModelProperty(value = "状态") 13 | private String status; 14 | 15 | @ApiModelProperty(value = "信息") 16 | private String msg; 17 | } 18 | -------------------------------------------------------------------------------- /player-music/src/main/java/com/player/music/entity/UserEntity.java: -------------------------------------------------------------------------------- 1 | package com.player.music.entity; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | 6 | import javax.persistence.*; 7 | import java.util.Date; 8 | 9 | @Data 10 | @Entity 11 | @Table(name = "user") 12 | public class UserEntity { 13 | @ApiModelProperty(value = "主键") 14 | @Id 15 | @Column(name = "user_id") 16 | private String userId; 17 | 18 | @Column(name = "password") 19 | private String password; 20 | 21 | @Column(name = "create_date") 22 | private Date create_date; 23 | 24 | @Column(name = "update_date") 25 | private Date update_date; 26 | 27 | @Column(name = "username") 28 | private String username; 29 | 30 | @Column(name = "telephone") 31 | private String telephone; 32 | 33 | @Column(name = "email") 34 | private String email; 35 | 36 | @Column(name = "avater") 37 | private String avater; 38 | 39 | @Column(name = "age") 40 | private String age; 41 | 42 | @Column(name = "sex") 43 | private String sex; 44 | 45 | @Column(name = "role") 46 | private String role; 47 | 48 | @Column(name = "secret_key") 49 | private String secret_key; 50 | } 51 | -------------------------------------------------------------------------------- /player-music/src/main/java/com/player/music/mapper/MyMusicMapper.java: -------------------------------------------------------------------------------- 1 | package com.player.music.mapper; 2 | 3 | import com.player.music.entity.*; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import java.util.List; 7 | 8 | @Repository 9 | public interface MyMusicMapper { 10 | MyMusicEntity getKeywordMusic(); 11 | 12 | List getMusicClassify(); 13 | 14 | List getMusicListByClassifyId(int classifyId,int start,int pageSize,String userId); 15 | 16 | Long getMusicTotalByClassifyId(int classifyId); 17 | 18 | List getMusicAuthorListByCategoryId(String userId,int categoryId, int start,int pageSize); 19 | 20 | Long getMusicAuthorTotal(int categoryId); 21 | 22 | List getMusicListByAuthorId(String userId,int authorId, int start, int pageSize); 23 | 24 | Long getMusicListByAuthorIdTotal(int authorId); 25 | 26 | List getFavoriteAuthor(String userId, int start, int pageSize); 27 | 28 | Long getFavoriteAuthorCount(String userId); 29 | 30 | Long insertFavoriteAuthor(String userId,int authorId); 31 | 32 | Long deleteFavoriteAuthor(String userId,int authorId); 33 | 34 | List getMusicRecord(String userId, int start, int pageSize); 35 | 36 | Long getMusicRecordCount(String userId); 37 | 38 | Long insertMusicRecord(MyMusicRecordEntity myMusicRecordEntity); 39 | 40 | Long insertMusicLike(String userId,int musicId); 41 | 42 | Long deleteMusicLike(String userId,int musicId); 43 | 44 | List getMusicLike(String userId, int start, int pageSize); 45 | 46 | Long getMusicLikeCount(String userId); 47 | 48 | List searchMusic(String userId,String keyword, int start, int pageSize); 49 | 50 | Long searchMusicCount(String keyword); 51 | 52 | List getMusicAuthorCategory(); 53 | 54 | List getFavoriteDirectory(String userId,Long musicId); 55 | 56 | List getMusicListByFavoriteId(String userId,Long favoriteId,int start,int pageSize); 57 | 58 | Long getMusicCountByFavoriteId(Long favoriteId); 59 | 60 | Long deleteFavoriteDirectory(String userId, Long favoriteId); 61 | 62 | Long updateFavoriteDirectory(String userId, Long favoriteId, String name); 63 | 64 | Long insertFavoriteDirectory(MyMusicFavoriteDirectoryEntity favoriteDirectoryEntity); 65 | 66 | MyMusicFavoriteDirectoryEntity getFavoriteDirectoryById(Long id); 67 | 68 | Long insertMusicFavorite(List myMusicFavoriteEntityList); 69 | 70 | Long deleteMusicFavorite(String userId,Long musicId); 71 | 72 | Long deleteMusicFavoriteByFavoriteId(String userId,Long favoriteId); 73 | 74 | Long isMusicFavorite(String userId,Long musicId); 75 | 76 | Long saveLog(LogEntity logEntity); 77 | } 78 | -------------------------------------------------------------------------------- /player-music/src/main/java/com/player/music/service/IMyMusicService.java: -------------------------------------------------------------------------------- 1 | package com.player.music.service; 2 | 3 | import com.player.common.entity.ResultEntity; 4 | import com.player.music.entity.MyMusicEntity; 5 | import com.player.music.entity.MyMusicFavoriteDirectoryEntity; 6 | import com.player.music.entity.MyMusicFavoriteEntity; 7 | import com.player.music.entity.MyMusicRecordEntity; 8 | import org.springframework.transaction.annotation.Transactional; 9 | 10 | import java.util.List; 11 | 12 | public interface IMyMusicService { 13 | ResultEntity getKeywordMusic(String redisKey); 14 | 15 | ResultEntity getMusicClassify(String redisKey); 16 | 17 | ResultEntity getMusicListByClassifyId(String redisKey, int classifyId, int pageNum, int pageSize, boolean isRedis, String token); 18 | 19 | ResultEntity getMusicAuthorListByCategoryId(String redisKey,String token, int categoryId, int pageNum, int pageSize); 20 | 21 | ResultEntity getMusicListByAuthorId(String redisKey,String token, int authorId, int pageNum, int pageSize); 22 | 23 | ResultEntity getFavoriteAuthor(String token,int pageNum, int pageSize); 24 | 25 | ResultEntity insertFavoriteAuthor(String token,int authorId); 26 | 27 | ResultEntity deleteFavoriteAuthor(String token,int authorId); 28 | 29 | ResultEntity getMusicRecord(String token, int pageNum, int pageSize); 30 | 31 | @Transactional 32 | ResultEntity insertMusicRecord(String token, MyMusicRecordEntity myMusicRecordEntity); 33 | 34 | @Transactional 35 | ResultEntity insertMusicLike(String token,int musicId); 36 | 37 | @Transactional 38 | ResultEntity deleteMusicLike(String token,int id); 39 | 40 | ResultEntity getMusicLike(String token, int pageNum, int pageSize); 41 | 42 | ResultEntity searchMusic(String token,String keyword, int pageNum, int pageSize); 43 | 44 | ResultEntity getMusicAuthorCategory(String redisKey); 45 | 46 | ResultEntity getFavoriteDirectory(String token,Long musicId); 47 | 48 | ResultEntity getMusicListByFavoriteId(String token,Long favoriteId,int pageNum,int pageSize); 49 | 50 | @Transactional 51 | ResultEntity insertFavoriteDirectory(String token, MyMusicFavoriteDirectoryEntity favoriteDirectoryEntity); 52 | 53 | @Transactional 54 | ResultEntity deleteFavoriteDirectory(String token, Long favoriteId); 55 | 56 | @Transactional 57 | ResultEntity updateFavoriteDirectory(String token, Long favoriteId,String name); 58 | 59 | @Transactional 60 | ResultEntity insertMusicFavorite(String token,Long musicId, List myMusicFavoriteEntityList); 61 | 62 | ResultEntity isMusicFavorite(String token, Long musicId); 63 | 64 | } 65 | -------------------------------------------------------------------------------- /player-music/src/main/java/com/player/music/utils/CookieUtils.java: -------------------------------------------------------------------------------- 1 | package com.player.music.utils; 2 | 3 | import org.springframework.beans.factory.annotation.Value; 4 | import org.springframework.stereotype.Component; 5 | 6 | import javax.servlet.http.Cookie; 7 | import javax.servlet.http.HttpServletRequest; 8 | import javax.servlet.http.HttpServletResponse; 9 | 10 | @Component 11 | public class CookieUtils { 12 | 13 | private static String cookieName; 14 | private static int expiry; 15 | 16 | @Value("${cookie.name}") 17 | public void setCookieName(String cookieName){ 18 | this.cookieName = cookieName; 19 | } 20 | 21 | @Value("${cookie.expiry}") 22 | public void setExpiry(int expiry){ 23 | this.expiry = expiry; 24 | } 25 | 26 | /** 27 | * @author: wuwenqiang 28 | * @methodsName: fail 29 | * @description: 获取cookie方法 30 | * @return: ResultEntity 31 | * @date: 2020-07-25 8:26 32 | */ 33 | public static void setTokenCookie(HttpServletResponse response, String value) { 34 | Cookie cookie = new Cookie(cookieName,value); 35 | cookie.setMaxAge(expiry); 36 | response.addCookie(cookie); 37 | } 38 | 39 | /** 40 | * @author: wuwenqiang 41 | * @methodsName: fail 42 | * @description: 获取cookie方法 43 | * @return: ResultEntity 44 | * @date: 2020-07-25 8:26 45 | */ 46 | public static String getCookie(HttpServletRequest request, String name) { 47 | Cookie[] cookies = request.getCookies(); 48 | if(cookies != null){ 49 | for(Cookie cookie : cookies){ 50 | if(cookie.getName().equals(name)){ 51 | return cookie.getValue(); 52 | } 53 | } 54 | } 55 | return null; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /player-music/src/main/java/com/player/music/utils/RedisUitls.java: -------------------------------------------------------------------------------- 1 | package com.player.music.utils; 2 | 3 | import com.alibaba.fastjson.JSON; 4 | import com.player.common.entity.ResultEntity; 5 | import com.player.common.entity.ResultUtil; 6 | import org.springframework.data.redis.core.RedisTemplate; 7 | import org.springframework.stereotype.Component; 8 | import org.springframework.util.ObjectUtils; 9 | 10 | import java.util.Map; 11 | import java.util.concurrent.TimeUnit; 12 | 13 | @Component 14 | public class RedisUitls { 15 | 16 | 17 | public static ResultEntity getRedis(RedisTemplate redisTemplate,String url, String result,String errorMsg){ 18 | Map resultMap = JSON.parseObject(result, Map.class); 19 | Integer code = (Integer) resultMap.get("code"); 20 | ResultEntity resultEntity; 21 | if( code == 0){ 22 | Object data = resultMap.get("data"); 23 | if(ObjectUtils.isEmpty(data)){ 24 | resultEntity = ResultUtil.success(resultMap); 25 | }else{ 26 | resultEntity = ResultUtil.success(data); 27 | } 28 | }else{ 29 | resultEntity = ResultUtil.fail(null, errorMsg); 30 | } 31 | redisTemplate.opsForValue().set(url,JSON.toJSONString(resultEntity),1, TimeUnit.DAYS); 32 | return resultEntity; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /player-music/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | static: 2 | file-path: E:/ 3 | server: 4 | port: 3002 5 | token: 6 | secret: ${SECRET} #token秘钥 7 | cookie: 8 | name: token #cookie名称 9 | expiry: 2592000 #tcookie失效时间一个月 60 * 60 * 24 * 30,以秒为单位 10 | app: 11 | appId: com.play.music 12 | appName: 在线音乐 13 | avater-img: /static/user/avater/ 14 | avater-path: E:${app.avater-img} 15 | 16 | spring: 17 | token: 18 | secret: ${SECRET} #token秘钥 19 | jackson: 20 | date-format: yyyy-MM-dd HH:mm:ss 21 | time-zone: GMT+8 22 | redis: 23 | database: 2 # Redis数据库索引(默认为0) 24 | host: 127.0.0.1 # Redis服务器地址 25 | port: 6379 # Redis服务器连接端口 26 | password: # Redis服务器连接密码(默认为空) 27 | timeout: 5000 # 连接超时时间(毫秒) 28 | jedis: 29 | pool: 30 | max-active: 8 # 连接池最大连接数(使用负值表示没有限制) 31 | max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制) 32 | max-idle: 8 # 连接池中的最大空闲连接 33 | min-idle: 0 # 连接池中的最小空闲连接 34 | jpa: 35 | show-sql: true 36 | application: 37 | name: player-music 38 | datasource: 39 | druid: 40 | url: jdbc:mysql://127.0.0.1:3306/play?characterEncoding=utf-8 41 | username: root 42 | password: ${MYSQL_PASSWORD} 43 | driverClassName: com.mysql.jdbc.Driver 44 | initialSize: 5 #初始建立连接数量 45 | minIdle: 5 #最小连接数量 46 | maxActive: 20 #最大连接数量 47 | maxWait: 10000 #获取连接最大等待时间,毫秒 48 | testOnBorrow: true #申请连接时检测连接是否有效 49 | testOnReturn: false #归还连接时检测连接是否有效 50 | timeBetweenEvictionRunsMillis: 60000 #配置间隔检测连接是否有效的时间(单位是毫秒) 51 | minEvictableIdleTimeMillis: 300000 #连接在连接池的最小生存时间(毫秒) 52 | 53 | mybatis: 54 | mapper-locations: classpath:mapper/*Mapper.xml 55 | type-aliases-package: com.player.music.entity 56 | configuration: 57 | map-underscore-to-camel-case: true 58 | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl 59 | -------------------------------------------------------------------------------- /player-music/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuyuanwuhui99/springboot-app-service/3cf924cf4fcc905514c081aa637d871c161b5a1f/player-music/src/main/resources/log4j.properties -------------------------------------------------------------------------------- /player-social/src/main/java/com/player/circle/PlayerSocialApplication.java: -------------------------------------------------------------------------------- 1 | package com.player.circle; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | @SpringBootApplication(scanBasePackages = "com.player.circle") 8 | @MapperScan("com.player.circle.mapper") 9 | public class PlayerSocialApplication { 10 | public static void main(String[] args) { 11 | SpringApplication.run(PlayerSocialApplication.class, args); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /player-social/src/main/java/com/player/circle/config/AuthInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.player.circle.config; 2 | 3 | import com.alibaba.fastjson.JSONObject; 4 | import com.player.common.entity.ResultEntity; 5 | import com.player.common.entity.ResultUtil; 6 | import com.player.common.entity.UserEntity; 7 | import com.player.common.utils.JwtToken; 8 | import com.player.common.utils.ResultCode; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.beans.factory.annotation.Value; 11 | import org.springframework.data.redis.core.RedisTemplate; 12 | import org.springframework.web.servlet.HandlerInterceptor; 13 | 14 | import javax.servlet.http.HttpServletRequest; 15 | import javax.servlet.http.HttpServletResponse; 16 | import java.io.IOException; 17 | import java.io.PrintWriter; 18 | 19 | public class AuthInterceptor implements HandlerInterceptor { 20 | @Value("${token.secret}") 21 | private String secret; 22 | 23 | @Autowired 24 | private RedisTemplate redisTemplate; 25 | 26 | @Override 27 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { 28 | String token = request.getHeader("Authorization"); 29 | if (token == null || redisTemplate.opsForValue().get(token) == null) { 30 | renderJson(response, ResultUtil.fail("未通过登录认证", null, ResultCode.LOGOUT)); 31 | return false; 32 | } 33 | UserEntity userEntity = JwtToken.parserToken(token, UserEntity.class,secret); 34 | if (userEntity == null) { 35 | response.setContentType("application/json;charset=UTF-8"); 36 | //设置编码格式 37 | response.setCharacterEncoding("UTF-8"); 38 | response.setStatus(401); 39 | response.getWriter().write("未通过登录认证,请在登录页面登录"); 40 | renderJson(response, ResultUtil.fail("未通过登录认证", ResultCode.LOGOUT)); 41 | return false; 42 | } 43 | return true; 44 | } 45 | 46 | protected void renderJson(HttpServletResponse response, ResultEntity resultEntity) { 47 | String dataJson = JSONObject.toJSONString(resultEntity); 48 | PrintWriter writer; 49 | try { 50 | response.setContentType("application/json; charset=utf-8"); 51 | writer = response.getWriter(); 52 | writer.write(dataJson); 53 | writer.flush(); 54 | return; 55 | } catch (IOException e) { 56 | throw new RuntimeException(e); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /player-social/src/main/java/com/player/circle/config/Swagger2Configuration.java: -------------------------------------------------------------------------------- 1 | package com.player.circle.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import springfox.documentation.builders.ApiInfoBuilder; 6 | import springfox.documentation.builders.PathSelectors; 7 | import springfox.documentation.builders.RequestHandlerSelectors; 8 | import springfox.documentation.service.ApiInfo; 9 | import springfox.documentation.spi.DocumentationType; 10 | import springfox.documentation.spring.web.plugins.Docket; 11 | import springfox.documentation.swagger2.annotations.EnableSwagger2; 12 | 13 | 14 | @Configuration 15 | @EnableSwagger2 16 | public class Swagger2Configuration { 17 | @Bean 18 | public Docket createRestApi() { 19 | return new Docket(DocumentationType.SWAGGER_2) 20 | .apiInfo(apiInfo()) 21 | .select() 22 | .apis(RequestHandlerSelectors.basePackage("com.player")) 23 | .paths(PathSelectors.any()) 24 | .build(); 25 | } 26 | 27 | private ApiInfo apiInfo() { 28 | return new ApiInfoBuilder() 29 | .title("评论") 30 | .description("电影、电影圈,文章等评论") 31 | .version("1.0") 32 | .build(); 33 | } 34 | 35 | } 36 | 37 | -------------------------------------------------------------------------------- /player-social/src/main/java/com/player/circle/config/WebAppConfig.java: -------------------------------------------------------------------------------- 1 | package com.player.circle.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.web.servlet.config.annotation.InterceptorRegistration; 6 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; 7 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 8 | 9 | /** 10 | * @Description:拦截器配置 11 | * @author: zk 12 | * @date: 2020年12月25日 21:41 13 | */ 14 | @Configuration 15 | public class WebAppConfig implements WebMvcConfigurer { 16 | @Bean 17 | public AuthInterceptor getAuthInterceptor() { 18 | return new AuthInterceptor(); 19 | } 20 | 21 | @Override 22 | public void addInterceptors(InterceptorRegistry registry) { 23 | //注册TestInterceptor拦截器 24 | InterceptorRegistration registration = registry.addInterceptor(getAuthInterceptor()); 25 | registration.addPathPatterns("/service/circle-getway/**"); //所有路径都被拦截 26 | registration.excludePathPatterns( //添加不拦截路径 27 | "/**/*.html", //html静态资源 28 | "/**/*.js", //js静态资源 29 | "/**/*.css", //css静态资源 30 | "/**/*.woff", 31 | "/**/*.ttf" 32 | ); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /player-social/src/main/java/com/player/circle/controller/SocialController.java: -------------------------------------------------------------------------------- 1 | package com.player.circle.controller; 2 | 3 | import com.player.common.entity.*; 4 | import com.player.common.myInterface.OperLog; 5 | import com.player.common.utils.OperationType; 6 | import com.player.circle.service.ISocialService; 7 | import io.swagger.annotations.Api; 8 | import io.swagger.annotations.ApiOperation; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.web.bind.annotation.*; 11 | 12 | @RequestMapping("/service") 13 | @Api(value = "评论", description = "查询评论,删除评论") 14 | @RestController 15 | public class SocialController { 16 | @Autowired 17 | private ISocialService socialService; 18 | 19 | @ApiOperation("获取总评论数量") 20 | @GetMapping("/social/getCommentCount") 21 | public ResultEntity getCommentCount( 22 | @RequestParam("relationId") int relationId, 23 | @RequestParam("type") String type 24 | ) { 25 | return socialService.getCommentCount(relationId,type); 26 | } 27 | 28 | @ApiOperation("获取一级评论列表") 29 | @GetMapping("/social/getTopCommentList") 30 | public ResultEntity getTopCommentList( 31 | @RequestParam("relationId") int relationId, 32 | @RequestParam("type") String type, 33 | @RequestParam("pageNum") int pageNum, 34 | @RequestParam("pageSize")int pageSize 35 | ) { 36 | return socialService.getTopCommentList(relationId,type,pageNum,pageSize); 37 | } 38 | 39 | @ApiOperation("新增评论") 40 | @PostMapping("/social-getway/insertComment") 41 | public ResultEntity insertComment( 42 | @RequestHeader("Authorization") String token, 43 | @RequestBody CommentEntity commentEntity 44 | ) { 45 | return socialService.insertComment(token,commentEntity); 46 | } 47 | 48 | @ApiOperation("删除评论") 49 | @DeleteMapping("/social-getway/deleteComment/{id}") 50 | public ResultEntity deleteComment( 51 | @RequestHeader("Authorization") String token, 52 | @PathVariable("id") int id 53 | ) { 54 | return socialService.deleteComment(id,token); 55 | } 56 | 57 | @ApiOperation("获取回复列表") 58 | @GetMapping("/social/getReplyCommentList") 59 | public ResultEntity getReplyCommentList( 60 | @RequestParam("topId") int topId, 61 | @RequestParam("pageNum") int pageNum, 62 | @RequestParam("pageSize")int pageSize 63 | ) { 64 | return socialService.getReplyCommentList(topId,pageNum,pageSize); 65 | } 66 | 67 | @OperLog(message = "添加点赞", operation = OperationType.ADD) 68 | @ApiOperation("保存收藏记录,请求地地址:/service/movie-getway/saveLike") 69 | @PostMapping("/social-getway/saveLike") 70 | public ResultEntity saveLike( 71 | @RequestBody LikeEntity likeEntity, 72 | @RequestHeader("Authorization") String token 73 | ) { 74 | return socialService.saveLike(likeEntity,token); 75 | } 76 | 77 | @OperLog(message = "删除点赞", operation = OperationType.DELETE) 78 | @ApiOperation("删除收藏,请求地地址:/service/movie-getway/deleteFavorite") 79 | @DeleteMapping("/social-getway/deleteLike") 80 | public ResultEntity deleteLike( 81 | @RequestParam("relationId") Long relationId, 82 | @RequestParam("type") String type, 83 | @RequestHeader("Authorization") String token 84 | ) { 85 | return socialService.deleteLike(relationId,type,token); 86 | } 87 | 88 | @OperLog(message = "查询是否已经收藏", operation = OperationType.QUERY) 89 | @ApiOperation("查询是否已经收藏,请求地地址:/service/movie-getway/isLike") 90 | @GetMapping("/social-getway/isLike") 91 | public ResultEntity isLike( 92 | @RequestParam("relationId") Long relationId, 93 | @RequestParam("type") String type, 94 | @RequestHeader("Authorization") String token 95 | ) { 96 | return socialService.isLike(relationId,type,token); 97 | } 98 | 99 | 100 | } 101 | -------------------------------------------------------------------------------- /player-social/src/main/java/com/player/circle/mapper/SocialMapper.java: -------------------------------------------------------------------------------- 1 | package com.player.circle.mapper; 2 | 3 | import com.player.common.entity.CommentEntity; 4 | import com.player.common.entity.LikeEntity; 5 | import org.springframework.stereotype.Repository; 6 | 7 | import java.util.List; 8 | 9 | @Repository 10 | public interface SocialMapper { 11 | 12 | Long getCommentCount(int relationId,String type); 13 | 14 | List getTopCommentList(int relationId, String type, int start, int pageSize); 15 | 16 | Long insertComment(CommentEntity commentEntity); 17 | 18 | List getReplyCommentList(int topId, int start, int pageSize); 19 | 20 | Long deleteComment(int id, String userId); 21 | 22 | CommentEntity getCommentItem(Long id,String type); 23 | 24 | Long saveLike(LikeEntity likeEntity); 25 | 26 | LikeEntity getLikeById(Long id); 27 | 28 | Long deleteLike(Long relationId,String type,String userId); 29 | 30 | Long isLike(Long relationId,String type, String userId); 31 | } 32 | -------------------------------------------------------------------------------- /player-social/src/main/java/com/player/circle/service/ISocialService.java: -------------------------------------------------------------------------------- 1 | package com.player.circle.service; 2 | 3 | import com.player.common.entity.LikeEntity; 4 | import com.player.common.entity.ResultEntity; 5 | import com.player.common.entity.CommentEntity; 6 | 7 | public interface ISocialService { 8 | 9 | ResultEntity getTopCommentList(int movieId, String type, int pageNum, int pageSize); 10 | 11 | ResultEntity insertComment(String token, CommentEntity commentEntity); 12 | 13 | ResultEntity deleteComment(int id, String userId); 14 | 15 | ResultEntity getReplyCommentList(int topId, int pageNum, int pageSize); 16 | 17 | ResultEntity saveLike(LikeEntity likeEntity, String token); 18 | 19 | ResultEntity deleteLike(Long relationId,String type,String token); 20 | 21 | ResultEntity isLike(Long relationId,String type,String token); 22 | 23 | ResultEntity getCommentCount(int relationId, String type); 24 | } 25 | -------------------------------------------------------------------------------- /player-social/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | static: 2 | file-path: E:/ 3 | server: 4 | port: 3003 5 | tomcat: 6 | uri-encoding: UTF-8 7 | token: 8 | secret: ${SECRET} #token秘钥 9 | app: 10 | appId: com.player.circle 11 | appName: 评论 12 | spring: 13 | http: 14 | encoding: 15 | charset: UTF-8 16 | force: true 17 | enabled: true 18 | redis: 19 | database: 0 # Redis数据库索引(默认为0) 20 | host: 127.0.0.1 # Redis服务器地址 21 | port: 6379 # Redis服务器连接端口 22 | password: # Redis服务器连接密码(默认为空) 23 | timeout: 5000 # 连接超时时间(毫秒) 24 | jedis: 25 | pool: 26 | max-active: 8 # 连接池最大连接数(使用负值表示没有限制) 27 | max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制) 28 | max-idle: 8 # 连接池中的最大空闲连接 29 | min-idle: 0 # 连接池中的最小空闲连接 30 | application: 31 | name: player-circle 32 | datasource: 33 | druid: 34 | url: jdbc:mysql://localhost:3306/play?characterEncoding=utf-8 35 | username: root 36 | password: wwq_2021 37 | driverClassName: com.mysql.jdbc.Driver 38 | initialSize: 5 #初始建立连接数量 39 | minIdle: 5 #最小连接数量 40 | maxActive: 20 #最大连接数量 41 | maxWait: 10000 #获取连接最大等待时间,毫秒 42 | testOnBorrow: true #申请连接时检测连接是否有效 43 | testOnReturn: false #归还连接时检测连接是否有效 44 | timeBetweenEvictionRunsMillis: 60000 #配置间隔检测连接是否有效的时间(单位是毫秒) 45 | minEvictableIdleTimeMillis: 300000 #连接在连接池的最小生存时间(毫秒) 46 | #mybatis: 47 | # mapper-locations: classpath:mapper/*Mapper.xml 48 | 49 | mybatis: 50 | mapper-locations: classpath:mapper/*Mapper.xml 51 | type-aliases-package: com.player.circle.entity 52 | configuration: 53 | map-underscore-to-camel-case: true 54 | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl -------------------------------------------------------------------------------- /player-social/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuyuanwuhui99/springboot-app-service/3cf924cf4fcc905514c081aa637d871c161b5a1f/player-social/src/main/resources/log4j.properties -------------------------------------------------------------------------------- /player-toutiao/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /player-toutiao/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuyuanwuhui99/springboot-app-service/3cf924cf4fcc905514c081aa637d871c161b5a1f/player-toutiao/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /player-toutiao/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.1/apache-maven-3.8.1-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /player-toutiao/src/main/java/com/player/toutiao/PlayerToutiaoApplication.java: -------------------------------------------------------------------------------- 1 | package com.player.toutiao; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | @SpringBootApplication(scanBasePackages = "com.player.toutiao") 8 | @MapperScan("com.player.toutiao.mapper") 9 | public class PlayerToutiaoApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(PlayerToutiaoApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /player-toutiao/src/main/java/com/player/toutiao/config/AuthInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.player.toutiao.config; 2 | 3 | import com.alibaba.fastjson.JSONObject; 4 | import com.player.common.entity.ResultEntity; 5 | import com.player.common.entity.ResultUtil; 6 | import com.player.common.entity.UserEntity; 7 | import com.player.common.utils.JwtToken; 8 | import com.player.common.utils.ResultCode; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.data.redis.core.RedisTemplate; 11 | import org.springframework.web.servlet.HandlerInterceptor; 12 | 13 | import javax.servlet.http.HttpServletRequest; 14 | import javax.servlet.http.HttpServletResponse; 15 | import java.io.IOException; 16 | import java.io.PrintWriter; 17 | 18 | public class AuthInterceptor implements HandlerInterceptor { 19 | @Autowired 20 | private RedisTemplate redisTemplate; 21 | 22 | @Override 23 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { 24 | String token = request.getHeader("Authorization"); 25 | if (token == null || redisTemplate.opsForValue().get(token) == null) { 26 | renderJson(response, ResultUtil.fail("未通过登录认证", null, ResultCode.LOGOUT)); 27 | return false; 28 | } 29 | UserEntity userEntity = JwtToken.parserToken(token, UserEntity.class); 30 | if (userEntity == null) { 31 | response.setContentType("application/json;charset=UTF-8"); 32 | //设置编码格式 33 | response.setCharacterEncoding("UTF-8"); 34 | response.setStatus(401); 35 | response.getWriter().write("未通过登录认证,请在登录页面登录"); 36 | renderJson(response, ResultUtil.fail("未通过登录认证", ResultCode.LOGOUT)); 37 | return false; 38 | } 39 | return true; 40 | } 41 | 42 | protected void renderJson(HttpServletResponse response, ResultEntity resultEntity) { 43 | String dataJson = JSONObject.toJSONString(resultEntity); 44 | PrintWriter writer; 45 | try { 46 | response.setContentType("application/json; charset=utf-8"); 47 | writer = response.getWriter(); 48 | writer.write(dataJson); 49 | writer.flush(); 50 | return; 51 | } catch (IOException e) { 52 | throw new RuntimeException(e); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /player-toutiao/src/main/java/com/player/toutiao/config/Swagger2Configuration.java: -------------------------------------------------------------------------------- 1 | package com.player.toutiao.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import springfox.documentation.builders.ApiInfoBuilder; 6 | import springfox.documentation.builders.PathSelectors; 7 | import springfox.documentation.builders.RequestHandlerSelectors; 8 | import springfox.documentation.service.ApiInfo; 9 | import springfox.documentation.spi.DocumentationType; 10 | import springfox.documentation.spring.web.plugins.Docket; 11 | import springfox.documentation.swagger2.annotations.EnableSwagger2; 12 | 13 | 14 | @Configuration 15 | @EnableSwagger2 16 | public class Swagger2Configuration { 17 | @Bean 18 | public Docket createRestApi() { 19 | return new Docket(DocumentationType.SWAGGER_2) 20 | .apiInfo(apiInfo()) 21 | .select() 22 | .apis(RequestHandlerSelectors.basePackage("com.player")) 23 | .paths(PathSelectors.any()) 24 | .build(); 25 | } 26 | 27 | private ApiInfo apiInfo() { 28 | return new ApiInfoBuilder() 29 | .title("明日头条") 30 | .description("明日头条api文档") 31 | .version("1.0") 32 | .build(); 33 | } 34 | 35 | } 36 | 37 | -------------------------------------------------------------------------------- /player-toutiao/src/main/java/com/player/toutiao/config/WebAppConfig.java: -------------------------------------------------------------------------------- 1 | package com.player.toutiao.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.web.servlet.config.annotation.InterceptorRegistration; 6 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; 7 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 8 | 9 | /** 10 | * @Description:拦截器配置 11 | * @author: zk 12 | * @date: 2020年12月25日 21:41 13 | */ 14 | @Configuration 15 | public class WebAppConfig implements WebMvcConfigurer { 16 | 17 | @Bean 18 | public AuthInterceptor getAuthInterceptor() { 19 | return new AuthInterceptor(); 20 | } 21 | 22 | @Override 23 | public void addInterceptors(InterceptorRegistry registry) { 24 | //注册TestInterceptor拦截器 25 | InterceptorRegistration registration = registry.addInterceptor(getAuthInterceptor()); 26 | registration.addPathPatterns("/service/toutiao-getway/**"); //所有路径都被拦截 27 | registration.excludePathPatterns( //添加不拦截路径 28 | "/**/*.html", //html静态资源 29 | "/**/*.js", //js静态资源 30 | "/**/*.css", //css静态资源 31 | "/**/*.woff", 32 | "/**/*.ttf" 33 | ); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /player-toutiao/src/main/java/com/player/toutiao/entity/ArticleEntity.java: -------------------------------------------------------------------------------- 1 | package com.player.toutiao.entity; 2 | import com.player.common.entity.AuthorEntity; 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | import lombok.ToString; 6 | 7 | import java.util.Date; 8 | 9 | @Data 10 | @ToString 11 | public class ArticleEntity { 12 | @ApiModelProperty(value = "主键") 13 | private Long id;//主键 14 | 15 | @ApiModelProperty(value = "频道id") 16 | private String channelId; 17 | 18 | @ApiModelProperty(value = "内容") 19 | private String content; 20 | 21 | @ApiModelProperty(value = "视频播放时长") 22 | private String duration; 23 | 24 | @ApiModelProperty(value = "链接地址") 25 | private String href; 26 | 27 | @ApiModelProperty(value = "视频图片地址") 28 | private String img; 29 | 30 | @ApiModelProperty(value = "类型,视频:video, 文章: article,博客:blog") 31 | private String type; 32 | 33 | @ApiModelProperty(value = "是否置顶,0表示否,1表示是") 34 | private String isTop; 35 | 36 | @ApiModelProperty(value = "主标题") 37 | private String title; 38 | 39 | @ApiModelProperty(value = "创建时间") 40 | private Date createTime; 41 | 42 | @ApiModelProperty(value = "更新时间") 43 | private Date updateTime; 44 | 45 | @ApiModelProperty(value = "来源") 46 | private String source; 47 | 48 | @ApiModelProperty(value = "评论id") 49 | private String commentId; 50 | 51 | @ApiModelProperty(value = "标签") 52 | private String labels; 53 | 54 | @ApiModelProperty(value = "作者id") 55 | private String authorId; 56 | 57 | @ApiModelProperty(value = "作者头像") 58 | private String authorAvatar; 59 | 60 | @ApiModelProperty(value = "作者主页") 61 | private String authorHref; 62 | 63 | @ApiModelProperty(value = "排名") 64 | private String ranks; 65 | 66 | @ApiModelProperty(value = "是否禁用") 67 | private int disabled; 68 | 69 | @ApiModelProperty(value = "作者信息") 70 | private AuthorEntity authorInfo; 71 | } 72 | -------------------------------------------------------------------------------- /player-toutiao/src/main/java/com/player/toutiao/entity/ChannelEntity.java: -------------------------------------------------------------------------------- 1 | package com.player.toutiao.entity; 2 | import io.swagger.annotations.ApiModelProperty; 3 | import lombok.Data; 4 | import lombok.ToString; 5 | 6 | import java.util.Date; 7 | 8 | @Data 9 | @ToString 10 | public class ChannelEntity { 11 | @ApiModelProperty(value = "主键") 12 | private int id; 13 | 14 | @ApiModelProperty(value = "频道id") 15 | private String channelId; 16 | 17 | @ApiModelProperty(value = "频道名称") 18 | private String channelName; 19 | 20 | @ApiModelProperty(value = "链接地址") 21 | private String href; 22 | 23 | @ApiModelProperty(value = "创建时间") 24 | private Date createTime; 25 | 26 | @ApiModelProperty(value = "最近更新时间") 27 | private Date updateTime; 28 | 29 | @ApiModelProperty(value = "用户id") 30 | private String userId; 31 | 32 | @ApiModelProperty(value = "是否禁用") 33 | private int disabled; 34 | 35 | @ApiModelProperty(value = "状态,公开:0,推荐:1,默认:2") 36 | private int status; 37 | 38 | @ApiModelProperty(value = "排序") 39 | private int sequence; 40 | } 41 | -------------------------------------------------------------------------------- /player-toutiao/src/main/java/com/player/toutiao/entity/CommentEntity.java: -------------------------------------------------------------------------------- 1 | package com.player.toutiao.entity; 2 | 3 | import com.player.common.entity.UserEntity; 4 | import io.swagger.annotations.ApiModelProperty; 5 | import lombok.Data; 6 | import lombok.ToString; 7 | 8 | @Data 9 | @ToString 10 | public class CommentEntity { 11 | @ApiModelProperty(value = "主键") 12 | private Long id;//主键 13 | 14 | @ApiModelProperty(value = "评论内容") 15 | private String content; 16 | 17 | @ApiModelProperty(value = "父节点id") 18 | private Long parentId; 19 | 20 | @ApiModelProperty(value = "顶级节点id") 21 | private Long topId; 22 | 23 | @ApiModelProperty(value = "文章id") 24 | private Long articleId; 25 | 26 | @ApiModelProperty(value = "创建时间") 27 | private String createTime; 28 | 29 | @ApiModelProperty(value = "更新时间") 30 | private String updateTime; 31 | 32 | @ApiModelProperty(value = "回复数量") 33 | private int replyCount; 34 | 35 | @ApiModelProperty(value = "用户id") 36 | private String userId; 37 | 38 | @ApiModelProperty(value = "用户名") 39 | private String username; 40 | 41 | @ApiModelProperty(value = "用户头像") 42 | private String avater; 43 | 44 | @ApiModelProperty(value = "被回复者id") 45 | private String replyUserId; 46 | 47 | @ApiModelProperty(value = "被回复者名称") 48 | private String replyUserName; 49 | } 50 | -------------------------------------------------------------------------------- /player-toutiao/src/main/java/com/player/toutiao/mapper/ToutiaoMapper.java: -------------------------------------------------------------------------------- 1 | package com.player.toutiao.mapper; 2 | 3 | import com.player.common.entity.LogEntity; 4 | import com.player.toutiao.entity.ArticleEntity; 5 | import com.player.toutiao.entity.ChannelEntity; 6 | import com.player.toutiao.entity.CommentEntity; 7 | import feign.Param; 8 | import org.springframework.stereotype.Repository; 9 | 10 | import java.util.List; 11 | 12 | @Repository 13 | public interface ToutiaoMapper { 14 | /** 15 | * @author: wuwenqiang 16 | * @description: 获取文章列表 17 | * @date: 2021-12-25 22:29 18 | */ 19 | List getArticleList(int start,int pageSize,String type, String channelId,String authorId, String keyword); 20 | 21 | /** 22 | * @author: wuwenqiang 23 | * @description: 获取文章详情 24 | * @date: 2021-5-29 19:22 25 | */ 26 | ArticleEntity getArticleDetail(int id); 27 | 28 | /** 29 | * @author: wuwenqiang 30 | * @description: 保存浏览记录 31 | * @date: 2021-5-29 19:22 32 | */ 33 | Long saveArticleRecord(String userId,Long articleId); 34 | 35 | /** 36 | * @author: wuwenqiang 37 | * @description: 只保留前20条浏览记录 38 | * @date: 2021-8-14 12:16 39 | */ 40 | Long deleteArticleRecord(String userId); 41 | 42 | /** 43 | * @author: wuwenqiang 44 | * @description: 插入日志 45 | * @date: 2021-5-29 19:22 46 | */ 47 | Long log(LogEntity logEntity); 48 | 49 | /** 50 | * @author: wuwenqiang 51 | * @description: 查询用户收藏的频道 52 | * @date: 2021-5-29 19:22 53 | */ 54 | List getFavoriteChannels(String userId); 55 | 56 | /** 57 | * @author: wuwenqiang 58 | * @description: 查询所有频道 59 | * @date: 2021-5-29 19:22 60 | */ 61 | List getAllChannels(@Param("list") List status); 62 | 63 | int insertFavoriteChannels(List favoriteChannels); 64 | 65 | List getRecordList(String userId); 66 | 67 | Long isFavorite(String userId,int articleId); 68 | 69 | ListgetFavoriteList(String userId,int start,int pageSize); 70 | 71 | Long insertFavorite(String userId,int articleId); 72 | 73 | Long deleteFavorite(String userId,int articleId); 74 | 75 | Long isLike(String userId, int articleId); 76 | 77 | Long insertLike(String userId,int articleId); 78 | 79 | Long deleteLike(String userId,int articleId); 80 | 81 | Long isFocus(String userId, String authorId); 82 | 83 | Long insertFocus(String userId,String authorId); 84 | 85 | Long deleteFocus(String userId,String authorId); 86 | 87 | Long getCommentCount(int articleId); 88 | 89 | List getTopCommentList(int articleId,int start,int pageSize); 90 | 91 | Long insertComment(CommentEntity commentEntity); 92 | 93 | List getReplyCommentList(int topId,int start,int pageSize); 94 | 95 | Long deleteComment(int id,String userId); 96 | 97 | CommentEntity getCommentItem(int id); 98 | } 99 | -------------------------------------------------------------------------------- /player-toutiao/src/main/java/com/player/toutiao/service/IToutiaoService.java: -------------------------------------------------------------------------------- 1 | package com.player.toutiao.service; 2 | 3 | import com.player.common.entity.ResultEntity; 4 | import com.player.toutiao.entity.CommentEntity; 5 | 6 | import java.util.List; 7 | 8 | public interface IToutiaoService { 9 | ResultEntity getArticleList(int pageNum, int pageSize,String type, String channelId, String userId, String keyword, String path); 10 | 11 | ResultEntity getArticleDetail(int id,String token); 12 | 13 | ResultEntity getFavoriteChannels(String token); 14 | 15 | ResultEntity getUserData(String token); 16 | 17 | ResultEntity getAllChannels(List status); 18 | 19 | ResultEntity getRecordList(String token); 20 | 21 | ResultEntity isFavorite(String token,int articleId); 22 | 23 | ResultEntity getFavoriteList(String token,int pageNum,int pageSize); 24 | 25 | ResultEntity insertFavorite(String token,int articleId); 26 | 27 | ResultEntity deleteFavorite(String token,int articleId); 28 | 29 | ResultEntity isLike(String token, int articleId); 30 | 31 | ResultEntity insertLike(String token,int articleId); 32 | 33 | ResultEntity deleteLike(String token,int articleId); 34 | 35 | ResultEntity isFocus(String token,String authorId); 36 | 37 | ResultEntity insertFocus(String token,String authorId); 38 | 39 | ResultEntity deleteFocus(String token,String authorId); 40 | 41 | ResultEntity getCommentCount(int articleId); 42 | 43 | ResultEntity getTopCommentList(int articleId,int pageNum, int pageSize); 44 | 45 | ResultEntity insertComment(String token,CommentEntity commentEntity); 46 | 47 | ResultEntity deleteComment(int id,String userId); 48 | 49 | ResultEntity getReplyCommentList(int topId,int pageNum,int pageSize); 50 | 51 | ResultEntity getCommentItem(int id); 52 | } 53 | -------------------------------------------------------------------------------- /player-toutiao/src/main/java/com/player/toutiao/utils/RedisCacheUtil.java: -------------------------------------------------------------------------------- 1 | package com.player.toutiao.utils; 2 | 3 | import org.springframework.data.redis.core.RedisTemplate; 4 | import org.springframework.stereotype.Component; 5 | 6 | import javax.annotation.Resource; 7 | 8 | @Component //注入spring容器 9 | public class RedisCacheUtil { 10 | @Resource 11 | private RedisTemplate redisTemplate; 12 | /** 13 | * 普通缓存获取 14 | * @param key 键 15 | * @return 值 16 | */ 17 | public Object get(String key) { 18 | return key == null ? null : redisTemplate.opsForValue().get(key); 19 | } 20 | 21 | /** 22 | * 普通缓存获取 23 | * @param key 键 24 | * @return 值 25 | */ 26 | public void set(String key,String value) { 27 | if( key != null)redisTemplate.opsForValue().set(key,value); 28 | } 29 | } -------------------------------------------------------------------------------- /player-toutiao/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8000 3 | uri-encoding: UTF-8 4 | token: 5 | expiration-time: 2592000000 #token失效时间一个月 1000 * 60 * 60 * 24 * 30 6 | secret: wuwenqiang #token秘钥 7 | app: 8 | appId: com.player.toutiao 9 | appName: 明日头条 10 | spring: 11 | http: 12 | encoding: 13 | charset: UTF-8 14 | force: true 15 | enabled: true 16 | redis: 17 | database: 0 # Redis数据库索引(默认为0) 18 | host: 127.0.0.1 # Redis服务器地址 19 | port: 6379 # Redis服务器连接端口 20 | password: # Redis服务器连接密码(默认为空) 21 | timeout: 5000 # 连接超时时间(毫秒) 22 | jedis: 23 | pool: 24 | max-active: 8 # 连接池最大连接数(使用负值表示没有限制) 25 | max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制) 26 | max-idle: 8 # 连接池中的最大空闲连接 27 | min-idle: 0 # 连接池中的最小空闲连接 28 | application: 29 | name: player-toutiao 30 | datasource: 31 | druid: 32 | url: jdbc:mysql://localhost:3306/play?characterEncoding=utf-8 33 | username: root 34 | password: wwq_2021 35 | driverClassName: com.mysql.jdbc.Driver 36 | initialSize: 5 #初始建立连接数量 37 | minIdle: 5 #最小连接数量 38 | maxActive: 20 #最大连接数量 39 | maxWait: 10000 #获取连接最大等待时间,毫秒 40 | testOnBorrow: true #申请连接时检测连接是否有效 41 | testOnReturn: false #归还连接时检测连接是否有效 42 | timeBetweenEvictionRunsMillis: 60000 #配置间隔检测连接是否有效的时间(单位是毫秒) 43 | minEvictableIdleTimeMillis: 300000 #连接在连接池的最小生存时间(毫秒) 44 | #mybatis: 45 | # mapper-locations: classpath:mapper/*Mapper.xml 46 | 47 | mybatis: 48 | mapper-locations: classpath:mapper/*Mapper.xml 49 | type-aliases-package: com.player.toutiao.entity 50 | configuration: 51 | map-underscore-to-camel-case: true 52 | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl -------------------------------------------------------------------------------- /player-toutiao/src/test/java/com/player/toutiao/PlayerToutiaoApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.player.toutiao; 2 | 3 | import org.springframework.boot.test.context.SpringBootTest; 4 | 5 | @SpringBootTest 6 | class PlayerToutiaoApplicationTests { 7 | 8 | 9 | } 10 | -------------------------------------------------------------------------------- /player-user/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /player-user/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuyuanwuhui99/springboot-app-service/3cf924cf4fcc905514c081aa637d871c161b5a1f/player-user/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /player-user/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.1/apache-maven-3.8.1-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /player-user/src/main/java/com/player/user/PlayerUserApplication.java: -------------------------------------------------------------------------------- 1 | package com.player.user; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | @SpringBootApplication(scanBasePackages = "com.player.user") 8 | @MapperScan("com.player.user.mapper") 9 | public class PlayerUserApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(PlayerUserApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /player-user/src/main/java/com/player/user/config/AuthInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.player.user.config; 2 | 3 | import com.alibaba.fastjson.JSONObject; 4 | import com.player.common.entity.ResultEntity; 5 | import com.player.common.entity.ResultUtil; 6 | import com.player.common.entity.UserEntity; 7 | import com.player.common.utils.JwtToken; 8 | import com.player.common.utils.ResultCode; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.beans.factory.annotation.Value; 11 | import org.springframework.data.redis.core.RedisTemplate; 12 | import org.springframework.util.StringUtils; 13 | import org.springframework.web.servlet.HandlerInterceptor; 14 | 15 | import javax.servlet.http.HttpServletRequest; 16 | import javax.servlet.http.HttpServletResponse; 17 | import java.io.IOException; 18 | import java.io.PrintWriter; 19 | 20 | public class AuthInterceptor implements HandlerInterceptor { 21 | @Value("${token.secret}") 22 | private String secret; 23 | 24 | @Autowired 25 | private RedisTemplate redisTemplate; 26 | 27 | @Override 28 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { 29 | String token = request.getHeader("Authorization"); 30 | if (token == null) { 31 | renderJson(response, ResultUtil.fail("未通过登录认证", null, ResultCode.LOGOUT)); 32 | return false; 33 | } 34 | String result = (String) redisTemplate.opsForValue().get(token); 35 | if(StringUtils.isEmpty(result)){ 36 | renderJson(response, ResultUtil.fail("未通过登录认证", null, ResultCode.LOGOUT)); 37 | return false; 38 | } 39 | UserEntity userEntity = JwtToken.parserToken(token, UserEntity.class,secret); 40 | if (userEntity == null) { 41 | response.setContentType("application/json;charset=UTF-8"); 42 | //设置编码格式 43 | response.setCharacterEncoding("UTF-8"); 44 | response.setStatus(401); 45 | response.getWriter().write("未通过登录认证,请在登录页面登录"); 46 | renderJson(response, ResultUtil.fail("未通过登录认证", ResultCode.LOGOUT)); 47 | return false; 48 | } 49 | return true; 50 | 51 | } 52 | 53 | protected void renderJson(HttpServletResponse response, ResultEntity resultEntity) { 54 | String dataJson = JSONObject.toJSONString(resultEntity); 55 | PrintWriter writer; 56 | try { 57 | response.setContentType("application/json; charset=utf-8"); 58 | writer = response.getWriter(); 59 | writer.write(dataJson); 60 | writer.flush(); 61 | } catch (IOException e) { 62 | throw new RuntimeException(e); 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /player-user/src/main/java/com/player/user/config/Swagger2Configuration.java: -------------------------------------------------------------------------------- 1 | package com.player.user.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import springfox.documentation.builders.ApiInfoBuilder; 6 | import springfox.documentation.builders.PathSelectors; 7 | import springfox.documentation.builders.RequestHandlerSelectors; 8 | import springfox.documentation.service.ApiInfo; 9 | import springfox.documentation.spi.DocumentationType; 10 | import springfox.documentation.spring.web.plugins.Docket; 11 | import springfox.documentation.swagger2.annotations.EnableSwagger2; 12 | 13 | 14 | @Configuration 15 | @EnableSwagger2 16 | public class Swagger2Configuration { 17 | @Bean 18 | public Docket createRestApi() { 19 | return new Docket(DocumentationType.SWAGGER_2) 20 | .apiInfo(apiInfo()) 21 | .select() 22 | .apis(RequestHandlerSelectors.basePackage("com.player.user")) 23 | .paths(PathSelectors.any()) 24 | .build(); 25 | } 26 | 27 | private ApiInfo apiInfo() { 28 | return new ApiInfoBuilder() 29 | .title("用户中心") 30 | .description("用户增删改查操作") 31 | .version("1.0") 32 | .build(); 33 | } 34 | 35 | } 36 | 37 | -------------------------------------------------------------------------------- /player-user/src/main/java/com/player/user/config/WebAppConfig.java: -------------------------------------------------------------------------------- 1 | package com.player.user.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.web.servlet.config.annotation.InterceptorRegistration; 6 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; 7 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 8 | 9 | /** 10 | * @Description:拦截器配置 11 | * @author: zk 12 | * @date: 2020年12月25日 21:41 13 | */ 14 | @Configuration 15 | public class WebAppConfig implements WebMvcConfigurer { 16 | @Bean 17 | public AuthInterceptor getAuthInterceptor(){ 18 | return new AuthInterceptor(); 19 | } 20 | 21 | @Override 22 | public void addInterceptors(InterceptorRegistry registry) { 23 | //注册拦截器 24 | InterceptorRegistration registration = registry.addInterceptor(getAuthInterceptor()); 25 | registration.addPathPatterns("/service/user-getway/**"); //所有路径都被拦截 26 | registration.excludePathPatterns( //添加不拦截路径 27 | "/**/*.html", //html静态资源 28 | "/**/*.js", //js静态资源 29 | "/**/*.css", //css静态资源 30 | "/**/*.woff", 31 | "/**/*.ttf" 32 | ); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /player-user/src/main/java/com/player/user/entity/MailEntity.java: -------------------------------------------------------------------------------- 1 | package com.player.user.entity; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | import lombok.ToString; 6 | 7 | @Data 8 | @ToString 9 | public class MailEntity { 10 | 11 | @ApiModelProperty(value = "发送的用户") 12 | private String email; 13 | 14 | @ApiModelProperty(value = "主题") 15 | private String subject; 16 | 17 | @ApiModelProperty(value = "发送的文本") 18 | private String text; 19 | 20 | @ApiModelProperty(value = "验证码") 21 | private String code; 22 | } 23 | -------------------------------------------------------------------------------- /player-user/src/main/java/com/player/user/entity/PasswordEntity.java: -------------------------------------------------------------------------------- 1 | package com.player.user.entity; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | import lombok.ToString; 6 | 7 | @Data 8 | @ToString 9 | public class PasswordEntity { 10 | @ApiModelProperty(value = "用户id") 11 | private String id; 12 | 13 | @ApiModelProperty(value = "新密码") 14 | private String newPassword; 15 | 16 | @ApiModelProperty(value = "旧密码") 17 | private String oldPassword; 18 | } 19 | -------------------------------------------------------------------------------- /player-user/src/main/java/com/player/user/entity/ResetPasswordEntity.java: -------------------------------------------------------------------------------- 1 | package com.player.user.entity; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | import lombok.ToString; 6 | 7 | import java.io.Serializable; 8 | 9 | @Data 10 | @ToString 11 | public class ResetPasswordEntity { 12 | 13 | @ApiModelProperty(value = "接收人") 14 | private String email; 15 | 16 | @ApiModelProperty(value = "验证码") 17 | private int code; 18 | 19 | @ApiModelProperty(value = "新密码") 20 | private String password; 21 | } 22 | -------------------------------------------------------------------------------- /player-user/src/main/java/com/player/user/mapper/UserMapper.java: -------------------------------------------------------------------------------- 1 | package com.player.user.mapper; 2 | 3 | import com.player.common.entity.LogEntity; 4 | import com.player.common.entity.UserEntity; 5 | import com.player.user.entity.PasswordEntity; 6 | import com.player.user.entity.ResetPasswordEntity; 7 | import org.springframework.stereotype.Repository; 8 | 9 | import java.util.List; 10 | 11 | @Repository 12 | public interface UserMapper { 13 | /** 14 | * @author: wuwenqiang 15 | * @description: 查询用户数据 16 | * @date: 2021-6-16 22:06 17 | */ 18 | UserEntity getUserData(); 19 | 20 | /** 21 | * @author: wuwenqiang 22 | * @description: 查询用户数据 23 | * @date: 2021-6-16 22:06 24 | */ 25 | UserEntity getMyUserData(String userId); 26 | 27 | UserEntity login(UserEntity userEntity); 28 | 29 | Long register(UserEntity userEntity); 30 | 31 | UserEntity queryUser(UserEntity userEntity); 32 | 33 | Long updateUser(UserEntity userEntity); 34 | 35 | Long updatePassword(PasswordEntity passwordEntity); 36 | 37 | Long log(LogEntity logEntity); 38 | 39 | Long updateAvater(String avater,String userId); 40 | 41 | List vertifyUserByEmail(String email); 42 | 43 | Long resetPassword(ResetPasswordEntity resetPasswordEntity); 44 | 45 | UserEntity loginByEmail(String email); 46 | } 47 | -------------------------------------------------------------------------------- /player-user/src/main/java/com/player/user/service/IUserService.java: -------------------------------------------------------------------------------- 1 | package com.player.user.service; 2 | 3 | import com.player.common.entity.LogEntity; 4 | import com.player.common.entity.ResultEntity; 5 | import com.player.common.entity.ResultUtil; 6 | import com.player.common.entity.UserEntity; 7 | import com.player.user.entity.MailEntity; 8 | import com.player.user.entity.PasswordEntity; 9 | import com.player.user.entity.ResetPasswordEntity; 10 | import org.springframework.web.multipart.MultipartFile; 11 | 12 | public interface IUserService { 13 | ResultEntity getUserData(String token); 14 | 15 | ResultEntity login(UserEntity userEntity); 16 | 17 | ResultEntity logout(String token); 18 | 19 | ResultEntity register(UserEntity userEntity); 20 | 21 | ResultEntity vertifyUser(UserEntity userEntity); 22 | 23 | ResultEntity updateUser(UserEntity userEntity,String token); 24 | 25 | ResultEntity updatePassword(PasswordEntity passwordEntity, String token); 26 | 27 | ResultEntity updateAvater(String token, String base64); 28 | 29 | ResultEntity resetPassword(ResetPasswordEntity resetPasswordEntity); 30 | 31 | ResultEntity sendEmailVertifyCode(MailEntity mailEntity); 32 | 33 | ResultEntity loginByEmail(MailEntity mailEntity); 34 | } 35 | -------------------------------------------------------------------------------- /player-user/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 3005 3 | token: 4 | expiration-time: 2592000000 #token失效时间一个月 1000 * 60 * 60 * 24 * 30 5 | secret: ${SECRET} #token秘钥 6 | app: 7 | appId: com.player.user 8 | appName: 用户中心 9 | avater-img: /static/user/avater/ 10 | avater-path: G:${app.avater-img} 11 | 12 | spring: 13 | #邮箱基本配置 14 | mail: 15 | #配置smtp服务主机地址 16 | host: smtp.qq.com 17 | #发送者邮箱 18 | username: ${EMAIL} 19 | #配置密码,注意不是真正的密码,而是刚刚申请到的授权码 20 | password: ${EMAIL_PASSWORD} 21 | #端口号465或587 22 | port: 465 23 | #默认的邮件编码为UTF-8 24 | default-encoding: UTF-8 25 | #其他参数 26 | properties: 27 | mail: 28 | #配置SSL 加密工厂 29 | smtp: 30 | ssl: 31 | #本地测试,先放开ssl 32 | enable: true 33 | required: false 34 | #开启debug模式,这样邮件发送过程的日志会在控制台打印出来,方便排查错误 35 | debug: true 36 | redis: 37 | database: 0 # Redis数据库索引(默认为0) 38 | host: 127.0.0.1 # Redis服务器地址 39 | port: 6379 # Redis服务器连接端口 40 | password: # Redis服务器连接密码(默认为空) 41 | timeout: 5000 # 连接超时时间(毫秒) 42 | jedis: 43 | pool: 44 | max-active: 8 # 连接池最大连接数(使用负值表示没有限制) 45 | max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制) 46 | max-idle: 8 # 连接池中的最大空闲连接 47 | min-idle: 0 # 连接池中的最小空闲连接 48 | application: 49 | name: player-user 50 | datasource: 51 | druid: 52 | url: jdbc:mysql://localhost:3306/play?characterEncoding=utf-8 53 | username: root 54 | password: ${MYSQL_PASSWORD} 55 | driverClassName: com.mysql.jdbc.Driver 56 | initialSize: 5 #初始建立连接数量 57 | minIdle: 5 #最小连接数量 58 | maxActive: 20 #最大连接数量 59 | maxWait: 10000 #获取连接最大等待时间,毫秒 60 | testOnBorrow: true #申请连接时检测连接是否有效 61 | testOnReturn: false #归还连接时检测连接是否有效 62 | timeBetweenEvictionRunsMillis: 60000 #配置间隔检测连接是否有效的时间(单位是毫秒) 63 | minEvictableIdleTimeMillis: 300000 #连接在连接池的最小生存时间(毫秒) 64 | #mybatis: 65 | # mapper-locations: classpath:mapper/*Mapper.xml 66 | 67 | mybatis: 68 | mapper-locations: classpath:mapper/*Mapper.xml 69 | type-aliases-package: com.player.user.entity 70 | configuration: 71 | map-underscore-to-camel-case: true 72 | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl -------------------------------------------------------------------------------- /player-video/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /player-video/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuyuanwuhui99/springboot-app-service/3cf924cf4fcc905514c081aa637d871c161b5a1f/player-video/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /player-video/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.1/apache-maven-3.8.1-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /player-video/src/main/java/com/player/video/PlayerVideoApplication.java: -------------------------------------------------------------------------------- 1 | package com.player.video; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | @SpringBootApplication(scanBasePackages = "com.player.video") 8 | @MapperScan("com.player.video.mapper") 9 | public class PlayerVideoApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(PlayerVideoApplication.class, args); 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /player-video/src/main/java/com/player/video/config/AuthInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.player.video.config; 2 | 3 | import com.alibaba.fastjson.JSONObject; 4 | import com.player.common.entity.ResultEntity; 5 | import com.player.common.entity.ResultUtil; 6 | import com.player.common.entity.UserEntity; 7 | import com.player.common.utils.JwtToken; 8 | import com.player.common.utils.ResultCode; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.data.redis.core.RedisTemplate; 11 | import org.springframework.web.servlet.HandlerInterceptor; 12 | 13 | import javax.servlet.http.HttpServletRequest; 14 | import javax.servlet.http.HttpServletResponse; 15 | import java.io.IOException; 16 | import java.io.PrintWriter; 17 | 18 | public class AuthInterceptor implements HandlerInterceptor { 19 | @Autowired 20 | private RedisTemplate redisTemplate; 21 | 22 | @Override 23 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { 24 | String token = request.getHeader("Authorization"); 25 | if (token == null || redisTemplate.opsForValue().get(token) == null) { 26 | renderJson(response, ResultUtil.fail("未通过登录认证", null, ResultCode.LOGOUT)); 27 | return false; 28 | } 29 | UserEntity userEntity = JwtToken.parserToken(token, UserEntity.class); 30 | if (userEntity == null) { 31 | response.setContentType("application/json;charset=UTF-8"); 32 | //设置编码格式 33 | response.setCharacterEncoding("UTF-8"); 34 | response.setStatus(401); 35 | response.getWriter().write("未通过登录认证,请在登录页面登录"); 36 | renderJson(response, ResultUtil.fail("未通过登录认证", ResultCode.LOGOUT)); 37 | return false; 38 | } 39 | return true; 40 | } 41 | 42 | protected void renderJson(HttpServletResponse response, ResultEntity resultEntity) { 43 | String dataJson = JSONObject.toJSONString(resultEntity); 44 | PrintWriter writer; 45 | try { 46 | response.setContentType("application/json; charset=utf-8"); 47 | writer = response.getWriter(); 48 | writer.write(dataJson); 49 | writer.flush(); 50 | return; 51 | } catch (IOException e) { 52 | throw new RuntimeException(e); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /player-video/src/main/java/com/player/video/config/Swagger2Configuration.java: -------------------------------------------------------------------------------- 1 | package com.player.video.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import springfox.documentation.builders.ApiInfoBuilder; 6 | import springfox.documentation.builders.PathSelectors; 7 | import springfox.documentation.builders.RequestHandlerSelectors; 8 | import springfox.documentation.service.ApiInfo; 9 | import springfox.documentation.spi.DocumentationType; 10 | import springfox.documentation.spring.web.plugins.Docket; 11 | import springfox.documentation.swagger2.annotations.EnableSwagger2; 12 | 13 | 14 | @Configuration 15 | @EnableSwagger2 16 | public class Swagger2Configuration { 17 | @Bean 18 | public Docket createRestApi() { 19 | return new Docket(DocumentationType.SWAGGER_2) 20 | .apiInfo(apiInfo()) 21 | .select() 22 | .apis(RequestHandlerSelectors.basePackage("com.player")) 23 | .paths(PathSelectors.any()) 24 | .build(); 25 | } 26 | 27 | private ApiInfo apiInfo() { 28 | return new ApiInfoBuilder() 29 | .title("冬瓜视频") 30 | .description("冬瓜视频api文档") 31 | .version("1.0") 32 | .build(); 33 | } 34 | 35 | } 36 | 37 | -------------------------------------------------------------------------------- /player-video/src/main/java/com/player/video/config/WebAppConfig.java: -------------------------------------------------------------------------------- 1 | package com.player.video.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.web.servlet.config.annotation.InterceptorRegistration; 6 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; 7 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 8 | 9 | /** 10 | * @Description:拦截器配置 11 | * @author: zk 12 | * @date: 2020年12月25日 21:41 13 | */ 14 | @Configuration 15 | public class WebAppConfig implements WebMvcConfigurer { 16 | @Bean 17 | public AuthInterceptor getAuthInterceptor() { 18 | return new AuthInterceptor(); 19 | } 20 | @Override 21 | public void addInterceptors(InterceptorRegistry registry) { 22 | //注册TestInterceptor拦截器 23 | InterceptorRegistration registration = registry.addInterceptor(getAuthInterceptor()); 24 | registration.addPathPatterns("/service/video-getway/**"); //所有路径都被拦截 25 | registration.excludePathPatterns( //添加不拦截路径 26 | "/**/*.html", //html静态资源 27 | "/**/*.js", //js静态资源 28 | "/**/*.css", //css静态资源 29 | "/**/*.woff", 30 | "/**/*.ttf" 31 | ); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /player-video/src/main/java/com/player/video/entity/ChannelEntity.java: -------------------------------------------------------------------------------- 1 | package com.player.video.entity; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | import lombok.ToString; 6 | 7 | @Data 8 | @ToString 9 | public class ChannelEntity { 10 | @ApiModelProperty(value = "主键") 11 | private Long id;//主键 12 | 13 | @ApiModelProperty(value = "频道名称") 14 | private String channelName; 15 | 16 | @ApiModelProperty(value = "频道id") 17 | private String channelId; 18 | 19 | @ApiModelProperty(value = "创建时间") 20 | private String createTime; 21 | 22 | @ApiModelProperty(value = "更新时间") 23 | private String updateTime; 24 | 25 | @ApiModelProperty(value = "是否禁用,0表示不禁用,1表示禁用") 26 | private String status; 27 | 28 | @ApiModelProperty(value = "排序规则") 29 | private String sequence; 30 | 31 | @ApiModelProperty(value = "用户id") 32 | private String userId; 33 | } 34 | -------------------------------------------------------------------------------- /player-video/src/main/java/com/player/video/entity/CommentEntity.java: -------------------------------------------------------------------------------- 1 | package com.player.video.entity; 2 | 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | import lombok.ToString; 6 | 7 | @Data 8 | @ToString 9 | public class CommentEntity { 10 | @ApiModelProperty(value = "主键") 11 | private Long id;//主键 12 | 13 | @ApiModelProperty(value = "评论内容") 14 | private String content; 15 | 16 | @ApiModelProperty(value = "父节点id") 17 | private Long parentId; 18 | 19 | @ApiModelProperty(value = "顶级节点id") 20 | private Long topId; 21 | 22 | @ApiModelProperty(value = "视频id") 23 | private Long videoId; 24 | 25 | @ApiModelProperty(value = "创建时间") 26 | private String createTime; 27 | 28 | @ApiModelProperty(value = "更新时间") 29 | private String updateTime; 30 | 31 | @ApiModelProperty(value = "回复数量") 32 | private int replyCount; 33 | 34 | @ApiModelProperty(value = "用户id") 35 | private String userId; 36 | 37 | @ApiModelProperty(value = "用户名") 38 | private String username; 39 | 40 | @ApiModelProperty(value = "用户头像") 41 | private String avater; 42 | 43 | @ApiModelProperty(value = "被回复者id") 44 | private String replyUserId; 45 | 46 | @ApiModelProperty(value = "被回复者名称") 47 | private String replyUserName; 48 | } 49 | -------------------------------------------------------------------------------- /player-video/src/main/java/com/player/video/entity/VideoEntity.java: -------------------------------------------------------------------------------- 1 | package com.player.video.entity; 2 | import com.player.common.entity.AuthorEntity; 3 | import io.swagger.annotations.ApiModelProperty; 4 | import lombok.Data; 5 | import lombok.ToString; 6 | 7 | import java.util.Date; 8 | 9 | @Data 10 | @ToString 11 | public class VideoEntity { 12 | @ApiModelProperty(value = "主键") 13 | private Long id;//主键 14 | 15 | @ApiModelProperty(value = "视频id") 16 | private String albumId; 17 | 18 | @ApiModelProperty(value = "频道id") 19 | private String channelId; 20 | 21 | @ApiModelProperty(value = "视频名称") 22 | private String title; 23 | 24 | @ApiModelProperty(value = "导演") 25 | private String director; 26 | 27 | @ApiModelProperty(value = "主演") 28 | private String star; 29 | 30 | @ApiModelProperty(value = "类型") 31 | private String type; 32 | 33 | @ApiModelProperty(value = "国家/语言") 34 | private String countryLanguage; 35 | 36 | @ApiModelProperty(value = "上映时间") 37 | private String publishTime; 38 | 39 | @ApiModelProperty(value = "剧情") 40 | private String plot; 41 | 42 | @ApiModelProperty(value = "是否推荐,0:不推荐,1:推荐") 43 | private String isRecommend; 44 | 45 | @ApiModelProperty(value = "大分类") 46 | private String classify; 47 | 48 | @ApiModelProperty(value = "来源名称") 49 | private String sourceName; 50 | 51 | @ApiModelProperty(value = "来源地址") 52 | private String sourceUrl; 53 | 54 | @ApiModelProperty(value = "标签") 55 | private String label; 56 | 57 | @ApiModelProperty(value = "源地址") 58 | private String originalHref; 59 | 60 | @ApiModelProperty(value = "简单描述") 61 | private String description; 62 | 63 | @ApiModelProperty(value = "链接地址") 64 | private String targetHref; 65 | 66 | @ApiModelProperty(value = "0代表未使用,1表示正在使用,") 67 | private String status; 68 | 69 | @ApiModelProperty(value = "评分") 70 | private String score; 71 | 72 | @ApiModelProperty(value = "类目") 73 | private String category; 74 | 75 | @ApiModelProperty(value = "排名") 76 | private String ranks; 77 | 78 | @ApiModelProperty(value = "作者id") 79 | private String authorId; 80 | 81 | @ApiModelProperty(value = "时长") 82 | private String duration; 83 | 84 | @ApiModelProperty(value = "图片地址") 85 | private String img; 86 | 87 | @ApiModelProperty(value = "创建时间") 88 | private Date createTime; 89 | 90 | @ApiModelProperty(value = "更新时间") 91 | private Date updateTime; 92 | 93 | @ApiModelProperty(value = "作者信息") 94 | private AuthorEntity authorInfo; 95 | 96 | @ApiModelProperty(value = "用户id") 97 | private String userId; 98 | } 99 | -------------------------------------------------------------------------------- /player-video/src/main/java/com/player/video/mapper/VideoMapper.java: -------------------------------------------------------------------------------- 1 | package com.player.video.mapper; 2 | 3 | import com.player.common.entity.LogEntity; 4 | import com.player.video.entity.ChannelEntity; 5 | import com.player.video.entity.CommentEntity; 6 | import com.player.video.entity.VideoEntity; 7 | 8 | import java.util.List; 9 | 10 | public interface VideoMapper { 11 | /** 12 | * @author: wuwenqiang 13 | * @description: 插入日志 14 | * @date: 2020-5-29 19:22 15 | */ 16 | Long log(LogEntity logEntity); 17 | 18 | /** 19 | * @author: wuwenqiang 20 | * @description: 查询日志列表 21 | * @date: 2020-5-29 19:22 22 | */ 23 | List getVideoList(int start,int pageSize,String star,String category,String type,String label,String authorId,String keyword); 24 | 25 | List getFavoriteChannels(String userId); 26 | 27 | List getPublicChannels(); 28 | 29 | Long insertFavoriteChannels(List channelEntities); 30 | 31 | Long isFavorite(String userId, int videoId); 32 | 33 | Long insertFavorite(String userId,int videoId); 34 | 35 | Long deleteFavorite(String userId, int videoId); 36 | 37 | Long isLike(String userId, int videoId); 38 | 39 | Long insertLike(String userId,int videoId); 40 | 41 | Long deleteLike(String userId, int videoId); 42 | 43 | Long isFocus(String userId, String authorId); 44 | 45 | Long insertFocus(String userId, String authorId); 46 | 47 | Long deleteFocus(String userId, String authorId); 48 | 49 | List getFavoriteList(String userId,int start,int pageSize); 50 | 51 | List getVideoRecordList(String userId); 52 | 53 | Long getCommentCount(int videoId); 54 | 55 | List getTopCommentList(int videoId, int start, int pageSize); 56 | 57 | Long insertComment(CommentEntity commentEntity); 58 | 59 | List getReplyCommentList(int topId,int start,int pageSize); 60 | 61 | Long deleteComment(int id,String userId); 62 | 63 | CommentEntity getCommentItem(int id); 64 | 65 | List getRecordList(String userId); 66 | } 67 | -------------------------------------------------------------------------------- /player-video/src/main/java/com/player/video/service/IVideoService.java: -------------------------------------------------------------------------------- 1 | package com.player.video.service; 2 | 3 | import com.player.common.entity.ResultEntity; 4 | import com.player.video.entity.ChannelEntity; 5 | import com.player.video.entity.CommentEntity; 6 | 7 | import java.util.List; 8 | 9 | public interface IVideoService { 10 | ResultEntity getUserData(String token); 11 | 12 | ResultEntity getVideoList(int pageNum,int pageSize,String star,String category,String type,String label,String userId,String keyword,String path); 13 | 14 | ResultEntity insertFavoriteChannels(List channelEntities); 15 | 16 | ResultEntity getFavoriteChannels(String token); 17 | 18 | ResultEntity isFavorite(String token,int videoId); 19 | 20 | ResultEntity insertFavorite(String token, int videoId); 21 | 22 | ResultEntity deleteFavorite(String token, int videoId); 23 | 24 | ResultEntity isLike(String token,int videoId); 25 | 26 | ResultEntity insertLike(String token, int videoId); 27 | 28 | ResultEntity deleteLike(String token, int videoId); 29 | 30 | ResultEntity isFocus(String token,String authorId); 31 | 32 | ResultEntity insertFocus(String token,String authorId); 33 | 34 | ResultEntity deleteFocus(String token,String authorId); 35 | 36 | ResultEntity getFavoriteList(String token, int pageNum, int pageSize); 37 | 38 | ResultEntity getVideoRecordList(String token); 39 | 40 | ResultEntity getCommentCount(int videoId); 41 | 42 | ResultEntity getTopCommentList(int videoId,int pageNum, int pageSize); 43 | 44 | ResultEntity insertComment(String token, CommentEntity commentEntity); 45 | 46 | ResultEntity deleteComment(int id,String userId); 47 | 48 | ResultEntity getReplyCommentList(int topId,int pageNum,int pageSize); 49 | 50 | ResultEntity getCommentItem(int id); 51 | 52 | ResultEntity getRecordList(String token); 53 | } -------------------------------------------------------------------------------- /player-video/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8001 3 | token: 4 | expiration-time: 2592000000 #token失效时间一个月 1000 * 60 * 60 * 24 * 30 5 | secret: wuwenqiang #token秘钥 6 | app: 7 | appId: com.player.video 8 | appName: 冬瓜视频 9 | spring: 10 | redis: 11 | database: 0 # Redis数据库索引(默认为0) 12 | host: 127.0.0.1 # Redis服务器地址 13 | port: 6379 # Redis服务器连接端口 14 | password: # Redis服务器连接密码(默认为空) 15 | timeout: 5000 # 连接超时时间(毫秒) 16 | jedis: 17 | pool: 18 | max-active: 8 # 连接池最大连接数(使用负值表示没有限制) 19 | max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制) 20 | max-idle: 8 # 连接池中的最大空闲连接 21 | min-idle: 0 # 连接池中的最小空闲连接 22 | application: 23 | name: player-video 24 | datasource: 25 | druid: 26 | url: jdbc:mysql://localhost:3306/play?characterEncoding=utf-8 27 | username: root 28 | password: wwq_2021 29 | driverClassName: com.mysql.jdbc.Driver 30 | initialSize: 5 #初始建立连接数量 31 | minIdle: 5 #最小连接数量 32 | maxActive: 20 #最大连接数量 33 | maxWait: 10000 #获取连接最大等待时间,毫秒 34 | testOnBorrow: true #申请连接时检测连接是否有效 35 | testOnReturn: false #归还连接时检测连接是否有效 36 | timeBetweenEvictionRunsMillis: 60000 #配置间隔检测连接是否有效的时间(单位是毫秒) 37 | minEvictableIdleTimeMillis: 300000 #连接在连接池的最小生存时间(毫秒) 38 | #mybatis: 39 | # mapper-locations: classpath:mapper/*Mapper.xml 40 | 41 | mybatis: 42 | mapper-locations: classpath:mapper/*Mapper.xml 43 | type-aliases-package: com.player.video.entity 44 | configuration: 45 | map-underscore-to-camel-case: true 46 | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.4.1 9 | 10 | 11 | com.player 12 | learn 13 | 0.0.1-SNAPSHOT 14 | learn 15 | Demo project for Spring Boot 16 | 17 | 18 | 1.8 19 | 20 | 21 | 22 | 23 | org.springframework.boot 24 | spring-boot-starter-data-jdbc 25 | 26 | 27 | org.springframework.boot 28 | spring-boot-starter-data-jpa 29 | 30 | 31 | org.springframework.boot 32 | spring-boot-starter-web 33 | 34 | 35 | 36 | mysql 37 | mysql-connector-java 38 | runtime 39 | 40 | 41 | org.projectlombok 42 | lombok 43 | true 44 | 45 | 46 | org.springframework.boot 47 | spring-boot-starter-test 48 | test 49 | 50 | 51 | 52 | 53 | 54 | 55 | org.springframework.boot 56 | spring-boot-maven-plugin 57 | 58 | 59 | 60 | org.projectlombok 61 | lombok 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /一键提交到gitee.bat: -------------------------------------------------------------------------------- 1 | git remote rm origin 2 | git remote add origin https://gitee.com/wuyuanwuhui99/springboot-app-service 3 | git push origin main 4 | pause -------------------------------------------------------------------------------- /一键提交到github.bat: -------------------------------------------------------------------------------- 1 | git remote rm origin 2 | git remote add origin https://github.com/wuyuanwuhui99/springboot-app-service 3 | git push origin main 4 | pause -------------------------------------------------------------------------------- /发说说.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuyuanwuhui99/springboot-app-service/3cf924cf4fcc905514c081aa637d871c161b5a1f/发说说.jpg -------------------------------------------------------------------------------- /在线音乐app整体预览.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuyuanwuhui99/springboot-app-service/3cf924cf4fcc905514c081aa637d871c161b5a1f/在线音乐app整体预览.jpg -------------------------------------------------------------------------------- /外网映射正常访问提示.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuyuanwuhui99/springboot-app-service/3cf924cf4fcc905514c081aa637d871c161b5a1f/外网映射正常访问提示.png -------------------------------------------------------------------------------- /明日头条app整体效果图(待更新).jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuyuanwuhui99/springboot-app-service/3cf924cf4fcc905514c081aa637d871c161b5a1f/明日头条app整体效果图(待更新).jpg -------------------------------------------------------------------------------- /明日头条app整体效果图(待更新).jpg.lnk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuyuanwuhui99/springboot-app-service/3cf924cf4fcc905514c081aa637d871c161b5a1f/明日头条app整体效果图(待更新).jpg.lnk -------------------------------------------------------------------------------- /电影app整体预览.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuyuanwuhui99/springboot-app-service/3cf924cf4fcc905514c081aa637d871c161b5a1f/电影app整体预览.jpg -------------------------------------------------------------------------------- /电影圈.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuyuanwuhui99/springboot-app-service/3cf924cf4fcc905514c081aa637d871c161b5a1f/电影圈.jpg -------------------------------------------------------------------------------- /静态资源.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuyuanwuhui99/springboot-app-service/3cf924cf4fcc905514c081aa637d871c161b5a1f/静态资源.png -------------------------------------------------------------------------------- /音乐整体预览图.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wuyuanwuhui99/springboot-app-service/3cf924cf4fcc905514c081aa637d871c161b5a1f/音乐整体预览图.png --------------------------------------------------------------------------------