├── src ├── main │ ├── resources │ │ ├── static │ │ │ └── upload │ │ │ │ ├── test │ │ │ │ ├── picture1.jpg │ │ │ │ ├── picture2.jpg │ │ │ │ ├── picture3.jpg │ │ │ │ ├── 1577351717989.jpg │ │ │ │ ├── news_picture1.jpg │ │ │ │ ├── news_picture2.jpg │ │ │ │ ├── news_picture3.jpg │ │ │ │ ├── news_picture4.jpg │ │ │ │ ├── news_picture5.jpg │ │ │ │ ├── news_picture6.jpg │ │ │ │ ├── news_picture7.jpg │ │ │ │ ├── news_picture8.jpg │ │ │ │ ├── systemintro_picture1.jpg │ │ │ │ ├── systemintro_picture2.jpg │ │ │ │ ├── systemintro_picture3.jpg │ │ │ │ ├── bingxiangxinxi_fengmian1.jpg │ │ │ │ ├── bingxiangxinxi_fengmian2.jpg │ │ │ │ ├── bingxiangxinxi_fengmian3.jpg │ │ │ │ ├── bingxiangxinxi_fengmian4.jpg │ │ │ │ ├── bingxiangxinxi_fengmian5.jpg │ │ │ │ ├── bingxiangxinxi_fengmian6.jpg │ │ │ │ ├── bingxiangxinxi_fengmian7.jpg │ │ │ │ ├── bingxiangxinxi_fengmian8.jpg │ │ │ │ ├── zhinengjiaju_shangpintupian1.jpg │ │ │ │ ├── zhinengjiaju_shangpintupian2.jpg │ │ │ │ ├── zhinengjiaju_shangpintupian3.jpg │ │ │ │ ├── zhinengjiaju_shangpintupian4.jpg │ │ │ │ ├── zhinengjiaju_shangpintupian5.jpg │ │ │ │ ├── zhinengjiaju_shangpintupian6.jpg │ │ │ │ ├── zhinengjiaju_shangpintupian7.jpg │ │ │ │ └── zhinengjiaju_shangpintupian8.jpg │ │ ├── mapper │ │ │ ├── ConfigDao.xml │ │ │ ├── TokenDao.xml │ │ │ ├── UsersDao.xml │ │ │ ├── NewsDao.xml │ │ │ ├── YonghuDao.xml │ │ │ ├── SystemintroDao.xml │ │ │ ├── StoreupDao.xml │ │ │ ├── DiscusszhinengjiajuDao.xml │ │ │ ├── DiscussbingxiangxinxiDao.xml │ │ │ ├── CommonDao.xml │ │ │ ├── BingxiangxinxiDao.xml │ │ │ └── ZhinengjiajuDao.xml │ │ └── application.yml │ └── java │ │ └── com │ │ ├── dao │ │ ├── ConfigDao.java │ │ ├── UsersDao.java │ │ ├── TokenDao.java │ │ ├── CommonDao.java │ │ ├── NewsDao.java │ │ ├── YonghuDao.java │ │ ├── StoreupDao.java │ │ ├── SystemintroDao.java │ │ ├── DiscusszhinengjiajuDao.java │ │ ├── DiscussbingxiangxinxiDao.java │ │ ├── BingxiangxinxiDao.java │ │ └── ZhinengjiajuDao.java │ │ ├── annotation │ │ ├── IgnoreAuth.java │ │ ├── LoginUser.java │ │ └── APPLoginUser.java │ │ ├── config │ │ ├── AlipayConfig.java │ │ ├── MybatisPlusConfig.java │ │ ├── HadoopConfig.java │ │ ├── InterceptorConfig.java │ │ └── SparkConfig.java │ │ ├── utils │ │ ├── MD5Util.java │ │ ├── FileUtil.java │ │ ├── JQPageInfo.java │ │ ├── R.java │ │ ├── SQLFilter.java │ │ ├── HttpClientUtils.java │ │ ├── ValidatorUtils.java │ │ ├── SpringContextUtils.java │ │ ├── PageUtils.java │ │ └── Query.java │ │ ├── service │ │ ├── ConfigService.java │ │ ├── UsersService.java │ │ ├── CommonService.java │ │ ├── TokenService.java │ │ ├── impl │ │ │ ├── ConfigServiceImpl.java │ │ │ ├── UsersServiceImpl.java │ │ │ ├── CommonServiceImpl.java │ │ │ ├── NewsServiceImpl.java │ │ │ ├── YonghuServiceImpl.java │ │ │ ├── StoreupServiceImpl.java │ │ │ ├── SystemintroServiceImpl.java │ │ │ ├── DiscusszhinengjiajuServiceImpl.java │ │ │ ├── DiscussbingxiangxinxiServiceImpl.java │ │ │ ├── TokenServiceImpl.java │ │ │ ├── BingxiangxinxiServiceImpl.java │ │ │ └── ZhinengjiajuServiceImpl.java │ │ ├── NewsService.java │ │ ├── YonghuService.java │ │ ├── StoreupService.java │ │ ├── SystemintroService.java │ │ ├── DiscusszhinengjiajuService.java │ │ ├── DiscussbingxiangxinxiService.java │ │ ├── BingxiangxinxiService.java │ │ └── ZhinengjiajuService.java │ │ ├── entity │ │ ├── view │ │ │ ├── NewsView.java │ │ │ ├── YonghuView.java │ │ │ ├── StoreupView.java │ │ │ ├── SystemintroView.java │ │ │ ├── ZhinengjiajuView.java │ │ │ ├── BingxiangxinxiView.java │ │ │ ├── DiscusszhinengjiajuView.java │ │ │ └── DiscussbingxiangxinxiView.java │ │ ├── EIException.java │ │ ├── ConfigEntity.java │ │ ├── UsersEntity.java │ │ ├── vo │ │ │ ├── NewsVO.java │ │ │ ├── YonghuVO.java │ │ │ ├── SystemintroVO.java │ │ │ ├── DiscusszhinengjiajuVO.java │ │ │ ├── DiscussbingxiangxinxiVO.java │ │ │ ├── StoreupVO.java │ │ │ ├── ZhinengjiajuVO.java │ │ │ └── BingxiangxinxiVO.java │ │ ├── model │ │ │ ├── NewsModel.java │ │ │ ├── YonghuModel.java │ │ │ ├── SystemintroModel.java │ │ │ ├── DiscusszhinengjiajuModel.java │ │ │ ├── DiscussbingxiangxinxiModel.java │ │ │ ├── StoreupModel.java │ │ │ ├── ZhinengjiajuModel.java │ │ │ └── BingxiangxinxiModel.java │ │ ├── TokenEntity.java │ │ ├── NewsEntity.java │ │ ├── YonghuEntity.java │ │ ├── SystemintroEntity.java │ │ ├── DiscusszhinengjiajuEntity.java │ │ ├── DiscussbingxiangxinxiEntity.java │ │ ├── StoreupEntity.java │ │ └── ZhinengjiajuEntity.java │ │ ├── SpringbootSchemaApplication.java │ │ ├── interceptor │ │ └── AuthorizationInterceptor.java │ │ └── controller │ │ ├── ConfigController.java │ │ └── FileController.java └── test │ └── java │ └── com │ └── SpringbootSchemaApplicationTests.java ├── image ├── 1.png ├── 2.png ├── 3.png ├── 4.png ├── 5.png ├── 6.png ├── 7.png └── 8.png ├── .mvn └── wrapper │ ├── maven-wrapper.jar │ ├── maven-wrapper.properties │ └── MavenWrapperDownloader.java ├── .gitignore └── README.md /src/main/resources/static/upload/test: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /image/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No75Analysis-of-sales-data-for-smart-homes/HEAD/image/1.png -------------------------------------------------------------------------------- /image/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No75Analysis-of-sales-data-for-smart-homes/HEAD/image/2.png -------------------------------------------------------------------------------- /image/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No75Analysis-of-sales-data-for-smart-homes/HEAD/image/3.png -------------------------------------------------------------------------------- /image/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No75Analysis-of-sales-data-for-smart-homes/HEAD/image/4.png -------------------------------------------------------------------------------- /image/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No75Analysis-of-sales-data-for-smart-homes/HEAD/image/5.png -------------------------------------------------------------------------------- /image/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No75Analysis-of-sales-data-for-smart-homes/HEAD/image/6.png -------------------------------------------------------------------------------- /image/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No75Analysis-of-sales-data-for-smart-homes/HEAD/image/7.png -------------------------------------------------------------------------------- /image/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No75Analysis-of-sales-data-for-smart-homes/HEAD/image/8.png -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No75Analysis-of-sales-data-for-smart-homes/HEAD/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /src/main/resources/static/upload/picture1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No75Analysis-of-sales-data-for-smart-homes/HEAD/src/main/resources/static/upload/picture1.jpg -------------------------------------------------------------------------------- /src/main/resources/static/upload/picture2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No75Analysis-of-sales-data-for-smart-homes/HEAD/src/main/resources/static/upload/picture2.jpg -------------------------------------------------------------------------------- /src/main/resources/static/upload/picture3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No75Analysis-of-sales-data-for-smart-homes/HEAD/src/main/resources/static/upload/picture3.jpg -------------------------------------------------------------------------------- /src/main/resources/static/upload/1577351717989.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No75Analysis-of-sales-data-for-smart-homes/HEAD/src/main/resources/static/upload/1577351717989.jpg -------------------------------------------------------------------------------- /src/main/resources/static/upload/news_picture1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No75Analysis-of-sales-data-for-smart-homes/HEAD/src/main/resources/static/upload/news_picture1.jpg -------------------------------------------------------------------------------- /src/main/resources/static/upload/news_picture2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No75Analysis-of-sales-data-for-smart-homes/HEAD/src/main/resources/static/upload/news_picture2.jpg -------------------------------------------------------------------------------- /src/main/resources/static/upload/news_picture3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No75Analysis-of-sales-data-for-smart-homes/HEAD/src/main/resources/static/upload/news_picture3.jpg -------------------------------------------------------------------------------- /src/main/resources/static/upload/news_picture4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No75Analysis-of-sales-data-for-smart-homes/HEAD/src/main/resources/static/upload/news_picture4.jpg -------------------------------------------------------------------------------- /src/main/resources/static/upload/news_picture5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No75Analysis-of-sales-data-for-smart-homes/HEAD/src/main/resources/static/upload/news_picture5.jpg -------------------------------------------------------------------------------- /src/main/resources/static/upload/news_picture6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No75Analysis-of-sales-data-for-smart-homes/HEAD/src/main/resources/static/upload/news_picture6.jpg -------------------------------------------------------------------------------- /src/main/resources/static/upload/news_picture7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No75Analysis-of-sales-data-for-smart-homes/HEAD/src/main/resources/static/upload/news_picture7.jpg -------------------------------------------------------------------------------- /src/main/resources/static/upload/news_picture8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No75Analysis-of-sales-data-for-smart-homes/HEAD/src/main/resources/static/upload/news_picture8.jpg -------------------------------------------------------------------------------- /src/main/resources/static/upload/systemintro_picture1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No75Analysis-of-sales-data-for-smart-homes/HEAD/src/main/resources/static/upload/systemintro_picture1.jpg -------------------------------------------------------------------------------- /src/main/resources/static/upload/systemintro_picture2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No75Analysis-of-sales-data-for-smart-homes/HEAD/src/main/resources/static/upload/systemintro_picture2.jpg -------------------------------------------------------------------------------- /src/main/resources/static/upload/systemintro_picture3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No75Analysis-of-sales-data-for-smart-homes/HEAD/src/main/resources/static/upload/systemintro_picture3.jpg -------------------------------------------------------------------------------- /src/main/resources/static/upload/bingxiangxinxi_fengmian1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No75Analysis-of-sales-data-for-smart-homes/HEAD/src/main/resources/static/upload/bingxiangxinxi_fengmian1.jpg -------------------------------------------------------------------------------- /src/main/resources/static/upload/bingxiangxinxi_fengmian2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No75Analysis-of-sales-data-for-smart-homes/HEAD/src/main/resources/static/upload/bingxiangxinxi_fengmian2.jpg -------------------------------------------------------------------------------- /src/main/resources/static/upload/bingxiangxinxi_fengmian3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No75Analysis-of-sales-data-for-smart-homes/HEAD/src/main/resources/static/upload/bingxiangxinxi_fengmian3.jpg -------------------------------------------------------------------------------- /src/main/resources/static/upload/bingxiangxinxi_fengmian4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No75Analysis-of-sales-data-for-smart-homes/HEAD/src/main/resources/static/upload/bingxiangxinxi_fengmian4.jpg -------------------------------------------------------------------------------- /src/main/resources/static/upload/bingxiangxinxi_fengmian5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No75Analysis-of-sales-data-for-smart-homes/HEAD/src/main/resources/static/upload/bingxiangxinxi_fengmian5.jpg -------------------------------------------------------------------------------- /src/main/resources/static/upload/bingxiangxinxi_fengmian6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No75Analysis-of-sales-data-for-smart-homes/HEAD/src/main/resources/static/upload/bingxiangxinxi_fengmian6.jpg -------------------------------------------------------------------------------- /src/main/resources/static/upload/bingxiangxinxi_fengmian7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No75Analysis-of-sales-data-for-smart-homes/HEAD/src/main/resources/static/upload/bingxiangxinxi_fengmian7.jpg -------------------------------------------------------------------------------- /src/main/resources/static/upload/bingxiangxinxi_fengmian8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No75Analysis-of-sales-data-for-smart-homes/HEAD/src/main/resources/static/upload/bingxiangxinxi_fengmian8.jpg -------------------------------------------------------------------------------- /src/main/resources/static/upload/zhinengjiaju_shangpintupian1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No75Analysis-of-sales-data-for-smart-homes/HEAD/src/main/resources/static/upload/zhinengjiaju_shangpintupian1.jpg -------------------------------------------------------------------------------- /src/main/resources/static/upload/zhinengjiaju_shangpintupian2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No75Analysis-of-sales-data-for-smart-homes/HEAD/src/main/resources/static/upload/zhinengjiaju_shangpintupian2.jpg -------------------------------------------------------------------------------- /src/main/resources/static/upload/zhinengjiaju_shangpintupian3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No75Analysis-of-sales-data-for-smart-homes/HEAD/src/main/resources/static/upload/zhinengjiaju_shangpintupian3.jpg -------------------------------------------------------------------------------- /src/main/resources/static/upload/zhinengjiaju_shangpintupian4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No75Analysis-of-sales-data-for-smart-homes/HEAD/src/main/resources/static/upload/zhinengjiaju_shangpintupian4.jpg -------------------------------------------------------------------------------- /src/main/resources/static/upload/zhinengjiaju_shangpintupian5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No75Analysis-of-sales-data-for-smart-homes/HEAD/src/main/resources/static/upload/zhinengjiaju_shangpintupian5.jpg -------------------------------------------------------------------------------- /src/main/resources/static/upload/zhinengjiaju_shangpintupian6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No75Analysis-of-sales-data-for-smart-homes/HEAD/src/main/resources/static/upload/zhinengjiaju_shangpintupian6.jpg -------------------------------------------------------------------------------- /src/main/resources/static/upload/zhinengjiaju_shangpintupian7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No75Analysis-of-sales-data-for-smart-homes/HEAD/src/main/resources/static/upload/zhinengjiaju_shangpintupian7.jpg -------------------------------------------------------------------------------- /src/main/resources/static/upload/zhinengjiaju_shangpintupian8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No75Analysis-of-sales-data-for-smart-homes/HEAD/src/main/resources/static/upload/zhinengjiaju_shangpintupian8.jpg -------------------------------------------------------------------------------- /src/main/resources/mapper/ConfigDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.2/apache-maven-3.6.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar 3 | -------------------------------------------------------------------------------- /src/main/java/com/dao/ConfigDao.java: -------------------------------------------------------------------------------- 1 | 2 | package com.dao; 3 | 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | import com.entity.ConfigEntity; 6 | 7 | /** 8 | * 配置 9 | */ 10 | public interface ConfigDao extends BaseMapper { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/annotation/IgnoreAuth.java: -------------------------------------------------------------------------------- 1 | package com.annotation; 2 | 3 | import java.lang.annotation.*; 4 | 5 | /** 6 | * 忽略Token验证 7 | */ 8 | @Target(ElementType.METHOD) 9 | @Retention(RetentionPolicy.RUNTIME) 10 | @Documented 11 | public @interface IgnoreAuth { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/test/java/com/SpringbootSchemaApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringbootSchemaApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/config/AlipayConfig.java: -------------------------------------------------------------------------------- 1 | package com.config; 2 | 3 | import java.io.FileWriter; 4 | import java.io.IOException; 5 | 6 | /* * 7 | *类名:AlipayConfig 8 | *功能:基础配置类 9 | *详细:设置帐户有关信息及返回路径 10 | *修改日期:2017-04-05 11 | *说明: 12 | *以下代码只是为了方便商户测试而提供的样例代码,商户可以根据自己网站的需要,按照技术文档编写,并非一定要使用该代码。 13 | *该代码仅供学习和研究支付宝接口使用,只是提供一个参考。 14 | */ 15 | 16 | public class AlipayConfig { 17 | } 18 | 19 | -------------------------------------------------------------------------------- /src/main/java/com/utils/MD5Util.java: -------------------------------------------------------------------------------- 1 | package com.utils; 2 | 3 | import cn.hutool.crypto.digest.DigestUtil; 4 | 5 | public class MD5Util { 6 | 7 | /** 8 | * @param text明文 9 | * @param key密钥 10 | * @return 密文 11 | */ 12 | // 带秘钥加密 13 | public static String md5(String text) { 14 | // 加密后的字符串 15 | String md5str = DigestUtil.md5Hex(text); 16 | return md5str; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/annotation/LoginUser.java: -------------------------------------------------------------------------------- 1 | package com.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | /** 9 | * 登录用户信息 10 | */ 11 | @Target(ElementType.PARAMETER) 12 | @Retention(RetentionPolicy.RUNTIME) 13 | public @interface LoginUser { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/annotation/APPLoginUser.java: -------------------------------------------------------------------------------- 1 | package com.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | /** 9 | * 登录用户信息 10 | */ 11 | @Target(ElementType.PARAMETER) 12 | @Retention(RetentionPolicy.RUNTIME) 13 | public @interface APPLoginUser { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/main/resources/mapper/TokenDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/resources/mapper/UsersDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/main/java/com/service/ConfigService.java: -------------------------------------------------------------------------------- 1 | 2 | package com.service; 3 | 4 | import java.util.Map; 5 | 6 | import com.baomidou.mybatisplus.mapper.Wrapper; 7 | import com.baomidou.mybatisplus.service.IService; 8 | import com.entity.ConfigEntity; 9 | import com.utils.PageUtils; 10 | 11 | 12 | /** 13 | * 系统用户 14 | */ 15 | public interface ConfigService extends IService { 16 | PageUtils queryPage(Map params,Wrapper wrapper); 17 | } 18 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /src/main/java/com/config/MybatisPlusConfig.java: -------------------------------------------------------------------------------- 1 | 2 | package com.config; 3 | 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | 7 | import com.baomidou.mybatisplus.mapper.MetaObjectHandler; 8 | import com.baomidou.mybatisplus.plugins.PaginationInterceptor; 9 | 10 | /** 11 | * mybatis-plus配置 12 | */ 13 | @Configuration 14 | public class MybatisPlusConfig { 15 | 16 | /** 17 | * 分页插件 18 | */ 19 | @Bean 20 | public PaginationInterceptor paginationInterceptor() { 21 | return new PaginationInterceptor(); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/dao/UsersDao.java: -------------------------------------------------------------------------------- 1 | 2 | package com.dao; 3 | 4 | import java.util.List; 5 | 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | import com.baomidou.mybatisplus.mapper.BaseMapper; 9 | import com.baomidou.mybatisplus.mapper.Wrapper; 10 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 11 | import com.entity.UsersEntity; 12 | 13 | /** 14 | * 用户 15 | */ 16 | public interface UsersDao extends BaseMapper { 17 | 18 | List selectListView(@Param("ew") Wrapper wrapper); 19 | 20 | List selectListView(Pagination page,@Param("ew") Wrapper wrapper); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/dao/TokenDao.java: -------------------------------------------------------------------------------- 1 | 2 | package com.dao; 3 | 4 | import java.util.List; 5 | 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | import com.baomidou.mybatisplus.mapper.BaseMapper; 9 | import com.baomidou.mybatisplus.mapper.Wrapper; 10 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 11 | import com.entity.TokenEntity; 12 | 13 | /** 14 | * token 15 | */ 16 | public interface TokenDao extends BaseMapper { 17 | 18 | List selectListView(@Param("ew") Wrapper wrapper); 19 | 20 | List selectListView(Pagination page,@Param("ew") Wrapper wrapper); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/service/UsersService.java: -------------------------------------------------------------------------------- 1 | 2 | package com.service; 3 | 4 | import java.util.List; 5 | import java.util.Map; 6 | 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import com.baomidou.mybatisplus.mapper.Wrapper; 10 | import com.baomidou.mybatisplus.service.IService; 11 | import com.entity.UsersEntity; 12 | import com.utils.PageUtils; 13 | 14 | 15 | /** 16 | * 系统用户 17 | */ 18 | public interface UsersService extends IService { 19 | PageUtils queryPage(Map params); 20 | 21 | List selectListView(Wrapper wrapper); 22 | 23 | PageUtils queryPage(Map params,Wrapper wrapper); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/service/CommonService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | 6 | public interface CommonService { 7 | List getOption(Map params); 8 | 9 | Map getFollowByOption(Map params); 10 | 11 | void sh(Map params); 12 | 13 | int remindCount(Map params); 14 | 15 | Map selectCal(Map params); 16 | 17 | List> selectGroup(Map params); 18 | 19 | List> selectValue(Map params); 20 | 21 | List> selectTimeStatValue(Map params); 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/utils/FileUtil.java: -------------------------------------------------------------------------------- 1 | package com.utils; 2 | 3 | import java.io.ByteArrayOutputStream; 4 | import java.io.File; 5 | import java.io.FileInputStream; 6 | import java.io.IOException; 7 | import java.io.InputStream; 8 | 9 | /** 10 | * 类说明 : 11 | */ 12 | 13 | public class FileUtil { 14 | public static byte[] FileToByte(File file) throws IOException { 15 | // 将数据转为流 16 | @SuppressWarnings("resource") 17 | InputStream content = new FileInputStream(file); 18 | ByteArrayOutputStream swapStream = new ByteArrayOutputStream(); 19 | byte[] buff = new byte[100]; 20 | int rc = 0; 21 | while ((rc = content.read(buff, 0, 100)) > 0) { 22 | swapStream.write(buff, 0, rc); 23 | } 24 | // 获得二进制数组 25 | return swapStream.toByteArray(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/service/TokenService.java: -------------------------------------------------------------------------------- 1 | 2 | package com.service; 3 | 4 | import java.util.List; 5 | import java.util.Map; 6 | 7 | import com.baomidou.mybatisplus.mapper.Wrapper; 8 | import com.baomidou.mybatisplus.service.IService; 9 | import com.entity.TokenEntity; 10 | import com.utils.PageUtils; 11 | 12 | 13 | /** 14 | * token 15 | */ 16 | public interface TokenService extends IService { 17 | PageUtils queryPage(Map params); 18 | 19 | List selectListView(Wrapper wrapper); 20 | 21 | PageUtils queryPage(Map params,Wrapper wrapper); 22 | 23 | String generateToken(Long userid,String username,String tableName, String role); 24 | 25 | TokenEntity getTokenEntity(String token); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/dao/CommonDao.java: -------------------------------------------------------------------------------- 1 | 2 | package com.dao; 3 | 4 | import java.util.List; 5 | import java.util.Map; 6 | 7 | /** 8 | * 通用接口 9 | */ 10 | public interface CommonDao{ 11 | List getOption(Map params); 12 | 13 | Map getFollowByOption(Map params); 14 | 15 | List getFollowByOption2(Map params); 16 | 17 | void sh(Map params); 18 | 19 | int remindCount(Map params); 20 | 21 | Map selectCal(Map params); 22 | 23 | List> selectGroup(Map params); 24 | 25 | List> selectValue(Map params); 26 | 27 | List> selectTimeStatValue(Map params); 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/entity/view/NewsView.java: -------------------------------------------------------------------------------- 1 | package com.entity.view; 2 | 3 | import com.entity.NewsEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import org.apache.commons.beanutils.BeanUtils; 7 | import java.lang.reflect.InvocationTargetException; 8 | 9 | import java.io.Serializable; 10 | 11 | 12 | /** 13 | * 智能家居资讯 14 | * 后端返回视图实体辅助类 15 | * (通常后端关联的表或者自定义的字段需要返回使用) 16 | * @author 17 | * @email 18 | * @date 2023-05-05 15:46:46 19 | */ 20 | @TableName("news") 21 | public class NewsView extends NewsEntity implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | public NewsView(){ 25 | } 26 | 27 | public NewsView(NewsEntity newsEntity){ 28 | try { 29 | BeanUtils.copyProperties(this, newsEntity); 30 | } catch (IllegalAccessException | InvocationTargetException e) { 31 | // TODO Auto-generated catch block 32 | e.printStackTrace(); 33 | } 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/entity/view/YonghuView.java: -------------------------------------------------------------------------------- 1 | package com.entity.view; 2 | 3 | import com.entity.YonghuEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import org.apache.commons.beanutils.BeanUtils; 7 | import java.lang.reflect.InvocationTargetException; 8 | 9 | import java.io.Serializable; 10 | 11 | 12 | /** 13 | * 用户 14 | * 后端返回视图实体辅助类 15 | * (通常后端关联的表或者自定义的字段需要返回使用) 16 | * @author 17 | * @email 18 | * @date 2023-05-05 15:46:46 19 | */ 20 | @TableName("yonghu") 21 | public class YonghuView extends YonghuEntity implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | public YonghuView(){ 25 | } 26 | 27 | public YonghuView(YonghuEntity yonghuEntity){ 28 | try { 29 | BeanUtils.copyProperties(this, yonghuEntity); 30 | } catch (IllegalAccessException | InvocationTargetException e) { 31 | // TODO Auto-generated catch block 32 | e.printStackTrace(); 33 | } 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/entity/view/StoreupView.java: -------------------------------------------------------------------------------- 1 | package com.entity.view; 2 | 3 | import com.entity.StoreupEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import org.apache.commons.beanutils.BeanUtils; 7 | import java.lang.reflect.InvocationTargetException; 8 | 9 | import java.io.Serializable; 10 | 11 | 12 | /** 13 | * 收藏表 14 | * 后端返回视图实体辅助类 15 | * (通常后端关联的表或者自定义的字段需要返回使用) 16 | * @author 17 | * @email 18 | * @date 2023-05-05 15:46:46 19 | */ 20 | @TableName("storeup") 21 | public class StoreupView extends StoreupEntity implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | public StoreupView(){ 25 | } 26 | 27 | public StoreupView(StoreupEntity storeupEntity){ 28 | try { 29 | BeanUtils.copyProperties(this, storeupEntity); 30 | } catch (IllegalAccessException | InvocationTargetException e) { 31 | // TODO Auto-generated catch block 32 | e.printStackTrace(); 33 | } 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/SpringbootSchemaApplication.java: -------------------------------------------------------------------------------- 1 | package com; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.boot.builder.SpringApplicationBuilder; 7 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 8 | 9 | @SpringBootApplication 10 | @MapperScan(basePackages = {"com.dao"}) 11 | public class SpringbootSchemaApplication extends SpringBootServletInitializer{ 12 | 13 | public static void main(String[] args) { 14 | System.setProperty("hadoop.home.dir", "D:\\hadoop\\hadoop-2.7.7"); 15 | SpringApplication.run(SpringbootSchemaApplication.class, args); 16 | } 17 | 18 | @Override 19 | protected SpringApplicationBuilder configure(SpringApplicationBuilder applicationBuilder) { 20 | return applicationBuilder.sources(SpringbootSchemaApplication.class); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/utils/JQPageInfo.java: -------------------------------------------------------------------------------- 1 | package com.utils; 2 | 3 | public class JQPageInfo{ 4 | private Integer page; 5 | 6 | private Integer limit; 7 | 8 | private String sidx; 9 | 10 | private String order; 11 | 12 | private Integer offset; 13 | 14 | public Integer getPage() { 15 | return page; 16 | } 17 | 18 | public void setPage(Integer page) { 19 | this.page = page; 20 | } 21 | 22 | public Integer getLimit() { 23 | return limit; 24 | } 25 | 26 | public void setLimit(Integer limit) { 27 | this.limit = limit; 28 | } 29 | 30 | public String getSidx() { 31 | return sidx; 32 | } 33 | 34 | public void setSidx(String sidx) { 35 | this.sidx = sidx; 36 | } 37 | 38 | public String getOrder() { 39 | return order; 40 | } 41 | 42 | public void setOrder(String order) { 43 | this.order = order; 44 | } 45 | 46 | public Integer getOffset() { 47 | return offset; 48 | } 49 | 50 | public void setOffset(Integer offset) { 51 | this.offset = offset; 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/entity/view/SystemintroView.java: -------------------------------------------------------------------------------- 1 | package com.entity.view; 2 | 3 | import com.entity.SystemintroEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import org.apache.commons.beanutils.BeanUtils; 7 | import java.lang.reflect.InvocationTargetException; 8 | 9 | import java.io.Serializable; 10 | 11 | 12 | /** 13 | * 关于我们 14 | * 后端返回视图实体辅助类 15 | * (通常后端关联的表或者自定义的字段需要返回使用) 16 | * @author 17 | * @email 18 | * @date 2023-05-05 15:46:46 19 | */ 20 | @TableName("systemintro") 21 | public class SystemintroView extends SystemintroEntity implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | public SystemintroView(){ 25 | } 26 | 27 | public SystemintroView(SystemintroEntity systemintroEntity){ 28 | try { 29 | BeanUtils.copyProperties(this, systemintroEntity); 30 | } catch (IllegalAccessException | InvocationTargetException e) { 31 | // TODO Auto-generated catch block 32 | e.printStackTrace(); 33 | } 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/entity/view/ZhinengjiajuView.java: -------------------------------------------------------------------------------- 1 | package com.entity.view; 2 | 3 | import com.entity.ZhinengjiajuEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import org.apache.commons.beanutils.BeanUtils; 7 | import java.lang.reflect.InvocationTargetException; 8 | 9 | import java.io.Serializable; 10 | 11 | 12 | /** 13 | * 智能家居 14 | * 后端返回视图实体辅助类 15 | * (通常后端关联的表或者自定义的字段需要返回使用) 16 | * @author 17 | * @email 18 | * @date 2023-05-05 15:46:46 19 | */ 20 | @TableName("zhinengjiaju") 21 | public class ZhinengjiajuView extends ZhinengjiajuEntity implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | public ZhinengjiajuView(){ 25 | } 26 | 27 | public ZhinengjiajuView(ZhinengjiajuEntity zhinengjiajuEntity){ 28 | try { 29 | BeanUtils.copyProperties(this, zhinengjiajuEntity); 30 | } catch (IllegalAccessException | InvocationTargetException e) { 31 | // TODO Auto-generated catch block 32 | e.printStackTrace(); 33 | } 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/dao/NewsDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.entity.NewsEntity; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | import java.util.List; 6 | import java.util.Map; 7 | import com.baomidou.mybatisplus.mapper.Wrapper; 8 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 9 | 10 | import org.apache.ibatis.annotations.Param; 11 | import com.entity.vo.NewsVO; 12 | import com.entity.view.NewsView; 13 | 14 | 15 | /** 16 | * 智能家居资讯 17 | * 18 | * @author 19 | * @email 20 | * @date 2023-05-05 15:46:46 21 | */ 22 | public interface NewsDao extends BaseMapper { 23 | 24 | List selectListVO(@Param("ew") Wrapper wrapper); 25 | 26 | NewsVO selectVO(@Param("ew") Wrapper wrapper); 27 | 28 | List selectListView(@Param("ew") Wrapper wrapper); 29 | 30 | List selectListView(Pagination page,@Param("ew") Wrapper wrapper); 31 | 32 | NewsView selectView(@Param("ew") Wrapper wrapper); 33 | 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/entity/EIException.java: -------------------------------------------------------------------------------- 1 | 2 | package com.entity; 3 | 4 | /** 5 | * 自定义异常 6 | */ 7 | public class EIException extends RuntimeException { 8 | private static final long serialVersionUID = 1L; 9 | 10 | private String msg; 11 | private int code = 500; 12 | 13 | public EIException(String msg) { 14 | super(msg); 15 | this.msg = msg; 16 | } 17 | 18 | public EIException(String msg, Throwable e) { 19 | super(msg, e); 20 | this.msg = msg; 21 | } 22 | 23 | public EIException(String msg, int code) { 24 | super(msg); 25 | this.msg = msg; 26 | this.code = code; 27 | } 28 | 29 | public EIException(String msg, int code, Throwable e) { 30 | super(msg, e); 31 | this.msg = msg; 32 | this.code = code; 33 | } 34 | 35 | public String getMsg() { 36 | return msg; 37 | } 38 | 39 | public void setMsg(String msg) { 40 | this.msg = msg; 41 | } 42 | 43 | public int getCode() { 44 | return code; 45 | } 46 | 47 | public void setCode(int code) { 48 | this.code = code; 49 | } 50 | 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/com/entity/view/BingxiangxinxiView.java: -------------------------------------------------------------------------------- 1 | package com.entity.view; 2 | 3 | import com.entity.BingxiangxinxiEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import org.apache.commons.beanutils.BeanUtils; 7 | import java.lang.reflect.InvocationTargetException; 8 | 9 | import java.io.Serializable; 10 | 11 | 12 | /** 13 | * 冰箱信息 14 | * 后端返回视图实体辅助类 15 | * (通常后端关联的表或者自定义的字段需要返回使用) 16 | * @author 17 | * @email 18 | * @date 2023-05-05 15:46:46 19 | */ 20 | @TableName("bingxiangxinxi") 21 | public class BingxiangxinxiView extends BingxiangxinxiEntity implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | public BingxiangxinxiView(){ 25 | } 26 | 27 | public BingxiangxinxiView(BingxiangxinxiEntity bingxiangxinxiEntity){ 28 | try { 29 | BeanUtils.copyProperties(this, bingxiangxinxiEntity); 30 | } catch (IllegalAccessException | InvocationTargetException e) { 31 | // TODO Auto-generated catch block 32 | e.printStackTrace(); 33 | } 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/utils/R.java: -------------------------------------------------------------------------------- 1 | package com.utils; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | /** 7 | * 返回数据 8 | */ 9 | public class R extends HashMap { 10 | private static final long serialVersionUID = 1L; 11 | 12 | public R() { 13 | put("code", 0); 14 | } 15 | 16 | public static R error() { 17 | return error(500, "未知异常,请联系管理员"); 18 | } 19 | 20 | public static R error(String msg) { 21 | return error(500, msg); 22 | } 23 | 24 | public static R error(int code, String msg) { 25 | R r = new R(); 26 | r.put("code", code); 27 | r.put("msg", msg); 28 | return r; 29 | } 30 | 31 | public static R ok(String msg) { 32 | R r = new R(); 33 | r.put("msg", msg); 34 | return r; 35 | } 36 | 37 | public static R ok(Map map) { 38 | R r = new R(); 39 | r.putAll(map); 40 | return r; 41 | } 42 | 43 | public static R ok() { 44 | return new R(); 45 | } 46 | 47 | public R put(String key, Object value) { 48 | super.put(key, value); 49 | return this; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/ConfigServiceImpl.java: -------------------------------------------------------------------------------- 1 | 2 | package com.service.impl; 3 | 4 | 5 | import java.util.Map; 6 | 7 | import org.springframework.stereotype.Service; 8 | 9 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 10 | import com.baomidou.mybatisplus.mapper.Wrapper; 11 | import com.baomidou.mybatisplus.plugins.Page; 12 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 13 | import com.dao.ConfigDao; 14 | import com.entity.ConfigEntity; 15 | import com.service.ConfigService; 16 | import com.utils.PageUtils; 17 | import com.utils.Query; 18 | 19 | 20 | /** 21 | * 系统用户 22 | */ 23 | @Service("configService") 24 | public class ConfigServiceImpl extends ServiceImpl implements ConfigService { 25 | @Override 26 | public PageUtils queryPage(Map params, Wrapper wrapper) { 27 | Page page = this.selectPage( 28 | new Query(params).getPage(), 29 | wrapper 30 | ); 31 | return new PageUtils(page); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/entity/ConfigEntity.java: -------------------------------------------------------------------------------- 1 | package com.entity; 2 | 3 | import java.io.Serializable; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableId; 6 | import com.baomidou.mybatisplus.annotations.TableName; 7 | import com.baomidou.mybatisplus.enums.IdType; 8 | 9 | /** 10 | * 类说明 : 11 | */ 12 | @TableName("config") 13 | public class ConfigEntity implements Serializable{ 14 | private static final long serialVersionUID = 1L; 15 | 16 | @TableId(type = IdType.AUTO) 17 | private Long id; 18 | 19 | /** 20 | * key 21 | */ 22 | private String name; 23 | 24 | /** 25 | * value 26 | */ 27 | private String value; 28 | 29 | public Long getId() { 30 | return id; 31 | } 32 | 33 | public void setId(Long id) { 34 | this.id = id; 35 | } 36 | 37 | public String getName() { 38 | return name; 39 | } 40 | 41 | public void setName(String name) { 42 | this.name = name; 43 | } 44 | 45 | public String getValue() { 46 | return value; 47 | } 48 | 49 | public void setValue(String value) { 50 | this.value = value; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/com/dao/YonghuDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.entity.YonghuEntity; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | import java.util.List; 6 | import java.util.Map; 7 | import com.baomidou.mybatisplus.mapper.Wrapper; 8 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 9 | 10 | import org.apache.ibatis.annotations.Param; 11 | import com.entity.vo.YonghuVO; 12 | import com.entity.view.YonghuView; 13 | 14 | 15 | /** 16 | * 用户 17 | * 18 | * @author 19 | * @email 20 | * @date 2023-05-05 15:46:46 21 | */ 22 | public interface YonghuDao extends BaseMapper { 23 | 24 | List selectListVO(@Param("ew") Wrapper wrapper); 25 | 26 | YonghuVO selectVO(@Param("ew") Wrapper wrapper); 27 | 28 | List selectListView(@Param("ew") Wrapper wrapper); 29 | 30 | List selectListView(Pagination page,@Param("ew") Wrapper wrapper); 31 | 32 | YonghuView selectView(@Param("ew") Wrapper wrapper); 33 | 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/service/NewsService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.baomidou.mybatisplus.mapper.Wrapper; 4 | import com.baomidou.mybatisplus.service.IService; 5 | import com.utils.PageUtils; 6 | import com.entity.NewsEntity; 7 | import java.util.List; 8 | import java.util.Map; 9 | import com.entity.vo.NewsVO; 10 | import org.apache.ibatis.annotations.Param; 11 | import com.entity.view.NewsView; 12 | 13 | 14 | /** 15 | * 智能家居资讯 16 | * 17 | * @author 18 | * @email 19 | * @date 2023-05-05 15:46:46 20 | */ 21 | public interface NewsService extends IService { 22 | 23 | PageUtils queryPage(Map params); 24 | 25 | List selectListVO(Wrapper wrapper); 26 | 27 | NewsVO selectVO(@Param("ew") Wrapper wrapper); 28 | 29 | List selectListView(Wrapper wrapper); 30 | 31 | NewsView selectView(@Param("ew") Wrapper wrapper); 32 | 33 | PageUtils queryPage(Map params,Wrapper wrapper); 34 | 35 | 36 | } 37 | 38 | -------------------------------------------------------------------------------- /src/main/java/com/dao/StoreupDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.entity.StoreupEntity; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | import java.util.List; 6 | import java.util.Map; 7 | import com.baomidou.mybatisplus.mapper.Wrapper; 8 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 9 | 10 | import org.apache.ibatis.annotations.Param; 11 | import com.entity.vo.StoreupVO; 12 | import com.entity.view.StoreupView; 13 | 14 | 15 | /** 16 | * 收藏表 17 | * 18 | * @author 19 | * @email 20 | * @date 2023-05-05 15:46:46 21 | */ 22 | public interface StoreupDao extends BaseMapper { 23 | 24 | List selectListVO(@Param("ew") Wrapper wrapper); 25 | 26 | StoreupVO selectVO(@Param("ew") Wrapper wrapper); 27 | 28 | List selectListView(@Param("ew") Wrapper wrapper); 29 | 30 | List selectListView(Pagination page,@Param("ew") Wrapper wrapper); 31 | 32 | StoreupView selectView(@Param("ew") Wrapper wrapper); 33 | 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/entity/view/DiscusszhinengjiajuView.java: -------------------------------------------------------------------------------- 1 | package com.entity.view; 2 | 3 | import com.entity.DiscusszhinengjiajuEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import org.apache.commons.beanutils.BeanUtils; 7 | import java.lang.reflect.InvocationTargetException; 8 | 9 | import java.io.Serializable; 10 | 11 | 12 | /** 13 | * 智能家居评论表 14 | * 后端返回视图实体辅助类 15 | * (通常后端关联的表或者自定义的字段需要返回使用) 16 | * @author 17 | * @email 18 | * @date 2023-05-05 15:46:47 19 | */ 20 | @TableName("discusszhinengjiaju") 21 | public class DiscusszhinengjiajuView extends DiscusszhinengjiajuEntity implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | public DiscusszhinengjiajuView(){ 25 | } 26 | 27 | public DiscusszhinengjiajuView(DiscusszhinengjiajuEntity discusszhinengjiajuEntity){ 28 | try { 29 | BeanUtils.copyProperties(this, discusszhinengjiajuEntity); 30 | } catch (IllegalAccessException | InvocationTargetException e) { 31 | // TODO Auto-generated catch block 32 | e.printStackTrace(); 33 | } 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/service/YonghuService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.baomidou.mybatisplus.mapper.Wrapper; 4 | import com.baomidou.mybatisplus.service.IService; 5 | import com.utils.PageUtils; 6 | import com.entity.YonghuEntity; 7 | import java.util.List; 8 | import java.util.Map; 9 | import com.entity.vo.YonghuVO; 10 | import org.apache.ibatis.annotations.Param; 11 | import com.entity.view.YonghuView; 12 | 13 | 14 | /** 15 | * 用户 16 | * 17 | * @author 18 | * @email 19 | * @date 2023-05-05 15:46:46 20 | */ 21 | public interface YonghuService extends IService { 22 | 23 | PageUtils queryPage(Map params); 24 | 25 | List selectListVO(Wrapper wrapper); 26 | 27 | YonghuVO selectVO(@Param("ew") Wrapper wrapper); 28 | 29 | List selectListView(Wrapper wrapper); 30 | 31 | YonghuView selectView(@Param("ew") Wrapper wrapper); 32 | 33 | PageUtils queryPage(Map params,Wrapper wrapper); 34 | 35 | 36 | } 37 | 38 | -------------------------------------------------------------------------------- /src/main/java/com/service/StoreupService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.baomidou.mybatisplus.mapper.Wrapper; 4 | import com.baomidou.mybatisplus.service.IService; 5 | import com.utils.PageUtils; 6 | import com.entity.StoreupEntity; 7 | import java.util.List; 8 | import java.util.Map; 9 | import com.entity.vo.StoreupVO; 10 | import org.apache.ibatis.annotations.Param; 11 | import com.entity.view.StoreupView; 12 | 13 | 14 | /** 15 | * 收藏表 16 | * 17 | * @author 18 | * @email 19 | * @date 2023-05-05 15:46:46 20 | */ 21 | public interface StoreupService extends IService { 22 | 23 | PageUtils queryPage(Map params); 24 | 25 | List selectListVO(Wrapper wrapper); 26 | 27 | StoreupVO selectVO(@Param("ew") Wrapper wrapper); 28 | 29 | List selectListView(Wrapper wrapper); 30 | 31 | StoreupView selectView(@Param("ew") Wrapper wrapper); 32 | 33 | PageUtils queryPage(Map params,Wrapper wrapper); 34 | 35 | 36 | } 37 | 38 | -------------------------------------------------------------------------------- /src/main/java/com/entity/view/DiscussbingxiangxinxiView.java: -------------------------------------------------------------------------------- 1 | package com.entity.view; 2 | 3 | import com.entity.DiscussbingxiangxinxiEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import org.apache.commons.beanutils.BeanUtils; 7 | import java.lang.reflect.InvocationTargetException; 8 | 9 | import java.io.Serializable; 10 | 11 | 12 | /** 13 | * bingxiangxinxi评论表 14 | * 后端返回视图实体辅助类 15 | * (通常后端关联的表或者自定义的字段需要返回使用) 16 | * @author 17 | * @email 18 | * @date 2023-05-05 15:46:47 19 | */ 20 | @TableName("discussbingxiangxinxi") 21 | public class DiscussbingxiangxinxiView extends DiscussbingxiangxinxiEntity implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | public DiscussbingxiangxinxiView(){ 25 | } 26 | 27 | public DiscussbingxiangxinxiView(DiscussbingxiangxinxiEntity discussbingxiangxinxiEntity){ 28 | try { 29 | BeanUtils.copyProperties(this, discussbingxiangxinxiEntity); 30 | } catch (IllegalAccessException | InvocationTargetException e) { 31 | // TODO Auto-generated catch block 32 | e.printStackTrace(); 33 | } 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/dao/SystemintroDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.entity.SystemintroEntity; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | import java.util.List; 6 | import java.util.Map; 7 | import com.baomidou.mybatisplus.mapper.Wrapper; 8 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 9 | 10 | import org.apache.ibatis.annotations.Param; 11 | import com.entity.vo.SystemintroVO; 12 | import com.entity.view.SystemintroView; 13 | 14 | 15 | /** 16 | * 关于我们 17 | * 18 | * @author 19 | * @email 20 | * @date 2023-05-05 15:46:46 21 | */ 22 | public interface SystemintroDao extends BaseMapper { 23 | 24 | List selectListVO(@Param("ew") Wrapper wrapper); 25 | 26 | SystemintroVO selectVO(@Param("ew") Wrapper wrapper); 27 | 28 | List selectListView(@Param("ew") Wrapper wrapper); 29 | 30 | List selectListView(Pagination page,@Param("ew") Wrapper wrapper); 31 | 32 | SystemintroView selectView(@Param("ew") Wrapper wrapper); 33 | 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/utils/SQLFilter.java: -------------------------------------------------------------------------------- 1 | 2 | package com.utils; 3 | 4 | import org.apache.commons.lang3.StringUtils; 5 | 6 | import com.entity.EIException; 7 | 8 | /** 9 | * SQL过滤 10 | */ 11 | public class SQLFilter { 12 | 13 | /** 14 | * SQL注入过滤 15 | * @param str 待验证的字符串 16 | */ 17 | public static String sqlInject(String str){ 18 | if(StringUtils.isBlank(str)){ 19 | return null; 20 | } 21 | //去掉'|"|;|\字符 22 | str = StringUtils.replace(str, "'", ""); 23 | str = StringUtils.replace(str, "\"", ""); 24 | str = StringUtils.replace(str, ";", ""); 25 | str = StringUtils.replace(str, "\\", ""); 26 | 27 | //转换成小写 28 | str = str.toLowerCase(); 29 | 30 | //非法字符 31 | String[] keywords = {"master", "truncate", "insert", "select", "delete", "update", "declare", "alter", "drop"}; 32 | 33 | //判断是否包含非法字符 34 | for(String keyword : keywords){ 35 | if(str.indexOf(keyword) != -1){ 36 | throw new EIException("包含非法字符"); 37 | } 38 | } 39 | 40 | return str; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/utils/HttpClientUtils.java: -------------------------------------------------------------------------------- 1 | package com.utils; 2 | 3 | import java.io.BufferedReader; 4 | import java.io.InputStreamReader; 5 | import java.net.HttpURLConnection; 6 | import java.net.URL; 7 | 8 | 9 | /** 10 | * HttpClient工具类 11 | */ 12 | public class HttpClientUtils { 13 | 14 | /** 15 | * @param uri 16 | * @return String 17 | * @description get请求方式 18 | * @author: long.he01 19 | */ 20 | public static String doGet(String uri) { 21 | 22 | StringBuilder result = new StringBuilder(); 23 | try { 24 | String res = ""; 25 | URL url = new URL(uri); 26 | HttpURLConnection conn = (HttpURLConnection) url.openConnection(); 27 | BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8")); 28 | String line; 29 | while ((line = in.readLine()) != null) { 30 | res += line+"\n"; 31 | } 32 | in.close(); 33 | return res; 34 | }catch (Exception e) { 35 | e.printStackTrace(); 36 | return null; 37 | } 38 | 39 | } 40 | 41 | } 42 | 43 | -------------------------------------------------------------------------------- /src/main/java/com/service/SystemintroService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.baomidou.mybatisplus.mapper.Wrapper; 4 | import com.baomidou.mybatisplus.service.IService; 5 | import com.utils.PageUtils; 6 | import com.entity.SystemintroEntity; 7 | import java.util.List; 8 | import java.util.Map; 9 | import com.entity.vo.SystemintroVO; 10 | import org.apache.ibatis.annotations.Param; 11 | import com.entity.view.SystemintroView; 12 | 13 | 14 | /** 15 | * 关于我们 16 | * 17 | * @author 18 | * @email 19 | * @date 2023-05-05 15:46:46 20 | */ 21 | public interface SystemintroService extends IService { 22 | 23 | PageUtils queryPage(Map params); 24 | 25 | List selectListVO(Wrapper wrapper); 26 | 27 | SystemintroVO selectVO(@Param("ew") Wrapper wrapper); 28 | 29 | List selectListView(Wrapper wrapper); 30 | 31 | SystemintroView selectView(@Param("ew") Wrapper wrapper); 32 | 33 | PageUtils queryPage(Map params,Wrapper wrapper); 34 | 35 | 36 | } 37 | 38 | -------------------------------------------------------------------------------- /src/main/java/com/utils/ValidatorUtils.java: -------------------------------------------------------------------------------- 1 | 2 | package com.utils; 3 | 4 | 5 | import java.util.Set; 6 | 7 | import javax.validation.ConstraintViolation; 8 | import javax.validation.Validation; 9 | import javax.validation.Validator; 10 | 11 | import com.entity.EIException; 12 | 13 | /** 14 | * hibernate-validator校验工具类 15 | */ 16 | public class ValidatorUtils { 17 | private static Validator validator; 18 | 19 | static { 20 | validator = Validation.buildDefaultValidatorFactory().getValidator(); 21 | } 22 | 23 | /** 24 | * 校验对象 25 | * @param object 待校验对象 26 | * @param groups 待校验的组 27 | * @throws EIException 校验不通过,则报EIException异常 28 | */ 29 | public static void validateEntity(Object object, Class... groups) 30 | throws EIException { 31 | Set> constraintViolations = validator.validate(object, groups); 32 | if (!constraintViolations.isEmpty()) { 33 | ConstraintViolation constraint = (ConstraintViolation)constraintViolations.iterator().next(); 34 | throw new EIException(constraint.getMessage()); 35 | } 36 | } 37 | 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/dao/DiscusszhinengjiajuDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.entity.DiscusszhinengjiajuEntity; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | import java.util.List; 6 | import java.util.Map; 7 | import com.baomidou.mybatisplus.mapper.Wrapper; 8 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 9 | 10 | import org.apache.ibatis.annotations.Param; 11 | import com.entity.vo.DiscusszhinengjiajuVO; 12 | import com.entity.view.DiscusszhinengjiajuView; 13 | 14 | 15 | /** 16 | * 智能家居评论表 17 | * 18 | * @author 19 | * @email 20 | * @date 2023-05-05 15:46:47 21 | */ 22 | public interface DiscusszhinengjiajuDao extends BaseMapper { 23 | 24 | List selectListVO(@Param("ew") Wrapper wrapper); 25 | 26 | DiscusszhinengjiajuVO selectVO(@Param("ew") Wrapper wrapper); 27 | 28 | List selectListView(@Param("ew") Wrapper wrapper); 29 | 30 | List selectListView(Pagination page,@Param("ew") Wrapper wrapper); 31 | 32 | DiscusszhinengjiajuView selectView(@Param("ew") Wrapper wrapper); 33 | 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/service/DiscusszhinengjiajuService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.baomidou.mybatisplus.mapper.Wrapper; 4 | import com.baomidou.mybatisplus.service.IService; 5 | import com.utils.PageUtils; 6 | import com.entity.DiscusszhinengjiajuEntity; 7 | import java.util.List; 8 | import java.util.Map; 9 | import com.entity.vo.DiscusszhinengjiajuVO; 10 | import org.apache.ibatis.annotations.Param; 11 | import com.entity.view.DiscusszhinengjiajuView; 12 | 13 | 14 | /** 15 | * 智能家居评论表 16 | * 17 | * @author 18 | * @email 19 | * @date 2023-05-05 15:46:47 20 | */ 21 | public interface DiscusszhinengjiajuService extends IService { 22 | 23 | PageUtils queryPage(Map params); 24 | 25 | List selectListVO(Wrapper wrapper); 26 | 27 | DiscusszhinengjiajuVO selectVO(@Param("ew") Wrapper wrapper); 28 | 29 | List selectListView(Wrapper wrapper); 30 | 31 | DiscusszhinengjiajuView selectView(@Param("ew") Wrapper wrapper); 32 | 33 | PageUtils queryPage(Map params,Wrapper wrapper); 34 | 35 | 36 | } 37 | 38 | -------------------------------------------------------------------------------- /src/main/java/com/dao/DiscussbingxiangxinxiDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.entity.DiscussbingxiangxinxiEntity; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | import java.util.List; 6 | import java.util.Map; 7 | import com.baomidou.mybatisplus.mapper.Wrapper; 8 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 9 | 10 | import org.apache.ibatis.annotations.Param; 11 | import com.entity.vo.DiscussbingxiangxinxiVO; 12 | import com.entity.view.DiscussbingxiangxinxiView; 13 | 14 | 15 | /** 16 | * bingxiangxinxi评论表 17 | * 18 | * @author 19 | * @email 20 | * @date 2023-05-05 15:46:47 21 | */ 22 | public interface DiscussbingxiangxinxiDao extends BaseMapper { 23 | 24 | List selectListVO(@Param("ew") Wrapper wrapper); 25 | 26 | DiscussbingxiangxinxiVO selectVO(@Param("ew") Wrapper wrapper); 27 | 28 | List selectListView(@Param("ew") Wrapper wrapper); 29 | 30 | List selectListView(Pagination page,@Param("ew") Wrapper wrapper); 31 | 32 | DiscussbingxiangxinxiView selectView(@Param("ew") Wrapper wrapper); 33 | 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/utils/SpringContextUtils.java: -------------------------------------------------------------------------------- 1 | 2 | package com.utils; 3 | 4 | import org.springframework.beans.BeansException; 5 | import org.springframework.context.ApplicationContext; 6 | import org.springframework.context.ApplicationContextAware; 7 | import org.springframework.stereotype.Component; 8 | 9 | 10 | /** 11 | * Spring Context 工具类 12 | */ 13 | @Component 14 | public class SpringContextUtils implements ApplicationContextAware { 15 | public static ApplicationContext applicationContext; 16 | 17 | @Override 18 | public void setApplicationContext(ApplicationContext applicationContext) 19 | throws BeansException { 20 | SpringContextUtils.applicationContext = applicationContext; 21 | } 22 | 23 | public static Object getBean(String name) { 24 | return applicationContext.getBean(name); 25 | } 26 | 27 | public static T getBean(String name, Class requiredType) { 28 | return applicationContext.getBean(name, requiredType); 29 | } 30 | 31 | public static boolean containsBean(String name) { 32 | return applicationContext.containsBean(name); 33 | } 34 | 35 | public static boolean isSingleton(String name) { 36 | return applicationContext.isSingleton(name); 37 | } 38 | 39 | public static Class getType(String name) { 40 | return applicationContext.getType(name); 41 | } 42 | 43 | } -------------------------------------------------------------------------------- /src/main/java/com/service/DiscussbingxiangxinxiService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.baomidou.mybatisplus.mapper.Wrapper; 4 | import com.baomidou.mybatisplus.service.IService; 5 | import com.utils.PageUtils; 6 | import com.entity.DiscussbingxiangxinxiEntity; 7 | import java.util.List; 8 | import java.util.Map; 9 | import com.entity.vo.DiscussbingxiangxinxiVO; 10 | import org.apache.ibatis.annotations.Param; 11 | import com.entity.view.DiscussbingxiangxinxiView; 12 | 13 | 14 | /** 15 | * bingxiangxinxi评论表 16 | * 17 | * @author 18 | * @email 19 | * @date 2023-05-05 15:46:47 20 | */ 21 | public interface DiscussbingxiangxinxiService extends IService { 22 | 23 | PageUtils queryPage(Map params); 24 | 25 | List selectListVO(Wrapper wrapper); 26 | 27 | DiscussbingxiangxinxiVO selectVO(@Param("ew") Wrapper wrapper); 28 | 29 | List selectListView(Wrapper wrapper); 30 | 31 | DiscussbingxiangxinxiView selectView(@Param("ew") Wrapper wrapper); 32 | 33 | PageUtils queryPage(Map params,Wrapper wrapper); 34 | 35 | 36 | } 37 | 38 | -------------------------------------------------------------------------------- /src/main/resources/mapper/NewsDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 19 | 20 | 25 | 26 | 32 | 33 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /src/main/resources/mapper/YonghuDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 20 | 21 | 26 | 27 | 33 | 34 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /src/main/java/com/config/HadoopConfig.java: -------------------------------------------------------------------------------- 1 | package com.config; 2 | 3 | 4 | import java.net.URI; 5 | import org.apache.hadoop.fs.FileSystem; 6 | import org.springframework.beans.factory.annotation.Value; 7 | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; 8 | import org.springframework.context.annotation.Bean; 9 | import org.springframework.context.annotation.Configuration; 10 | 11 | /** 12 | * hadoop 配置 13 | */ 14 | @Configuration 15 | @ConditionalOnProperty(name="hadoop.name-node") 16 | public class HadoopConfig { 17 | @Value("${hadoop.name-node}") 18 | private String nameNode; 19 | 20 | /** 21 | * Configuration conf=new Configuration(); 22 | * 创建一个Configuration对象时,其构造方法会默认加载hadoop中的两个配置文件, 23 | * 分别是hdfs-site.xml以及core-site.xml,这两个文件中会有访问hdfs所需的参数值, 24 | * 主要是fs.default.name,指定了hdfs的地址,有了这个地址客户端就可以通过这个地址访问hdfs了。 25 | * 即可理解为configuration就是hadoop中的配置信息。 26 | * @return 27 | */ 28 | @Bean("fileSystem") 29 | public FileSystem createFs() throws Exception { 30 | //读取配置文件 31 | org.apache.hadoop.conf.Configuration conf = new org.apache.hadoop.conf.Configuration(); 32 | conf.set("fs.defalutFS", nameNode); 33 | conf.set("dfs.replication", "3"); 34 | URI uri = new URI(nameNode.trim()); 35 | FileSystem fs = FileSystem.get(uri,conf,"root"); 36 | System.out.println("fs.defaultFS: "+conf.get("fs.defaultFS")); 37 | return fs; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/entity/UsersEntity.java: -------------------------------------------------------------------------------- 1 | package com.entity; 2 | 3 | import java.io.Serializable; 4 | import java.util.Date; 5 | 6 | import com.baomidou.mybatisplus.annotations.TableId; 7 | import com.baomidou.mybatisplus.annotations.TableName; 8 | import com.baomidou.mybatisplus.enums.IdType; 9 | 10 | /** 11 | * 用户 12 | */ 13 | @TableName("users") 14 | public class UsersEntity implements Serializable { 15 | private static final long serialVersionUID = 1L; 16 | 17 | @TableId(type = IdType.AUTO) 18 | private Long id; 19 | 20 | /** 21 | * 用户账号 22 | */ 23 | private String username; 24 | 25 | /** 26 | * 密码 27 | */ 28 | private String password; 29 | 30 | /** 31 | * 用户类型 32 | */ 33 | private String role; 34 | 35 | private Date addtime; 36 | 37 | public String getUsername() { 38 | return username; 39 | } 40 | 41 | public void setUsername(String username) { 42 | this.username = username; 43 | } 44 | 45 | public String getPassword() { 46 | return password; 47 | } 48 | 49 | public void setPassword(String password) { 50 | this.password = password; 51 | } 52 | 53 | public String getRole() { 54 | return role; 55 | } 56 | 57 | public void setRole(String role) { 58 | this.role = role; 59 | } 60 | 61 | public Date getAddtime() { 62 | return addtime; 63 | } 64 | 65 | public void setAddtime(Date addtime) { 66 | this.addtime = addtime; 67 | } 68 | 69 | public Long getId() { 70 | return id; 71 | } 72 | 73 | public void setId(Long id) { 74 | this.id = id; 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 基于SpringBoot的智能家居销量数据分析 2 | = 3 | - 完整代码获取地址:从戎源码网 ([https://armycodes.com/](https://armycodes.com/)) 4 | - 作者微信:19941326836 QQ:952045282 5 | - 承接计算机毕业设计、Java毕业设计、Python毕业设计、深度学习、机器学习 6 | - 选题+开题报告+任务书+程序定制+安装调试+论文+答辩ppt 一条龙服务 7 | - 所有选题地址https://github.com/nature924/allProject 8 | 9 | 一、项目介绍 10 | --- 11 | 基于Spring Boot框架实现的智能家居销量数据分析,系统包含两种角色:管理员、用户,系统分为前台和后台两大模块,主要功能如下。 12 | 13 | ### 前台: 14 | 15 | 1. 首页:展示智能家居产品的最新信息和推荐内容。 16 | 2. 冰箱信息:提供冰箱产品的详细信息和特点介绍。 17 | 3. 智能家居:展示智能家居产品的种类、功能等信息。 18 | 4. 智能家居资讯:提供智能家居行业的最新资讯和动态。 19 | 5. 个人中心:用户可以管理个人信息,包括修改密码、查看订单历史等操作。 20 | 21 | ### 后台: 22 | 23 | ### 管理员: 24 | 1. 系统首页:展示系统的概览信息和数据统计。 25 | 2. 个人中心:管理员可以管理个人信息,包括修改密码等操作。 26 | 3. 用户管理:管理员可以管理用户信息,包括查看用户列表、禁用用户等操作。 27 | 4. 冰箱信息管理:管理员可以管理冰箱产品的信息,包括添加、编辑、删除等操作。 28 | 5. 智能家居管理:管理员可以管理智能家居产品的信息,包括添加、编辑、删除等操作。 29 | 6. 系统管理:管理员可以管理系统的参数设置、日志查看等功能。 30 | 31 | ### 用户: 32 | 33 | 1. 个人中心:用户可以管理个人信息,包括修改密码、查看订单历史等操作。 34 | 35 | 36 | 37 | 二、项目技术 38 | --- 39 | - 编程语言:Java 40 | - 数据库:MySQL 41 | - 项目管理工具:Maven 42 | - 前端技术:VUE、HTML、Jquery、Bootstrap 43 | - 后端技术:Spring、SpringMVC、MyBatis 44 | 45 | 三、运行环境 46 | --- 47 | - 操作系统:Windows、macOS都可以 48 | - JDK版本:JDK1.8以上都可以 49 | - 开发工具:IDEA、Ecplise、Myecplise都可以 50 | - 数据库: MySQL5.7以上都可以 51 | - Tomcat:任意版本都可以 52 | - Maven:任意版本都可以 53 | 54 | 四、运行截图 55 | --- 56 | 57 | ### 程序截图: 58 | ![image/1.png](image/1.png) 59 | ![image/1.png](image/2.png) 60 | ![image/1.png](image/3.png) 61 | ![image/1.png](image/4.png) 62 | ![image/1.png](image/5.png) 63 | ![image/1.png](image/6.png) 64 | ![image/1.png](image/7.png) 65 | ![image/1.png](image/8.png) 66 | 67 | 68 | -------------------------------------------------------------------------------- /src/main/resources/mapper/SystemintroDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 21 | 22 | 27 | 28 | 34 | 35 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/UsersServiceImpl.java: -------------------------------------------------------------------------------- 1 | 2 | package com.service.impl; 3 | 4 | 5 | import java.util.List; 6 | import java.util.Map; 7 | 8 | import org.springframework.stereotype.Service; 9 | 10 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 11 | import com.baomidou.mybatisplus.mapper.Wrapper; 12 | import com.baomidou.mybatisplus.plugins.Page; 13 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 14 | import com.dao.UsersDao; 15 | import com.entity.UsersEntity; 16 | import com.service.UsersService; 17 | import com.utils.PageUtils; 18 | import com.utils.Query; 19 | 20 | 21 | /** 22 | * 系统用户 23 | */ 24 | @Service("usersService") 25 | public class UsersServiceImpl extends ServiceImpl implements UsersService { 26 | 27 | @Override 28 | public PageUtils queryPage(Map params) { 29 | Page page = this.selectPage( 30 | new Query(params).getPage(), 31 | new EntityWrapper() 32 | ); 33 | return new PageUtils(page); 34 | } 35 | 36 | @Override 37 | public List selectListView(Wrapper wrapper) { 38 | return baseMapper.selectListView(wrapper); 39 | } 40 | 41 | @Override 42 | public PageUtils queryPage(Map params, 43 | Wrapper wrapper) { 44 | Page page =new Query(params).getPage(); 45 | page.setRecords(baseMapper.selectListView(page,wrapper)); 46 | PageUtils pageUtil = new PageUtils(page); 47 | return pageUtil; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/service/BingxiangxinxiService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.baomidou.mybatisplus.mapper.Wrapper; 4 | import com.baomidou.mybatisplus.service.IService; 5 | import com.utils.PageUtils; 6 | import com.entity.BingxiangxinxiEntity; 7 | import java.util.List; 8 | import java.util.Map; 9 | import com.entity.vo.BingxiangxinxiVO; 10 | import org.apache.ibatis.annotations.Param; 11 | import com.entity.view.BingxiangxinxiView; 12 | 13 | 14 | /** 15 | * 冰箱信息 16 | * 17 | * @author 18 | * @email 19 | * @date 2023-05-05 15:46:46 20 | */ 21 | public interface BingxiangxinxiService extends IService { 22 | 23 | PageUtils queryPage(Map params); 24 | 25 | List selectListVO(Wrapper wrapper); 26 | 27 | BingxiangxinxiVO selectVO(@Param("ew") Wrapper wrapper); 28 | 29 | List selectListView(Wrapper wrapper); 30 | 31 | BingxiangxinxiView selectView(@Param("ew") Wrapper wrapper); 32 | 33 | PageUtils queryPage(Map params,Wrapper wrapper); 34 | 35 | 36 | List> selectValue(Map params,Wrapper wrapper); 37 | 38 | List> selectTimeStatValue(Map params,Wrapper wrapper); 39 | 40 | List> selectGroup(Map params,Wrapper wrapper); 41 | 42 | 43 | 44 | } 45 | 46 | -------------------------------------------------------------------------------- /src/main/resources/mapper/StoreupDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 23 | 24 | 29 | 30 | 36 | 37 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /src/main/java/com/config/InterceptorConfig.java: -------------------------------------------------------------------------------- 1 | package com.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; 6 | import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; 7 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; 8 | 9 | import com.interceptor.AuthorizationInterceptor; 10 | 11 | @Configuration 12 | public class InterceptorConfig extends WebMvcConfigurationSupport{ 13 | 14 | @Bean 15 | public AuthorizationInterceptor getAuthorizationInterceptor() { 16 | return new AuthorizationInterceptor(); 17 | } 18 | 19 | @Override 20 | public void addInterceptors(InterceptorRegistry registry) { 21 | registry.addInterceptor(getAuthorizationInterceptor()).addPathPatterns("/**").excludePathPatterns("/static/**"); 22 | super.addInterceptors(registry); 23 | } 24 | 25 | /** 26 | * springboot 2.0配置WebMvcConfigurationSupport之后,会导致默认配置被覆盖,要访问静态资源需要重写addResourceHandlers方法 27 | */ 28 | @Override 29 | public void addResourceHandlers(ResourceHandlerRegistry registry) { 30 | registry.addResourceHandler("/**") 31 | .addResourceLocations("classpath:/resources/") 32 | .addResourceLocations("classpath:/static/") 33 | .addResourceLocations("classpath:/admin/") 34 | .addResourceLocations("classpath:/front/") 35 | .addResourceLocations("classpath:/public/"); 36 | super.addResourceHandlers(registry); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/entity/vo/NewsVO.java: -------------------------------------------------------------------------------- 1 | package com.entity.vo; 2 | 3 | import com.entity.NewsEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import java.util.Date; 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import com.fasterxml.jackson.annotation.JsonFormat; 10 | import java.io.Serializable; 11 | 12 | 13 | /** 14 | * 智能家居资讯 15 | * 手机端接口返回实体辅助类 16 | * (主要作用去除一些不必要的字段) 17 | * @author 18 | * @email 19 | * @date 2023-05-05 15:46:46 20 | */ 21 | public class NewsVO implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | 25 | /** 26 | * 简介 27 | */ 28 | 29 | private String introduction; 30 | 31 | /** 32 | * 图片 33 | */ 34 | 35 | private String picture; 36 | 37 | /** 38 | * 内容 39 | */ 40 | 41 | private String content; 42 | 43 | 44 | /** 45 | * 设置:简介 46 | */ 47 | 48 | public void setIntroduction(String introduction) { 49 | this.introduction = introduction; 50 | } 51 | 52 | /** 53 | * 获取:简介 54 | */ 55 | public String getIntroduction() { 56 | return introduction; 57 | } 58 | 59 | 60 | /** 61 | * 设置:图片 62 | */ 63 | 64 | public void setPicture(String picture) { 65 | this.picture = picture; 66 | } 67 | 68 | /** 69 | * 获取:图片 70 | */ 71 | public String getPicture() { 72 | return picture; 73 | } 74 | 75 | 76 | /** 77 | * 设置:内容 78 | */ 79 | 80 | public void setContent(String content) { 81 | this.content = content; 82 | } 83 | 84 | /** 85 | * 获取:内容 86 | */ 87 | public String getContent() { 88 | return content; 89 | } 90 | 91 | } 92 | -------------------------------------------------------------------------------- /src/main/java/com/dao/BingxiangxinxiDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.entity.BingxiangxinxiEntity; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | import java.util.List; 6 | import java.util.Map; 7 | import com.baomidou.mybatisplus.mapper.Wrapper; 8 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 9 | 10 | import org.apache.ibatis.annotations.Param; 11 | import com.entity.vo.BingxiangxinxiVO; 12 | import com.entity.view.BingxiangxinxiView; 13 | 14 | 15 | /** 16 | * 冰箱信息 17 | * 18 | * @author 19 | * @email 20 | * @date 2023-05-05 15:46:46 21 | */ 22 | public interface BingxiangxinxiDao extends BaseMapper { 23 | 24 | List selectListVO(@Param("ew") Wrapper wrapper); 25 | 26 | BingxiangxinxiVO selectVO(@Param("ew") Wrapper wrapper); 27 | 28 | List selectListView(@Param("ew") Wrapper wrapper); 29 | 30 | List selectListView(Pagination page,@Param("ew") Wrapper wrapper); 31 | 32 | BingxiangxinxiView selectView(@Param("ew") Wrapper wrapper); 33 | 34 | 35 | List> selectValue(@Param("params") Map params,@Param("ew") Wrapper wrapper); 36 | 37 | List> selectTimeStatValue(@Param("params") Map params,@Param("ew") Wrapper wrapper); 38 | 39 | List> selectGroup(@Param("params") Map params,@Param("ew") Wrapper wrapper); 40 | 41 | 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/service/ZhinengjiajuService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.baomidou.mybatisplus.mapper.Wrapper; 4 | import com.baomidou.mybatisplus.service.IService; 5 | import com.utils.PageUtils; 6 | import com.entity.ZhinengjiajuEntity; 7 | import java.util.List; 8 | import java.util.Map; 9 | import com.entity.vo.ZhinengjiajuVO; 10 | import org.apache.ibatis.annotations.Param; 11 | import com.entity.view.ZhinengjiajuView; 12 | 13 | 14 | /** 15 | * 智能家居 16 | * 17 | * @author 18 | * @email 19 | * @date 2023-05-05 15:46:46 20 | */ 21 | public interface ZhinengjiajuService extends IService { 22 | 23 | PageUtils queryPage(Map params); 24 | 25 | List selectListVO(Wrapper wrapper); 26 | 27 | ZhinengjiajuVO selectVO(@Param("ew") Wrapper wrapper); 28 | 29 | List selectListView(Wrapper wrapper); 30 | 31 | ZhinengjiajuView selectView(@Param("ew") Wrapper wrapper); 32 | 33 | PageUtils queryPage(Map params,Wrapper wrapper); 34 | 35 | 36 | List> selectValue(Map params,Wrapper wrapper); 37 | 38 | List> selectTimeStatValue(Map params,Wrapper wrapper); 39 | 40 | List> selectGroup(Map params,Wrapper wrapper); 41 | 42 | List> haopingshuSectionStat(Map params,Wrapper wrapper); 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/CommonServiceImpl.java: -------------------------------------------------------------------------------- 1 | 2 | package com.service.impl; 3 | 4 | 5 | import java.util.List; 6 | import java.util.Map; 7 | 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Service; 10 | 11 | import com.dao.CommonDao; 12 | import com.service.CommonService; 13 | 14 | 15 | /** 16 | * 系统用户 17 | */ 18 | @Service("commonService") 19 | public class CommonServiceImpl implements CommonService { 20 | 21 | @Autowired 22 | private CommonDao commonDao; 23 | 24 | @Override 25 | public List getOption(Map params) { 26 | return commonDao.getOption(params); 27 | } 28 | 29 | @Override 30 | public Map getFollowByOption(Map params) { 31 | return commonDao.getFollowByOption(params); 32 | } 33 | 34 | @Override 35 | public void sh(Map params) { 36 | commonDao.sh(params); 37 | } 38 | 39 | @Override 40 | public int remindCount(Map params) { 41 | return commonDao.remindCount(params); 42 | } 43 | 44 | @Override 45 | public Map selectCal(Map params) { 46 | return commonDao.selectCal(params); 47 | } 48 | 49 | @Override 50 | public List> selectGroup(Map params) { 51 | return commonDao.selectGroup(params); 52 | } 53 | 54 | @Override 55 | public List> selectValue(Map params) { 56 | return commonDao.selectValue(params); 57 | } 58 | 59 | @Override 60 | public List> selectTimeStatValue(Map params) { 61 | return commonDao.selectTimeStatValue(params); 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/com/entity/model/NewsModel.java: -------------------------------------------------------------------------------- 1 | package com.entity.model; 2 | 3 | import com.entity.NewsEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import java.util.Date; 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import com.fasterxml.jackson.annotation.JsonFormat; 10 | import java.io.Serializable; 11 | 12 | 13 | /** 14 | * 智能家居资讯 15 | * 接收传参的实体类 16 | *(实际开发中配合移动端接口开发手动去掉些没用的字段, 后端一般用entity就够用了) 17 | * 取自ModelAndView 的model名称 18 | * @author 19 | * @email 20 | * @date 2023-05-05 15:46:46 21 | */ 22 | public class NewsModel implements Serializable { 23 | private static final long serialVersionUID = 1L; 24 | 25 | 26 | /** 27 | * 简介 28 | */ 29 | 30 | private String introduction; 31 | 32 | /** 33 | * 图片 34 | */ 35 | 36 | private String picture; 37 | 38 | /** 39 | * 内容 40 | */ 41 | 42 | private String content; 43 | 44 | 45 | /** 46 | * 设置:简介 47 | */ 48 | 49 | public void setIntroduction(String introduction) { 50 | this.introduction = introduction; 51 | } 52 | 53 | /** 54 | * 获取:简介 55 | */ 56 | public String getIntroduction() { 57 | return introduction; 58 | } 59 | 60 | 61 | /** 62 | * 设置:图片 63 | */ 64 | 65 | public void setPicture(String picture) { 66 | this.picture = picture; 67 | } 68 | 69 | /** 70 | * 获取:图片 71 | */ 72 | public String getPicture() { 73 | return picture; 74 | } 75 | 76 | 77 | /** 78 | * 设置:内容 79 | */ 80 | 81 | public void setContent(String content) { 82 | this.content = content; 83 | } 84 | 85 | /** 86 | * 获取:内容 87 | */ 88 | public String getContent() { 89 | return content; 90 | } 91 | 92 | } 93 | -------------------------------------------------------------------------------- /src/main/resources/mapper/DiscusszhinengjiajuDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 21 | 22 | 27 | 28 | 34 | 35 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/main/resources/mapper/DiscussbingxiangxinxiDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 21 | 22 | 27 | 28 | 34 | 35 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/main/java/com/dao/ZhinengjiajuDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.entity.ZhinengjiajuEntity; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | import java.util.List; 6 | import java.util.Map; 7 | import com.baomidou.mybatisplus.mapper.Wrapper; 8 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 9 | 10 | import org.apache.ibatis.annotations.Param; 11 | import com.entity.vo.ZhinengjiajuVO; 12 | import com.entity.view.ZhinengjiajuView; 13 | 14 | 15 | /** 16 | * 智能家居 17 | * 18 | * @author 19 | * @email 20 | * @date 2023-05-05 15:46:46 21 | */ 22 | public interface ZhinengjiajuDao extends BaseMapper { 23 | 24 | List selectListVO(@Param("ew") Wrapper wrapper); 25 | 26 | ZhinengjiajuVO selectVO(@Param("ew") Wrapper wrapper); 27 | 28 | List selectListView(@Param("ew") Wrapper wrapper); 29 | 30 | List selectListView(Pagination page,@Param("ew") Wrapper wrapper); 31 | 32 | ZhinengjiajuView selectView(@Param("ew") Wrapper wrapper); 33 | 34 | 35 | List> selectValue(@Param("params") Map params,@Param("ew") Wrapper wrapper); 36 | 37 | List> selectTimeStatValue(@Param("params") Map params,@Param("ew") Wrapper wrapper); 38 | 39 | List> selectGroup(@Param("params") Map params,@Param("ew") Wrapper wrapper); 40 | 41 | List> haopingshuSectionStat(@Param("params") Map params,@Param("ew") Wrapper wrapper); 42 | 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/entity/vo/YonghuVO.java: -------------------------------------------------------------------------------- 1 | package com.entity.vo; 2 | 3 | import com.entity.YonghuEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import java.util.Date; 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import com.fasterxml.jackson.annotation.JsonFormat; 10 | import java.io.Serializable; 11 | 12 | 13 | /** 14 | * 用户 15 | * 手机端接口返回实体辅助类 16 | * (主要作用去除一些不必要的字段) 17 | * @author 18 | * @email 19 | * @date 2023-05-05 15:46:46 20 | */ 21 | public class YonghuVO implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | 25 | /** 26 | * 密码 27 | */ 28 | 29 | private String mima; 30 | 31 | /** 32 | * 姓名 33 | */ 34 | 35 | private String xingming; 36 | 37 | /** 38 | * 性别 39 | */ 40 | 41 | private String xingbie; 42 | 43 | /** 44 | * 手机 45 | */ 46 | 47 | private String shouji; 48 | 49 | 50 | /** 51 | * 设置:密码 52 | */ 53 | 54 | public void setMima(String mima) { 55 | this.mima = mima; 56 | } 57 | 58 | /** 59 | * 获取:密码 60 | */ 61 | public String getMima() { 62 | return mima; 63 | } 64 | 65 | 66 | /** 67 | * 设置:姓名 68 | */ 69 | 70 | public void setXingming(String xingming) { 71 | this.xingming = xingming; 72 | } 73 | 74 | /** 75 | * 获取:姓名 76 | */ 77 | public String getXingming() { 78 | return xingming; 79 | } 80 | 81 | 82 | /** 83 | * 设置:性别 84 | */ 85 | 86 | public void setXingbie(String xingbie) { 87 | this.xingbie = xingbie; 88 | } 89 | 90 | /** 91 | * 获取:性别 92 | */ 93 | public String getXingbie() { 94 | return xingbie; 95 | } 96 | 97 | 98 | /** 99 | * 设置:手机 100 | */ 101 | 102 | public void setShouji(String shouji) { 103 | this.shouji = shouji; 104 | } 105 | 106 | /** 107 | * 获取:手机 108 | */ 109 | public String getShouji() { 110 | return shouji; 111 | } 112 | 113 | } 114 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/NewsServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | 3 | import org.springframework.stereotype.Service; 4 | import java.util.Map; 5 | import java.util.List; 6 | 7 | import com.baomidou.mybatisplus.mapper.Wrapper; 8 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 9 | import com.baomidou.mybatisplus.plugins.Page; 10 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 11 | import com.utils.PageUtils; 12 | import com.utils.Query; 13 | 14 | 15 | import com.dao.NewsDao; 16 | import com.entity.NewsEntity; 17 | import com.service.NewsService; 18 | import com.entity.vo.NewsVO; 19 | import com.entity.view.NewsView; 20 | 21 | @Service("newsService") 22 | public class NewsServiceImpl extends ServiceImpl implements NewsService { 23 | 24 | 25 | @Override 26 | public PageUtils queryPage(Map params) { 27 | Page page = this.selectPage( 28 | new Query(params).getPage(), 29 | new EntityWrapper() 30 | ); 31 | return new PageUtils(page); 32 | } 33 | 34 | @Override 35 | public PageUtils queryPage(Map params, Wrapper wrapper) { 36 | Page page =new Query(params).getPage(); 37 | page.setRecords(baseMapper.selectListView(page,wrapper)); 38 | PageUtils pageUtil = new PageUtils(page); 39 | return pageUtil; 40 | } 41 | 42 | @Override 43 | public List selectListVO(Wrapper wrapper) { 44 | return baseMapper.selectListVO(wrapper); 45 | } 46 | 47 | @Override 48 | public NewsVO selectVO(Wrapper wrapper) { 49 | return baseMapper.selectVO(wrapper); 50 | } 51 | 52 | @Override 53 | public List selectListView(Wrapper wrapper) { 54 | return baseMapper.selectListView(wrapper); 55 | } 56 | 57 | @Override 58 | public NewsView selectView(Wrapper wrapper) { 59 | return baseMapper.selectView(wrapper); 60 | } 61 | 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/com/entity/model/YonghuModel.java: -------------------------------------------------------------------------------- 1 | package com.entity.model; 2 | 3 | import com.entity.YonghuEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import java.util.Date; 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import com.fasterxml.jackson.annotation.JsonFormat; 10 | import java.io.Serializable; 11 | 12 | 13 | /** 14 | * 用户 15 | * 接收传参的实体类 16 | *(实际开发中配合移动端接口开发手动去掉些没用的字段, 后端一般用entity就够用了) 17 | * 取自ModelAndView 的model名称 18 | * @author 19 | * @email 20 | * @date 2023-05-05 15:46:46 21 | */ 22 | public class YonghuModel implements Serializable { 23 | private static final long serialVersionUID = 1L; 24 | 25 | 26 | /** 27 | * 密码 28 | */ 29 | 30 | private String mima; 31 | 32 | /** 33 | * 姓名 34 | */ 35 | 36 | private String xingming; 37 | 38 | /** 39 | * 性别 40 | */ 41 | 42 | private String xingbie; 43 | 44 | /** 45 | * 手机 46 | */ 47 | 48 | private String shouji; 49 | 50 | 51 | /** 52 | * 设置:密码 53 | */ 54 | 55 | public void setMima(String mima) { 56 | this.mima = mima; 57 | } 58 | 59 | /** 60 | * 获取:密码 61 | */ 62 | public String getMima() { 63 | return mima; 64 | } 65 | 66 | 67 | /** 68 | * 设置:姓名 69 | */ 70 | 71 | public void setXingming(String xingming) { 72 | this.xingming = xingming; 73 | } 74 | 75 | /** 76 | * 获取:姓名 77 | */ 78 | public String getXingming() { 79 | return xingming; 80 | } 81 | 82 | 83 | /** 84 | * 设置:性别 85 | */ 86 | 87 | public void setXingbie(String xingbie) { 88 | this.xingbie = xingbie; 89 | } 90 | 91 | /** 92 | * 获取:性别 93 | */ 94 | public String getXingbie() { 95 | return xingbie; 96 | } 97 | 98 | 99 | /** 100 | * 设置:手机 101 | */ 102 | 103 | public void setShouji(String shouji) { 104 | this.shouji = shouji; 105 | } 106 | 107 | /** 108 | * 获取:手机 109 | */ 110 | public String getShouji() { 111 | return shouji; 112 | } 113 | 114 | } 115 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/YonghuServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | 3 | import org.springframework.stereotype.Service; 4 | import java.util.Map; 5 | import java.util.List; 6 | 7 | import com.baomidou.mybatisplus.mapper.Wrapper; 8 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 9 | import com.baomidou.mybatisplus.plugins.Page; 10 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 11 | import com.utils.PageUtils; 12 | import com.utils.Query; 13 | 14 | 15 | import com.dao.YonghuDao; 16 | import com.entity.YonghuEntity; 17 | import com.service.YonghuService; 18 | import com.entity.vo.YonghuVO; 19 | import com.entity.view.YonghuView; 20 | 21 | @Service("yonghuService") 22 | public class YonghuServiceImpl extends ServiceImpl implements YonghuService { 23 | 24 | 25 | @Override 26 | public PageUtils queryPage(Map params) { 27 | Page page = this.selectPage( 28 | new Query(params).getPage(), 29 | new EntityWrapper() 30 | ); 31 | return new PageUtils(page); 32 | } 33 | 34 | @Override 35 | public PageUtils queryPage(Map params, Wrapper wrapper) { 36 | Page page =new Query(params).getPage(); 37 | page.setRecords(baseMapper.selectListView(page,wrapper)); 38 | PageUtils pageUtil = new PageUtils(page); 39 | return pageUtil; 40 | } 41 | 42 | @Override 43 | public List selectListVO(Wrapper wrapper) { 44 | return baseMapper.selectListVO(wrapper); 45 | } 46 | 47 | @Override 48 | public YonghuVO selectVO(Wrapper wrapper) { 49 | return baseMapper.selectVO(wrapper); 50 | } 51 | 52 | @Override 53 | public List selectListView(Wrapper wrapper) { 54 | return baseMapper.selectListView(wrapper); 55 | } 56 | 57 | @Override 58 | public YonghuView selectView(Wrapper wrapper) { 59 | return baseMapper.selectView(wrapper); 60 | } 61 | 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/com/config/SparkConfig.java: -------------------------------------------------------------------------------- 1 | package com.config; 2 | 3 | 4 | import org.apache.spark.SparkConf; 5 | import org.apache.spark.api.java.JavaSparkContext; 6 | import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; 7 | import org.springframework.boot.context.properties.ConfigurationProperties; 8 | import org.springframework.context.annotation.Bean; 9 | import org.springframework.context.annotation.Configuration; 10 | import scala.Serializable; 11 | 12 | @SuppressWarnings("serial") 13 | @Configuration 14 | @ConfigurationProperties(prefix="spark") 15 | public class SparkConfig implements Serializable { 16 | 17 | //spark的安装地址 18 | private String sparkHome = "."; 19 | //应用的名称 20 | private String appName = "mySpark"; 21 | //master的地址 22 | private String master = "local[*]"; 23 | 24 | @Bean 25 | @ConditionalOnMissingBean(SparkConf.class) 26 | public SparkConf sparkConf() throws Exception { 27 | SparkConf conf = new SparkConf() 28 | .setSparkHome(sparkHome) 29 | .setAppName(appName) 30 | .setMaster(master); 31 | conf.set("spark.serializer", "org.apache.spark.serializer.KryoSerializer"); 32 | //JVM申请的memory不够会导致无法启动 33 | conf.set("spark.testing.memory","471859200"); 34 | return conf; 35 | } 36 | 37 | @Bean 38 | @ConditionalOnMissingBean(JavaSparkContext.class) 39 | public JavaSparkContext javaSparkContext() throws Exception { 40 | return new JavaSparkContext(sparkConf()); 41 | } 42 | 43 | public String getSparkHome() { 44 | return sparkHome; 45 | } 46 | 47 | public void setSparkHome(String sparkHome) { 48 | this.sparkHome = sparkHome; 49 | } 50 | 51 | public String getAppName() { 52 | return appName; 53 | } 54 | 55 | public void setAppName(String appName) { 56 | this.appName = appName; 57 | } 58 | 59 | public String getMaster() { 60 | return master; 61 | } 62 | 63 | public void setMaster(String master) { 64 | this.master = master; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/StoreupServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | 3 | import org.springframework.stereotype.Service; 4 | import java.util.Map; 5 | import java.util.List; 6 | 7 | import com.baomidou.mybatisplus.mapper.Wrapper; 8 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 9 | import com.baomidou.mybatisplus.plugins.Page; 10 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 11 | import com.utils.PageUtils; 12 | import com.utils.Query; 13 | 14 | 15 | import com.dao.StoreupDao; 16 | import com.entity.StoreupEntity; 17 | import com.service.StoreupService; 18 | import com.entity.vo.StoreupVO; 19 | import com.entity.view.StoreupView; 20 | 21 | @Service("storeupService") 22 | public class StoreupServiceImpl extends ServiceImpl implements StoreupService { 23 | 24 | 25 | @Override 26 | public PageUtils queryPage(Map params) { 27 | Page page = this.selectPage( 28 | new Query(params).getPage(), 29 | new EntityWrapper() 30 | ); 31 | return new PageUtils(page); 32 | } 33 | 34 | @Override 35 | public PageUtils queryPage(Map params, Wrapper wrapper) { 36 | Page page =new Query(params).getPage(); 37 | page.setRecords(baseMapper.selectListView(page,wrapper)); 38 | PageUtils pageUtil = new PageUtils(page); 39 | return pageUtil; 40 | } 41 | 42 | @Override 43 | public List selectListVO(Wrapper wrapper) { 44 | return baseMapper.selectListVO(wrapper); 45 | } 46 | 47 | @Override 48 | public StoreupVO selectVO(Wrapper wrapper) { 49 | return baseMapper.selectVO(wrapper); 50 | } 51 | 52 | @Override 53 | public List selectListView(Wrapper wrapper) { 54 | return baseMapper.selectListView(wrapper); 55 | } 56 | 57 | @Override 58 | public StoreupView selectView(Wrapper wrapper) { 59 | return baseMapper.selectView(wrapper); 60 | } 61 | 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/SystemintroServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | 3 | import org.springframework.stereotype.Service; 4 | import java.util.Map; 5 | import java.util.List; 6 | 7 | import com.baomidou.mybatisplus.mapper.Wrapper; 8 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 9 | import com.baomidou.mybatisplus.plugins.Page; 10 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 11 | import com.utils.PageUtils; 12 | import com.utils.Query; 13 | 14 | 15 | import com.dao.SystemintroDao; 16 | import com.entity.SystemintroEntity; 17 | import com.service.SystemintroService; 18 | import com.entity.vo.SystemintroVO; 19 | import com.entity.view.SystemintroView; 20 | 21 | @Service("systemintroService") 22 | public class SystemintroServiceImpl extends ServiceImpl implements SystemintroService { 23 | 24 | 25 | @Override 26 | public PageUtils queryPage(Map params) { 27 | Page page = this.selectPage( 28 | new Query(params).getPage(), 29 | new EntityWrapper() 30 | ); 31 | return new PageUtils(page); 32 | } 33 | 34 | @Override 35 | public PageUtils queryPage(Map params, Wrapper wrapper) { 36 | Page page =new Query(params).getPage(); 37 | page.setRecords(baseMapper.selectListView(page,wrapper)); 38 | PageUtils pageUtil = new PageUtils(page); 39 | return pageUtil; 40 | } 41 | 42 | @Override 43 | public List selectListVO(Wrapper wrapper) { 44 | return baseMapper.selectListVO(wrapper); 45 | } 46 | 47 | @Override 48 | public SystemintroVO selectVO(Wrapper wrapper) { 49 | return baseMapper.selectVO(wrapper); 50 | } 51 | 52 | @Override 53 | public List selectListView(Wrapper wrapper) { 54 | return baseMapper.selectListView(wrapper); 55 | } 56 | 57 | @Override 58 | public SystemintroView selectView(Wrapper wrapper) { 59 | return baseMapper.selectView(wrapper); 60 | } 61 | 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/com/utils/PageUtils.java: -------------------------------------------------------------------------------- 1 | 2 | package com.utils; 3 | 4 | import java.io.Serializable; 5 | import java.util.List; 6 | import java.util.Map; 7 | 8 | import com.baomidou.mybatisplus.plugins.Page; 9 | 10 | /** 11 | * 分页工具类 12 | */ 13 | public class PageUtils implements Serializable { 14 | private static final long serialVersionUID = 1L; 15 | //总记录数 16 | private long total; 17 | //每页记录数 18 | private int pageSize; 19 | //总页数 20 | private long totalPage; 21 | //当前页数 22 | private int currPage; 23 | //列表数据 24 | private List list; 25 | 26 | /** 27 | * 分页 28 | * @param list 列表数据 29 | * @param totalCount 总记录数 30 | * @param pageSize 每页记录数 31 | * @param currPage 当前页数 32 | */ 33 | public PageUtils(List list, int totalCount, int pageSize, int currPage) { 34 | this.list = list; 35 | this.total = totalCount; 36 | this.pageSize = pageSize; 37 | this.currPage = currPage; 38 | this.totalPage = (int)Math.ceil((double)totalCount/pageSize); 39 | } 40 | 41 | /** 42 | * 分页 43 | */ 44 | public PageUtils(Page page) { 45 | this.list = page.getRecords(); 46 | this.total = page.getTotal(); 47 | this.pageSize = page.getSize(); 48 | this.currPage = page.getCurrent(); 49 | this.totalPage = page.getPages(); 50 | } 51 | 52 | /* 53 | * 空数据的分页 54 | */ 55 | public PageUtils(Map params) { 56 | Page page =new Query(params).getPage(); 57 | new PageUtils(page); 58 | } 59 | 60 | 61 | public int getPageSize() { 62 | return pageSize; 63 | } 64 | 65 | public void setPageSize(int pageSize) { 66 | this.pageSize = pageSize; 67 | } 68 | 69 | public int getCurrPage() { 70 | return currPage; 71 | } 72 | 73 | public void setCurrPage(int currPage) { 74 | this.currPage = currPage; 75 | } 76 | 77 | public List getList() { 78 | return list; 79 | } 80 | 81 | public void setList(List list) { 82 | this.list = list; 83 | } 84 | 85 | public long getTotalPage() { 86 | return totalPage; 87 | } 88 | 89 | public void setTotalPage(long totalPage) { 90 | this.totalPage = totalPage; 91 | } 92 | 93 | public long getTotal() { 94 | return total; 95 | } 96 | 97 | public void setTotal(long total) { 98 | this.total = total; 99 | } 100 | 101 | } 102 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/DiscusszhinengjiajuServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | 3 | import org.springframework.stereotype.Service; 4 | import java.util.Map; 5 | import java.util.List; 6 | 7 | import com.baomidou.mybatisplus.mapper.Wrapper; 8 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 9 | import com.baomidou.mybatisplus.plugins.Page; 10 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 11 | import com.utils.PageUtils; 12 | import com.utils.Query; 13 | 14 | 15 | import com.dao.DiscusszhinengjiajuDao; 16 | import com.entity.DiscusszhinengjiajuEntity; 17 | import com.service.DiscusszhinengjiajuService; 18 | import com.entity.vo.DiscusszhinengjiajuVO; 19 | import com.entity.view.DiscusszhinengjiajuView; 20 | 21 | @Service("discusszhinengjiajuService") 22 | public class DiscusszhinengjiajuServiceImpl extends ServiceImpl implements DiscusszhinengjiajuService { 23 | 24 | 25 | @Override 26 | public PageUtils queryPage(Map params) { 27 | Page page = this.selectPage( 28 | new Query(params).getPage(), 29 | new EntityWrapper() 30 | ); 31 | return new PageUtils(page); 32 | } 33 | 34 | @Override 35 | public PageUtils queryPage(Map params, Wrapper wrapper) { 36 | Page page =new Query(params).getPage(); 37 | page.setRecords(baseMapper.selectListView(page,wrapper)); 38 | PageUtils pageUtil = new PageUtils(page); 39 | return pageUtil; 40 | } 41 | 42 | @Override 43 | public List selectListVO(Wrapper wrapper) { 44 | return baseMapper.selectListVO(wrapper); 45 | } 46 | 47 | @Override 48 | public DiscusszhinengjiajuVO selectVO(Wrapper wrapper) { 49 | return baseMapper.selectVO(wrapper); 50 | } 51 | 52 | @Override 53 | public List selectListView(Wrapper wrapper) { 54 | return baseMapper.selectListView(wrapper); 55 | } 56 | 57 | @Override 58 | public DiscusszhinengjiajuView selectView(Wrapper wrapper) { 59 | return baseMapper.selectView(wrapper); 60 | } 61 | 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/com/entity/vo/SystemintroVO.java: -------------------------------------------------------------------------------- 1 | package com.entity.vo; 2 | 3 | import com.entity.SystemintroEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import java.util.Date; 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import com.fasterxml.jackson.annotation.JsonFormat; 10 | import java.io.Serializable; 11 | 12 | 13 | /** 14 | * 关于我们 15 | * 手机端接口返回实体辅助类 16 | * (主要作用去除一些不必要的字段) 17 | * @author 18 | * @email 19 | * @date 2023-05-05 15:46:46 20 | */ 21 | public class SystemintroVO implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | 25 | /** 26 | * 副标题 27 | */ 28 | 29 | private String subtitle; 30 | 31 | /** 32 | * 内容 33 | */ 34 | 35 | private String content; 36 | 37 | /** 38 | * 图片1 39 | */ 40 | 41 | private String picture1; 42 | 43 | /** 44 | * 图片2 45 | */ 46 | 47 | private String picture2; 48 | 49 | /** 50 | * 图片3 51 | */ 52 | 53 | private String picture3; 54 | 55 | 56 | /** 57 | * 设置:副标题 58 | */ 59 | 60 | public void setSubtitle(String subtitle) { 61 | this.subtitle = subtitle; 62 | } 63 | 64 | /** 65 | * 获取:副标题 66 | */ 67 | public String getSubtitle() { 68 | return subtitle; 69 | } 70 | 71 | 72 | /** 73 | * 设置:内容 74 | */ 75 | 76 | public void setContent(String content) { 77 | this.content = content; 78 | } 79 | 80 | /** 81 | * 获取:内容 82 | */ 83 | public String getContent() { 84 | return content; 85 | } 86 | 87 | 88 | /** 89 | * 设置:图片1 90 | */ 91 | 92 | public void setPicture1(String picture1) { 93 | this.picture1 = picture1; 94 | } 95 | 96 | /** 97 | * 获取:图片1 98 | */ 99 | public String getPicture1() { 100 | return picture1; 101 | } 102 | 103 | 104 | /** 105 | * 设置:图片2 106 | */ 107 | 108 | public void setPicture2(String picture2) { 109 | this.picture2 = picture2; 110 | } 111 | 112 | /** 113 | * 获取:图片2 114 | */ 115 | public String getPicture2() { 116 | return picture2; 117 | } 118 | 119 | 120 | /** 121 | * 设置:图片3 122 | */ 123 | 124 | public void setPicture3(String picture3) { 125 | this.picture3 = picture3; 126 | } 127 | 128 | /** 129 | * 获取:图片3 130 | */ 131 | public String getPicture3() { 132 | return picture3; 133 | } 134 | 135 | } 136 | -------------------------------------------------------------------------------- /src/main/java/com/entity/vo/DiscusszhinengjiajuVO.java: -------------------------------------------------------------------------------- 1 | package com.entity.vo; 2 | 3 | import com.entity.DiscusszhinengjiajuEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import java.util.Date; 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import com.fasterxml.jackson.annotation.JsonFormat; 10 | import java.io.Serializable; 11 | 12 | 13 | /** 14 | * 智能家居评论表 15 | * 手机端接口返回实体辅助类 16 | * (主要作用去除一些不必要的字段) 17 | * @author 18 | * @email 19 | * @date 2023-05-05 15:46:47 20 | */ 21 | public class DiscusszhinengjiajuVO implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | 25 | /** 26 | * 用户id 27 | */ 28 | 29 | private Long userid; 30 | 31 | /** 32 | * 头像 33 | */ 34 | 35 | private String avatarurl; 36 | 37 | /** 38 | * 用户名 39 | */ 40 | 41 | private String nickname; 42 | 43 | /** 44 | * 评论内容 45 | */ 46 | 47 | private String content; 48 | 49 | /** 50 | * 回复内容 51 | */ 52 | 53 | private String reply; 54 | 55 | 56 | /** 57 | * 设置:用户id 58 | */ 59 | 60 | public void setUserid(Long userid) { 61 | this.userid = userid; 62 | } 63 | 64 | /** 65 | * 获取:用户id 66 | */ 67 | public Long getUserid() { 68 | return userid; 69 | } 70 | 71 | 72 | /** 73 | * 设置:头像 74 | */ 75 | 76 | public void setAvatarurl(String avatarurl) { 77 | this.avatarurl = avatarurl; 78 | } 79 | 80 | /** 81 | * 获取:头像 82 | */ 83 | public String getAvatarurl() { 84 | return avatarurl; 85 | } 86 | 87 | 88 | /** 89 | * 设置:用户名 90 | */ 91 | 92 | public void setNickname(String nickname) { 93 | this.nickname = nickname; 94 | } 95 | 96 | /** 97 | * 获取:用户名 98 | */ 99 | public String getNickname() { 100 | return nickname; 101 | } 102 | 103 | 104 | /** 105 | * 设置:评论内容 106 | */ 107 | 108 | public void setContent(String content) { 109 | this.content = content; 110 | } 111 | 112 | /** 113 | * 获取:评论内容 114 | */ 115 | public String getContent() { 116 | return content; 117 | } 118 | 119 | 120 | /** 121 | * 设置:回复内容 122 | */ 123 | 124 | public void setReply(String reply) { 125 | this.reply = reply; 126 | } 127 | 128 | /** 129 | * 获取:回复内容 130 | */ 131 | public String getReply() { 132 | return reply; 133 | } 134 | 135 | } 136 | -------------------------------------------------------------------------------- /src/main/java/com/entity/vo/DiscussbingxiangxinxiVO.java: -------------------------------------------------------------------------------- 1 | package com.entity.vo; 2 | 3 | import com.entity.DiscussbingxiangxinxiEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import java.util.Date; 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import com.fasterxml.jackson.annotation.JsonFormat; 10 | import java.io.Serializable; 11 | 12 | 13 | /** 14 | * bingxiangxinxi评论表 15 | * 手机端接口返回实体辅助类 16 | * (主要作用去除一些不必要的字段) 17 | * @author 18 | * @email 19 | * @date 2023-05-05 15:46:47 20 | */ 21 | public class DiscussbingxiangxinxiVO implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | 25 | /** 26 | * 用户id 27 | */ 28 | 29 | private Long userid; 30 | 31 | /** 32 | * 头像 33 | */ 34 | 35 | private String avatarurl; 36 | 37 | /** 38 | * 用户名 39 | */ 40 | 41 | private String nickname; 42 | 43 | /** 44 | * 评论内容 45 | */ 46 | 47 | private String content; 48 | 49 | /** 50 | * 回复内容 51 | */ 52 | 53 | private String reply; 54 | 55 | 56 | /** 57 | * 设置:用户id 58 | */ 59 | 60 | public void setUserid(Long userid) { 61 | this.userid = userid; 62 | } 63 | 64 | /** 65 | * 获取:用户id 66 | */ 67 | public Long getUserid() { 68 | return userid; 69 | } 70 | 71 | 72 | /** 73 | * 设置:头像 74 | */ 75 | 76 | public void setAvatarurl(String avatarurl) { 77 | this.avatarurl = avatarurl; 78 | } 79 | 80 | /** 81 | * 获取:头像 82 | */ 83 | public String getAvatarurl() { 84 | return avatarurl; 85 | } 86 | 87 | 88 | /** 89 | * 设置:用户名 90 | */ 91 | 92 | public void setNickname(String nickname) { 93 | this.nickname = nickname; 94 | } 95 | 96 | /** 97 | * 获取:用户名 98 | */ 99 | public String getNickname() { 100 | return nickname; 101 | } 102 | 103 | 104 | /** 105 | * 设置:评论内容 106 | */ 107 | 108 | public void setContent(String content) { 109 | this.content = content; 110 | } 111 | 112 | /** 113 | * 获取:评论内容 114 | */ 115 | public String getContent() { 116 | return content; 117 | } 118 | 119 | 120 | /** 121 | * 设置:回复内容 122 | */ 123 | 124 | public void setReply(String reply) { 125 | this.reply = reply; 126 | } 127 | 128 | /** 129 | * 获取:回复内容 130 | */ 131 | public String getReply() { 132 | return reply; 133 | } 134 | 135 | } 136 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/DiscussbingxiangxinxiServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | 3 | import org.springframework.stereotype.Service; 4 | import java.util.Map; 5 | import java.util.List; 6 | 7 | import com.baomidou.mybatisplus.mapper.Wrapper; 8 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 9 | import com.baomidou.mybatisplus.plugins.Page; 10 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 11 | import com.utils.PageUtils; 12 | import com.utils.Query; 13 | 14 | 15 | import com.dao.DiscussbingxiangxinxiDao; 16 | import com.entity.DiscussbingxiangxinxiEntity; 17 | import com.service.DiscussbingxiangxinxiService; 18 | import com.entity.vo.DiscussbingxiangxinxiVO; 19 | import com.entity.view.DiscussbingxiangxinxiView; 20 | 21 | @Service("discussbingxiangxinxiService") 22 | public class DiscussbingxiangxinxiServiceImpl extends ServiceImpl implements DiscussbingxiangxinxiService { 23 | 24 | 25 | @Override 26 | public PageUtils queryPage(Map params) { 27 | Page page = this.selectPage( 28 | new Query(params).getPage(), 29 | new EntityWrapper() 30 | ); 31 | return new PageUtils(page); 32 | } 33 | 34 | @Override 35 | public PageUtils queryPage(Map params, Wrapper wrapper) { 36 | Page page =new Query(params).getPage(); 37 | page.setRecords(baseMapper.selectListView(page,wrapper)); 38 | PageUtils pageUtil = new PageUtils(page); 39 | return pageUtil; 40 | } 41 | 42 | @Override 43 | public List selectListVO(Wrapper wrapper) { 44 | return baseMapper.selectListVO(wrapper); 45 | } 46 | 47 | @Override 48 | public DiscussbingxiangxinxiVO selectVO(Wrapper wrapper) { 49 | return baseMapper.selectVO(wrapper); 50 | } 51 | 52 | @Override 53 | public List selectListView(Wrapper wrapper) { 54 | return baseMapper.selectListView(wrapper); 55 | } 56 | 57 | @Override 58 | public DiscussbingxiangxinxiView selectView(Wrapper wrapper) { 59 | return baseMapper.selectView(wrapper); 60 | } 61 | 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/com/entity/model/SystemintroModel.java: -------------------------------------------------------------------------------- 1 | package com.entity.model; 2 | 3 | import com.entity.SystemintroEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import java.util.Date; 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import com.fasterxml.jackson.annotation.JsonFormat; 10 | import java.io.Serializable; 11 | 12 | 13 | /** 14 | * 关于我们 15 | * 接收传参的实体类 16 | *(实际开发中配合移动端接口开发手动去掉些没用的字段, 后端一般用entity就够用了) 17 | * 取自ModelAndView 的model名称 18 | * @author 19 | * @email 20 | * @date 2023-05-05 15:46:46 21 | */ 22 | public class SystemintroModel implements Serializable { 23 | private static final long serialVersionUID = 1L; 24 | 25 | 26 | /** 27 | * 副标题 28 | */ 29 | 30 | private String subtitle; 31 | 32 | /** 33 | * 内容 34 | */ 35 | 36 | private String content; 37 | 38 | /** 39 | * 图片1 40 | */ 41 | 42 | private String picture1; 43 | 44 | /** 45 | * 图片2 46 | */ 47 | 48 | private String picture2; 49 | 50 | /** 51 | * 图片3 52 | */ 53 | 54 | private String picture3; 55 | 56 | 57 | /** 58 | * 设置:副标题 59 | */ 60 | 61 | public void setSubtitle(String subtitle) { 62 | this.subtitle = subtitle; 63 | } 64 | 65 | /** 66 | * 获取:副标题 67 | */ 68 | public String getSubtitle() { 69 | return subtitle; 70 | } 71 | 72 | 73 | /** 74 | * 设置:内容 75 | */ 76 | 77 | public void setContent(String content) { 78 | this.content = content; 79 | } 80 | 81 | /** 82 | * 获取:内容 83 | */ 84 | public String getContent() { 85 | return content; 86 | } 87 | 88 | 89 | /** 90 | * 设置:图片1 91 | */ 92 | 93 | public void setPicture1(String picture1) { 94 | this.picture1 = picture1; 95 | } 96 | 97 | /** 98 | * 获取:图片1 99 | */ 100 | public String getPicture1() { 101 | return picture1; 102 | } 103 | 104 | 105 | /** 106 | * 设置:图片2 107 | */ 108 | 109 | public void setPicture2(String picture2) { 110 | this.picture2 = picture2; 111 | } 112 | 113 | /** 114 | * 获取:图片2 115 | */ 116 | public String getPicture2() { 117 | return picture2; 118 | } 119 | 120 | 121 | /** 122 | * 设置:图片3 123 | */ 124 | 125 | public void setPicture3(String picture3) { 126 | this.picture3 = picture3; 127 | } 128 | 129 | /** 130 | * 获取:图片3 131 | */ 132 | public String getPicture3() { 133 | return picture3; 134 | } 135 | 136 | } 137 | -------------------------------------------------------------------------------- /src/main/java/com/entity/model/DiscusszhinengjiajuModel.java: -------------------------------------------------------------------------------- 1 | package com.entity.model; 2 | 3 | import com.entity.DiscusszhinengjiajuEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import java.util.Date; 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import com.fasterxml.jackson.annotation.JsonFormat; 10 | import java.io.Serializable; 11 | 12 | 13 | /** 14 | * 智能家居评论表 15 | * 接收传参的实体类 16 | *(实际开发中配合移动端接口开发手动去掉些没用的字段, 后端一般用entity就够用了) 17 | * 取自ModelAndView 的model名称 18 | * @author 19 | * @email 20 | * @date 2023-05-05 15:46:47 21 | */ 22 | public class DiscusszhinengjiajuModel implements Serializable { 23 | private static final long serialVersionUID = 1L; 24 | 25 | 26 | /** 27 | * 用户id 28 | */ 29 | 30 | private Long userid; 31 | 32 | /** 33 | * 头像 34 | */ 35 | 36 | private String avatarurl; 37 | 38 | /** 39 | * 用户名 40 | */ 41 | 42 | private String nickname; 43 | 44 | /** 45 | * 评论内容 46 | */ 47 | 48 | private String content; 49 | 50 | /** 51 | * 回复内容 52 | */ 53 | 54 | private String reply; 55 | 56 | 57 | /** 58 | * 设置:用户id 59 | */ 60 | 61 | public void setUserid(Long userid) { 62 | this.userid = userid; 63 | } 64 | 65 | /** 66 | * 获取:用户id 67 | */ 68 | public Long getUserid() { 69 | return userid; 70 | } 71 | 72 | 73 | /** 74 | * 设置:头像 75 | */ 76 | 77 | public void setAvatarurl(String avatarurl) { 78 | this.avatarurl = avatarurl; 79 | } 80 | 81 | /** 82 | * 获取:头像 83 | */ 84 | public String getAvatarurl() { 85 | return avatarurl; 86 | } 87 | 88 | 89 | /** 90 | * 设置:用户名 91 | */ 92 | 93 | public void setNickname(String nickname) { 94 | this.nickname = nickname; 95 | } 96 | 97 | /** 98 | * 获取:用户名 99 | */ 100 | public String getNickname() { 101 | return nickname; 102 | } 103 | 104 | 105 | /** 106 | * 设置:评论内容 107 | */ 108 | 109 | public void setContent(String content) { 110 | this.content = content; 111 | } 112 | 113 | /** 114 | * 获取:评论内容 115 | */ 116 | public String getContent() { 117 | return content; 118 | } 119 | 120 | 121 | /** 122 | * 设置:回复内容 123 | */ 124 | 125 | public void setReply(String reply) { 126 | this.reply = reply; 127 | } 128 | 129 | /** 130 | * 获取:回复内容 131 | */ 132 | public String getReply() { 133 | return reply; 134 | } 135 | 136 | } 137 | -------------------------------------------------------------------------------- /src/main/java/com/entity/model/DiscussbingxiangxinxiModel.java: -------------------------------------------------------------------------------- 1 | package com.entity.model; 2 | 3 | import com.entity.DiscussbingxiangxinxiEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import java.util.Date; 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import com.fasterxml.jackson.annotation.JsonFormat; 10 | import java.io.Serializable; 11 | 12 | 13 | /** 14 | * bingxiangxinxi评论表 15 | * 接收传参的实体类 16 | *(实际开发中配合移动端接口开发手动去掉些没用的字段, 后端一般用entity就够用了) 17 | * 取自ModelAndView 的model名称 18 | * @author 19 | * @email 20 | * @date 2023-05-05 15:46:47 21 | */ 22 | public class DiscussbingxiangxinxiModel implements Serializable { 23 | private static final long serialVersionUID = 1L; 24 | 25 | 26 | /** 27 | * 用户id 28 | */ 29 | 30 | private Long userid; 31 | 32 | /** 33 | * 头像 34 | */ 35 | 36 | private String avatarurl; 37 | 38 | /** 39 | * 用户名 40 | */ 41 | 42 | private String nickname; 43 | 44 | /** 45 | * 评论内容 46 | */ 47 | 48 | private String content; 49 | 50 | /** 51 | * 回复内容 52 | */ 53 | 54 | private String reply; 55 | 56 | 57 | /** 58 | * 设置:用户id 59 | */ 60 | 61 | public void setUserid(Long userid) { 62 | this.userid = userid; 63 | } 64 | 65 | /** 66 | * 获取:用户id 67 | */ 68 | public Long getUserid() { 69 | return userid; 70 | } 71 | 72 | 73 | /** 74 | * 设置:头像 75 | */ 76 | 77 | public void setAvatarurl(String avatarurl) { 78 | this.avatarurl = avatarurl; 79 | } 80 | 81 | /** 82 | * 获取:头像 83 | */ 84 | public String getAvatarurl() { 85 | return avatarurl; 86 | } 87 | 88 | 89 | /** 90 | * 设置:用户名 91 | */ 92 | 93 | public void setNickname(String nickname) { 94 | this.nickname = nickname; 95 | } 96 | 97 | /** 98 | * 获取:用户名 99 | */ 100 | public String getNickname() { 101 | return nickname; 102 | } 103 | 104 | 105 | /** 106 | * 设置:评论内容 107 | */ 108 | 109 | public void setContent(String content) { 110 | this.content = content; 111 | } 112 | 113 | /** 114 | * 获取:评论内容 115 | */ 116 | public String getContent() { 117 | return content; 118 | } 119 | 120 | 121 | /** 122 | * 设置:回复内容 123 | */ 124 | 125 | public void setReply(String reply) { 126 | this.reply = reply; 127 | } 128 | 129 | /** 130 | * 获取:回复内容 131 | */ 132 | public String getReply() { 133 | return reply; 134 | } 135 | 136 | } 137 | -------------------------------------------------------------------------------- /src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | # Tomcat 2 | server: 3 | tomcat: 4 | uri-encoding: UTF-8 5 | port: 8080 6 | servlet: 7 | context-path: /springbootjr986 8 | 9 | #name-node 10 | hadoop.name-node: hdfs://localhost:9000 11 | #hdfs目录 12 | hadoop.namespace: /data 13 | 14 | spring: 15 | datasource: 16 | driverClassName: com.mysql.cj.jdbc.Driver 17 | url: jdbc:mysql://127.0.0.1:3306/springbootjr986?useUnicode=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8 18 | username: root 19 | password: 123456 20 | 21 | # driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver 22 | # url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=springbootjr986 23 | # username: sa 24 | # password: 123456 25 | 26 | servlet: 27 | multipart: 28 | max-file-size: 300MB 29 | max-request-size: 300MB 30 | resources: 31 | static-locations: classpath:static/,file:static/ 32 | 33 | #mybatis 34 | mybatis-plus: 35 | mapper-locations: classpath*:mapper/*.xml 36 | #实体扫描,多个package用逗号或者分号分隔 37 | typeAliasesPackage: com.entity 38 | global-config: 39 | #主键类型 0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID"; 40 | id-type: 1 41 | #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断" 42 | field-strategy: 1 43 | #驼峰下划线转换 44 | db-column-underline: true 45 | #刷新mapper 调试神器 46 | refresh-mapper: true 47 | #逻辑删除配置 48 | logic-delete-value: -1 49 | logic-not-delete-value: 0 50 | #自定义SQL注入器 51 | sql-injector: com.baomidou.mybatisplus.mapper.LogicSqlInjector 52 | configuration: 53 | map-underscore-to-camel-case: true 54 | cache-enabled: false 55 | call-setters-on-nulls: true 56 | #springboot 项目mybatis plus 设置 jdbcTypeForNull (oracle数据库需配置JdbcType.NULL, 默认是Other) 57 | jdbc-type-for-null: 'null' 58 | hive: 59 | url: jdbc:hive2://127.0.0.1:10000/default 60 | driver-class-name: org.apache.hive.jdbc.HiveDriver 61 | type: com.alibaba.druid.pool.DruidDataSource 62 | user: root 63 | password: 123456 64 | 65 | # 下面为连接池的补充设置,应用到上面所有数据源中 66 | # 初始化大小,最小,最大 67 | initialSize: 1 68 | minIdle: 3 69 | maxActive: 20 70 | # 配置获取连接等待超时的时间 71 | maxWait: 60000 72 | # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 73 | timeBetweenEvictionRunsMillis: 60000 74 | # 配置一个连接在池中最小生存的时间,单位是毫秒 75 | minEvictableIdleTimeMillis: 30000 76 | validationQuery: select 1 77 | testWhileIdle: true 78 | testOnBorrow: false 79 | testOnReturn: false 80 | # 打开PSCache,并且指定每个连接上PSCache的大小 81 | poolPreparedStatements: true 82 | maxPoolPreparedStatementPerConnectionSize: 20 83 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/TokenServiceImpl.java: -------------------------------------------------------------------------------- 1 | 2 | package com.service.impl; 3 | 4 | 5 | import java.util.Calendar; 6 | import java.util.Date; 7 | import java.util.List; 8 | import java.util.Map; 9 | 10 | import org.springframework.stereotype.Service; 11 | 12 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 13 | import com.baomidou.mybatisplus.mapper.Wrapper; 14 | import com.baomidou.mybatisplus.plugins.Page; 15 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 16 | import com.dao.TokenDao; 17 | import com.entity.TokenEntity; 18 | import com.entity.TokenEntity; 19 | import com.service.TokenService; 20 | import com.utils.CommonUtil; 21 | import com.utils.PageUtils; 22 | import com.utils.Query; 23 | 24 | 25 | /** 26 | * token 27 | */ 28 | @Service("tokenService") 29 | public class TokenServiceImpl extends ServiceImpl implements TokenService { 30 | 31 | @Override 32 | public PageUtils queryPage(Map params) { 33 | Page page = this.selectPage( 34 | new Query(params).getPage(), 35 | new EntityWrapper() 36 | ); 37 | return new PageUtils(page); 38 | } 39 | 40 | @Override 41 | public List selectListView(Wrapper wrapper) { 42 | return baseMapper.selectListView(wrapper); 43 | } 44 | 45 | @Override 46 | public PageUtils queryPage(Map params, 47 | Wrapper wrapper) { 48 | Page page =new Query(params).getPage(); 49 | page.setRecords(baseMapper.selectListView(page,wrapper)); 50 | PageUtils pageUtil = new PageUtils(page); 51 | return pageUtil; 52 | } 53 | 54 | @Override 55 | public String generateToken(Long userid,String username, String tableName, String role) { 56 | TokenEntity tokenEntity = this.selectOne(new EntityWrapper().eq("userid", userid).eq("role", role)); 57 | String token = CommonUtil.getRandomString(32); 58 | Calendar cal = Calendar.getInstance(); 59 | cal.setTime(new Date()); 60 | cal.add(Calendar.HOUR_OF_DAY, 1); 61 | if(tokenEntity!=null) { 62 | tokenEntity.setToken(token); 63 | tokenEntity.setExpiratedtime(cal.getTime()); 64 | this.updateById(tokenEntity); 65 | } else { 66 | this.insert(new TokenEntity(userid,username, tableName, role, token, cal.getTime())); 67 | } 68 | return token; 69 | } 70 | 71 | @Override 72 | public TokenEntity getTokenEntity(String token) { 73 | TokenEntity tokenEntity = this.selectOne(new EntityWrapper().eq("token", token)); 74 | if(tokenEntity == null || tokenEntity.getExpiratedtime().getTime() extends LinkedHashMap { 15 | private static final long serialVersionUID = 1L; 16 | /** 17 | * mybatis-plus分页参数 18 | */ 19 | private Page page; 20 | /** 21 | * 当前页码 22 | */ 23 | private int currPage = 1; 24 | /** 25 | * 每页条数 26 | */ 27 | private int limit = 10; 28 | 29 | public Query(JQPageInfo pageInfo) { 30 | //分页参数 31 | if(pageInfo.getPage()!= null){ 32 | currPage = pageInfo.getPage(); 33 | } 34 | if(pageInfo.getLimit()!= null){ 35 | limit = pageInfo.getLimit(); 36 | } 37 | 38 | 39 | //防止SQL注入(因为sidx、order是通过拼接SQL实现排序的,会有SQL注入风险) 40 | String sidx = SQLFilter.sqlInject(pageInfo.getSidx()); 41 | String order = SQLFilter.sqlInject(pageInfo.getOrder()); 42 | 43 | 44 | //mybatis-plus分页 45 | this.page = new Page<>(currPage, limit); 46 | 47 | //排序 48 | if(StringUtils.isNotBlank(sidx) && StringUtils.isNotBlank(order)){ 49 | this.page.setOrderByField(sidx); 50 | this.page.setAsc("ASC".equalsIgnoreCase(order)); 51 | } 52 | } 53 | 54 | 55 | public Query(Map params){ 56 | this.putAll(params); 57 | 58 | //分页参数 59 | if(params.get("page") != null){ 60 | currPage = Integer.parseInt((String)params.get("page")); 61 | } 62 | if(params.get("limit") != null){ 63 | limit = Integer.parseInt((String)params.get("limit")); 64 | } 65 | 66 | this.put("offset", (currPage - 1) * limit); 67 | this.put("page", currPage); 68 | this.put("limit", limit); 69 | 70 | //防止SQL注入(因为sidx、order是通过拼接SQL实现排序的,会有SQL注入风险) 71 | String sidx = SQLFilter.sqlInject((String)params.get("sidx")); 72 | String order = SQLFilter.sqlInject((String)params.get("order")); 73 | this.put("sidx", sidx); 74 | this.put("order", order); 75 | 76 | //mybatis-plus分页 77 | this.page = new Page<>(currPage, limit); 78 | 79 | //排序 80 | if(StringUtils.isNotBlank(sidx) && StringUtils.isNotBlank(order)){ 81 | this.page.setOrderByField(sidx); 82 | this.page.setAsc("ASC".equalsIgnoreCase(order)); 83 | } 84 | 85 | } 86 | 87 | public Page getPage() { 88 | return page; 89 | } 90 | 91 | public int getCurrPage() { 92 | return currPage; 93 | } 94 | 95 | public int getLimit() { 96 | return limit; 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /src/main/resources/mapper/CommonDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | 22 | 23 | 24 | UPDATE ${table} set sfsh=#{sfsh} where id=#{id} 25 | 26 | 27 | 47 | 48 | 51 | 52 | 55 | 56 | 59 | 60 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/BingxiangxinxiServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | 3 | import org.springframework.stereotype.Service; 4 | import java.util.Map; 5 | import java.util.List; 6 | 7 | import com.baomidou.mybatisplus.mapper.Wrapper; 8 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 9 | import com.baomidou.mybatisplus.plugins.Page; 10 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 11 | import com.utils.PageUtils; 12 | import com.utils.Query; 13 | 14 | 15 | import com.dao.BingxiangxinxiDao; 16 | import com.entity.BingxiangxinxiEntity; 17 | import com.service.BingxiangxinxiService; 18 | import com.entity.vo.BingxiangxinxiVO; 19 | import com.entity.view.BingxiangxinxiView; 20 | 21 | @Service("bingxiangxinxiService") 22 | public class BingxiangxinxiServiceImpl extends ServiceImpl implements BingxiangxinxiService { 23 | 24 | 25 | @Override 26 | public PageUtils queryPage(Map params) { 27 | Page page = this.selectPage( 28 | new Query(params).getPage(), 29 | new EntityWrapper() 30 | ); 31 | return new PageUtils(page); 32 | } 33 | 34 | @Override 35 | public PageUtils queryPage(Map params, Wrapper wrapper) { 36 | Page page =new Query(params).getPage(); 37 | page.setRecords(baseMapper.selectListView(page,wrapper)); 38 | PageUtils pageUtil = new PageUtils(page); 39 | return pageUtil; 40 | } 41 | 42 | @Override 43 | public List selectListVO(Wrapper wrapper) { 44 | return baseMapper.selectListVO(wrapper); 45 | } 46 | 47 | @Override 48 | public BingxiangxinxiVO selectVO(Wrapper wrapper) { 49 | return baseMapper.selectVO(wrapper); 50 | } 51 | 52 | @Override 53 | public List selectListView(Wrapper wrapper) { 54 | return baseMapper.selectListView(wrapper); 55 | } 56 | 57 | @Override 58 | public BingxiangxinxiView selectView(Wrapper wrapper) { 59 | return baseMapper.selectView(wrapper); 60 | } 61 | 62 | @Override 63 | public List> selectValue(Map params, Wrapper wrapper) { 64 | return baseMapper.selectValue(params, wrapper); 65 | } 66 | 67 | @Override 68 | public List> selectTimeStatValue(Map params, Wrapper wrapper) { 69 | return baseMapper.selectTimeStatValue(params, wrapper); 70 | } 71 | 72 | @Override 73 | public List> selectGroup(Map params, Wrapper wrapper) { 74 | return baseMapper.selectGroup(params, wrapper); 75 | } 76 | 77 | 78 | 79 | 80 | } 81 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/ZhinengjiajuServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | 3 | import org.springframework.stereotype.Service; 4 | import java.util.Map; 5 | import java.util.List; 6 | 7 | import com.baomidou.mybatisplus.mapper.Wrapper; 8 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 9 | import com.baomidou.mybatisplus.plugins.Page; 10 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 11 | import com.utils.PageUtils; 12 | import com.utils.Query; 13 | 14 | 15 | import com.dao.ZhinengjiajuDao; 16 | import com.entity.ZhinengjiajuEntity; 17 | import com.service.ZhinengjiajuService; 18 | import com.entity.vo.ZhinengjiajuVO; 19 | import com.entity.view.ZhinengjiajuView; 20 | 21 | @Service("zhinengjiajuService") 22 | public class ZhinengjiajuServiceImpl extends ServiceImpl implements ZhinengjiajuService { 23 | 24 | 25 | @Override 26 | public PageUtils queryPage(Map params) { 27 | Page page = this.selectPage( 28 | new Query(params).getPage(), 29 | new EntityWrapper() 30 | ); 31 | return new PageUtils(page); 32 | } 33 | 34 | @Override 35 | public PageUtils queryPage(Map params, Wrapper wrapper) { 36 | Page page =new Query(params).getPage(); 37 | page.setRecords(baseMapper.selectListView(page,wrapper)); 38 | PageUtils pageUtil = new PageUtils(page); 39 | return pageUtil; 40 | } 41 | 42 | @Override 43 | public List selectListVO(Wrapper wrapper) { 44 | return baseMapper.selectListVO(wrapper); 45 | } 46 | 47 | @Override 48 | public ZhinengjiajuVO selectVO(Wrapper wrapper) { 49 | return baseMapper.selectVO(wrapper); 50 | } 51 | 52 | @Override 53 | public List selectListView(Wrapper wrapper) { 54 | return baseMapper.selectListView(wrapper); 55 | } 56 | 57 | @Override 58 | public ZhinengjiajuView selectView(Wrapper wrapper) { 59 | return baseMapper.selectView(wrapper); 60 | } 61 | 62 | @Override 63 | public List> selectValue(Map params, Wrapper wrapper) { 64 | return baseMapper.selectValue(params, wrapper); 65 | } 66 | 67 | @Override 68 | public List> selectTimeStatValue(Map params, Wrapper wrapper) { 69 | return baseMapper.selectTimeStatValue(params, wrapper); 70 | } 71 | 72 | @Override 73 | public List> selectGroup(Map params, Wrapper wrapper) { 74 | return baseMapper.selectGroup(params, wrapper); 75 | } 76 | 77 | @Override 78 | public List> haopingshuSectionStat(Map params, Wrapper wrapper) { 79 | return baseMapper.haopingshuSectionStat(params, wrapper); 80 | } 81 | 82 | 83 | 84 | } 85 | -------------------------------------------------------------------------------- /src/main/java/com/entity/vo/StoreupVO.java: -------------------------------------------------------------------------------- 1 | package com.entity.vo; 2 | 3 | import com.entity.StoreupEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import java.util.Date; 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import com.fasterxml.jackson.annotation.JsonFormat; 10 | import java.io.Serializable; 11 | 12 | 13 | /** 14 | * 收藏表 15 | * 手机端接口返回实体辅助类 16 | * (主要作用去除一些不必要的字段) 17 | * @author 18 | * @email 19 | * @date 2023-05-05 15:46:46 20 | */ 21 | public class StoreupVO implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | 25 | /** 26 | * 商品id 27 | */ 28 | 29 | private Long refid; 30 | 31 | /** 32 | * 表名 33 | */ 34 | 35 | private String tablename; 36 | 37 | /** 38 | * 名称 39 | */ 40 | 41 | private String name; 42 | 43 | /** 44 | * 图片 45 | */ 46 | 47 | private String picture; 48 | 49 | /** 50 | * 类型(1:收藏,21:赞,22:踩,31:竞拍参与,41:关注) 51 | */ 52 | 53 | private String type; 54 | 55 | /** 56 | * 推荐类型 57 | */ 58 | 59 | private String inteltype; 60 | 61 | /** 62 | * 备注 63 | */ 64 | 65 | private String remark; 66 | 67 | 68 | /** 69 | * 设置:商品id 70 | */ 71 | 72 | public void setRefid(Long refid) { 73 | this.refid = refid; 74 | } 75 | 76 | /** 77 | * 获取:商品id 78 | */ 79 | public Long getRefid() { 80 | return refid; 81 | } 82 | 83 | 84 | /** 85 | * 设置:表名 86 | */ 87 | 88 | public void setTablename(String tablename) { 89 | this.tablename = tablename; 90 | } 91 | 92 | /** 93 | * 获取:表名 94 | */ 95 | public String getTablename() { 96 | return tablename; 97 | } 98 | 99 | 100 | /** 101 | * 设置:名称 102 | */ 103 | 104 | public void setName(String name) { 105 | this.name = name; 106 | } 107 | 108 | /** 109 | * 获取:名称 110 | */ 111 | public String getName() { 112 | return name; 113 | } 114 | 115 | 116 | /** 117 | * 设置:图片 118 | */ 119 | 120 | public void setPicture(String picture) { 121 | this.picture = picture; 122 | } 123 | 124 | /** 125 | * 获取:图片 126 | */ 127 | public String getPicture() { 128 | return picture; 129 | } 130 | 131 | 132 | /** 133 | * 设置:类型(1:收藏,21:赞,22:踩,31:竞拍参与,41:关注) 134 | */ 135 | 136 | public void setType(String type) { 137 | this.type = type; 138 | } 139 | 140 | /** 141 | * 获取:类型(1:收藏,21:赞,22:踩,31:竞拍参与,41:关注) 142 | */ 143 | public String getType() { 144 | return type; 145 | } 146 | 147 | 148 | /** 149 | * 设置:推荐类型 150 | */ 151 | 152 | public void setInteltype(String inteltype) { 153 | this.inteltype = inteltype; 154 | } 155 | 156 | /** 157 | * 获取:推荐类型 158 | */ 159 | public String getInteltype() { 160 | return inteltype; 161 | } 162 | 163 | 164 | /** 165 | * 设置:备注 166 | */ 167 | 168 | public void setRemark(String remark) { 169 | this.remark = remark; 170 | } 171 | 172 | /** 173 | * 获取:备注 174 | */ 175 | public String getRemark() { 176 | return remark; 177 | } 178 | 179 | } 180 | -------------------------------------------------------------------------------- /src/main/java/com/entity/model/StoreupModel.java: -------------------------------------------------------------------------------- 1 | package com.entity.model; 2 | 3 | import com.entity.StoreupEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import java.util.Date; 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import com.fasterxml.jackson.annotation.JsonFormat; 10 | import java.io.Serializable; 11 | 12 | 13 | /** 14 | * 收藏表 15 | * 接收传参的实体类 16 | *(实际开发中配合移动端接口开发手动去掉些没用的字段, 后端一般用entity就够用了) 17 | * 取自ModelAndView 的model名称 18 | * @author 19 | * @email 20 | * @date 2023-05-05 15:46:46 21 | */ 22 | public class StoreupModel implements Serializable { 23 | private static final long serialVersionUID = 1L; 24 | 25 | 26 | /** 27 | * 商品id 28 | */ 29 | 30 | private Long refid; 31 | 32 | /** 33 | * 表名 34 | */ 35 | 36 | private String tablename; 37 | 38 | /** 39 | * 名称 40 | */ 41 | 42 | private String name; 43 | 44 | /** 45 | * 图片 46 | */ 47 | 48 | private String picture; 49 | 50 | /** 51 | * 类型(1:收藏,21:赞,22:踩,31:竞拍参与,41:关注) 52 | */ 53 | 54 | private String type; 55 | 56 | /** 57 | * 推荐类型 58 | */ 59 | 60 | private String inteltype; 61 | 62 | /** 63 | * 备注 64 | */ 65 | 66 | private String remark; 67 | 68 | 69 | /** 70 | * 设置:商品id 71 | */ 72 | 73 | public void setRefid(Long refid) { 74 | this.refid = refid; 75 | } 76 | 77 | /** 78 | * 获取:商品id 79 | */ 80 | public Long getRefid() { 81 | return refid; 82 | } 83 | 84 | 85 | /** 86 | * 设置:表名 87 | */ 88 | 89 | public void setTablename(String tablename) { 90 | this.tablename = tablename; 91 | } 92 | 93 | /** 94 | * 获取:表名 95 | */ 96 | public String getTablename() { 97 | return tablename; 98 | } 99 | 100 | 101 | /** 102 | * 设置:名称 103 | */ 104 | 105 | public void setName(String name) { 106 | this.name = name; 107 | } 108 | 109 | /** 110 | * 获取:名称 111 | */ 112 | public String getName() { 113 | return name; 114 | } 115 | 116 | 117 | /** 118 | * 设置:图片 119 | */ 120 | 121 | public void setPicture(String picture) { 122 | this.picture = picture; 123 | } 124 | 125 | /** 126 | * 获取:图片 127 | */ 128 | public String getPicture() { 129 | return picture; 130 | } 131 | 132 | 133 | /** 134 | * 设置:类型(1:收藏,21:赞,22:踩,31:竞拍参与,41:关注) 135 | */ 136 | 137 | public void setType(String type) { 138 | this.type = type; 139 | } 140 | 141 | /** 142 | * 获取:类型(1:收藏,21:赞,22:踩,31:竞拍参与,41:关注) 143 | */ 144 | public String getType() { 145 | return type; 146 | } 147 | 148 | 149 | /** 150 | * 设置:推荐类型 151 | */ 152 | 153 | public void setInteltype(String inteltype) { 154 | this.inteltype = inteltype; 155 | } 156 | 157 | /** 158 | * 获取:推荐类型 159 | */ 160 | public String getInteltype() { 161 | return inteltype; 162 | } 163 | 164 | 165 | /** 166 | * 设置:备注 167 | */ 168 | 169 | public void setRemark(String remark) { 170 | this.remark = remark; 171 | } 172 | 173 | /** 174 | * 获取:备注 175 | */ 176 | public String getRemark() { 177 | return remark; 178 | } 179 | 180 | } 181 | -------------------------------------------------------------------------------- /src/main/java/com/entity/NewsEntity.java: -------------------------------------------------------------------------------- 1 | package com.entity; 2 | 3 | import com.baomidou.mybatisplus.annotations.TableId; 4 | import com.baomidou.mybatisplus.annotations.TableName; 5 | import javax.validation.constraints.NotBlank; 6 | import javax.validation.constraints.NotEmpty; 7 | import javax.validation.constraints.NotNull; 8 | 9 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 10 | import java.lang.reflect.InvocationTargetException; 11 | 12 | import java.io.Serializable; 13 | import java.util.Date; 14 | import java.util.List; 15 | 16 | import org.springframework.format.annotation.DateTimeFormat; 17 | import com.fasterxml.jackson.annotation.JsonFormat; 18 | import org.apache.commons.beanutils.BeanUtils; 19 | import com.baomidou.mybatisplus.annotations.TableField; 20 | import com.baomidou.mybatisplus.enums.FieldFill; 21 | import com.baomidou.mybatisplus.enums.IdType; 22 | 23 | 24 | /** 25 | * 智能家居资讯 26 | * 数据库通用操作实体类(普通增删改查) 27 | * @author 28 | * @email 29 | * @date 2023-05-05 15:46:46 30 | */ 31 | @TableName("news") 32 | public class NewsEntity implements Serializable { 33 | private static final long serialVersionUID = 1L; 34 | 35 | 36 | public NewsEntity() { 37 | 38 | } 39 | 40 | public NewsEntity(T t) { 41 | try { 42 | BeanUtils.copyProperties(this, t); 43 | } catch (IllegalAccessException | InvocationTargetException e) { 44 | // TODO Auto-generated catch block 45 | e.printStackTrace(); 46 | } 47 | } 48 | 49 | /** 50 | * 主键id 51 | */ 52 | @TableId 53 | private Long id; 54 | /** 55 | * 标题 56 | */ 57 | 58 | private String title; 59 | 60 | /** 61 | * 简介 62 | */ 63 | 64 | private String introduction; 65 | 66 | /** 67 | * 图片 68 | */ 69 | 70 | private String picture; 71 | 72 | /** 73 | * 内容 74 | */ 75 | 76 | private String content; 77 | 78 | 79 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 80 | @DateTimeFormat 81 | private Date addtime; 82 | 83 | public Date getAddtime() { 84 | return addtime; 85 | } 86 | public void setAddtime(Date addtime) { 87 | this.addtime = addtime; 88 | } 89 | 90 | public Long getId() { 91 | return id; 92 | } 93 | 94 | public void setId(Long id) { 95 | this.id = id; 96 | } 97 | /** 98 | * 设置:标题 99 | */ 100 | public void setTitle(String title) { 101 | this.title = title; 102 | } 103 | /** 104 | * 获取:标题 105 | */ 106 | public String getTitle() { 107 | return title; 108 | } 109 | /** 110 | * 设置:简介 111 | */ 112 | public void setIntroduction(String introduction) { 113 | this.introduction = introduction; 114 | } 115 | /** 116 | * 获取:简介 117 | */ 118 | public String getIntroduction() { 119 | return introduction; 120 | } 121 | /** 122 | * 设置:图片 123 | */ 124 | public void setPicture(String picture) { 125 | this.picture = picture; 126 | } 127 | /** 128 | * 获取:图片 129 | */ 130 | public String getPicture() { 131 | return picture; 132 | } 133 | /** 134 | * 设置:内容 135 | */ 136 | public void setContent(String content) { 137 | this.content = content; 138 | } 139 | /** 140 | * 获取:内容 141 | */ 142 | public String getContent() { 143 | return content; 144 | } 145 | 146 | } 147 | -------------------------------------------------------------------------------- /src/main/java/com/entity/vo/ZhinengjiajuVO.java: -------------------------------------------------------------------------------- 1 | package com.entity.vo; 2 | 3 | import com.entity.ZhinengjiajuEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import java.util.Date; 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import com.fasterxml.jackson.annotation.JsonFormat; 10 | import java.io.Serializable; 11 | 12 | 13 | /** 14 | * 智能家居 15 | * 手机端接口返回实体辅助类 16 | * (主要作用去除一些不必要的字段) 17 | * @author 18 | * @email 19 | * @date 2023-05-05 15:46:46 20 | */ 21 | public class ZhinengjiajuVO implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | 25 | /** 26 | * 商品价格 27 | */ 28 | 29 | private Integer shangpinjiage; 30 | 31 | /** 32 | * 商品图片 33 | */ 34 | 35 | private String shangpintupian; 36 | 37 | /** 38 | * 商品类型 39 | */ 40 | 41 | private String shangpinleixing; 42 | 43 | /** 44 | * 商品品牌 45 | */ 46 | 47 | private String shangpinpinpai; 48 | 49 | /** 50 | * 好评数 51 | */ 52 | 53 | private Integer haopingshu; 54 | 55 | /** 56 | * 差评数 57 | */ 58 | 59 | private Integer chapingshu; 60 | 61 | /** 62 | * 总评论数 63 | */ 64 | 65 | private Integer zongpinglunshu; 66 | 67 | 68 | /** 69 | * 设置:商品价格 70 | */ 71 | 72 | public void setShangpinjiage(Integer shangpinjiage) { 73 | this.shangpinjiage = shangpinjiage; 74 | } 75 | 76 | /** 77 | * 获取:商品价格 78 | */ 79 | public Integer getShangpinjiage() { 80 | return shangpinjiage; 81 | } 82 | 83 | 84 | /** 85 | * 设置:商品图片 86 | */ 87 | 88 | public void setShangpintupian(String shangpintupian) { 89 | this.shangpintupian = shangpintupian; 90 | } 91 | 92 | /** 93 | * 获取:商品图片 94 | */ 95 | public String getShangpintupian() { 96 | return shangpintupian; 97 | } 98 | 99 | 100 | /** 101 | * 设置:商品类型 102 | */ 103 | 104 | public void setShangpinleixing(String shangpinleixing) { 105 | this.shangpinleixing = shangpinleixing; 106 | } 107 | 108 | /** 109 | * 获取:商品类型 110 | */ 111 | public String getShangpinleixing() { 112 | return shangpinleixing; 113 | } 114 | 115 | 116 | /** 117 | * 设置:商品品牌 118 | */ 119 | 120 | public void setShangpinpinpai(String shangpinpinpai) { 121 | this.shangpinpinpai = shangpinpinpai; 122 | } 123 | 124 | /** 125 | * 获取:商品品牌 126 | */ 127 | public String getShangpinpinpai() { 128 | return shangpinpinpai; 129 | } 130 | 131 | 132 | /** 133 | * 设置:好评数 134 | */ 135 | 136 | public void setHaopingshu(Integer haopingshu) { 137 | this.haopingshu = haopingshu; 138 | } 139 | 140 | /** 141 | * 获取:好评数 142 | */ 143 | public Integer getHaopingshu() { 144 | return haopingshu; 145 | } 146 | 147 | 148 | /** 149 | * 设置:差评数 150 | */ 151 | 152 | public void setChapingshu(Integer chapingshu) { 153 | this.chapingshu = chapingshu; 154 | } 155 | 156 | /** 157 | * 获取:差评数 158 | */ 159 | public Integer getChapingshu() { 160 | return chapingshu; 161 | } 162 | 163 | 164 | /** 165 | * 设置:总评论数 166 | */ 167 | 168 | public void setZongpinglunshu(Integer zongpinglunshu) { 169 | this.zongpinglunshu = zongpinglunshu; 170 | } 171 | 172 | /** 173 | * 获取:总评论数 174 | */ 175 | public Integer getZongpinglunshu() { 176 | return zongpinglunshu; 177 | } 178 | 179 | } 180 | -------------------------------------------------------------------------------- /src/main/java/com/entity/model/ZhinengjiajuModel.java: -------------------------------------------------------------------------------- 1 | package com.entity.model; 2 | 3 | import com.entity.ZhinengjiajuEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import java.util.Date; 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import com.fasterxml.jackson.annotation.JsonFormat; 10 | import java.io.Serializable; 11 | 12 | 13 | /** 14 | * 智能家居 15 | * 接收传参的实体类 16 | *(实际开发中配合移动端接口开发手动去掉些没用的字段, 后端一般用entity就够用了) 17 | * 取自ModelAndView 的model名称 18 | * @author 19 | * @email 20 | * @date 2023-05-05 15:46:46 21 | */ 22 | public class ZhinengjiajuModel implements Serializable { 23 | private static final long serialVersionUID = 1L; 24 | 25 | 26 | /** 27 | * 商品价格 28 | */ 29 | 30 | private Integer shangpinjiage; 31 | 32 | /** 33 | * 商品图片 34 | */ 35 | 36 | private String shangpintupian; 37 | 38 | /** 39 | * 商品类型 40 | */ 41 | 42 | private String shangpinleixing; 43 | 44 | /** 45 | * 商品品牌 46 | */ 47 | 48 | private String shangpinpinpai; 49 | 50 | /** 51 | * 好评数 52 | */ 53 | 54 | private Integer haopingshu; 55 | 56 | /** 57 | * 差评数 58 | */ 59 | 60 | private Integer chapingshu; 61 | 62 | /** 63 | * 总评论数 64 | */ 65 | 66 | private Integer zongpinglunshu; 67 | 68 | 69 | /** 70 | * 设置:商品价格 71 | */ 72 | 73 | public void setShangpinjiage(Integer shangpinjiage) { 74 | this.shangpinjiage = shangpinjiage; 75 | } 76 | 77 | /** 78 | * 获取:商品价格 79 | */ 80 | public Integer getShangpinjiage() { 81 | return shangpinjiage; 82 | } 83 | 84 | 85 | /** 86 | * 设置:商品图片 87 | */ 88 | 89 | public void setShangpintupian(String shangpintupian) { 90 | this.shangpintupian = shangpintupian; 91 | } 92 | 93 | /** 94 | * 获取:商品图片 95 | */ 96 | public String getShangpintupian() { 97 | return shangpintupian; 98 | } 99 | 100 | 101 | /** 102 | * 设置:商品类型 103 | */ 104 | 105 | public void setShangpinleixing(String shangpinleixing) { 106 | this.shangpinleixing = shangpinleixing; 107 | } 108 | 109 | /** 110 | * 获取:商品类型 111 | */ 112 | public String getShangpinleixing() { 113 | return shangpinleixing; 114 | } 115 | 116 | 117 | /** 118 | * 设置:商品品牌 119 | */ 120 | 121 | public void setShangpinpinpai(String shangpinpinpai) { 122 | this.shangpinpinpai = shangpinpinpai; 123 | } 124 | 125 | /** 126 | * 获取:商品品牌 127 | */ 128 | public String getShangpinpinpai() { 129 | return shangpinpinpai; 130 | } 131 | 132 | 133 | /** 134 | * 设置:好评数 135 | */ 136 | 137 | public void setHaopingshu(Integer haopingshu) { 138 | this.haopingshu = haopingshu; 139 | } 140 | 141 | /** 142 | * 获取:好评数 143 | */ 144 | public Integer getHaopingshu() { 145 | return haopingshu; 146 | } 147 | 148 | 149 | /** 150 | * 设置:差评数 151 | */ 152 | 153 | public void setChapingshu(Integer chapingshu) { 154 | this.chapingshu = chapingshu; 155 | } 156 | 157 | /** 158 | * 获取:差评数 159 | */ 160 | public Integer getChapingshu() { 161 | return chapingshu; 162 | } 163 | 164 | 165 | /** 166 | * 设置:总评论数 167 | */ 168 | 169 | public void setZongpinglunshu(Integer zongpinglunshu) { 170 | this.zongpinglunshu = zongpinglunshu; 171 | } 172 | 173 | /** 174 | * 获取:总评论数 175 | */ 176 | public Integer getZongpinglunshu() { 177 | return zongpinglunshu; 178 | } 179 | 180 | } 181 | -------------------------------------------------------------------------------- /src/main/resources/mapper/BingxiangxinxiDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 27 | 28 | 33 | 34 | 40 | 41 | 45 | 46 | 47 | 53 | 54 | 71 | 72 | 78 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /src/main/java/com/entity/YonghuEntity.java: -------------------------------------------------------------------------------- 1 | package com.entity; 2 | 3 | import com.baomidou.mybatisplus.annotations.TableId; 4 | import com.baomidou.mybatisplus.annotations.TableName; 5 | import javax.validation.constraints.NotBlank; 6 | import javax.validation.constraints.NotEmpty; 7 | import javax.validation.constraints.NotNull; 8 | 9 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 10 | import java.lang.reflect.InvocationTargetException; 11 | 12 | import java.io.Serializable; 13 | import java.util.Date; 14 | import java.util.List; 15 | 16 | import org.springframework.format.annotation.DateTimeFormat; 17 | import com.fasterxml.jackson.annotation.JsonFormat; 18 | import org.apache.commons.beanutils.BeanUtils; 19 | import com.baomidou.mybatisplus.annotations.TableField; 20 | import com.baomidou.mybatisplus.enums.FieldFill; 21 | import com.baomidou.mybatisplus.enums.IdType; 22 | 23 | 24 | /** 25 | * 用户 26 | * 数据库通用操作实体类(普通增删改查) 27 | * @author 28 | * @email 29 | * @date 2023-05-05 15:46:46 30 | */ 31 | @TableName("yonghu") 32 | public class YonghuEntity implements Serializable { 33 | private static final long serialVersionUID = 1L; 34 | 35 | 36 | public YonghuEntity() { 37 | 38 | } 39 | 40 | public YonghuEntity(T t) { 41 | try { 42 | BeanUtils.copyProperties(this, t); 43 | } catch (IllegalAccessException | InvocationTargetException e) { 44 | // TODO Auto-generated catch block 45 | e.printStackTrace(); 46 | } 47 | } 48 | 49 | /** 50 | * 主键id 51 | */ 52 | @TableId 53 | private Long id; 54 | /** 55 | * 账号 56 | */ 57 | 58 | private String zhanghao; 59 | 60 | /** 61 | * 密码 62 | */ 63 | 64 | private String mima; 65 | 66 | /** 67 | * 姓名 68 | */ 69 | 70 | private String xingming; 71 | 72 | /** 73 | * 性别 74 | */ 75 | 76 | private String xingbie; 77 | 78 | /** 79 | * 手机 80 | */ 81 | 82 | private String shouji; 83 | 84 | 85 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 86 | @DateTimeFormat 87 | private Date addtime; 88 | 89 | public Date getAddtime() { 90 | return addtime; 91 | } 92 | public void setAddtime(Date addtime) { 93 | this.addtime = addtime; 94 | } 95 | 96 | public Long getId() { 97 | return id; 98 | } 99 | 100 | public void setId(Long id) { 101 | this.id = id; 102 | } 103 | /** 104 | * 设置:账号 105 | */ 106 | public void setZhanghao(String zhanghao) { 107 | this.zhanghao = zhanghao; 108 | } 109 | /** 110 | * 获取:账号 111 | */ 112 | public String getZhanghao() { 113 | return zhanghao; 114 | } 115 | /** 116 | * 设置:密码 117 | */ 118 | public void setMima(String mima) { 119 | this.mima = mima; 120 | } 121 | /** 122 | * 获取:密码 123 | */ 124 | public String getMima() { 125 | return mima; 126 | } 127 | /** 128 | * 设置:姓名 129 | */ 130 | public void setXingming(String xingming) { 131 | this.xingming = xingming; 132 | } 133 | /** 134 | * 获取:姓名 135 | */ 136 | public String getXingming() { 137 | return xingming; 138 | } 139 | /** 140 | * 设置:性别 141 | */ 142 | public void setXingbie(String xingbie) { 143 | this.xingbie = xingbie; 144 | } 145 | /** 146 | * 获取:性别 147 | */ 148 | public String getXingbie() { 149 | return xingbie; 150 | } 151 | /** 152 | * 设置:手机 153 | */ 154 | public void setShouji(String shouji) { 155 | this.shouji = shouji; 156 | } 157 | /** 158 | * 获取:手机 159 | */ 160 | public String getShouji() { 161 | return shouji; 162 | } 163 | 164 | } 165 | -------------------------------------------------------------------------------- /src/main/java/com/interceptor/AuthorizationInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.interceptor; 2 | 3 | import java.io.IOException; 4 | import java.io.PrintWriter; 5 | import java.util.HashMap; 6 | import java.util.Map; 7 | import com.alibaba.fastjson.JSONObject; 8 | import javax.servlet.http.HttpServletRequest; 9 | import javax.servlet.http.HttpServletResponse; 10 | 11 | import org.apache.commons.lang3.StringUtils; 12 | import org.springframework.beans.factory.annotation.Autowired; 13 | import org.springframework.stereotype.Component; 14 | import org.springframework.web.method.HandlerMethod; 15 | import org.springframework.web.servlet.HandlerInterceptor; 16 | import org.springframework.web.bind.annotation.RequestMethod; 17 | import org.springframework.http.HttpStatus; 18 | 19 | import com.annotation.IgnoreAuth; 20 | import com.entity.EIException; 21 | import com.entity.TokenEntity; 22 | import com.service.TokenService; 23 | import com.utils.R; 24 | 25 | /** 26 | * 权限(Token)验证 27 | */ 28 | @Component 29 | public class AuthorizationInterceptor implements HandlerInterceptor { 30 | 31 | public static final String LOGIN_TOKEN_KEY = "Token"; 32 | 33 | @Autowired 34 | private TokenService tokenService; 35 | 36 | @Override 37 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { 38 | 39 | //支持跨域请求 40 | response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); 41 | response.setHeader("Access-Control-Max-Age", "3600"); 42 | response.setHeader("Access-Control-Allow-Credentials", "true"); 43 | response.setHeader("Access-Control-Allow-Headers", "x-requested-with,request-source,Token, Origin,imgType, Content-Type, cache-control,postman-token,Cookie, Accept,authorization"); 44 | response.setHeader("Access-Control-Allow-Origin", request.getHeader("Origin")); 45 | // 跨域时会首先发送一个OPTIONS请求,这里我们给OPTIONS请求直接返回正常状态 46 | if (request.getMethod().equals(RequestMethod.OPTIONS.name())) { 47 | response.setStatus(HttpStatus.OK.value()); 48 | return false; 49 | } 50 | 51 | IgnoreAuth annotation; 52 | if (handler instanceof HandlerMethod) { 53 | annotation = ((HandlerMethod) handler).getMethodAnnotation(IgnoreAuth.class); 54 | } else { 55 | return true; 56 | } 57 | 58 | //从header中获取token 59 | String token = request.getHeader(LOGIN_TOKEN_KEY); 60 | 61 | /** 62 | * 不需要验证权限的方法直接放过 63 | */ 64 | if(annotation!=null) { 65 | return true; 66 | } 67 | 68 | TokenEntity tokenEntity = null; 69 | if(StringUtils.isNotBlank(token)) { 70 | tokenEntity = tokenService.getTokenEntity(token); 71 | } 72 | 73 | if(tokenEntity != null) { 74 | request.getSession().setAttribute("userId", tokenEntity.getUserid()); 75 | request.getSession().setAttribute("role", tokenEntity.getRole()); 76 | request.getSession().setAttribute("tableName", tokenEntity.getTablename()); 77 | request.getSession().setAttribute("username", tokenEntity.getUsername()); 78 | return true; 79 | } 80 | 81 | PrintWriter writer = null; 82 | response.setCharacterEncoding("UTF-8"); 83 | response.setContentType("application/json; charset=utf-8"); 84 | try { 85 | writer = response.getWriter(); 86 | writer.print(JSONObject.toJSONString(R.error(401, "请先登录"))); 87 | } finally { 88 | if(writer != null){ 89 | writer.close(); 90 | } 91 | } 92 | // throw new EIException("请先登录", 401); 93 | return false; 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /src/main/java/com/controller/ConfigController.java: -------------------------------------------------------------------------------- 1 | 2 | package com.controller; 3 | 4 | 5 | import java.util.Arrays; 6 | import java.util.Map; 7 | 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.web.bind.annotation.PathVariable; 10 | import org.springframework.web.bind.annotation.PostMapping; 11 | import org.springframework.web.bind.annotation.RequestBody; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | import org.springframework.web.bind.annotation.RequestParam; 14 | import org.springframework.web.bind.annotation.RestController; 15 | 16 | import com.annotation.IgnoreAuth; 17 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 18 | import com.entity.ConfigEntity; 19 | import com.service.ConfigService; 20 | import com.utils.MPUtil; 21 | import com.utils.PageUtils; 22 | import com.utils.R; 23 | import com.utils.ValidatorUtils; 24 | 25 | /** 26 | * 登录相关 27 | */ 28 | @RequestMapping("config") 29 | @RestController 30 | public class ConfigController{ 31 | 32 | @Autowired 33 | private ConfigService configService; 34 | 35 | /** 36 | * 列表 37 | */ 38 | @RequestMapping("/page") 39 | public R page(@RequestParam Map params,ConfigEntity config){ 40 | EntityWrapper ew = new EntityWrapper(); 41 | PageUtils page = configService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, config), params), params)); 42 | return R.ok().put("data", page); 43 | } 44 | 45 | /** 46 | * 列表 47 | */ 48 | @IgnoreAuth 49 | @RequestMapping("/list") 50 | public R list(@RequestParam Map params,ConfigEntity config){ 51 | EntityWrapper ew = new EntityWrapper(); 52 | PageUtils page = configService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, config), params), params)); 53 | return R.ok().put("data", page); 54 | } 55 | 56 | /** 57 | * 信息 58 | */ 59 | @RequestMapping("/info/{id}") 60 | public R info(@PathVariable("id") String id){ 61 | ConfigEntity config = configService.selectById(id); 62 | return R.ok().put("data", config); 63 | } 64 | 65 | /** 66 | * 详情 67 | */ 68 | @IgnoreAuth 69 | @RequestMapping("/detail/{id}") 70 | public R detail(@PathVariable("id") String id){ 71 | ConfigEntity config = configService.selectById(id); 72 | return R.ok().put("data", config); 73 | } 74 | 75 | /** 76 | * 根据name获取信息 77 | */ 78 | @RequestMapping("/info") 79 | public R infoByName(@RequestParam String name){ 80 | ConfigEntity config = configService.selectOne(new EntityWrapper().eq("name", "faceFile")); 81 | return R.ok().put("data", config); 82 | } 83 | 84 | /** 85 | * 保存 86 | */ 87 | @PostMapping("/save") 88 | public R save(@RequestBody ConfigEntity config){ 89 | // ValidatorUtils.validateEntity(config); 90 | configService.insert(config); 91 | return R.ok(); 92 | } 93 | 94 | /** 95 | * 修改 96 | */ 97 | @RequestMapping("/update") 98 | public R update(@RequestBody ConfigEntity config){ 99 | // ValidatorUtils.validateEntity(config); 100 | configService.updateById(config);//全部更新 101 | return R.ok(); 102 | } 103 | 104 | /** 105 | * 删除 106 | */ 107 | @RequestMapping("/delete") 108 | public R delete(@RequestBody Long[] ids){ 109 | configService.deleteBatchIds(Arrays.asList(ids)); 110 | return R.ok(); 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /src/main/java/com/entity/SystemintroEntity.java: -------------------------------------------------------------------------------- 1 | package com.entity; 2 | 3 | import com.baomidou.mybatisplus.annotations.TableId; 4 | import com.baomidou.mybatisplus.annotations.TableName; 5 | import javax.validation.constraints.NotBlank; 6 | import javax.validation.constraints.NotEmpty; 7 | import javax.validation.constraints.NotNull; 8 | 9 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 10 | import java.lang.reflect.InvocationTargetException; 11 | 12 | import java.io.Serializable; 13 | import java.util.Date; 14 | import java.util.List; 15 | 16 | import org.springframework.format.annotation.DateTimeFormat; 17 | import com.fasterxml.jackson.annotation.JsonFormat; 18 | import org.apache.commons.beanutils.BeanUtils; 19 | import com.baomidou.mybatisplus.annotations.TableField; 20 | import com.baomidou.mybatisplus.enums.FieldFill; 21 | import com.baomidou.mybatisplus.enums.IdType; 22 | 23 | 24 | /** 25 | * 关于我们 26 | * 数据库通用操作实体类(普通增删改查) 27 | * @author 28 | * @email 29 | * @date 2023-05-05 15:46:46 30 | */ 31 | @TableName("systemintro") 32 | public class SystemintroEntity implements Serializable { 33 | private static final long serialVersionUID = 1L; 34 | 35 | 36 | public SystemintroEntity() { 37 | 38 | } 39 | 40 | public SystemintroEntity(T t) { 41 | try { 42 | BeanUtils.copyProperties(this, t); 43 | } catch (IllegalAccessException | InvocationTargetException e) { 44 | // TODO Auto-generated catch block 45 | e.printStackTrace(); 46 | } 47 | } 48 | 49 | /** 50 | * 主键id 51 | */ 52 | @TableId 53 | private Long id; 54 | /** 55 | * 标题 56 | */ 57 | 58 | private String title; 59 | 60 | /** 61 | * 副标题 62 | */ 63 | 64 | private String subtitle; 65 | 66 | /** 67 | * 内容 68 | */ 69 | 70 | private String content; 71 | 72 | /** 73 | * 图片1 74 | */ 75 | 76 | private String picture1; 77 | 78 | /** 79 | * 图片2 80 | */ 81 | 82 | private String picture2; 83 | 84 | /** 85 | * 图片3 86 | */ 87 | 88 | private String picture3; 89 | 90 | 91 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 92 | @DateTimeFormat 93 | private Date addtime; 94 | 95 | public Date getAddtime() { 96 | return addtime; 97 | } 98 | public void setAddtime(Date addtime) { 99 | this.addtime = addtime; 100 | } 101 | 102 | public Long getId() { 103 | return id; 104 | } 105 | 106 | public void setId(Long id) { 107 | this.id = id; 108 | } 109 | /** 110 | * 设置:标题 111 | */ 112 | public void setTitle(String title) { 113 | this.title = title; 114 | } 115 | /** 116 | * 获取:标题 117 | */ 118 | public String getTitle() { 119 | return title; 120 | } 121 | /** 122 | * 设置:副标题 123 | */ 124 | public void setSubtitle(String subtitle) { 125 | this.subtitle = subtitle; 126 | } 127 | /** 128 | * 获取:副标题 129 | */ 130 | public String getSubtitle() { 131 | return subtitle; 132 | } 133 | /** 134 | * 设置:内容 135 | */ 136 | public void setContent(String content) { 137 | this.content = content; 138 | } 139 | /** 140 | * 获取:内容 141 | */ 142 | public String getContent() { 143 | return content; 144 | } 145 | /** 146 | * 设置:图片1 147 | */ 148 | public void setPicture1(String picture1) { 149 | this.picture1 = picture1; 150 | } 151 | /** 152 | * 获取:图片1 153 | */ 154 | public String getPicture1() { 155 | return picture1; 156 | } 157 | /** 158 | * 设置:图片2 159 | */ 160 | public void setPicture2(String picture2) { 161 | this.picture2 = picture2; 162 | } 163 | /** 164 | * 获取:图片2 165 | */ 166 | public String getPicture2() { 167 | return picture2; 168 | } 169 | /** 170 | * 设置:图片3 171 | */ 172 | public void setPicture3(String picture3) { 173 | this.picture3 = picture3; 174 | } 175 | /** 176 | * 获取:图片3 177 | */ 178 | public String getPicture3() { 179 | return picture3; 180 | } 181 | 182 | } 183 | -------------------------------------------------------------------------------- /src/main/java/com/entity/DiscusszhinengjiajuEntity.java: -------------------------------------------------------------------------------- 1 | package com.entity; 2 | 3 | import com.baomidou.mybatisplus.annotations.TableId; 4 | import com.baomidou.mybatisplus.annotations.TableName; 5 | import javax.validation.constraints.NotBlank; 6 | import javax.validation.constraints.NotEmpty; 7 | import javax.validation.constraints.NotNull; 8 | 9 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 10 | import java.lang.reflect.InvocationTargetException; 11 | 12 | import java.io.Serializable; 13 | import java.util.Date; 14 | import java.util.List; 15 | 16 | import org.springframework.format.annotation.DateTimeFormat; 17 | import com.fasterxml.jackson.annotation.JsonFormat; 18 | import org.apache.commons.beanutils.BeanUtils; 19 | import com.baomidou.mybatisplus.annotations.TableField; 20 | import com.baomidou.mybatisplus.enums.FieldFill; 21 | import com.baomidou.mybatisplus.enums.IdType; 22 | 23 | 24 | /** 25 | * 智能家居评论表 26 | * 数据库通用操作实体类(普通增删改查) 27 | * @author 28 | * @email 29 | * @date 2023-05-05 15:46:47 30 | */ 31 | @TableName("discusszhinengjiaju") 32 | public class DiscusszhinengjiajuEntity implements Serializable { 33 | private static final long serialVersionUID = 1L; 34 | 35 | 36 | public DiscusszhinengjiajuEntity() { 37 | 38 | } 39 | 40 | public DiscusszhinengjiajuEntity(T t) { 41 | try { 42 | BeanUtils.copyProperties(this, t); 43 | } catch (IllegalAccessException | InvocationTargetException e) { 44 | // TODO Auto-generated catch block 45 | e.printStackTrace(); 46 | } 47 | } 48 | 49 | /** 50 | * 主键id 51 | */ 52 | @TableId 53 | private Long id; 54 | /** 55 | * 关联表id 56 | */ 57 | 58 | private Long refid; 59 | 60 | /** 61 | * 用户id 62 | */ 63 | 64 | private Long userid; 65 | 66 | /** 67 | * 头像 68 | */ 69 | 70 | private String avatarurl; 71 | 72 | /** 73 | * 用户名 74 | */ 75 | 76 | private String nickname; 77 | 78 | /** 79 | * 评论内容 80 | */ 81 | 82 | private String content; 83 | 84 | /** 85 | * 回复内容 86 | */ 87 | 88 | private String reply; 89 | 90 | 91 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 92 | @DateTimeFormat 93 | private Date addtime; 94 | 95 | public Date getAddtime() { 96 | return addtime; 97 | } 98 | public void setAddtime(Date addtime) { 99 | this.addtime = addtime; 100 | } 101 | 102 | public Long getId() { 103 | return id; 104 | } 105 | 106 | public void setId(Long id) { 107 | this.id = id; 108 | } 109 | /** 110 | * 设置:关联表id 111 | */ 112 | public void setRefid(Long refid) { 113 | this.refid = refid; 114 | } 115 | /** 116 | * 获取:关联表id 117 | */ 118 | public Long getRefid() { 119 | return refid; 120 | } 121 | /** 122 | * 设置:用户id 123 | */ 124 | public void setUserid(Long userid) { 125 | this.userid = userid; 126 | } 127 | /** 128 | * 获取:用户id 129 | */ 130 | public Long getUserid() { 131 | return userid; 132 | } 133 | /** 134 | * 设置:头像 135 | */ 136 | public void setAvatarurl(String avatarurl) { 137 | this.avatarurl = avatarurl; 138 | } 139 | /** 140 | * 获取:头像 141 | */ 142 | public String getAvatarurl() { 143 | return avatarurl; 144 | } 145 | /** 146 | * 设置:用户名 147 | */ 148 | public void setNickname(String nickname) { 149 | this.nickname = nickname; 150 | } 151 | /** 152 | * 获取:用户名 153 | */ 154 | public String getNickname() { 155 | return nickname; 156 | } 157 | /** 158 | * 设置:评论内容 159 | */ 160 | public void setContent(String content) { 161 | this.content = content; 162 | } 163 | /** 164 | * 获取:评论内容 165 | */ 166 | public String getContent() { 167 | return content; 168 | } 169 | /** 170 | * 设置:回复内容 171 | */ 172 | public void setReply(String reply) { 173 | this.reply = reply; 174 | } 175 | /** 176 | * 获取:回复内容 177 | */ 178 | public String getReply() { 179 | return reply; 180 | } 181 | 182 | } 183 | -------------------------------------------------------------------------------- /src/main/java/com/entity/DiscussbingxiangxinxiEntity.java: -------------------------------------------------------------------------------- 1 | package com.entity; 2 | 3 | import com.baomidou.mybatisplus.annotations.TableId; 4 | import com.baomidou.mybatisplus.annotations.TableName; 5 | import javax.validation.constraints.NotBlank; 6 | import javax.validation.constraints.NotEmpty; 7 | import javax.validation.constraints.NotNull; 8 | 9 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 10 | import java.lang.reflect.InvocationTargetException; 11 | 12 | import java.io.Serializable; 13 | import java.util.Date; 14 | import java.util.List; 15 | 16 | import org.springframework.format.annotation.DateTimeFormat; 17 | import com.fasterxml.jackson.annotation.JsonFormat; 18 | import org.apache.commons.beanutils.BeanUtils; 19 | import com.baomidou.mybatisplus.annotations.TableField; 20 | import com.baomidou.mybatisplus.enums.FieldFill; 21 | import com.baomidou.mybatisplus.enums.IdType; 22 | 23 | 24 | /** 25 | * bingxiangxinxi评论表 26 | * 数据库通用操作实体类(普通增删改查) 27 | * @author 28 | * @email 29 | * @date 2023-05-05 15:46:47 30 | */ 31 | @TableName("discussbingxiangxinxi") 32 | public class DiscussbingxiangxinxiEntity implements Serializable { 33 | private static final long serialVersionUID = 1L; 34 | 35 | 36 | public DiscussbingxiangxinxiEntity() { 37 | 38 | } 39 | 40 | public DiscussbingxiangxinxiEntity(T t) { 41 | try { 42 | BeanUtils.copyProperties(this, t); 43 | } catch (IllegalAccessException | InvocationTargetException e) { 44 | // TODO Auto-generated catch block 45 | e.printStackTrace(); 46 | } 47 | } 48 | 49 | /** 50 | * 主键id 51 | */ 52 | @TableId 53 | private Long id; 54 | /** 55 | * 关联表id 56 | */ 57 | 58 | private Long refid; 59 | 60 | /** 61 | * 用户id 62 | */ 63 | 64 | private Long userid; 65 | 66 | /** 67 | * 头像 68 | */ 69 | 70 | private String avatarurl; 71 | 72 | /** 73 | * 用户名 74 | */ 75 | 76 | private String nickname; 77 | 78 | /** 79 | * 评论内容 80 | */ 81 | 82 | private String content; 83 | 84 | /** 85 | * 回复内容 86 | */ 87 | 88 | private String reply; 89 | 90 | 91 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 92 | @DateTimeFormat 93 | private Date addtime; 94 | 95 | public Date getAddtime() { 96 | return addtime; 97 | } 98 | public void setAddtime(Date addtime) { 99 | this.addtime = addtime; 100 | } 101 | 102 | public Long getId() { 103 | return id; 104 | } 105 | 106 | public void setId(Long id) { 107 | this.id = id; 108 | } 109 | /** 110 | * 设置:关联表id 111 | */ 112 | public void setRefid(Long refid) { 113 | this.refid = refid; 114 | } 115 | /** 116 | * 获取:关联表id 117 | */ 118 | public Long getRefid() { 119 | return refid; 120 | } 121 | /** 122 | * 设置:用户id 123 | */ 124 | public void setUserid(Long userid) { 125 | this.userid = userid; 126 | } 127 | /** 128 | * 获取:用户id 129 | */ 130 | public Long getUserid() { 131 | return userid; 132 | } 133 | /** 134 | * 设置:头像 135 | */ 136 | public void setAvatarurl(String avatarurl) { 137 | this.avatarurl = avatarurl; 138 | } 139 | /** 140 | * 获取:头像 141 | */ 142 | public String getAvatarurl() { 143 | return avatarurl; 144 | } 145 | /** 146 | * 设置:用户名 147 | */ 148 | public void setNickname(String nickname) { 149 | this.nickname = nickname; 150 | } 151 | /** 152 | * 获取:用户名 153 | */ 154 | public String getNickname() { 155 | return nickname; 156 | } 157 | /** 158 | * 设置:评论内容 159 | */ 160 | public void setContent(String content) { 161 | this.content = content; 162 | } 163 | /** 164 | * 获取:评论内容 165 | */ 166 | public String getContent() { 167 | return content; 168 | } 169 | /** 170 | * 设置:回复内容 171 | */ 172 | public void setReply(String reply) { 173 | this.reply = reply; 174 | } 175 | /** 176 | * 获取:回复内容 177 | */ 178 | public String getReply() { 179 | return reply; 180 | } 181 | 182 | } 183 | -------------------------------------------------------------------------------- /src/main/java/com/entity/vo/BingxiangxinxiVO.java: -------------------------------------------------------------------------------- 1 | package com.entity.vo; 2 | 3 | import com.entity.BingxiangxinxiEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import java.util.Date; 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import com.fasterxml.jackson.annotation.JsonFormat; 10 | import java.io.Serializable; 11 | 12 | 13 | /** 14 | * 冰箱信息 15 | * 手机端接口返回实体辅助类 16 | * (主要作用去除一些不必要的字段) 17 | * @author 18 | * @email 19 | * @date 2023-05-05 15:46:46 20 | */ 21 | public class BingxiangxinxiVO implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | 25 | /** 26 | * 封面 27 | */ 28 | 29 | private String fengmian; 30 | 31 | /** 32 | * 标题 33 | */ 34 | 35 | private String biaoti; 36 | 37 | /** 38 | * 价格 39 | */ 40 | 41 | private Float jiage; 42 | 43 | /** 44 | * 品牌 45 | */ 46 | 47 | private String pinpai; 48 | 49 | /** 50 | * 商品名称 51 | */ 52 | 53 | private String spmc; 54 | 55 | /** 56 | * 商品产地 57 | */ 58 | 59 | private String spcd; 60 | 61 | /** 62 | * 能效等级 63 | */ 64 | 65 | private String nxdj; 66 | 67 | /** 68 | * 门款式 69 | */ 70 | 71 | private String mks; 72 | 73 | /** 74 | * 制冷方式 75 | */ 76 | 77 | private String zlfs; 78 | 79 | /** 80 | * 主色系 81 | */ 82 | 83 | private String zhusexi; 84 | 85 | /** 86 | * 最近点击时间 87 | */ 88 | 89 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 90 | @DateTimeFormat 91 | private Date clicktime; 92 | 93 | 94 | /** 95 | * 设置:封面 96 | */ 97 | 98 | public void setFengmian(String fengmian) { 99 | this.fengmian = fengmian; 100 | } 101 | 102 | /** 103 | * 获取:封面 104 | */ 105 | public String getFengmian() { 106 | return fengmian; 107 | } 108 | 109 | 110 | /** 111 | * 设置:标题 112 | */ 113 | 114 | public void setBiaoti(String biaoti) { 115 | this.biaoti = biaoti; 116 | } 117 | 118 | /** 119 | * 获取:标题 120 | */ 121 | public String getBiaoti() { 122 | return biaoti; 123 | } 124 | 125 | 126 | /** 127 | * 设置:价格 128 | */ 129 | 130 | public void setJiage(Float jiage) { 131 | this.jiage = jiage; 132 | } 133 | 134 | /** 135 | * 获取:价格 136 | */ 137 | public Float getJiage() { 138 | return jiage; 139 | } 140 | 141 | 142 | /** 143 | * 设置:品牌 144 | */ 145 | 146 | public void setPinpai(String pinpai) { 147 | this.pinpai = pinpai; 148 | } 149 | 150 | /** 151 | * 获取:品牌 152 | */ 153 | public String getPinpai() { 154 | return pinpai; 155 | } 156 | 157 | 158 | /** 159 | * 设置:商品名称 160 | */ 161 | 162 | public void setSpmc(String spmc) { 163 | this.spmc = spmc; 164 | } 165 | 166 | /** 167 | * 获取:商品名称 168 | */ 169 | public String getSpmc() { 170 | return spmc; 171 | } 172 | 173 | 174 | /** 175 | * 设置:商品产地 176 | */ 177 | 178 | public void setSpcd(String spcd) { 179 | this.spcd = spcd; 180 | } 181 | 182 | /** 183 | * 获取:商品产地 184 | */ 185 | public String getSpcd() { 186 | return spcd; 187 | } 188 | 189 | 190 | /** 191 | * 设置:能效等级 192 | */ 193 | 194 | public void setNxdj(String nxdj) { 195 | this.nxdj = nxdj; 196 | } 197 | 198 | /** 199 | * 获取:能效等级 200 | */ 201 | public String getNxdj() { 202 | return nxdj; 203 | } 204 | 205 | 206 | /** 207 | * 设置:门款式 208 | */ 209 | 210 | public void setMks(String mks) { 211 | this.mks = mks; 212 | } 213 | 214 | /** 215 | * 获取:门款式 216 | */ 217 | public String getMks() { 218 | return mks; 219 | } 220 | 221 | 222 | /** 223 | * 设置:制冷方式 224 | */ 225 | 226 | public void setZlfs(String zlfs) { 227 | this.zlfs = zlfs; 228 | } 229 | 230 | /** 231 | * 获取:制冷方式 232 | */ 233 | public String getZlfs() { 234 | return zlfs; 235 | } 236 | 237 | 238 | /** 239 | * 设置:主色系 240 | */ 241 | 242 | public void setZhusexi(String zhusexi) { 243 | this.zhusexi = zhusexi; 244 | } 245 | 246 | /** 247 | * 获取:主色系 248 | */ 249 | public String getZhusexi() { 250 | return zhusexi; 251 | } 252 | 253 | 254 | /** 255 | * 设置:最近点击时间 256 | */ 257 | 258 | public void setClicktime(Date clicktime) { 259 | this.clicktime = clicktime; 260 | } 261 | 262 | /** 263 | * 获取:最近点击时间 264 | */ 265 | public Date getClicktime() { 266 | return clicktime; 267 | } 268 | 269 | } 270 | -------------------------------------------------------------------------------- /src/main/java/com/controller/FileController.java: -------------------------------------------------------------------------------- 1 | package com.controller; 2 | 3 | import java.io.File; 4 | import java.io.FileNotFoundException; 5 | import java.io.IOException; 6 | import java.util.Arrays; 7 | import java.util.Date; 8 | import java.util.HashMap; 9 | import java.util.List; 10 | import java.util.Map; 11 | import java.util.Random; 12 | import java.util.UUID; 13 | 14 | import org.apache.commons.io.FileUtils; 15 | import org.apache.commons.lang3.StringUtils; 16 | import org.springframework.beans.factory.annotation.Autowired; 17 | import org.springframework.http.HttpHeaders; 18 | import org.springframework.http.HttpStatus; 19 | import org.springframework.http.MediaType; 20 | import org.springframework.http.ResponseEntity; 21 | import org.springframework.util.ResourceUtils; 22 | import org.springframework.web.bind.annotation.PathVariable; 23 | import org.springframework.web.bind.annotation.RequestBody; 24 | import org.springframework.web.bind.annotation.RequestMapping; 25 | import org.springframework.web.bind.annotation.RequestParam; 26 | import org.springframework.web.bind.annotation.RestController; 27 | import org.springframework.web.multipart.MultipartFile; 28 | 29 | import com.annotation.IgnoreAuth; 30 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 31 | import com.entity.ConfigEntity; 32 | import com.entity.EIException; 33 | import com.service.ConfigService; 34 | import com.utils.R; 35 | import com.utils.HadoopTemplate; 36 | 37 | /** 38 | * 上传文件映射表 39 | */ 40 | @RestController 41 | @RequestMapping("file") 42 | @SuppressWarnings({"unchecked","rawtypes"}) 43 | public class FileController{ 44 | @Autowired 45 | private ConfigService configService; 46 | @Autowired 47 | private HadoopTemplate hadoopTemplate; 48 | /** 49 | * 上传文件 50 | */ 51 | @RequestMapping("/upload") 52 | @IgnoreAuth 53 | public R upload(@RequestParam("file") MultipartFile file,String type) throws Exception { 54 | if (file.isEmpty()) { 55 | throw new EIException("上传文件不能为空"); 56 | } 57 | String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1); 58 | File path = new File(ResourceUtils.getURL("classpath:static").getPath()); 59 | if(!path.exists()) { 60 | path = new File(""); 61 | } 62 | File upload = new File(path.getAbsolutePath(),"/upload/"); 63 | if(!upload.exists()) { 64 | upload.mkdirs(); 65 | } 66 | String fileName = new Date().getTime()+"."+fileExt; 67 | if(StringUtils.isNotBlank(type) && type.contains("_template")) { 68 | fileName = type + "."+fileExt; 69 | new File(upload.getAbsolutePath()+"/"+fileName).deleteOnExit(); 70 | } 71 | File dest = new File(upload.getAbsolutePath()+"/"+fileName); 72 | file.transferTo(dest); 73 | //上传到hadoop HDFS 74 | hadoopTemplate.uploadFile(dest.getAbsolutePath()); 75 | /** 76 | * 如果使用idea或者eclipse重启项目,发现之前上传的图片或者文件丢失,将下面一行代码注释打开 77 | * 请将以下的"D:\\springbootq33sd\\src\\main\\resources\\static\\upload"替换成你本地项目的upload路径, 78 | * 并且项目路径不能存在中文、空格等特殊字符 79 | */ 80 | // FileUtils.copyFile(dest, new File("D:\\springbootq33sd\\src\\main\\resources\\static\\upload"+"/"+fileName)); /**修改了路径以后请将该行最前面的//注释去掉**/ 81 | if(StringUtils.isNotBlank(type) && type.equals("1")) { 82 | ConfigEntity configEntity = configService.selectOne(new EntityWrapper().eq("name", "faceFile")); 83 | if(configEntity==null) { 84 | configEntity = new ConfigEntity(); 85 | configEntity.setName("faceFile"); 86 | configEntity.setValue(fileName); 87 | } else { 88 | configEntity.setValue(fileName); 89 | } 90 | configService.insertOrUpdate(configEntity); 91 | } 92 | return R.ok().put("file", fileName); 93 | } 94 | 95 | /** 96 | * 下载文件(从HDFS中获取) 97 | */ 98 | @IgnoreAuth 99 | @RequestMapping("/download") 100 | public ResponseEntity download(@RequestParam String fileName) { 101 | byte[] ioBuffer = hadoopTemplate.download(fileName); 102 | if(ioBuffer.length>0) { 103 | HttpHeaders headers = new HttpHeaders(); 104 | headers.setContentType(MediaType.APPLICATION_OCTET_STREAM); 105 | headers.setContentDispositionFormData("attachment", fileName); 106 | return new ResponseEntity(ioBuffer,headers, HttpStatus.CREATED); 107 | } 108 | return new ResponseEntity(HttpStatus.INTERNAL_SERVER_ERROR); 109 | } 110 | 111 | } 112 | -------------------------------------------------------------------------------- /src/main/java/com/entity/model/BingxiangxinxiModel.java: -------------------------------------------------------------------------------- 1 | package com.entity.model; 2 | 3 | import com.entity.BingxiangxinxiEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import java.util.Date; 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import com.fasterxml.jackson.annotation.JsonFormat; 10 | import java.io.Serializable; 11 | 12 | 13 | /** 14 | * 冰箱信息 15 | * 接收传参的实体类 16 | *(实际开发中配合移动端接口开发手动去掉些没用的字段, 后端一般用entity就够用了) 17 | * 取自ModelAndView 的model名称 18 | * @author 19 | * @email 20 | * @date 2023-05-05 15:46:46 21 | */ 22 | public class BingxiangxinxiModel implements Serializable { 23 | private static final long serialVersionUID = 1L; 24 | 25 | 26 | /** 27 | * 封面 28 | */ 29 | 30 | private String fengmian; 31 | 32 | /** 33 | * 标题 34 | */ 35 | 36 | private String biaoti; 37 | 38 | /** 39 | * 价格 40 | */ 41 | 42 | private Float jiage; 43 | 44 | /** 45 | * 品牌 46 | */ 47 | 48 | private String pinpai; 49 | 50 | /** 51 | * 商品名称 52 | */ 53 | 54 | private String spmc; 55 | 56 | /** 57 | * 商品产地 58 | */ 59 | 60 | private String spcd; 61 | 62 | /** 63 | * 能效等级 64 | */ 65 | 66 | private String nxdj; 67 | 68 | /** 69 | * 门款式 70 | */ 71 | 72 | private String mks; 73 | 74 | /** 75 | * 制冷方式 76 | */ 77 | 78 | private String zlfs; 79 | 80 | /** 81 | * 主色系 82 | */ 83 | 84 | private String zhusexi; 85 | 86 | /** 87 | * 最近点击时间 88 | */ 89 | 90 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 91 | @DateTimeFormat 92 | private Date clicktime; 93 | 94 | 95 | /** 96 | * 设置:封面 97 | */ 98 | 99 | public void setFengmian(String fengmian) { 100 | this.fengmian = fengmian; 101 | } 102 | 103 | /** 104 | * 获取:封面 105 | */ 106 | public String getFengmian() { 107 | return fengmian; 108 | } 109 | 110 | 111 | /** 112 | * 设置:标题 113 | */ 114 | 115 | public void setBiaoti(String biaoti) { 116 | this.biaoti = biaoti; 117 | } 118 | 119 | /** 120 | * 获取:标题 121 | */ 122 | public String getBiaoti() { 123 | return biaoti; 124 | } 125 | 126 | 127 | /** 128 | * 设置:价格 129 | */ 130 | 131 | public void setJiage(Float jiage) { 132 | this.jiage = jiage; 133 | } 134 | 135 | /** 136 | * 获取:价格 137 | */ 138 | public Float getJiage() { 139 | return jiage; 140 | } 141 | 142 | 143 | /** 144 | * 设置:品牌 145 | */ 146 | 147 | public void setPinpai(String pinpai) { 148 | this.pinpai = pinpai; 149 | } 150 | 151 | /** 152 | * 获取:品牌 153 | */ 154 | public String getPinpai() { 155 | return pinpai; 156 | } 157 | 158 | 159 | /** 160 | * 设置:商品名称 161 | */ 162 | 163 | public void setSpmc(String spmc) { 164 | this.spmc = spmc; 165 | } 166 | 167 | /** 168 | * 获取:商品名称 169 | */ 170 | public String getSpmc() { 171 | return spmc; 172 | } 173 | 174 | 175 | /** 176 | * 设置:商品产地 177 | */ 178 | 179 | public void setSpcd(String spcd) { 180 | this.spcd = spcd; 181 | } 182 | 183 | /** 184 | * 获取:商品产地 185 | */ 186 | public String getSpcd() { 187 | return spcd; 188 | } 189 | 190 | 191 | /** 192 | * 设置:能效等级 193 | */ 194 | 195 | public void setNxdj(String nxdj) { 196 | this.nxdj = nxdj; 197 | } 198 | 199 | /** 200 | * 获取:能效等级 201 | */ 202 | public String getNxdj() { 203 | return nxdj; 204 | } 205 | 206 | 207 | /** 208 | * 设置:门款式 209 | */ 210 | 211 | public void setMks(String mks) { 212 | this.mks = mks; 213 | } 214 | 215 | /** 216 | * 获取:门款式 217 | */ 218 | public String getMks() { 219 | return mks; 220 | } 221 | 222 | 223 | /** 224 | * 设置:制冷方式 225 | */ 226 | 227 | public void setZlfs(String zlfs) { 228 | this.zlfs = zlfs; 229 | } 230 | 231 | /** 232 | * 获取:制冷方式 233 | */ 234 | public String getZlfs() { 235 | return zlfs; 236 | } 237 | 238 | 239 | /** 240 | * 设置:主色系 241 | */ 242 | 243 | public void setZhusexi(String zhusexi) { 244 | this.zhusexi = zhusexi; 245 | } 246 | 247 | /** 248 | * 获取:主色系 249 | */ 250 | public String getZhusexi() { 251 | return zhusexi; 252 | } 253 | 254 | 255 | /** 256 | * 设置:最近点击时间 257 | */ 258 | 259 | public void setClicktime(Date clicktime) { 260 | this.clicktime = clicktime; 261 | } 262 | 263 | /** 264 | * 获取:最近点击时间 265 | */ 266 | public Date getClicktime() { 267 | return clicktime; 268 | } 269 | 270 | } 271 | -------------------------------------------------------------------------------- /src/main/java/com/entity/StoreupEntity.java: -------------------------------------------------------------------------------- 1 | package com.entity; 2 | 3 | import com.baomidou.mybatisplus.annotations.TableId; 4 | import com.baomidou.mybatisplus.annotations.TableName; 5 | import javax.validation.constraints.NotBlank; 6 | import javax.validation.constraints.NotEmpty; 7 | import javax.validation.constraints.NotNull; 8 | 9 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 10 | import java.lang.reflect.InvocationTargetException; 11 | 12 | import java.io.Serializable; 13 | import java.util.Date; 14 | import java.util.List; 15 | 16 | import org.springframework.format.annotation.DateTimeFormat; 17 | import com.fasterxml.jackson.annotation.JsonFormat; 18 | import org.apache.commons.beanutils.BeanUtils; 19 | import com.baomidou.mybatisplus.annotations.TableField; 20 | import com.baomidou.mybatisplus.enums.FieldFill; 21 | import com.baomidou.mybatisplus.enums.IdType; 22 | 23 | 24 | /** 25 | * 收藏表 26 | * 数据库通用操作实体类(普通增删改查) 27 | * @author 28 | * @email 29 | * @date 2023-05-05 15:46:46 30 | */ 31 | @TableName("storeup") 32 | public class StoreupEntity implements Serializable { 33 | private static final long serialVersionUID = 1L; 34 | 35 | 36 | public StoreupEntity() { 37 | 38 | } 39 | 40 | public StoreupEntity(T t) { 41 | try { 42 | BeanUtils.copyProperties(this, t); 43 | } catch (IllegalAccessException | InvocationTargetException e) { 44 | // TODO Auto-generated catch block 45 | e.printStackTrace(); 46 | } 47 | } 48 | 49 | /** 50 | * 主键id 51 | */ 52 | @TableId 53 | private Long id; 54 | /** 55 | * 用户id 56 | */ 57 | 58 | private Long userid; 59 | 60 | /** 61 | * 商品id 62 | */ 63 | 64 | private Long refid; 65 | 66 | /** 67 | * 表名 68 | */ 69 | 70 | private String tablename; 71 | 72 | /** 73 | * 名称 74 | */ 75 | 76 | private String name; 77 | 78 | /** 79 | * 图片 80 | */ 81 | 82 | private String picture; 83 | 84 | /** 85 | * 类型(1:收藏,21:赞,22:踩,31:竞拍参与,41:关注) 86 | */ 87 | 88 | private String type; 89 | 90 | /** 91 | * 推荐类型 92 | */ 93 | 94 | private String inteltype; 95 | 96 | /** 97 | * 备注 98 | */ 99 | 100 | private String remark; 101 | 102 | 103 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 104 | @DateTimeFormat 105 | private Date addtime; 106 | 107 | public Date getAddtime() { 108 | return addtime; 109 | } 110 | public void setAddtime(Date addtime) { 111 | this.addtime = addtime; 112 | } 113 | 114 | public Long getId() { 115 | return id; 116 | } 117 | 118 | public void setId(Long id) { 119 | this.id = id; 120 | } 121 | /** 122 | * 设置:用户id 123 | */ 124 | public void setUserid(Long userid) { 125 | this.userid = userid; 126 | } 127 | /** 128 | * 获取:用户id 129 | */ 130 | public Long getUserid() { 131 | return userid; 132 | } 133 | /** 134 | * 设置:商品id 135 | */ 136 | public void setRefid(Long refid) { 137 | this.refid = refid; 138 | } 139 | /** 140 | * 获取:商品id 141 | */ 142 | public Long getRefid() { 143 | return refid; 144 | } 145 | /** 146 | * 设置:表名 147 | */ 148 | public void setTablename(String tablename) { 149 | this.tablename = tablename; 150 | } 151 | /** 152 | * 获取:表名 153 | */ 154 | public String getTablename() { 155 | return tablename; 156 | } 157 | /** 158 | * 设置:名称 159 | */ 160 | public void setName(String name) { 161 | this.name = name; 162 | } 163 | /** 164 | * 获取:名称 165 | */ 166 | public String getName() { 167 | return name; 168 | } 169 | /** 170 | * 设置:图片 171 | */ 172 | public void setPicture(String picture) { 173 | this.picture = picture; 174 | } 175 | /** 176 | * 获取:图片 177 | */ 178 | public String getPicture() { 179 | return picture; 180 | } 181 | /** 182 | * 设置:类型(1:收藏,21:赞,22:踩,31:竞拍参与,41:关注) 183 | */ 184 | public void setType(String type) { 185 | this.type = type; 186 | } 187 | /** 188 | * 获取:类型(1:收藏,21:赞,22:踩,31:竞拍参与,41:关注) 189 | */ 190 | public String getType() { 191 | return type; 192 | } 193 | /** 194 | * 设置:推荐类型 195 | */ 196 | public void setInteltype(String inteltype) { 197 | this.inteltype = inteltype; 198 | } 199 | /** 200 | * 获取:推荐类型 201 | */ 202 | public String getInteltype() { 203 | return inteltype; 204 | } 205 | /** 206 | * 设置:备注 207 | */ 208 | public void setRemark(String remark) { 209 | this.remark = remark; 210 | } 211 | /** 212 | * 获取:备注 213 | */ 214 | public String getRemark() { 215 | return remark; 216 | } 217 | 218 | } 219 | -------------------------------------------------------------------------------- /src/main/java/com/entity/ZhinengjiajuEntity.java: -------------------------------------------------------------------------------- 1 | package com.entity; 2 | 3 | import com.baomidou.mybatisplus.annotations.TableId; 4 | import com.baomidou.mybatisplus.annotations.TableName; 5 | import javax.validation.constraints.NotBlank; 6 | import javax.validation.constraints.NotEmpty; 7 | import javax.validation.constraints.NotNull; 8 | 9 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 10 | import java.lang.reflect.InvocationTargetException; 11 | 12 | import java.io.Serializable; 13 | import java.util.Date; 14 | import java.util.List; 15 | 16 | import org.springframework.format.annotation.DateTimeFormat; 17 | import com.fasterxml.jackson.annotation.JsonFormat; 18 | import org.apache.commons.beanutils.BeanUtils; 19 | import com.baomidou.mybatisplus.annotations.TableField; 20 | import com.baomidou.mybatisplus.enums.FieldFill; 21 | import com.baomidou.mybatisplus.enums.IdType; 22 | 23 | 24 | /** 25 | * 智能家居 26 | * 数据库通用操作实体类(普通增删改查) 27 | * @author 28 | * @email 29 | * @date 2023-05-05 15:46:46 30 | */ 31 | @TableName("zhinengjiaju") 32 | public class ZhinengjiajuEntity implements Serializable { 33 | private static final long serialVersionUID = 1L; 34 | 35 | 36 | public ZhinengjiajuEntity() { 37 | 38 | } 39 | 40 | public ZhinengjiajuEntity(T t) { 41 | try { 42 | BeanUtils.copyProperties(this, t); 43 | } catch (IllegalAccessException | InvocationTargetException e) { 44 | // TODO Auto-generated catch block 45 | e.printStackTrace(); 46 | } 47 | } 48 | 49 | /** 50 | * 主键id 51 | */ 52 | @TableId 53 | private Long id; 54 | /** 55 | * 商品链接 56 | */ 57 | 58 | private String shangpinlianjie; 59 | 60 | /** 61 | * 商品价格 62 | */ 63 | 64 | private Integer shangpinjiage; 65 | 66 | /** 67 | * 商品图片 68 | */ 69 | 70 | private String shangpintupian; 71 | 72 | /** 73 | * 商品类型 74 | */ 75 | 76 | private String shangpinleixing; 77 | 78 | /** 79 | * 商品品牌 80 | */ 81 | 82 | private String shangpinpinpai; 83 | 84 | /** 85 | * 好评数 86 | */ 87 | 88 | private Integer haopingshu; 89 | 90 | /** 91 | * 差评数 92 | */ 93 | 94 | private Integer chapingshu; 95 | 96 | /** 97 | * 总评论数 98 | */ 99 | 100 | private Integer zongpinglunshu; 101 | 102 | 103 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 104 | @DateTimeFormat 105 | private Date addtime; 106 | 107 | public Date getAddtime() { 108 | return addtime; 109 | } 110 | public void setAddtime(Date addtime) { 111 | this.addtime = addtime; 112 | } 113 | 114 | public Long getId() { 115 | return id; 116 | } 117 | 118 | public void setId(Long id) { 119 | this.id = id; 120 | } 121 | /** 122 | * 设置:商品链接 123 | */ 124 | public void setShangpinlianjie(String shangpinlianjie) { 125 | this.shangpinlianjie = shangpinlianjie; 126 | } 127 | /** 128 | * 获取:商品链接 129 | */ 130 | public String getShangpinlianjie() { 131 | return shangpinlianjie; 132 | } 133 | /** 134 | * 设置:商品价格 135 | */ 136 | public void setShangpinjiage(Integer shangpinjiage) { 137 | this.shangpinjiage = shangpinjiage; 138 | } 139 | /** 140 | * 获取:商品价格 141 | */ 142 | public Integer getShangpinjiage() { 143 | return shangpinjiage; 144 | } 145 | /** 146 | * 设置:商品图片 147 | */ 148 | public void setShangpintupian(String shangpintupian) { 149 | this.shangpintupian = shangpintupian; 150 | } 151 | /** 152 | * 获取:商品图片 153 | */ 154 | public String getShangpintupian() { 155 | return shangpintupian; 156 | } 157 | /** 158 | * 设置:商品类型 159 | */ 160 | public void setShangpinleixing(String shangpinleixing) { 161 | this.shangpinleixing = shangpinleixing; 162 | } 163 | /** 164 | * 获取:商品类型 165 | */ 166 | public String getShangpinleixing() { 167 | return shangpinleixing; 168 | } 169 | /** 170 | * 设置:商品品牌 171 | */ 172 | public void setShangpinpinpai(String shangpinpinpai) { 173 | this.shangpinpinpai = shangpinpinpai; 174 | } 175 | /** 176 | * 获取:商品品牌 177 | */ 178 | public String getShangpinpinpai() { 179 | return shangpinpinpai; 180 | } 181 | /** 182 | * 设置:好评数 183 | */ 184 | public void setHaopingshu(Integer haopingshu) { 185 | this.haopingshu = haopingshu; 186 | } 187 | /** 188 | * 获取:好评数 189 | */ 190 | public Integer getHaopingshu() { 191 | return haopingshu; 192 | } 193 | /** 194 | * 设置:差评数 195 | */ 196 | public void setChapingshu(Integer chapingshu) { 197 | this.chapingshu = chapingshu; 198 | } 199 | /** 200 | * 获取:差评数 201 | */ 202 | public Integer getChapingshu() { 203 | return chapingshu; 204 | } 205 | /** 206 | * 设置:总评论数 207 | */ 208 | public void setZongpinglunshu(Integer zongpinglunshu) { 209 | this.zongpinglunshu = zongpinglunshu; 210 | } 211 | /** 212 | * 获取:总评论数 213 | */ 214 | public Integer getZongpinglunshu() { 215 | return zongpinglunshu; 216 | } 217 | 218 | } 219 | -------------------------------------------------------------------------------- /src/main/resources/mapper/ZhinengjiajuDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 23 | 24 | 29 | 30 | 36 | 37 | 41 | 42 | 43 | 49 | 50 | 67 | 68 | 74 | 75 | 97 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /.mvn/wrapper/MavenWrapperDownloader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2019 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import java.net.*; 17 | import java.io.*; 18 | import java.nio.channels.*; 19 | import java.util.Properties; 20 | 21 | public class MavenWrapperDownloader { 22 | 23 | private static final String WRAPPER_VERSION = "0.5.5"; 24 | /** 25 | * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. 26 | */ 27 | private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/" 28 | + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar"; 29 | 30 | /** 31 | * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to 32 | * use instead of the default one. 33 | */ 34 | private static final String MAVEN_WRAPPER_PROPERTIES_PATH = 35 | ".mvn/wrapper/maven-wrapper.properties"; 36 | 37 | /** 38 | * Path where the maven-wrapper.jar will be saved to. 39 | */ 40 | private static final String MAVEN_WRAPPER_JAR_PATH = 41 | ".mvn/wrapper/maven-wrapper.jar"; 42 | 43 | /** 44 | * Name of the property which should be used to override the default download url for the wrapper. 45 | */ 46 | private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl"; 47 | 48 | public static void main(String args[]) { 49 | System.out.println("- Downloader started"); 50 | File baseDirectory = new File(args[0]); 51 | System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath()); 52 | 53 | // If the maven-wrapper.properties exists, read it and check if it contains a custom 54 | // wrapperUrl parameter. 55 | File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); 56 | String url = DEFAULT_DOWNLOAD_URL; 57 | if(mavenWrapperPropertyFile.exists()) { 58 | FileInputStream mavenWrapperPropertyFileInputStream = null; 59 | try { 60 | mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); 61 | Properties mavenWrapperProperties = new Properties(); 62 | mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream); 63 | url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); 64 | } catch (IOException e) { 65 | System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); 66 | } finally { 67 | try { 68 | if(mavenWrapperPropertyFileInputStream != null) { 69 | mavenWrapperPropertyFileInputStream.close(); 70 | } 71 | } catch (IOException e) { 72 | // Ignore ... 73 | } 74 | } 75 | } 76 | System.out.println("- Downloading from: " + url); 77 | 78 | File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); 79 | if(!outputFile.getParentFile().exists()) { 80 | if(!outputFile.getParentFile().mkdirs()) { 81 | System.out.println( 82 | "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'"); 83 | } 84 | } 85 | System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); 86 | try { 87 | downloadFileFromURL(url, outputFile); 88 | System.out.println("Done"); 89 | System.exit(0); 90 | } catch (Throwable e) { 91 | System.out.println("- Error downloading"); 92 | e.printStackTrace(); 93 | System.exit(1); 94 | } 95 | } 96 | 97 | private static void downloadFileFromURL(String urlString, File destination) throws Exception { 98 | if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) { 99 | String username = System.getenv("MVNW_USERNAME"); 100 | char[] password = System.getenv("MVNW_PASSWORD").toCharArray(); 101 | Authenticator.setDefault(new Authenticator() { 102 | @Override 103 | protected PasswordAuthentication getPasswordAuthentication() { 104 | return new PasswordAuthentication(username, password); 105 | } 106 | }); 107 | } 108 | URL website = new URL(urlString); 109 | ReadableByteChannel rbc; 110 | rbc = Channels.newChannel(website.openStream()); 111 | FileOutputStream fos = new FileOutputStream(destination); 112 | fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); 113 | fos.close(); 114 | rbc.close(); 115 | } 116 | 117 | } 118 | --------------------------------------------------------------------------------