├── image ├── 1.png ├── 10.png ├── 11.png ├── 2.png ├── 3.png ├── 4.png ├── 5.png ├── 6.png ├── 7.png ├── 8.png └── 9.png ├── limage ├── 1.png ├── 2.png └── 3.png ├── src └── main │ ├── resources │ ├── img │ │ └── img │ │ │ ├── logo.jpg │ │ │ ├── back-img-bg.jpg │ │ │ ├── front-img-bg.jpg │ │ │ └── back-list-img-bg.jpg │ ├── mapper │ │ ├── ConfigDao.xml │ │ ├── UsersDao.xml │ │ ├── TokenDao.xml │ │ ├── GonggaoDao.xml │ │ ├── DictionaryDao.xml │ │ └── YonghuDao.xml │ └── application.yml │ └── java │ └── com │ ├── dao │ ├── ConfigDao.java │ ├── ForumDao.java │ ├── HanfuDao.java │ ├── YonghuDao.java │ ├── GonggaoDao.java │ ├── DictionaryDao.java │ ├── HanfuOrderDao.java │ ├── UsersDao.java │ ├── HanfuCollectionDao.java │ ├── TokenDao.java │ ├── HanfuCommentbackDao.java │ └── CommonDao.java │ ├── annotation │ ├── IgnoreAuth.java │ ├── LoginUser.java │ ├── APPLoginUser.java │ └── ColumnInfo.java │ ├── utils │ ├── StringUtil.java │ ├── DateUtil.java │ ├── MD5Utils.java │ ├── FileUtil.java │ ├── JQPageInfo.java │ ├── R.java │ ├── SQLFilter.java │ ├── HttpClientUtils.java │ ├── ValidatorUtils.java │ ├── SpringContextUtils.java │ ├── CommonUtil.java │ ├── PageUtils.java │ ├── Query.java │ ├── BaiduUtil.java │ └── PoiUtil.java │ ├── service │ ├── ConfigService.java │ ├── ForumService.java │ ├── HanfuService.java │ ├── YonghuService.java │ ├── GonggaoService.java │ ├── HanfuOrderService.java │ ├── HanfuCollectionService.java │ ├── HanfuCommentbackService.java │ ├── UsersService.java │ ├── DictionaryService.java │ ├── TokenService.java │ ├── impl │ │ ├── ConfigServiceImpl.java │ │ ├── ForumServiceImpl.java │ │ ├── HanfuServiceImpl.java │ │ ├── YonghuServiceImpl.java │ │ ├── GonggaoServiceImpl.java │ │ ├── HanfuOrderServiceImpl.java │ │ ├── UsersServiceImpl.java │ │ ├── HanfuCollectionServiceImpl.java │ │ ├── HanfuCommentbackServiceImpl.java │ │ ├── CommonServiceImpl.java │ │ └── TokenServiceImpl.java │ └── CommonService.java │ ├── config │ ├── MybatisPlusConfig.java │ ├── MyMetaObjectHandler.java │ └── InterceptorConfig.java │ ├── thread │ └── MyThreadMethod.java │ ├── model │ └── enums │ │ └── TypeEnum.java │ ├── entity │ ├── EIException.java │ ├── ConfigEntity.java │ ├── view │ │ ├── DictionaryView.java │ │ ├── YonghuView.java │ │ ├── HanfuView.java │ │ └── GonggaoView.java │ ├── UsersEntity.java │ ├── TokenEntity.java │ ├── model │ │ ├── HanfuCollectionModel.java │ │ ├── GonggaoModel.java │ │ └── DictionaryModel.java │ └── vo │ │ ├── HanfuCollectionVO.java │ │ └── GonggaoVO.java │ ├── gaoxiaohanfuzulinwangzhanApplication.java │ ├── ServletContextListener │ └── DictionaryServletContextListener.java │ ├── controller │ └── ConfigController.java │ └── interceptor │ └── AuthorizationInterceptor.java ├── .idea ├── encodings.xml ├── modules.xml ├── misc.xml ├── libraries │ ├── Maven__dom4j_dom4j_1_6_1.xml │ ├── Maven__log4j_log4j_1_2_17.xml │ ├── Maven__org_apache_poi_poi_3_9.xml │ ├── Maven__org_ow2_asm_asm_5_0_4.xml │ ├── Maven__stax_stax_api_1_0_1.xml │ ├── Maven__org_apache_ant_ant_1_8_2.xml │ ├── Maven__org_json_json_20160810.xml │ ├── Maven__org_yaml_snakeyaml_1_25.xml │ ├── Maven__org_hamcrest_hamcrest_2_1.xml │ ├── Maven__com_zaxxer_HikariCP_3_4_1.xml │ ├── Maven__commons_io_commons_io_2_2.xml │ ├── Maven__org_mybatis_mybatis_3_5_3.xml │ ├── Maven__xml_apis_xml_apis_1_0_b2.xml │ ├── Maven__com_alibaba_fastjson_1_2_8.xml │ ├── Maven__net_minidev_json_smart_2_3.xml │ ├── Maven__org_objenesis_objenesis_2_6.xml │ ├── Maven__org_slf4j_slf4j_api_1_7_29.xml │ ├── Maven__com_baidu_aip_java_sdk_4_4_1.xml │ ├── Maven__org_apache_poi_poi_ooxml_3_9.xml │ ├── Maven__cn_hutool_hutool_all_4_0_12.xml │ ├── Maven__com_baomidou_mybatis_plus_2_3.xml │ ├── Maven__com_fasterxml_classmate_1_5_1.xml │ ├── Maven__org_apache_poi_poi_examples_3_9.xml │ ├── Maven__org_apache_poi_poi_excelant_3_9.xml │ ├── Maven__org_opentest4j_opentest4j_1_2_0.xml │ ├── Maven__org_slf4j_jul_to_slf4j_1_7_29.xml │ ├── Maven__net_bytebuddy_byte_buddy_1_10_4.xml │ ├── Maven__org_apache_shiro_shiro_web_1_3_2.xml │ ├── Maven__org_mockito_mockito_core_3_1_0.xml │ ├── Maven__org_skyscreamer_jsonassert_1_5_0.xml │ ├── Maven__org_xmlunit_xmlunit_core_2_6_3.xml │ ├── Maven__net_minidev_accessors_smart_1_2.xml │ ├── Maven__org_apache_shiro_shiro_core_1_3_2.xml │ ├── Maven__org_apache_xmlbeans_xmlbeans_2_3_0.xml │ ├── Maven__org_assertj_assertj_core_3_13_2.xml │ ├── Maven__commons_codec_commons_codec_1_13.xml │ ├── Maven__ch_qos_logback_logback_core_1_2_3.xml │ ├── Maven__com_github_jsqlparser_jsqlparser_1_1.xml │ ├── Maven__com_jayway_jsonpath_json_path_2_4_0.xml │ ├── Maven__org_apache_ant_ant_launcher_1_8_2.xml │ ├── Maven__org_apache_poi_poi_scratchpad_3_9.xml │ ├── Maven__org_mybatis_mybatis_spring_2_0_3.xml │ ├── Maven__com_baomidou_mybatis_plus_core_2_3.xml │ ├── Maven__org_apache_commons_commons_lang3_3_0.xml │ ├── Maven__org_apache_shiro_shiro_spring_1_3_2.xml │ ├── Maven__ch_qos_logback_logback_classic_1_2_3.xml │ ├── Maven__org_apache_poi_poi_ooxml_schemas_3_9.xml │ ├── Maven__org_junit_jupiter_junit_jupiter_5_5_2.xml │ ├── Maven__mysql_mysql_connector_java_8_0_18.xml │ ├── Maven__org_apiguardian_apiguardian_api_1_1_0.xml │ ├── Maven__org_apache_logging_log4j_log4j_api_2_12_1.xml │ ├── Maven__com_baomidou_mybatis_plus_support_2_3.xml │ ├── Maven__net_bytebuddy_byte_buddy_agent_1_10_4.xml │ ├── Maven__org_unbescape_unbescape_1_1_6_RELEASE.xml │ ├── Maven__com_google_protobuf_protobuf_java_3_10_0.xml │ ├── Maven__org_thymeleaf_thymeleaf_3_0_11_RELEASE.xml │ ├── Maven__com_baomidou_mybatis_plus_generate_2_3.xml │ ├── Maven__org_attoparser_attoparser_2_0_5_RELEASE.xml │ ├── Maven__commons_beanutils_commons_beanutils_1_8_3.xml │ ├── Maven__org_junit_jupiter_junit_jupiter_api_5_5_2.xml │ ├── Maven__org_mockito_mockito_junit_jupiter_3_1_0.xml │ ├── Maven__com_fasterxml_jackson_core_jackson_core_2_10_1.xml │ ├── Maven__org_springframework_spring_tx_5_2_2_RELEASE.xml │ ├── Maven__jakarta_xml_bind_jakarta_xml_bind_api_2_3_2.xml │ ├── Maven__javax_validation_validation_api_2_0_1_Final.xml │ ├── Maven__org_apache_logging_log4j_log4j_to_slf4j_2_12_1.xml │ ├── Maven__org_jboss_logging_jboss_logging_3_4_1_Final.xml │ ├── Maven__org_springframework_spring_aop_5_2_2_RELEASE.xml │ ├── Maven__org_springframework_spring_jcl_5_2_2_RELEASE.xml │ ├── Maven__org_springframework_spring_web_5_2_2_RELEASE.xml │ ├── Maven__org_apache_tomcat_embed_tomcat_embed_el_9_0_29.xml │ ├── Maven__org_junit_jupiter_junit_jupiter_engine_5_5_2.xml │ ├── Maven__org_junit_jupiter_junit_jupiter_params_5_5_2.xml │ ├── Maven__org_springframework_spring_core_5_2_2_RELEASE.xml │ ├── Maven__org_springframework_spring_jdbc_5_2_2_RELEASE.xml │ ├── Maven__org_springframework_spring_test_5_2_2_RELEASE.xml │ ├── Maven__org_springframework_spring_beans_5_2_2_RELEASE.xml │ ├── Maven__org_apache_tomcat_embed_tomcat_embed_core_9_0_29.xml │ ├── Maven__org_junit_platform_junit_platform_engine_1_5_2.xml │ ├── Maven__org_springframework_spring_webmvc_5_2_2_RELEASE.xml │ ├── Maven__com_fasterxml_jackson_core_jackson_databind_2_10_1.xml │ ├── Maven__jakarta_activation_jakarta_activation_api_1_2_1.xml │ ├── Maven__jakarta_annotation_jakarta_annotation_api_1_3_5.xml │ ├── Maven__jakarta_validation_jakarta_validation_api_2_0_1.xml │ ├── Maven__org_junit_platform_junit_platform_commons_1_5_2.xml │ ├── Maven__org_springframework_boot_spring_boot_2_2_2_RELEASE.xml │ ├── Maven__org_springframework_spring_context_5_2_2_RELEASE.xml │ ├── Maven__org_thymeleaf_thymeleaf_spring5_3_0_11_RELEASE.xml │ ├── Maven__com_fasterxml_jackson_core_jackson_annotations_2_10_1.xml │ ├── Maven__org_springframework_spring_expression_5_2_2_RELEASE.xml │ ├── Maven__org_apache_tomcat_embed_tomcat_embed_websocket_9_0_29.xml │ ├── Maven__com_baomidou_mybatisplus_spring_boot_starter_1_0_5.xml │ ├── Maven__org_springframework_boot_spring_boot_test_2_2_2_RELEASE.xml │ ├── Maven__org_hibernate_validator_hibernate_validator_6_0_18_Final.xml │ ├── Maven__com_fasterxml_jackson_datatype_jackson_datatype_jdk8_2_10_1.xml │ ├── Maven__org_mybatis_spring_boot_mybatis_spring_boot_starter_2_1_1.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_2_2_2_RELEASE.xml │ ├── Maven__com_fasterxml_jackson_datatype_jackson_datatype_jsr310_2_10_1.xml │ ├── Maven__org_springframework_boot_spring_boot_devtools_2_2_2_RELEASE.xml │ ├── Maven__com_vaadin_external_google_android_json_0_0_20131108_vaadin1.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_web_2_2_2_RELEASE.xml │ ├── Maven__org_thymeleaf_extras_thymeleaf_extras_java8time_3_0_4_RELEASE.xml │ ├── Maven__org_mybatis_spring_boot_mybatis_spring_boot_autoconfigure_2_1_1.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_jdbc_2_2_2_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_json_2_2_2_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_test_2_2_2_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_autoconfigure_2_2_2_RELEASE.xml │ ├── Maven__com_fasterxml_jackson_module_jackson_module_parameter_names_2_10_1.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_tomcat_2_2_2_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_logging_2_2_2_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_thymeleaf_2_2_2_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_validation_2_2_2_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_test_autoconfigure_2_2_2_RELEASE.xml │ └── Maven__org_springframework_boot_spring_boot_configuration_processor_2_2_2_RELEASE.xml └── compiler.xml └── README.md /image/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No139University-Hanfu-Rental-Website/HEAD/image/1.png -------------------------------------------------------------------------------- /image/10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No139University-Hanfu-Rental-Website/HEAD/image/10.png -------------------------------------------------------------------------------- /image/11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No139University-Hanfu-Rental-Website/HEAD/image/11.png -------------------------------------------------------------------------------- /image/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No139University-Hanfu-Rental-Website/HEAD/image/2.png -------------------------------------------------------------------------------- /image/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No139University-Hanfu-Rental-Website/HEAD/image/3.png -------------------------------------------------------------------------------- /image/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No139University-Hanfu-Rental-Website/HEAD/image/4.png -------------------------------------------------------------------------------- /image/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No139University-Hanfu-Rental-Website/HEAD/image/5.png -------------------------------------------------------------------------------- /image/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No139University-Hanfu-Rental-Website/HEAD/image/6.png -------------------------------------------------------------------------------- /image/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No139University-Hanfu-Rental-Website/HEAD/image/7.png -------------------------------------------------------------------------------- /image/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No139University-Hanfu-Rental-Website/HEAD/image/8.png -------------------------------------------------------------------------------- /image/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No139University-Hanfu-Rental-Website/HEAD/image/9.png -------------------------------------------------------------------------------- /limage/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No139University-Hanfu-Rental-Website/HEAD/limage/1.png -------------------------------------------------------------------------------- /limage/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No139University-Hanfu-Rental-Website/HEAD/limage/2.png -------------------------------------------------------------------------------- /limage/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No139University-Hanfu-Rental-Website/HEAD/limage/3.png -------------------------------------------------------------------------------- /src/main/resources/img/img/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No139University-Hanfu-Rental-Website/HEAD/src/main/resources/img/img/logo.jpg -------------------------------------------------------------------------------- /src/main/resources/img/img/back-img-bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No139University-Hanfu-Rental-Website/HEAD/src/main/resources/img/img/back-img-bg.jpg -------------------------------------------------------------------------------- /src/main/resources/img/img/front-img-bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No139University-Hanfu-Rental-Website/HEAD/src/main/resources/img/img/front-img-bg.jpg -------------------------------------------------------------------------------- /src/main/resources/img/img/back-list-img-bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No139University-Hanfu-Rental-Website/HEAD/src/main/resources/img/img/back-list-img-bg.jpg -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/main/resources/mapper/ConfigDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /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/utils/StringUtil.java: -------------------------------------------------------------------------------- 1 | package com.utils; 2 | 3 | public class StringUtil { 4 | 5 | public static boolean isEmpty(String s){ 6 | if(s==null || s.equals("") || s.equals("null")){ 7 | return true; 8 | } 9 | return false; 10 | } 11 | 12 | public static boolean isNotEmpty(String s){ 13 | return !StringUtil.isEmpty(s); 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/java/com/annotation/ColumnInfo.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 | @Target(ElementType.FIELD) 9 | @Retention(RetentionPolicy.RUNTIME) 10 | public @interface ColumnInfo { 11 | String comment(); 12 | String type(); 13 | } 14 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/main/resources/mapper/UsersDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/resources/mapper/TokenDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/java/com/service/ConfigService.java: -------------------------------------------------------------------------------- 1 | 2 | package com.service; 3 | 4 | import java.util.Map; 5 | 6 | import com.baomidou.mybatisplus.service.IService; 7 | import com.entity.ConfigEntity; 8 | import com.utils.PageUtils; 9 | 10 | 11 | /** 12 | * 系统用户 13 | * @author yangliyuan 14 | * @date 2019年10月10日 上午9:18:20 15 | */ 16 | public interface ConfigService extends IService { 17 | PageUtils queryPage(Map params); 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/utils/DateUtil.java: -------------------------------------------------------------------------------- 1 | package com.utils; 2 | 3 | import java.text.Format; 4 | import java.text.SimpleDateFormat; 5 | import java.util.Date; 6 | 7 | public class DateUtil { 8 | 9 | 10 | public static String convertString(Date date,String format){ 11 | if(date == null){ 12 | return null; 13 | } 14 | SimpleDateFormat sdf = new SimpleDateFormat(format); 15 | return sdf.format(date); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__dom4j_dom4j_1_6_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__log4j_log4j_1_2_17.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_poi_poi_3_9.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_ow2_asm_asm_5_0_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__stax_stax_api_1_0_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_ant_ant_1_8_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_json_json_20160810.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_yaml_snakeyaml_1_25.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_hamcrest_hamcrest_2_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_zaxxer_HikariCP_3_4_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__commons_io_commons_io_2_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_mybatis_mybatis_3_5_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__xml_apis_xml_apis_1_0_b2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_alibaba_fastjson_1_2_8.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__net_minidev_json_smart_2_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_objenesis_objenesis_2_6.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_slf4j_slf4j_api_1_7_29.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_baidu_aip_java_sdk_4_4_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_poi_poi_ooxml_3_9.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/java/com/service/ForumService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.baomidou.mybatisplus.service.IService; 4 | import com.utils.PageUtils; 5 | import com.entity.ForumEntity; 6 | import java.util.Map; 7 | import javax.servlet.http.HttpServletRequest; 8 | import org.springframework.lang.Nullable; 9 | import java.util.List; 10 | 11 | /** 12 | * 交流论坛 服务类 13 | */ 14 | public interface ForumService extends IService { 15 | 16 | /** 17 | * @param params 查询参数 18 | * @return 带分页的查询出来的数据 19 | */ 20 | PageUtils queryPage(Map params); 21 | 22 | } -------------------------------------------------------------------------------- /src/main/java/com/service/HanfuService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.baomidou.mybatisplus.service.IService; 4 | import com.utils.PageUtils; 5 | import com.entity.HanfuEntity; 6 | import java.util.Map; 7 | import javax.servlet.http.HttpServletRequest; 8 | import org.springframework.lang.Nullable; 9 | import java.util.List; 10 | 11 | /** 12 | * 汉服信息 服务类 13 | */ 14 | public interface HanfuService extends IService { 15 | 16 | /** 17 | * @param params 查询参数 18 | * @return 带分页的查询出来的数据 19 | */ 20 | PageUtils queryPage(Map params); 21 | 22 | } -------------------------------------------------------------------------------- /src/main/java/com/service/YonghuService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.baomidou.mybatisplus.service.IService; 4 | import com.utils.PageUtils; 5 | import com.entity.YonghuEntity; 6 | import java.util.Map; 7 | import javax.servlet.http.HttpServletRequest; 8 | import org.springframework.lang.Nullable; 9 | import java.util.List; 10 | 11 | /** 12 | * 用户 服务类 13 | */ 14 | public interface YonghuService extends IService { 15 | 16 | /** 17 | * @param params 查询参数 18 | * @return 带分页的查询出来的数据 19 | */ 20 | PageUtils queryPage(Map params); 21 | 22 | } -------------------------------------------------------------------------------- /.idea/libraries/Maven__cn_hutool_hutool_all_4_0_12.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/java/com/dao/ForumDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.entity.ForumEntity; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | import java.util.List; 6 | import java.util.Map; 7 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 8 | 9 | import org.apache.ibatis.annotations.Param; 10 | import com.entity.view.ForumView; 11 | 12 | /** 13 | * 交流论坛 Dao 接口 14 | * 15 | * @author 16 | */ 17 | public interface ForumDao extends BaseMapper { 18 | 19 | List selectListView(Pagination page,@Param("params")Map params); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/dao/HanfuDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.entity.HanfuEntity; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | import java.util.List; 6 | import java.util.Map; 7 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 8 | 9 | import org.apache.ibatis.annotations.Param; 10 | import com.entity.view.HanfuView; 11 | 12 | /** 13 | * 汉服信息 Dao 接口 14 | * 15 | * @author 16 | */ 17 | public interface HanfuDao extends BaseMapper { 18 | 19 | List selectListView(Pagination page,@Param("params")Map params); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/service/GonggaoService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.baomidou.mybatisplus.service.IService; 4 | import com.utils.PageUtils; 5 | import com.entity.GonggaoEntity; 6 | import java.util.Map; 7 | import javax.servlet.http.HttpServletRequest; 8 | import org.springframework.lang.Nullable; 9 | import java.util.List; 10 | 11 | /** 12 | * 公告资讯 服务类 13 | */ 14 | public interface GonggaoService extends IService { 15 | 16 | /** 17 | * @param params 查询参数 18 | * @return 带分页的查询出来的数据 19 | */ 20 | PageUtils queryPage(Map params); 21 | 22 | } -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_baomidou_mybatis_plus_2_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_classmate_1_5_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /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.plugins.pagination.Pagination; 8 | 9 | import org.apache.ibatis.annotations.Param; 10 | import com.entity.view.YonghuView; 11 | 12 | /** 13 | * 用户 Dao 接口 14 | * 15 | * @author 16 | */ 17 | public interface YonghuDao extends BaseMapper { 18 | 19 | List selectListView(Pagination page,@Param("params")Map params); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/dao/GonggaoDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.entity.GonggaoEntity; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | import java.util.List; 6 | import java.util.Map; 7 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 8 | 9 | import org.apache.ibatis.annotations.Param; 10 | import com.entity.view.GonggaoView; 11 | 12 | /** 13 | * 公告资讯 Dao 接口 14 | * 15 | * @author 16 | */ 17 | public interface GonggaoDao extends BaseMapper { 18 | 19 | List selectListView(Pagination page,@Param("params")Map params); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_poi_poi_examples_3_9.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_poi_poi_excelant_3_9.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_opentest4j_opentest4j_1_2_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_slf4j_jul_to_slf4j_1_7_29.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/java/com/service/HanfuOrderService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.baomidou.mybatisplus.service.IService; 4 | import com.utils.PageUtils; 5 | import com.entity.HanfuOrderEntity; 6 | import java.util.Map; 7 | import javax.servlet.http.HttpServletRequest; 8 | import org.springframework.lang.Nullable; 9 | import java.util.List; 10 | 11 | /** 12 | * 汉服租赁 服务类 13 | */ 14 | public interface HanfuOrderService extends IService { 15 | 16 | /** 17 | * @param params 查询参数 18 | * @return 带分页的查询出来的数据 19 | */ 20 | PageUtils queryPage(Map params); 21 | 22 | } -------------------------------------------------------------------------------- /.idea/libraries/Maven__net_bytebuddy_byte_buddy_1_10_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_shiro_shiro_web_1_3_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_mockito_mockito_core_3_1_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_skyscreamer_jsonassert_1_5_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_xmlunit_xmlunit_core_2_6_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__net_minidev_accessors_smart_1_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_shiro_shiro_core_1_3_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_xmlbeans_xmlbeans_2_3_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_assertj_assertj_core_3_13_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/java/com/dao/DictionaryDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.entity.DictionaryEntity; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | import java.util.List; 6 | import java.util.Map; 7 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 8 | 9 | import org.apache.ibatis.annotations.Param; 10 | import com.entity.view.DictionaryView; 11 | 12 | /** 13 | * 字典 Dao 接口 14 | * 15 | * @author 16 | */ 17 | public interface DictionaryDao extends BaseMapper { 18 | 19 | List selectListView(Pagination page,@Param("params")Map params); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__commons_codec_commons_codec_1_13.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /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/HanfuOrderDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.entity.HanfuOrderEntity; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | import java.util.List; 6 | import java.util.Map; 7 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 8 | 9 | import org.apache.ibatis.annotations.Param; 10 | import com.entity.view.HanfuOrderView; 11 | 12 | /** 13 | * 汉服租赁 Dao 接口 14 | * 15 | * @author 16 | */ 17 | public interface HanfuOrderDao extends BaseMapper { 18 | 19 | List selectListView(Pagination page,@Param("params")Map params); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__ch_qos_logback_logback_core_1_2_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_github_jsqlparser_jsqlparser_1_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_jayway_jsonpath_json_path_2_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_ant_ant_launcher_1_8_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_poi_poi_scratchpad_3_9.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_mybatis_mybatis_spring_2_0_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/java/com/service/HanfuCollectionService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.baomidou.mybatisplus.service.IService; 4 | import com.utils.PageUtils; 5 | import com.entity.HanfuCollectionEntity; 6 | import java.util.Map; 7 | import javax.servlet.http.HttpServletRequest; 8 | import org.springframework.lang.Nullable; 9 | import java.util.List; 10 | 11 | /** 12 | * 汉服收藏 服务类 13 | */ 14 | public interface HanfuCollectionService extends IService { 15 | 16 | /** 17 | * @param params 查询参数 18 | * @return 带分页的查询出来的数据 19 | */ 20 | PageUtils queryPage(Map params); 21 | 22 | } -------------------------------------------------------------------------------- /src/main/java/com/service/HanfuCommentbackService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.baomidou.mybatisplus.service.IService; 4 | import com.utils.PageUtils; 5 | import com.entity.HanfuCommentbackEntity; 6 | import java.util.Map; 7 | import javax.servlet.http.HttpServletRequest; 8 | import org.springframework.lang.Nullable; 9 | import java.util.List; 10 | 11 | /** 12 | * 汉服评价 服务类 13 | */ 14 | public interface HanfuCommentbackService extends IService { 15 | 16 | /** 17 | * @param params 查询参数 18 | * @return 带分页的查询出来的数据 19 | */ 20 | PageUtils queryPage(Map params); 21 | 22 | } -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_baomidou_mybatis_plus_core_2_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_commons_commons_lang3_3_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_shiro_shiro_spring_1_3_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__ch_qos_logback_logback_classic_1_2_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_poi_poi_ooxml_schemas_3_9.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_junit_jupiter_junit_jupiter_5_5_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /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/thread/MyThreadMethod.java: -------------------------------------------------------------------------------- 1 | package com.thread; 2 | 3 | /** 4 | * 线程执行方法(做一些项目启动后 一直要执行的操作,比如根据时间自动更改订单状态,比如订单签收30天自动收货功能,比如根据时间来更改状态) 5 | */ 6 | public class MyThreadMethod extends Thread { 7 | public void run() { 8 | while (!this.isInterrupted()) {// 线程未中断执行循环 9 | try { 10 | Thread.sleep(5000); //每隔2000ms执行一次 11 | } catch (InterruptedException e) { 12 | e.printStackTrace(); 13 | } 14 | 15 | // ------------------ 开始执行 --------------------------- 16 | // System.out.println("线程执行中:" + System.currentTimeMillis()); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__mysql_mysql_connector_java_8_0_18.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apiguardian_apiguardian_api_1_1_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/java/com/dao/HanfuCollectionDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.entity.HanfuCollectionEntity; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | import java.util.List; 6 | import java.util.Map; 7 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 8 | 9 | import org.apache.ibatis.annotations.Param; 10 | import com.entity.view.HanfuCollectionView; 11 | 12 | /** 13 | * 汉服收藏 Dao 接口 14 | * 15 | * @author 16 | */ 17 | public interface HanfuCollectionDao extends BaseMapper { 18 | 19 | List selectListView(Pagination page,@Param("params")Map params); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_logging_log4j_log4j_api_2_12_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/java/com/dao/HanfuCommentbackDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.entity.HanfuCommentbackEntity; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | import java.util.List; 6 | import java.util.Map; 7 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 8 | 9 | import org.apache.ibatis.annotations.Param; 10 | import com.entity.view.HanfuCommentbackView; 11 | 12 | /** 13 | * 汉服评价 Dao 接口 14 | * 15 | * @author 16 | */ 17 | public interface HanfuCommentbackDao extends BaseMapper { 18 | 19 | List selectListView(Pagination page,@Param("params")Map params); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_baomidou_mybatis_plus_support_2_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__net_bytebuddy_byte_buddy_agent_1_10_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_unbescape_unbescape_1_1_6_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_google_protobuf_protobuf_java_3_10_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_thymeleaf_thymeleaf_3_0_11_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_baomidou_mybatis_plus_generate_2_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_attoparser_attoparser_2_0_5_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__commons_beanutils_commons_beanutils_1_8_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_junit_jupiter_junit_jupiter_api_5_5_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_mockito_mockito_junit_jupiter_3_1_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_10_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_tx_5_2_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__jakarta_xml_bind_jakarta_xml_bind_api_2_3_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__javax_validation_validation_api_2_0_1_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_logging_log4j_log4j_to_slf4j_2_12_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_jboss_logging_jboss_logging_3_4_1_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_aop_5_2_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_jcl_5_2_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_web_5_2_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_el_9_0_29.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_junit_jupiter_junit_jupiter_engine_5_5_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_junit_jupiter_junit_jupiter_params_5_5_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_core_5_2_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_jdbc_5_2_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_test_5_2_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/java/com/config/MyMetaObjectHandler.java: -------------------------------------------------------------------------------- 1 | package com.config; 2 | 3 | import java.util.Date; 4 | 5 | import org.apache.ibatis.reflection.MetaObject; 6 | 7 | import com.baomidou.mybatisplus.mapper.MetaObjectHandler; 8 | 9 | /** 10 | * 自定义填充处理器 11 | */ 12 | public class MyMetaObjectHandler extends MetaObjectHandler { 13 | 14 | @Override 15 | public void insertFill(MetaObject metaObject) { 16 | this.setFieldValByName("ctime", new Date(), metaObject); 17 | } 18 | 19 | @Override 20 | public boolean openUpdateFill() { 21 | return false; 22 | } 23 | 24 | @Override 25 | public void updateFill(MetaObject metaObject) { 26 | // 关闭更新填充、这里不执行 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_beans_5_2_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /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 com.baomidou.mybatisplus.mapper.Wrapper; 8 | import com.baomidou.mybatisplus.service.IService; 9 | import com.entity.UsersEntity; 10 | import com.utils.PageUtils; 11 | 12 | 13 | /** 14 | * 系统用户 15 | * @author yangliyuan 16 | * @date 2019年10月10日 上午9:18:20 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 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_core_9_0_29.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_junit_platform_junit_platform_engine_1_5_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_webmvc_5_2_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_10_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__jakarta_activation_jakarta_activation_api_1_2_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__jakarta_annotation_jakarta_annotation_api_1_3_5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__jakarta_validation_jakarta_validation_api_2_0_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_junit_platform_junit_platform_commons_1_5_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_2_2_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_context_5_2_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_thymeleaf_thymeleaf_spring5_3_0_11_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_10_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/java/com/service/DictionaryService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.baomidou.mybatisplus.service.IService; 4 | import com.utils.PageUtils; 5 | import com.entity.DictionaryEntity; 6 | import java.util.Map; 7 | import javax.servlet.http.HttpServletRequest; 8 | import org.springframework.lang.Nullable; 9 | import java.util.List; 10 | 11 | /** 12 | * 字典 服务类 13 | */ 14 | public interface DictionaryService extends IService { 15 | 16 | /** 17 | * @param params 查询参数 18 | * @return 带分页的查询出来的数据 19 | */ 20 | PageUtils queryPage(Map params); 21 | /** 22 | * 字典表转换 23 | * @param obj 24 | */ 25 | void dictionaryConvert(Object obj, HttpServletRequest request); 26 | 27 | } -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_expression_5_2_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_websocket_9_0_29.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_baomidou_mybatisplus_spring_boot_starter_1_0_5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_test_2_2_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_hibernate_validator_hibernate_validator_6_0_18_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jdk8_2_10_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_mybatis_spring_boot_mybatis_spring_boot_starter_2_1_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/java/com/model/enums/TypeEnum.java: -------------------------------------------------------------------------------- 1 | package com.model.enums; 2 | 3 | import java.io.Serializable; 4 | 5 | import com.baomidou.mybatisplus.enums.IEnum; 6 | 7 | /** 8 | * 必须现在 IEnum 配置 该包扫描自动注入,查看文件 spring-mybatis.xml 参数 typeEnumsPackage 9 | */ 10 | public enum TypeEnum implements IEnum { 11 | DISABLED(0, "禁用"), 12 | NORMAL(1, "正常"); 13 | 14 | private final int value; 15 | private final String desc; 16 | 17 | TypeEnum(final int value, final String desc) { 18 | this.value = value; 19 | this.desc = desc; 20 | } 21 | 22 | @Override 23 | public Serializable getValue() { 24 | return this.value; 25 | } 26 | 27 | // Jackson 注解为 JsonValue 返回中文 json 描述 28 | public String getDesc() { 29 | return this.desc; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_2_2_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/java/com/utils/MD5Utils.java: -------------------------------------------------------------------------------- 1 | package com.utils; 2 | 3 | import java.math.BigInteger; 4 | import java.security.MessageDigest; 5 | import java.security.NoSuchAlgorithmException; 6 | 7 | public class MD5Utils { 8 | public static String md5(String plainText) { 9 | byte[] secretBytes = null; 10 | try { 11 | secretBytes = MessageDigest.getInstance("md5").digest( 12 | plainText.getBytes()); 13 | } catch (NoSuchAlgorithmException e) { 14 | throw new RuntimeException("没有这个md5算法!"); 15 | } 16 | String md5code = new BigInteger(1, secretBytes).toString(16); 17 | for (int i = 0; i < 32 - md5code.length(); i++) { 18 | md5code = "0" + md5code; 19 | } 20 | return md5code; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jsr310_2_10_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_devtools_2_2_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_vaadin_external_google_android_json_0_0_20131108_vaadin1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_web_2_2_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /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 | * @author yangliyuan 11 | * @version 创建时间:2020年2月7日 下午8:01:14 12 | * 类说明 : 13 | */ 14 | 15 | public class FileUtil { 16 | public static byte[] FileToByte(File file) throws IOException { 17 | // 将数据转为流 18 | @SuppressWarnings("resource") 19 | InputStream content = new FileInputStream(file); 20 | ByteArrayOutputStream swapStream = new ByteArrayOutputStream(); 21 | byte[] buff = new byte[100]; 22 | int rc = 0; 23 | while ((rc = content.read(buff, 0, 100)) > 0) { 24 | swapStream.write(buff, 0, rc); 25 | } 26 | // 获得二进制数组 27 | return swapStream.toByteArray(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_thymeleaf_extras_thymeleaf_extras_java8time_3_0_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_mybatis_spring_boot_mybatis_spring_boot_autoconfigure_2_1_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_jdbc_2_2_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_json_2_2_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_test_2_2_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_autoconfigure_2_2_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_jackson_module_jackson_module_parameter_names_2_10_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_tomcat_2_2_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_logging_2_2_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /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 | * @author yangliyuan 16 | * @date 2019年10月10日 上午9:18:20 17 | */ 18 | public interface TokenService extends IService { 19 | PageUtils queryPage(Map params); 20 | 21 | List selectListView(Wrapper wrapper); 22 | 23 | PageUtils queryPage(Map params,Wrapper wrapper); 24 | 25 | String generateToken(Integer userid,String username,String tableName, String role); 26 | 27 | TokenEntity getTokenEntity(String token); 28 | } 29 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_thymeleaf_2_2_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_validation_2_2_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_test_autoconfigure_2_2_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_configuration_processor_2_2_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 20 | 21 | -------------------------------------------------------------------------------- /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/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/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.plugins.Page; 11 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 12 | import com.dao.ConfigDao; 13 | import com.entity.ConfigEntity; 14 | import com.service.ConfigService; 15 | import com.utils.PageUtils; 16 | import com.utils.Query; 17 | 18 | 19 | /** 20 | * 系统用户 21 | * @author yangliyuan 22 | * @date 2019年10月10日 上午9:17:59 23 | */ 24 | @Service("configService") 25 | public class ConfigServiceImpl extends ServiceImpl implements ConfigService { 26 | @Override 27 | public PageUtils queryPage(Map params) { 28 | Page page = this.selectPage( 29 | new Query(params).getPage(), 30 | new EntityWrapper() 31 | ); 32 | return new PageUtils(page); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/gaoxiaohanfuzulinwangzhanApplication.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.ServletComponentScan; 8 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 9 | 10 | @SpringBootApplication 11 | @ServletComponentScan(value = "com.ServletContextListener") 12 | @MapperScan(basePackages = {"com.dao"}) 13 | public class gaoxiaohanfuzulinwangzhanApplication extends SpringBootServletInitializer{ 14 | 15 | public static void main(String[] args) { 16 | SpringApplication.run(gaoxiaohanfuzulinwangzhanApplication.class, args); 17 | } 18 | 19 | @Override 20 | protected SpringApplicationBuilder configure(SpringApplicationBuilder applicationBuilder) { 21 | return applicationBuilder.sources(gaoxiaohanfuzulinwangzhanApplication.class); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /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 | * @author yangliyuan 11 | * @version 创建时间:2020年2月7日 下午8:36:05 12 | * 类说明 : 13 | */ 14 | @TableName("config") 15 | public class ConfigEntity implements Serializable{ 16 | private static final long serialVersionUID = 1L; 17 | 18 | @TableId(type = IdType.AUTO) 19 | private Long id; 20 | 21 | /** 22 | * key 23 | */ 24 | private String name; 25 | 26 | /** 27 | * value 28 | */ 29 | private String value; 30 | 31 | public Long getId() { 32 | return id; 33 | } 34 | 35 | public void setId(Long id) { 36 | this.id = id; 37 | } 38 | 39 | public String getName() { 40 | return name; 41 | } 42 | 43 | public void setName(String name) { 44 | this.name = name; 45 | } 46 | 47 | public String getValue() { 48 | return value; 49 | } 50 | 51 | public void setValue(String value) { 52 | this.value = value; 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /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/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/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> pieSum(Map params); 12 | List> pieCount(Map params); 13 | List> barSumOne(Map params); 14 | List> barCountOne(Map params); 15 | List> barSumTwo(Map params); 16 | List> barCountTwo(Map params); 17 | Map queryScore(Map params); 18 | /** 19 | * 新的级联字典表的 分组求和方法 20 | * @param params 21 | * @return 22 | */ 23 | List> newSelectGroupSum(Map params); 24 | /** 25 | * 新的级联字典表的 分组条数统计统计方法方法 26 | * @param params 27 | * @return 28 | */ 29 | List> newSelectGroupCount(Map params); 30 | /** 31 | * 柱状图求和 32 | * @param params 33 | * @return 34 | */ 35 | List> barSum(Map params); 36 | 37 | /** 38 | * 柱状图统计 39 | * @param params 40 | * @return 41 | */ 42 | List> barCount(Map params); 43 | } 44 | -------------------------------------------------------------------------------- /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/entity/view/DictionaryView.java: -------------------------------------------------------------------------------- 1 | package com.entity.view; 2 | 3 | import org.apache.tools.ant.util.DateUtils; 4 | import com.annotation.ColumnInfo; 5 | import com.entity.DictionaryEntity; 6 | import com.baomidou.mybatisplus.annotations.TableName; 7 | import org.apache.commons.beanutils.BeanUtils; 8 | import java.lang.reflect.InvocationTargetException; 9 | import org.springframework.format.annotation.DateTimeFormat; 10 | import com.fasterxml.jackson.annotation.JsonFormat; 11 | import java.io.Serializable; 12 | import java.util.Date; 13 | import com.utils.DateUtil; 14 | 15 | /** 16 | * 字典 17 | * 后端返回视图实体辅助类 18 | * (通常后端关联的表或者自定义的字段需要返回使用) 19 | */ 20 | @TableName("dictionary") 21 | public class DictionaryView extends DictionaryEntity implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | //当前表 25 | 26 | 27 | 28 | 29 | public DictionaryView() { 30 | 31 | } 32 | 33 | public DictionaryView(DictionaryEntity dictionaryEntity) { 34 | try { 35 | BeanUtils.copyProperties(this, dictionaryEntity); 36 | } catch (IllegalAccessException | InvocationTargetException e) { 37 | // TODO Auto-generated catch block 38 | e.printStackTrace(); 39 | } 40 | } 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | @Override 49 | public String toString() { 50 | return "DictionaryView{" + 51 | "} " + super.toString(); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /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> pieSum(Map params); 8 | List> pieCount(Map params); 9 | List> barSumOne(Map params); 10 | List> barCountOne(Map params); 11 | List> barSumTwo(Map params); 12 | List> barCountTwo(Map params); 13 | 14 | /** 15 | tableName 查询表 16 | condition1 条件1 17 | condition1Value 条件1值 18 | average 计算平均评分 19 | * */ 20 | Map queryScore(Map params); 21 | /** 22 | * 新的级联字典表的 分组求和统计 23 | * @param params 24 | * @return 25 | */ 26 | List> newSelectGroupSum(Map params); 27 | /** 28 | * 新的级联字典表的 分组求和统计 29 | * @param params 30 | * @return 31 | */ 32 | List> newSelectGroupCount(Map params); 33 | /** 34 | * 柱状图求和 35 | * @param params 36 | * @return 37 | */ 38 | List> barSum(Map params); 39 | /** 40 | * 柱状图统计 41 | * @param params 42 | * @return 43 | */ 44 | List> barCount(Map params); 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/ForumServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | 3 | import com.utils.StringUtil; 4 | import com.service.DictionaryService; 5 | import com.utils.ClazzDiff; 6 | import org.springframework.beans.BeanUtils; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | import java.lang.reflect.Field; 10 | import java.util.*; 11 | import com.baomidou.mybatisplus.plugins.Page; 12 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 13 | import org.springframework.transaction.annotation.Transactional; 14 | import com.utils.PageUtils; 15 | import com.utils.Query; 16 | import org.springframework.web.context.ContextLoader; 17 | import javax.servlet.ServletContext; 18 | import javax.servlet.http.HttpServletRequest; 19 | import org.springframework.lang.Nullable; 20 | import org.springframework.util.Assert; 21 | import com.dao.ForumDao; 22 | import com.entity.ForumEntity; 23 | import com.service.ForumService; 24 | import com.entity.view.ForumView; 25 | 26 | /** 27 | * 交流论坛 服务实现类 28 | */ 29 | @Service("forumService") 30 | @Transactional 31 | public class ForumServiceImpl extends ServiceImpl implements ForumService { 32 | 33 | @Override 34 | public PageUtils queryPage(Map params) { 35 | Page page =new Query(params).getPage(); 36 | page.setRecords(baseMapper.selectListView(page,params)); 37 | return new PageUtils(page); 38 | } 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/HanfuServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | 3 | import com.utils.StringUtil; 4 | import com.service.DictionaryService; 5 | import com.utils.ClazzDiff; 6 | import org.springframework.beans.BeanUtils; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | import java.lang.reflect.Field; 10 | import java.util.*; 11 | import com.baomidou.mybatisplus.plugins.Page; 12 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 13 | import org.springframework.transaction.annotation.Transactional; 14 | import com.utils.PageUtils; 15 | import com.utils.Query; 16 | import org.springframework.web.context.ContextLoader; 17 | import javax.servlet.ServletContext; 18 | import javax.servlet.http.HttpServletRequest; 19 | import org.springframework.lang.Nullable; 20 | import org.springframework.util.Assert; 21 | import com.dao.HanfuDao; 22 | import com.entity.HanfuEntity; 23 | import com.service.HanfuService; 24 | import com.entity.view.HanfuView; 25 | 26 | /** 27 | * 汉服信息 服务实现类 28 | */ 29 | @Service("hanfuService") 30 | @Transactional 31 | public class HanfuServiceImpl extends ServiceImpl implements HanfuService { 32 | 33 | @Override 34 | public PageUtils queryPage(Map params) { 35 | Page page =new Query(params).getPage(); 36 | page.setRecords(baseMapper.selectListView(page,params)); 37 | return new PageUtils(page); 38 | } 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/YonghuServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | 3 | import com.utils.StringUtil; 4 | import com.service.DictionaryService; 5 | import com.utils.ClazzDiff; 6 | import org.springframework.beans.BeanUtils; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | import java.lang.reflect.Field; 10 | import java.util.*; 11 | import com.baomidou.mybatisplus.plugins.Page; 12 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 13 | import org.springframework.transaction.annotation.Transactional; 14 | import com.utils.PageUtils; 15 | import com.utils.Query; 16 | import org.springframework.web.context.ContextLoader; 17 | import javax.servlet.ServletContext; 18 | import javax.servlet.http.HttpServletRequest; 19 | import org.springframework.lang.Nullable; 20 | import org.springframework.util.Assert; 21 | import com.dao.YonghuDao; 22 | import com.entity.YonghuEntity; 23 | import com.service.YonghuService; 24 | import com.entity.view.YonghuView; 25 | 26 | /** 27 | * 用户 服务实现类 28 | */ 29 | @Service("yonghuService") 30 | @Transactional 31 | public class YonghuServiceImpl extends ServiceImpl implements YonghuService { 32 | 33 | @Override 34 | public PageUtils queryPage(Map params) { 35 | Page page =new Query(params).getPage(); 36 | page.setRecords(baseMapper.selectListView(page,params)); 37 | return new PageUtils(page); 38 | } 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /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 Integer 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 Integer getId() { 70 | return id; 71 | } 72 | 73 | public void setId(Integer id) { 74 | this.id = id; 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/GonggaoServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | 3 | import com.utils.StringUtil; 4 | import com.service.DictionaryService; 5 | import com.utils.ClazzDiff; 6 | import org.springframework.beans.BeanUtils; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | import java.lang.reflect.Field; 10 | import java.util.*; 11 | import com.baomidou.mybatisplus.plugins.Page; 12 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 13 | import org.springframework.transaction.annotation.Transactional; 14 | import com.utils.PageUtils; 15 | import com.utils.Query; 16 | import org.springframework.web.context.ContextLoader; 17 | import javax.servlet.ServletContext; 18 | import javax.servlet.http.HttpServletRequest; 19 | import org.springframework.lang.Nullable; 20 | import org.springframework.util.Assert; 21 | import com.dao.GonggaoDao; 22 | import com.entity.GonggaoEntity; 23 | import com.service.GonggaoService; 24 | import com.entity.view.GonggaoView; 25 | 26 | /** 27 | * 公告资讯 服务实现类 28 | */ 29 | @Service("gonggaoService") 30 | @Transactional 31 | public class GonggaoServiceImpl extends ServiceImpl implements GonggaoService { 32 | 33 | @Override 34 | public PageUtils queryPage(Map params) { 35 | Page page =new Query(params).getPage(); 36 | page.setRecords(baseMapper.selectListView(page,params)); 37 | return new PageUtils(page); 38 | } 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/HanfuOrderServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | 3 | import com.utils.StringUtil; 4 | import com.service.DictionaryService; 5 | import com.utils.ClazzDiff; 6 | import org.springframework.beans.BeanUtils; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | import java.lang.reflect.Field; 10 | import java.util.*; 11 | import com.baomidou.mybatisplus.plugins.Page; 12 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 13 | import org.springframework.transaction.annotation.Transactional; 14 | import com.utils.PageUtils; 15 | import com.utils.Query; 16 | import org.springframework.web.context.ContextLoader; 17 | import javax.servlet.ServletContext; 18 | import javax.servlet.http.HttpServletRequest; 19 | import org.springframework.lang.Nullable; 20 | import org.springframework.util.Assert; 21 | import com.dao.HanfuOrderDao; 22 | import com.entity.HanfuOrderEntity; 23 | import com.service.HanfuOrderService; 24 | import com.entity.view.HanfuOrderView; 25 | 26 | /** 27 | * 汉服租赁 服务实现类 28 | */ 29 | @Service("hanfuOrderService") 30 | @Transactional 31 | public class HanfuOrderServiceImpl extends ServiceImpl implements HanfuOrderService { 32 | 33 | @Override 34 | public PageUtils queryPage(Map params) { 35 | Page page =new Query(params).getPage(); 36 | page.setRecords(baseMapper.selectListView(page,params)); 37 | return new PageUtils(page); 38 | } 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 com.service.UsersService; 9 | import org.springframework.stereotype.Service; 10 | 11 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 12 | import com.baomidou.mybatisplus.mapper.Wrapper; 13 | import com.baomidou.mybatisplus.plugins.Page; 14 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 15 | import com.dao.UsersDao; 16 | import com.entity.UsersEntity; 17 | import com.utils.PageUtils; 18 | import com.utils.Query; 19 | 20 | 21 | /** 22 | * 系统用户 23 | * @author 24 | */ 25 | @Service("userService") 26 | public class UsersServiceImpl extends ServiceImpl implements UsersService { 27 | 28 | @Override 29 | public PageUtils queryPage(Map params) { 30 | Page page = this.selectPage( 31 | new Query(params).getPage(), 32 | new EntityWrapper() 33 | ); 34 | return new PageUtils(page); 35 | } 36 | 37 | @Override 38 | public List selectListView(Wrapper wrapper) { 39 | return baseMapper.selectListView(wrapper); 40 | } 41 | 42 | @Override 43 | public PageUtils queryPage(Map params, 44 | Wrapper wrapper) { 45 | Page page =new Query(params).getPage(); 46 | page.setRecords(baseMapper.selectListView(page,wrapper)); 47 | PageUtils pageUtil = new PageUtils(page); 48 | return pageUtil; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/HanfuCollectionServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | 3 | import com.utils.StringUtil; 4 | import com.service.DictionaryService; 5 | import com.utils.ClazzDiff; 6 | import org.springframework.beans.BeanUtils; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | import java.lang.reflect.Field; 10 | import java.util.*; 11 | import com.baomidou.mybatisplus.plugins.Page; 12 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 13 | import org.springframework.transaction.annotation.Transactional; 14 | import com.utils.PageUtils; 15 | import com.utils.Query; 16 | import org.springframework.web.context.ContextLoader; 17 | import javax.servlet.ServletContext; 18 | import javax.servlet.http.HttpServletRequest; 19 | import org.springframework.lang.Nullable; 20 | import org.springframework.util.Assert; 21 | import com.dao.HanfuCollectionDao; 22 | import com.entity.HanfuCollectionEntity; 23 | import com.service.HanfuCollectionService; 24 | import com.entity.view.HanfuCollectionView; 25 | 26 | /** 27 | * 汉服收藏 服务实现类 28 | */ 29 | @Service("hanfuCollectionService") 30 | @Transactional 31 | public class HanfuCollectionServiceImpl extends ServiceImpl implements HanfuCollectionService { 32 | 33 | @Override 34 | public PageUtils queryPage(Map params) { 35 | Page page =new Query(params).getPage(); 36 | page.setRecords(baseMapper.selectListView(page,params)); 37 | return new PageUtils(page); 38 | } 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/HanfuCommentbackServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | 3 | import com.utils.StringUtil; 4 | import com.service.DictionaryService; 5 | import com.utils.ClazzDiff; 6 | import org.springframework.beans.BeanUtils; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | import java.lang.reflect.Field; 10 | import java.util.*; 11 | import com.baomidou.mybatisplus.plugins.Page; 12 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 13 | import org.springframework.transaction.annotation.Transactional; 14 | import com.utils.PageUtils; 15 | import com.utils.Query; 16 | import org.springframework.web.context.ContextLoader; 17 | import javax.servlet.ServletContext; 18 | import javax.servlet.http.HttpServletRequest; 19 | import org.springframework.lang.Nullable; 20 | import org.springframework.util.Assert; 21 | import com.dao.HanfuCommentbackDao; 22 | import com.entity.HanfuCommentbackEntity; 23 | import com.service.HanfuCommentbackService; 24 | import com.entity.view.HanfuCommentbackView; 25 | 26 | /** 27 | * 汉服评价 服务实现类 28 | */ 29 | @Service("hanfuCommentbackService") 30 | @Transactional 31 | public class HanfuCommentbackServiceImpl extends ServiceImpl implements HanfuCommentbackService { 32 | 33 | @Override 34 | public PageUtils queryPage(Map params) { 35 | Page page =new Query(params).getPage(); 36 | page.setRecords(baseMapper.selectListView(page,params)); 37 | return new PageUtils(page); 38 | } 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /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:/img/") 35 | .addResourceLocations("classpath:/front/") 36 | .addResourceLocations("classpath:/public/"); 37 | super.addResourceHandlers(registry); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | # Tomcat 2 | server: 3 | tomcat: 4 | uri-encoding: UTF-8 5 | port: 8080 6 | servlet: 7 | context-path: /gaoxiaohanfuzulinwangzhan 8 | 9 | spring: 10 | datasource: 11 | driverClassName: com.mysql.cj.jdbc.Driver 12 | url: jdbc:mysql://127.0.0.1:3306/gaoxiaohanfuzulinwangzhan?useUnicode=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&useSSL=false 13 | username: root 14 | password: 123456 15 | 16 | 17 | servlet: 18 | multipart: 19 | max-file-size: 1000MB 20 | max-request-size: 1000MB 21 | resources: 22 | static-locations: classpath:static/,file:static/ 23 | 24 | #mybatis 25 | mybatis-plus: 26 | mapper-locations: classpath*:mapper/*.xml 27 | #实体扫描,多个package用逗号或者分号分隔 28 | typeAliasesPackage: com.entity 29 | global-config: 30 | #主键类型 0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID"; 31 | id-type: 1 32 | #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断" 33 | field-strategy: 2 34 | #驼峰下划线转换 35 | db-column-underline: true 36 | #刷新mapper 调试神器 37 | refresh-mapper: true 38 | #逻辑删除配置 39 | logic-delete-value: -1 40 | logic-not-delete-value: 0 41 | #自定义SQL注入器 42 | sql-injector: com.baomidou.mybatisplus.mapper.LogicSqlInjector 43 | configuration: 44 | map-underscore-to-camel-case: true 45 | cache-enabled: false 46 | call-setters-on-nulls: true 47 | #springboot 项目mybatis plus 设置 jdbcTypeForNull (oracle数据库需配置JdbcType.NULL, 默认是Other) 48 | jdbc-type-for-null: 'null' 49 | 50 | #打印sql语句 51 | logging: 52 | level: 53 | com.dao: debug -------------------------------------------------------------------------------- /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 | 1. 汉服首页:展示网站的主页。 14 | 2. 交流论坛:提供一个汉服爱好者的交流平台。 15 | 3. 公告资讯:发布网站相关的公告和资讯。 16 | 4. 汉服信息:展示各种类型的汉服。 17 | 5. 个人中心:用户可以管理个人信息。 18 | 19 | ### 后台: 20 | ### 管理员: 21 | 1. 个人中心:管理员可以管理个人信息,包括修改密码、查看个人资料等。 22 | 2. 管理员管理:管理员可以对其他管理员进行管理,包括添加、编辑、删除管理员账号等操作。 23 | 3. 用户管理:管理员可以对用户进行管理,包括查看用户列表、禁用用户账号等操作。 24 | 4. 汉服信息管理:管理员可以管理汉服的信息,包括添加、编辑、删除汉服信息等操作。 25 | 5. 交流论坛管理:管理员可以管理交流论坛的帖子和评论,包括审核、删除不当内容等操作。 26 | 6. 公告资讯管理:管理员可以管理公告资讯的发布和编辑,包括添加、编辑、删除公告等操作。 27 | 7. 基础数据管理:管理员可以管理网站的基础数据,包括汉服分类、活动标签等的添加、编辑、删除等操作。 28 | 8. 轮播图信息:管理员可以管理网站首页的轮播图信息,包括添加、编辑、删除轮播图等操作。 29 | 30 | 31 | 32 | 33 | 34 | 35 | 二、项目技术 36 | --- 37 | - 编程语言:Java 38 | - 数据库:MySQL 39 | - 项目管理工具:Maven 40 | - 前端技术:VUE、HTML、Jquery、Bootstrap 41 | - 后端技术:Spring、SpringMVC、MyBatis 42 | 43 | 三、运行环境 44 | --- 45 | - 操作系统:Windows、macOS都可以 46 | - JDK版本:JDK1.8以上都可以 47 | - 开发工具:IDEA、Ecplise、Myecplise都可以 48 | - 数据库: MySQL5.7以上都可以 49 | - Tomcat:任意版本都可以 50 | - Maven:任意版本都可以 51 | 52 | 四、运行截图 53 | --- 54 | ### 论文截图: 55 | ![image/1.png](limage/1.png) 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 | ![image/1.png](image/9.png) 67 | 68 | 69 | -------------------------------------------------------------------------------- /src/main/java/com/entity/view/YonghuView.java: -------------------------------------------------------------------------------- 1 | package com.entity.view; 2 | 3 | import org.apache.tools.ant.util.DateUtils; 4 | import com.annotation.ColumnInfo; 5 | import com.entity.YonghuEntity; 6 | import com.baomidou.mybatisplus.annotations.TableName; 7 | import org.apache.commons.beanutils.BeanUtils; 8 | import java.lang.reflect.InvocationTargetException; 9 | import org.springframework.format.annotation.DateTimeFormat; 10 | import com.fasterxml.jackson.annotation.JsonFormat; 11 | import java.io.Serializable; 12 | import java.util.Date; 13 | import com.utils.DateUtil; 14 | 15 | /** 16 | * 用户 17 | * 后端返回视图实体辅助类 18 | * (通常后端关联的表或者自定义的字段需要返回使用) 19 | */ 20 | @TableName("yonghu") 21 | public class YonghuView extends YonghuEntity implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | //当前表 25 | /** 26 | * 性别的值 27 | */ 28 | @ColumnInfo(comment="性别的字典表值",type="varchar(200)") 29 | private String sexValue; 30 | 31 | 32 | 33 | 34 | public YonghuView() { 35 | 36 | } 37 | 38 | public YonghuView(YonghuEntity yonghuEntity) { 39 | try { 40 | BeanUtils.copyProperties(this, yonghuEntity); 41 | } catch (IllegalAccessException | InvocationTargetException e) { 42 | // TODO Auto-generated catch block 43 | e.printStackTrace(); 44 | } 45 | } 46 | 47 | 48 | 49 | //当前表的 50 | /** 51 | * 获取: 性别的值 52 | */ 53 | public String getSexValue() { 54 | return sexValue; 55 | } 56 | /** 57 | * 设置: 性别的值 58 | */ 59 | public void setSexValue(String sexValue) { 60 | this.sexValue = sexValue; 61 | } 62 | 63 | 64 | 65 | 66 | @Override 67 | public String toString() { 68 | return "YonghuView{" + 69 | ", sexValue=" + sexValue + 70 | "} " + super.toString(); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/com/entity/view/HanfuView.java: -------------------------------------------------------------------------------- 1 | package com.entity.view; 2 | 3 | import org.apache.tools.ant.util.DateUtils; 4 | import com.annotation.ColumnInfo; 5 | import com.entity.HanfuEntity; 6 | import com.baomidou.mybatisplus.annotations.TableName; 7 | import org.apache.commons.beanutils.BeanUtils; 8 | import java.lang.reflect.InvocationTargetException; 9 | import org.springframework.format.annotation.DateTimeFormat; 10 | import com.fasterxml.jackson.annotation.JsonFormat; 11 | import java.io.Serializable; 12 | import java.util.Date; 13 | import com.utils.DateUtil; 14 | 15 | /** 16 | * 汉服信息 17 | * 后端返回视图实体辅助类 18 | * (通常后端关联的表或者自定义的字段需要返回使用) 19 | */ 20 | @TableName("hanfu") 21 | public class HanfuView extends HanfuEntity implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | //当前表 25 | /** 26 | * 汉服类型的值 27 | */ 28 | @ColumnInfo(comment="汉服类型的字典表值",type="varchar(200)") 29 | private String hanfuValue; 30 | 31 | 32 | 33 | 34 | public HanfuView() { 35 | 36 | } 37 | 38 | public HanfuView(HanfuEntity hanfuEntity) { 39 | try { 40 | BeanUtils.copyProperties(this, hanfuEntity); 41 | } catch (IllegalAccessException | InvocationTargetException e) { 42 | // TODO Auto-generated catch block 43 | e.printStackTrace(); 44 | } 45 | } 46 | 47 | 48 | 49 | //当前表的 50 | /** 51 | * 获取: 汉服类型的值 52 | */ 53 | public String getHanfuValue() { 54 | return hanfuValue; 55 | } 56 | /** 57 | * 设置: 汉服类型的值 58 | */ 59 | public void setHanfuValue(String hanfuValue) { 60 | this.hanfuValue = hanfuValue; 61 | } 62 | 63 | 64 | 65 | 66 | @Override 67 | public String toString() { 68 | return "HanfuView{" + 69 | ", hanfuValue=" + hanfuValue + 70 | "} " + super.toString(); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/com/utils/CommonUtil.java: -------------------------------------------------------------------------------- 1 | package com.utils; 2 | 3 | import java.util.*; 4 | 5 | /** 6 | * 公共方法 7 | */ 8 | public class CommonUtil { 9 | /** 10 | * 获取随机字符串 11 | * 12 | * @param num 13 | * @return 14 | */ 15 | public static String getRandomString(Integer num) { 16 | String base = "abcdefghijklmnopqrstuvwxyz0123456789"; 17 | Random random = new Random(); 18 | StringBuffer sb = new StringBuffer(); 19 | for (int i = 0; i < num; i++) { 20 | int number = random.nextInt(base.length()); 21 | sb.append(base.charAt(number)); 22 | } 23 | return sb.toString(); 24 | } 25 | 26 | 27 | /** 28 | * 检查map参数并添加缺失参数 29 | * @param params 30 | * @return 31 | */ 32 | public static void checkMap(Map params) { 33 | boolean page=true,limit=true,sort=true,order=true; 34 | Iterator> iter = params.entrySet().iterator(); 35 | while (iter.hasNext()) { 36 | Map.Entry info = iter.next(); 37 | Object key = info.getKey(); 38 | Object value = info.getValue(); 39 | if(value==null || "".equals(value) || "null".equals(value)){ 40 | iter.remove(); 41 | }else if("page".equals(key)){page=false; 42 | }else if("limit".equals(key)){limit=false; 43 | }else if("sort".equals(key)){sort=false; 44 | }else if("order".equals(key)){order=false; 45 | } 46 | } 47 | if(page){params.put("page","1");} 48 | if(limit){params.put("limit","10");} 49 | if(sort){params.put("sort","id");} 50 | if(order){params.put("order","desc");} 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/com/entity/view/GonggaoView.java: -------------------------------------------------------------------------------- 1 | package com.entity.view; 2 | 3 | import org.apache.tools.ant.util.DateUtils; 4 | import com.annotation.ColumnInfo; 5 | import com.entity.GonggaoEntity; 6 | import com.baomidou.mybatisplus.annotations.TableName; 7 | import org.apache.commons.beanutils.BeanUtils; 8 | import java.lang.reflect.InvocationTargetException; 9 | import org.springframework.format.annotation.DateTimeFormat; 10 | import com.fasterxml.jackson.annotation.JsonFormat; 11 | import java.io.Serializable; 12 | import java.util.Date; 13 | import com.utils.DateUtil; 14 | 15 | /** 16 | * 公告资讯 17 | * 后端返回视图实体辅助类 18 | * (通常后端关联的表或者自定义的字段需要返回使用) 19 | */ 20 | @TableName("gonggao") 21 | public class GonggaoView extends GonggaoEntity implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | //当前表 25 | /** 26 | * 公告类型的值 27 | */ 28 | @ColumnInfo(comment="公告类型的字典表值",type="varchar(200)") 29 | private String gonggaoValue; 30 | 31 | 32 | 33 | 34 | public GonggaoView() { 35 | 36 | } 37 | 38 | public GonggaoView(GonggaoEntity gonggaoEntity) { 39 | try { 40 | BeanUtils.copyProperties(this, gonggaoEntity); 41 | } catch (IllegalAccessException | InvocationTargetException e) { 42 | // TODO Auto-generated catch block 43 | e.printStackTrace(); 44 | } 45 | } 46 | 47 | 48 | 49 | //当前表的 50 | /** 51 | * 获取: 公告类型的值 52 | */ 53 | public String getGonggaoValue() { 54 | return gonggaoValue; 55 | } 56 | /** 57 | * 设置: 公告类型的值 58 | */ 59 | public void setGonggaoValue(String gonggaoValue) { 60 | this.gonggaoValue = gonggaoValue; 61 | } 62 | 63 | 64 | 65 | 66 | @Override 67 | public String toString() { 68 | return "GonggaoView{" + 69 | ", gonggaoValue=" + gonggaoValue + 70 | "} " + super.toString(); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /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/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 | * @author 18 | * @date 19 | */ 20 | @Service("commonService") 21 | public class CommonServiceImpl implements CommonService { 22 | 23 | @Autowired 24 | private CommonDao commonDao; 25 | 26 | public List> pieSum(Map params){ 27 | return commonDao.pieSum(params); 28 | } 29 | public List> pieCount(Map params){ 30 | return commonDao.pieCount(params); 31 | } 32 | public List> barSumOne(Map params){ 33 | return commonDao.barSumOne(params); 34 | } 35 | public List> barCountOne(Map params){ 36 | return commonDao.barCountOne(params); 37 | } 38 | public List> barSumTwo(Map params){ 39 | return commonDao.barSumTwo(params); 40 | } 41 | public List> barCountTwo(Map params){ 42 | return commonDao.barCountTwo(params); 43 | } 44 | /** 45 | tableName 查询表 46 | condition1 条件1 47 | condition1Value 条件1值 48 | average 计算平均评分 49 | * */ 50 | public Map queryScore(Map params){ 51 | return commonDao.queryScore(params); 52 | } 53 | /** 54 | * 新的级联字典表的 分组求和统计 55 | * @param params 56 | * @return 57 | */ 58 | @Override 59 | public List> newSelectGroupSum(Map params) { 60 | return commonDao.newSelectGroupSum(params); 61 | } 62 | /** 63 | * 新的级联字典表的 分组条数统计 64 | * @param params 65 | * @return 66 | */ 67 | @Override 68 | public List> newSelectGroupCount(Map params) { 69 | return commonDao.newSelectGroupCount(params); 70 | } 71 | /** 72 | * 柱状图求和 73 | * @param params 74 | * @return 75 | */ 76 | public List> barSum(Map params){ 77 | return commonDao.barSum(params); 78 | } 79 | 80 | /** 81 | * 柱状图统计 82 | * @param params 83 | * @return 84 | */ 85 | public List> barCount(Map params){ 86 | return commonDao.barCount(params); 87 | } 88 | 89 | } 90 | -------------------------------------------------------------------------------- /src/main/resources/mapper/GonggaoDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | a.id as id 8 | ,a.gonggao_name as gonggaoName 9 | ,a.gonggao_photo as gonggaoPhoto 10 | ,a.gonggao_types as gonggaoTypes 11 | ,a.insert_time as insertTime 12 | ,a.gonggao_content as gonggaoContent 13 | ,a.create_time as createTime 14 | 15 | 51 | 52 | -------------------------------------------------------------------------------- /src/main/java/com/ServletContextListener/DictionaryServletContextListener.java: -------------------------------------------------------------------------------- 1 | package com.ServletContextListener; 2 | 3 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 4 | import com.entity.DictionaryEntity; 5 | import com.service.DictionaryService; 6 | import com.thread.MyThreadMethod; 7 | import org.slf4j.Logger; 8 | import org.slf4j.LoggerFactory; 9 | import org.springframework.context.ApplicationContext; 10 | import org.springframework.web.context.support.WebApplicationContextUtils; 11 | 12 | import javax.servlet.ServletContextListener; 13 | import javax.servlet.ServletContextEvent; 14 | import javax.servlet.annotation.WebListener; 15 | import java.util.HashMap; 16 | import java.util.List; 17 | import java.util.Map; 18 | 19 | /** 20 | * 字典初始化监视器 用的是服务器监听,每次项目启动,都会调用这个类 21 | */ 22 | @WebListener 23 | public class DictionaryServletContextListener implements ServletContextListener { 24 | 25 | private static final Logger logger = LoggerFactory.getLogger(DictionaryServletContextListener.class); 26 | private MyThreadMethod myThreadMethod; 27 | @Override 28 | public void contextDestroyed(ServletContextEvent sce) { 29 | logger.info("----------服务器停止----------"); 30 | } 31 | 32 | @Override 33 | public void contextInitialized(ServletContextEvent sce) { 34 | ApplicationContext appContext = WebApplicationContextUtils.getWebApplicationContext(sce.getServletContext()); 35 | 36 | logger.info("----------字典表初始化开始----------"); 37 | DictionaryService dictionaryService = (DictionaryService)appContext.getBean("dictionaryService"); 38 | List dictionaryEntities = dictionaryService.selectList(new EntityWrapper()); 39 | Map> map = new HashMap<>(); 40 | for(DictionaryEntity d :dictionaryEntities){ 41 | Map m = map.get(d.getDicCode()); 42 | if(m ==null || m.isEmpty()){ 43 | m = new HashMap<>(); 44 | } 45 | m.put(d.getCodeIndex(),d.getIndexName()); 46 | map.put(d.getDicCode(),m); 47 | } 48 | sce.getServletContext().setAttribute("dictionaryMap", map); 49 | logger.info("----------字典表初始化完成----------"); 50 | 51 | 52 | 53 | logger.info("----------线程执行开始----------"); 54 | if (myThreadMethod == null) { 55 | myThreadMethod = new MyThreadMethod(); 56 | myThreadMethod.start(); // servlet 上下文初始化时启动线程myThreadMethod 57 | } 58 | logger.info("----------线程执行结束----------"); 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /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 | * @author 28 | */ 29 | @Service("tokenService") 30 | public class TokenServiceImpl extends ServiceImpl implements TokenService { 31 | 32 | @Override 33 | public PageUtils queryPage(Map params) { 34 | Page page = this.selectPage( 35 | new Query(params).getPage(), 36 | new EntityWrapper() 37 | ); 38 | return new PageUtils(page); 39 | } 40 | 41 | @Override 42 | public List selectListView(Wrapper wrapper) { 43 | return baseMapper.selectListView(wrapper); 44 | } 45 | 46 | @Override 47 | public PageUtils queryPage(Map params, 48 | Wrapper wrapper) { 49 | Page page =new Query(params).getPage(); 50 | page.setRecords(baseMapper.selectListView(page,wrapper)); 51 | PageUtils pageUtil = new PageUtils(page); 52 | return pageUtil; 53 | } 54 | 55 | @Override 56 | public String generateToken(Integer userid,String username, String tableName, String role) { 57 | TokenEntity tokenEntity = this.selectOne(new EntityWrapper().eq("userid", userid).eq("role", role)); 58 | String token = CommonUtil.getRandomString(32); 59 | Calendar cal = Calendar.getInstance(); 60 | cal.setTime(new Date()); 61 | cal.add(Calendar.HOUR_OF_DAY, 1); 62 | if(tokenEntity!=null) { 63 | tokenEntity.setToken(token); 64 | tokenEntity.setExpiratedtime(cal.getTime()); 65 | this.updateById(tokenEntity); 66 | } else { 67 | this.insert(new TokenEntity(userid,username, tableName, role, token, cal.getTime())); 68 | } 69 | return token; 70 | } 71 | 72 | @Override 73 | public TokenEntity getTokenEntity(String token) { 74 | TokenEntity tokenEntity = this.selectOne(new EntityWrapper().eq("token", token)); 75 | if(tokenEntity == null || tokenEntity.getExpiratedtime().getTime() 2 | 3 | 4 | 5 | 6 | 7 | a.id as id 8 | ,a.dic_code as dicCode 9 | ,a.dic_name as dicName 10 | ,a.code_index as codeIndex 11 | ,a.index_name as indexName 12 | ,a.super_id as superId 13 | ,a.beizhu as beizhu 14 | ,a.create_time as createTime 15 | 16 | 60 | 61 | -------------------------------------------------------------------------------- /src/main/java/com/entity/TokenEntity.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 | * token表 12 | */ 13 | @TableName("token") 14 | public class TokenEntity implements Serializable { 15 | private static final long serialVersionUID = 1L; 16 | 17 | @TableId(type = IdType.AUTO) 18 | private Integer id; 19 | 20 | /** 21 | * 用户id 22 | */ 23 | private Integer userid; 24 | 25 | /** 26 | * 用户名 27 | */ 28 | private String username; 29 | 30 | /** 31 | * 表名 32 | */ 33 | private String tablename; 34 | 35 | /** 36 | * 角色 37 | */ 38 | private String role; 39 | 40 | /** 41 | * token 42 | */ 43 | private String token; 44 | 45 | /** 46 | * 过期时间 47 | */ 48 | private Date expiratedtime; 49 | 50 | /** 51 | * 新增时间 52 | */ 53 | private Date addtime; 54 | 55 | public Integer getId() { 56 | return id; 57 | } 58 | 59 | public void setId(Integer id) { 60 | this.id = id; 61 | } 62 | 63 | public Integer getUserid() { 64 | return userid; 65 | } 66 | 67 | public void setUserid(Integer userid) { 68 | this.userid = userid; 69 | } 70 | 71 | public String getRole() { 72 | return role; 73 | } 74 | 75 | public void setRole(String role) { 76 | this.role = role; 77 | } 78 | 79 | public String getToken() { 80 | return token; 81 | } 82 | 83 | public String getTablename() { 84 | return tablename; 85 | } 86 | 87 | public void setTablename(String tablename) { 88 | this.tablename = tablename; 89 | } 90 | 91 | public void setToken(String token) { 92 | this.token = token; 93 | } 94 | 95 | public Date getExpiratedtime() { 96 | return expiratedtime; 97 | } 98 | 99 | public void setExpiratedtime(Date expiratedtime) { 100 | this.expiratedtime = expiratedtime; 101 | } 102 | 103 | public Date getAddtime() { 104 | return addtime; 105 | } 106 | 107 | public void setAddtime(Date addtime) { 108 | this.addtime = addtime; 109 | } 110 | 111 | public String getUsername() { 112 | return username; 113 | } 114 | 115 | public void setUsername(String username) { 116 | this.username = username; 117 | } 118 | 119 | public TokenEntity(Integer userid, String username, String tablename,String role, String token, Date expiratedtime) { 120 | super(); 121 | this.userid = userid; 122 | this.username = username; 123 | this.tablename = tablename; 124 | this.role = role; 125 | this.token = token; 126 | this.expiratedtime = expiratedtime; 127 | } 128 | 129 | public TokenEntity() { 130 | } 131 | 132 | } 133 | -------------------------------------------------------------------------------- /src/main/java/com/utils/Query.java: -------------------------------------------------------------------------------- 1 | 2 | package com.utils; 3 | 4 | import java.util.LinkedHashMap; 5 | import java.util.Map; 6 | 7 | import org.apache.commons.lang3.StringUtils; 8 | 9 | import com.baomidou.mybatisplus.plugins.Page; 10 | 11 | /** 12 | * 查询参数 13 | */ 14 | public class Query 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.valueOf(params.get("page"))); 61 | } 62 | if(params.get("limit") != null){ 63 | limit = Integer.parseInt(String.valueOf(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/java/com/entity/model/HanfuCollectionModel.java: -------------------------------------------------------------------------------- 1 | package com.entity.model; 2 | 3 | import com.entity.HanfuCollectionEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import com.fasterxml.jackson.annotation.JsonFormat; 7 | import java.util.Date; 8 | import org.springframework.format.annotation.DateTimeFormat; 9 | import java.io.Serializable; 10 | 11 | 12 | /** 13 | * 汉服收藏 14 | * 接收传参的实体类 15 | *(实际开发中配合移动端接口开发手动去掉些没用的字段, 后端一般用entity就够用了) 16 | * 取自ModelAndView 的model名称 17 | */ 18 | public class HanfuCollectionModel implements Serializable { 19 | private static final long serialVersionUID = 1L; 20 | 21 | 22 | 23 | 24 | /** 25 | * 主键 26 | */ 27 | private Integer id; 28 | 29 | 30 | /** 31 | * 汉服 32 | */ 33 | private Integer hanfuId; 34 | 35 | 36 | /** 37 | * 用户 38 | */ 39 | private Integer yonghuId; 40 | 41 | 42 | /** 43 | * 类型 44 | */ 45 | private Integer hanfuCollectionTypes; 46 | 47 | 48 | /** 49 | * 收藏时间 50 | */ 51 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 52 | @DateTimeFormat 53 | private Date insertTime; 54 | 55 | 56 | /** 57 | * 创建时间 show3 photoShow 58 | */ 59 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 60 | @DateTimeFormat 61 | private Date createTime; 62 | 63 | 64 | /** 65 | * 获取:主键 66 | */ 67 | public Integer getId() { 68 | return id; 69 | } 70 | 71 | 72 | /** 73 | * 设置:主键 74 | */ 75 | public void setId(Integer id) { 76 | this.id = id; 77 | } 78 | /** 79 | * 获取:汉服 80 | */ 81 | public Integer getHanfuId() { 82 | return hanfuId; 83 | } 84 | 85 | 86 | /** 87 | * 设置:汉服 88 | */ 89 | public void setHanfuId(Integer hanfuId) { 90 | this.hanfuId = hanfuId; 91 | } 92 | /** 93 | * 获取:用户 94 | */ 95 | public Integer getYonghuId() { 96 | return yonghuId; 97 | } 98 | 99 | 100 | /** 101 | * 设置:用户 102 | */ 103 | public void setYonghuId(Integer yonghuId) { 104 | this.yonghuId = yonghuId; 105 | } 106 | /** 107 | * 获取:类型 108 | */ 109 | public Integer getHanfuCollectionTypes() { 110 | return hanfuCollectionTypes; 111 | } 112 | 113 | 114 | /** 115 | * 设置:类型 116 | */ 117 | public void setHanfuCollectionTypes(Integer hanfuCollectionTypes) { 118 | this.hanfuCollectionTypes = hanfuCollectionTypes; 119 | } 120 | /** 121 | * 获取:收藏时间 122 | */ 123 | public Date getInsertTime() { 124 | return insertTime; 125 | } 126 | 127 | 128 | /** 129 | * 设置:收藏时间 130 | */ 131 | public void setInsertTime(Date insertTime) { 132 | this.insertTime = insertTime; 133 | } 134 | /** 135 | * 获取:创建时间 show3 photoShow 136 | */ 137 | public Date getCreateTime() { 138 | return createTime; 139 | } 140 | 141 | 142 | /** 143 | * 设置:创建时间 show3 photoShow 144 | */ 145 | public void setCreateTime(Date createTime) { 146 | this.createTime = createTime; 147 | } 148 | 149 | } 150 | -------------------------------------------------------------------------------- /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.PageUtils; 21 | import com.utils.R; 22 | import com.utils.ValidatorUtils; 23 | 24 | /** 25 | * 登录相关 26 | */ 27 | @RequestMapping("config") 28 | @RestController 29 | public class ConfigController{ 30 | 31 | @Autowired 32 | private ConfigService configService; 33 | 34 | /** 35 | * 列表 36 | */ 37 | @RequestMapping("/page") 38 | public R page(@RequestParam Map params,ConfigEntity config){ 39 | EntityWrapper ew = new EntityWrapper(); 40 | PageUtils page = configService.queryPage(params); 41 | return R.ok().put("data", page); 42 | } 43 | 44 | /** 45 | * 列表 46 | */ 47 | @IgnoreAuth 48 | @RequestMapping("/list") 49 | public R list(@RequestParam Map params,ConfigEntity config){ 50 | EntityWrapper ew = new EntityWrapper(); 51 | PageUtils page = configService.queryPage(params); 52 | return R.ok().put("data", page); 53 | } 54 | 55 | /** 56 | * 信息 57 | */ 58 | @RequestMapping("/info/{id}") 59 | public R info(@PathVariable("id") String id){ 60 | ConfigEntity config = configService.selectById(id); 61 | return R.ok().put("data", config); 62 | } 63 | 64 | /** 65 | * 详情 66 | */ 67 | @IgnoreAuth 68 | @RequestMapping("/detail/{id}") 69 | public R detail(@PathVariable("id") String id){ 70 | ConfigEntity config = configService.selectById(id); 71 | return R.ok().put("data", config); 72 | } 73 | 74 | /** 75 | * 根据name获取信息 76 | */ 77 | @RequestMapping("/info") 78 | public R infoByName(@RequestParam String name){ 79 | ConfigEntity config = configService.selectOne(new EntityWrapper().eq("name", "faceFile")); 80 | return R.ok().put("data", config); 81 | } 82 | 83 | /** 84 | * 保存 85 | */ 86 | @PostMapping("/save") 87 | public R save(@RequestBody ConfigEntity config){ 88 | // ValidatorUtils.validateEntity(config); 89 | configService.insert(config); 90 | return R.ok(); 91 | } 92 | 93 | /** 94 | * 修改 95 | */ 96 | @RequestMapping("/update") 97 | public R update(@RequestBody ConfigEntity config){ 98 | // ValidatorUtils.validateEntity(config); 99 | configService.updateById(config);//全部更新 100 | return R.ok(); 101 | } 102 | 103 | /** 104 | * 删除 105 | */ 106 | @RequestMapping("/delete") 107 | public R delete(@RequestBody Long[] ids){ 108 | configService.deleteBatchIds(Arrays.asList(ids)); 109 | return R.ok(); 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /src/main/java/com/entity/vo/HanfuCollectionVO.java: -------------------------------------------------------------------------------- 1 | package com.entity.vo; 2 | 3 | import com.entity.HanfuCollectionEntity; 4 | import com.baomidou.mybatisplus.annotations.TableField; 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import com.fasterxml.jackson.annotation.JsonFormat; 7 | import java.util.Date; 8 | import org.springframework.format.annotation.DateTimeFormat; 9 | 10 | import java.io.Serializable; 11 | 12 | /** 13 | * 汉服收藏 14 | * 手机端接口返回实体辅助类 15 | * (主要作用去除一些不必要的字段) 16 | */ 17 | @TableName("hanfu_collection") 18 | public class HanfuCollectionVO implements Serializable { 19 | private static final long serialVersionUID = 1L; 20 | 21 | 22 | /** 23 | * 主键 24 | */ 25 | 26 | @TableField(value = "id") 27 | private Integer id; 28 | 29 | 30 | /** 31 | * 汉服 32 | */ 33 | 34 | @TableField(value = "hanfu_id") 35 | private Integer hanfuId; 36 | 37 | 38 | /** 39 | * 用户 40 | */ 41 | 42 | @TableField(value = "yonghu_id") 43 | private Integer yonghuId; 44 | 45 | 46 | /** 47 | * 类型 48 | */ 49 | 50 | @TableField(value = "hanfu_collection_types") 51 | private Integer hanfuCollectionTypes; 52 | 53 | 54 | /** 55 | * 收藏时间 56 | */ 57 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 58 | @DateTimeFormat 59 | 60 | @TableField(value = "insert_time") 61 | private Date insertTime; 62 | 63 | 64 | /** 65 | * 创建时间 show3 photoShow 66 | */ 67 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 68 | @DateTimeFormat 69 | 70 | @TableField(value = "create_time") 71 | private Date createTime; 72 | 73 | 74 | /** 75 | * 设置:主键 76 | */ 77 | public Integer getId() { 78 | return id; 79 | } 80 | 81 | 82 | /** 83 | * 获取:主键 84 | */ 85 | 86 | public void setId(Integer id) { 87 | this.id = id; 88 | } 89 | /** 90 | * 设置:汉服 91 | */ 92 | public Integer getHanfuId() { 93 | return hanfuId; 94 | } 95 | 96 | 97 | /** 98 | * 获取:汉服 99 | */ 100 | 101 | public void setHanfuId(Integer hanfuId) { 102 | this.hanfuId = hanfuId; 103 | } 104 | /** 105 | * 设置:用户 106 | */ 107 | public Integer getYonghuId() { 108 | return yonghuId; 109 | } 110 | 111 | 112 | /** 113 | * 获取:用户 114 | */ 115 | 116 | public void setYonghuId(Integer yonghuId) { 117 | this.yonghuId = yonghuId; 118 | } 119 | /** 120 | * 设置:类型 121 | */ 122 | public Integer getHanfuCollectionTypes() { 123 | return hanfuCollectionTypes; 124 | } 125 | 126 | 127 | /** 128 | * 获取:类型 129 | */ 130 | 131 | public void setHanfuCollectionTypes(Integer hanfuCollectionTypes) { 132 | this.hanfuCollectionTypes = hanfuCollectionTypes; 133 | } 134 | /** 135 | * 设置:收藏时间 136 | */ 137 | public Date getInsertTime() { 138 | return insertTime; 139 | } 140 | 141 | 142 | /** 143 | * 获取:收藏时间 144 | */ 145 | 146 | public void setInsertTime(Date insertTime) { 147 | this.insertTime = insertTime; 148 | } 149 | /** 150 | * 设置:创建时间 show3 photoShow 151 | */ 152 | public Date getCreateTime() { 153 | return createTime; 154 | } 155 | 156 | 157 | /** 158 | * 获取:创建时间 show3 photoShow 159 | */ 160 | 161 | public void setCreateTime(Date createTime) { 162 | this.createTime = createTime; 163 | } 164 | 165 | } 166 | -------------------------------------------------------------------------------- /src/main/resources/mapper/YonghuDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | a.id as id 8 | ,a.username as username 9 | ,a.password as password 10 | ,a.yonghu_uuid_number as yonghuUuidNumber 11 | ,a.yonghu_name as yonghuName 12 | ,a.yonghu_phone as yonghuPhone 13 | ,a.yonghu_id_number as yonghuIdNumber 14 | ,a.yonghu_photo as yonghuPhoto 15 | ,a.sex_types as sexTypes 16 | ,a.new_money as newMoney 17 | ,a.yonghu_email as yonghuEmail 18 | ,a.create_time as createTime 19 | 20 | 71 | 72 | -------------------------------------------------------------------------------- /src/main/java/com/entity/model/GonggaoModel.java: -------------------------------------------------------------------------------- 1 | package com.entity.model; 2 | 3 | import com.entity.GonggaoEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import com.fasterxml.jackson.annotation.JsonFormat; 7 | import java.util.Date; 8 | import org.springframework.format.annotation.DateTimeFormat; 9 | import java.io.Serializable; 10 | 11 | 12 | /** 13 | * 公告资讯 14 | * 接收传参的实体类 15 | *(实际开发中配合移动端接口开发手动去掉些没用的字段, 后端一般用entity就够用了) 16 | * 取自ModelAndView 的model名称 17 | */ 18 | public class GonggaoModel implements Serializable { 19 | private static final long serialVersionUID = 1L; 20 | 21 | 22 | 23 | 24 | /** 25 | * 主键 26 | */ 27 | private Integer id; 28 | 29 | 30 | /** 31 | * 公告名称 32 | */ 33 | private String gonggaoName; 34 | 35 | 36 | /** 37 | * 公告图片 38 | */ 39 | private String gonggaoPhoto; 40 | 41 | 42 | /** 43 | * 公告类型 44 | */ 45 | private Integer gonggaoTypes; 46 | 47 | 48 | /** 49 | * 发布时间 50 | */ 51 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 52 | @DateTimeFormat 53 | private Date insertTime; 54 | 55 | 56 | /** 57 | * 公告详情 58 | */ 59 | private String gonggaoContent; 60 | 61 | 62 | /** 63 | * 创建时间 show1 show2 nameShow 64 | */ 65 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 66 | @DateTimeFormat 67 | private Date createTime; 68 | 69 | 70 | /** 71 | * 获取:主键 72 | */ 73 | public Integer getId() { 74 | return id; 75 | } 76 | 77 | 78 | /** 79 | * 设置:主键 80 | */ 81 | public void setId(Integer id) { 82 | this.id = id; 83 | } 84 | /** 85 | * 获取:公告名称 86 | */ 87 | public String getGonggaoName() { 88 | return gonggaoName; 89 | } 90 | 91 | 92 | /** 93 | * 设置:公告名称 94 | */ 95 | public void setGonggaoName(String gonggaoName) { 96 | this.gonggaoName = gonggaoName; 97 | } 98 | /** 99 | * 获取:公告图片 100 | */ 101 | public String getGonggaoPhoto() { 102 | return gonggaoPhoto; 103 | } 104 | 105 | 106 | /** 107 | * 设置:公告图片 108 | */ 109 | public void setGonggaoPhoto(String gonggaoPhoto) { 110 | this.gonggaoPhoto = gonggaoPhoto; 111 | } 112 | /** 113 | * 获取:公告类型 114 | */ 115 | public Integer getGonggaoTypes() { 116 | return gonggaoTypes; 117 | } 118 | 119 | 120 | /** 121 | * 设置:公告类型 122 | */ 123 | public void setGonggaoTypes(Integer gonggaoTypes) { 124 | this.gonggaoTypes = gonggaoTypes; 125 | } 126 | /** 127 | * 获取:发布时间 128 | */ 129 | public Date getInsertTime() { 130 | return insertTime; 131 | } 132 | 133 | 134 | /** 135 | * 设置:发布时间 136 | */ 137 | public void setInsertTime(Date insertTime) { 138 | this.insertTime = insertTime; 139 | } 140 | /** 141 | * 获取:公告详情 142 | */ 143 | public String getGonggaoContent() { 144 | return gonggaoContent; 145 | } 146 | 147 | 148 | /** 149 | * 设置:公告详情 150 | */ 151 | public void setGonggaoContent(String gonggaoContent) { 152 | this.gonggaoContent = gonggaoContent; 153 | } 154 | /** 155 | * 获取:创建时间 show1 show2 nameShow 156 | */ 157 | public Date getCreateTime() { 158 | return createTime; 159 | } 160 | 161 | 162 | /** 163 | * 设置:创建时间 show1 show2 nameShow 164 | */ 165 | public void setCreateTime(Date createTime) { 166 | this.createTime = createTime; 167 | } 168 | 169 | } 170 | -------------------------------------------------------------------------------- /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 | 17 | import com.annotation.IgnoreAuth; 18 | import com.entity.EIException; 19 | import com.entity.TokenEntity; 20 | import com.service.TokenService; 21 | import com.utils.R; 22 | 23 | /** 24 | * 权限(Token)验证 25 | */ 26 | @Component 27 | public class AuthorizationInterceptor implements HandlerInterceptor { 28 | 29 | public static final String LOGIN_TOKEN_KEY = "Token"; 30 | 31 | @Autowired 32 | private TokenService tokenService; 33 | 34 | @Override 35 | 36 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { 37 | 38 | 39 | String servletPath = request.getServletPath(); 40 | if("/dictionary/page".equals(request.getServletPath()) || "/file/upload".equals(request.getServletPath()) || "/yonghu/register".equals(request.getServletPath()) ){//请求路径是字典表或者文件上传 直接放行 41 | return true; 42 | } 43 | //支持跨域请求 44 | response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); 45 | response.setHeader("Access-Control-Max-Age", "3600"); 46 | response.setHeader("Access-Control-Allow-Credentials", "true"); 47 | response.setHeader("Access-Control-Allow-Headers", "x-requested-with,request-source,Token, Origin,imgType, Content-Type, cache-control,postman-token,Cookie, Accept,authorization"); 48 | response.setHeader("Access-Control-Allow-Origin", request.getHeader("Origin")); 49 | 50 | IgnoreAuth annotation; 51 | if (handler instanceof HandlerMethod) { 52 | annotation = ((HandlerMethod) handler).getMethodAnnotation(IgnoreAuth.class); 53 | } else { 54 | return true; 55 | } 56 | 57 | //从header中获取token 58 | String token = request.getHeader(LOGIN_TOKEN_KEY); 59 | 60 | /** 61 | * 不需要验证权限的方法直接放过 62 | */ 63 | if(annotation!=null) { 64 | return true; 65 | } 66 | 67 | TokenEntity tokenEntity = null; 68 | if(StringUtils.isNotBlank(token)) { 69 | tokenEntity = tokenService.getTokenEntity(token); 70 | } 71 | 72 | if(tokenEntity != null) { 73 | request.getSession().setAttribute("userId", tokenEntity.getUserid()); 74 | request.getSession().setAttribute("role", tokenEntity.getRole()); 75 | request.getSession().setAttribute("tableName", tokenEntity.getTablename()); 76 | request.getSession().setAttribute("username", tokenEntity.getUsername()); 77 | return true; 78 | } 79 | 80 | PrintWriter writer = null; 81 | response.setCharacterEncoding("UTF-8"); 82 | response.setContentType("application/json; charset=utf-8"); 83 | try { 84 | writer = response.getWriter(); 85 | writer.print(JSONObject.toJSONString(R.error(401, "请先登录"))); 86 | } finally { 87 | if(writer != null){ 88 | writer.close(); 89 | } 90 | } 91 | // throw new EIException("请先登录", 401); 92 | return false; 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /src/main/java/com/entity/model/DictionaryModel.java: -------------------------------------------------------------------------------- 1 | package com.entity.model; 2 | 3 | import com.entity.DictionaryEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import com.fasterxml.jackson.annotation.JsonFormat; 7 | import java.util.Date; 8 | import org.springframework.format.annotation.DateTimeFormat; 9 | import java.io.Serializable; 10 | 11 | 12 | /** 13 | * 字典 14 | * 接收传参的实体类 15 | *(实际开发中配合移动端接口开发手动去掉些没用的字段, 后端一般用entity就够用了) 16 | * 取自ModelAndView 的model名称 17 | */ 18 | public class DictionaryModel implements Serializable { 19 | private static final long serialVersionUID = 1L; 20 | 21 | 22 | 23 | 24 | /** 25 | * 主键 26 | */ 27 | private Long id; 28 | 29 | 30 | /** 31 | * 字段 32 | */ 33 | private String dicCode; 34 | 35 | 36 | /** 37 | * 字段名 38 | */ 39 | private String dicName; 40 | 41 | 42 | /** 43 | * 编码 44 | */ 45 | private Integer codeIndex; 46 | 47 | 48 | /** 49 | * 编码名字 50 | */ 51 | private String indexName; 52 | 53 | 54 | /** 55 | * 父字段id 56 | */ 57 | private Integer superId; 58 | 59 | 60 | /** 61 | * 备注 62 | */ 63 | private String beizhu; 64 | 65 | 66 | /** 67 | * 创建时间 68 | */ 69 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 70 | @DateTimeFormat 71 | private Date createTime; 72 | 73 | 74 | /** 75 | * 获取:主键 76 | */ 77 | public Long getId() { 78 | return id; 79 | } 80 | 81 | 82 | /** 83 | * 设置:主键 84 | */ 85 | public void setId(Long id) { 86 | this.id = id; 87 | } 88 | /** 89 | * 获取:字段 90 | */ 91 | public String getDicCode() { 92 | return dicCode; 93 | } 94 | 95 | 96 | /** 97 | * 设置:字段 98 | */ 99 | public void setDicCode(String dicCode) { 100 | this.dicCode = dicCode; 101 | } 102 | /** 103 | * 获取:字段名 104 | */ 105 | public String getDicName() { 106 | return dicName; 107 | } 108 | 109 | 110 | /** 111 | * 设置:字段名 112 | */ 113 | public void setDicName(String dicName) { 114 | this.dicName = dicName; 115 | } 116 | /** 117 | * 获取:编码 118 | */ 119 | public Integer getCodeIndex() { 120 | return codeIndex; 121 | } 122 | 123 | 124 | /** 125 | * 设置:编码 126 | */ 127 | public void setCodeIndex(Integer codeIndex) { 128 | this.codeIndex = codeIndex; 129 | } 130 | /** 131 | * 获取:编码名字 132 | */ 133 | public String getIndexName() { 134 | return indexName; 135 | } 136 | 137 | 138 | /** 139 | * 设置:编码名字 140 | */ 141 | public void setIndexName(String indexName) { 142 | this.indexName = indexName; 143 | } 144 | /** 145 | * 获取:父字段id 146 | */ 147 | public Integer getSuperId() { 148 | return superId; 149 | } 150 | 151 | 152 | /** 153 | * 设置:父字段id 154 | */ 155 | public void setSuperId(Integer superId) { 156 | this.superId = superId; 157 | } 158 | /** 159 | * 获取:备注 160 | */ 161 | public String getBeizhu() { 162 | return beizhu; 163 | } 164 | 165 | 166 | /** 167 | * 设置:备注 168 | */ 169 | public void setBeizhu(String beizhu) { 170 | this.beizhu = beizhu; 171 | } 172 | /** 173 | * 获取:创建时间 174 | */ 175 | public Date getCreateTime() { 176 | return createTime; 177 | } 178 | 179 | 180 | /** 181 | * 设置:创建时间 182 | */ 183 | public void setCreateTime(Date createTime) { 184 | this.createTime = createTime; 185 | } 186 | 187 | } 188 | -------------------------------------------------------------------------------- /src/main/java/com/utils/BaiduUtil.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 | import java.util.HashMap; 8 | import java.util.List; 9 | import java.util.Map; 10 | 11 | import org.json.JSONObject; 12 | 13 | 14 | /** 15 | * @author yangliyuan 16 | * @version 创建时间:2020年2月7日 下午9:37:05 17 | * 类说明 : 18 | */ 19 | 20 | public class BaiduUtil { 21 | 22 | /** 23 | * 根据经纬度获得省市区信息 24 | * @param lon 纬度 25 | * @param lat 经度 26 | * @param coordtype 经纬度坐标系 27 | * @return 28 | */ 29 | public static Map getCityByLonLat(String key, String lng, String lat) { 30 | String location = lat + "," + lng; 31 | try { 32 | //拼装url 33 | String url = "http://api.map.baidu.com/reverse_geocoding/v3/?ak="+key+"&output=json&coordtype=wgs84ll&location="+location; 34 | String result = HttpClientUtils.doGet(url); 35 | JSONObject o = new JSONObject(result); 36 | Map area = new HashMap<>(); 37 | area.put("province", o.getJSONObject("result").getJSONObject("addressComponent").getString("province")); 38 | area.put("city", o.getJSONObject("result").getJSONObject("addressComponent").getString("city")); 39 | area.put("district", o.getJSONObject("result").getJSONObject("addressComponent").getString("district")); 40 | area.put("street", o.getJSONObject("result").getJSONObject("addressComponent").getString("street")); 41 | return area; 42 | }catch (Exception e) { 43 | e.printStackTrace(); 44 | } 45 | return null; 46 | } 47 | 48 | /** 49 | * 获取API访问token 50 | * 该token有一定的有效期,需要自行管理,当失效时需重新获取. 51 | * @param ak - 百度云官网获取的 API Key 52 | * @param sk - 百度云官网获取的 Securet Key 53 | * @return assess_token 54 | */ 55 | public static String getAuth(String ak, String sk) { 56 | // 获取token地址 57 | String authHost = "https://aip.baidubce.com/oauth/2.0/token?"; 58 | String getAccessTokenUrl = authHost 59 | // 1. grant_type为固定参数 60 | + "grant_type=client_credentials" 61 | // 2. 官网获取的 API Key 62 | + "&client_id=" + ak 63 | // 3. 官网获取的 Secret Key 64 | + "&client_secret=" + sk; 65 | try { 66 | URL realUrl = new URL(getAccessTokenUrl); 67 | // 打开和URL之间的连接 68 | HttpURLConnection connection = (HttpURLConnection) realUrl.openConnection(); 69 | connection.setRequestMethod("GET"); 70 | connection.connect(); 71 | // 获取所有响应头字段 72 | Map> map = connection.getHeaderFields(); 73 | // 遍历所有的响应头字段 74 | for (String key : map.keySet()) { 75 | System.err.println(key + "--->" + map.get(key)); 76 | } 77 | // 定义 BufferedReader输入流来读取URL的响应 78 | BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream())); 79 | String result = ""; 80 | String line; 81 | while ((line = in.readLine()) != null) { 82 | result += line; 83 | } 84 | /** 85 | * 返回结果示例 86 | */ 87 | System.err.println("result:" + result); 88 | org.json.JSONObject jsonObject = new org.json.JSONObject(result); 89 | String access_token = jsonObject.getString("access_token"); 90 | return access_token; 91 | } catch (Exception e) { 92 | System.err.printf("获取token失败!"); 93 | e.printStackTrace(System.err); 94 | } 95 | return null; 96 | } 97 | 98 | } 99 | -------------------------------------------------------------------------------- /src/main/java/com/utils/PoiUtil.java: -------------------------------------------------------------------------------- 1 | package com.utils; 2 | 3 | import org.apache.commons.io.FileUtils; 4 | import org.apache.poi.hssf.usermodel.HSSFCell; 5 | import org.apache.poi.hssf.usermodel.HSSFRow; 6 | import org.apache.poi.hssf.usermodel.HSSFSheet; 7 | import org.apache.poi.hssf.usermodel.HSSFWorkbook; 8 | import org.apache.poi.ss.usermodel.Cell; 9 | 10 | import java.io.File; 11 | import java.io.FileOutputStream; 12 | import java.util.ArrayList; 13 | import java.util.List; 14 | 15 | /** 16 | * 文件导入到处 17 | */ 18 | public class PoiUtil { 19 | /** 20 | * 导入 21 | * 22 | * @param url 23 | * @return 24 | * @throws Exception 25 | */ 26 | public static List> poiImport(String url) throws Exception { 27 | List> list = new ArrayList<>(); 28 | // 创建Excel 读取文件内容 29 | HSSFWorkbook workbook = new HSSFWorkbook(FileUtils.openInputStream(new File(url))); 30 | /** 31 | * 第一种方式读取Sheet页 32 | */ 33 | // HSSFSheet sheet = workbook.getSheet("Sheet0"); 34 | /** 35 | * 第二种方式读取Sheet页 36 | */ 37 | HSSFSheet sheet = workbook.getSheetAt(0);//获取工作表 38 | for (int i = 0; i < sheet.getLastRowNum()+1; i++) { 39 | HSSFRow row = sheet.getRow(i);//获取行 40 | List rowlist = new ArrayList<>();//行数据 41 | for (int j = 0; j < row.getLastCellNum(); j++) { 42 | HSSFCell cell = row.getCell(j); 43 | cell.setCellType(Cell.CELL_TYPE_STRING); 44 | String value = cell.getStringCellValue(); 45 | rowlist.add(value);//行中数据添加到行中 46 | } 47 | list.add(rowlist);//将行数据添加到list中 48 | } 49 | return list; 50 | } 51 | 52 | 53 | 54 | 55 | 56 | 57 | // 导出 58 | public static void poiExport(List> list, String url) throws Exception { 59 | //创建Excel工作薄 60 | HSSFWorkbook workbook = new HSSFWorkbook(); 61 | //创建一个工作表shheet 62 | HSSFSheet sheet = workbook.createSheet(); 63 | for (int i = 0; i < list.size(); i++) { 64 | HSSFRow row = sheet.createRow(i); 65 | List dataList = list.get(i); 66 | for (int j = 0; j < dataList.size(); j++) { 67 | HSSFCell cell = row.createCell(j); 68 | cell.setCellValue(dataList.get(j)); 69 | } 70 | 71 | } 72 | FileOutputStream stream = FileUtils.openOutputStream(new File(url)); 73 | workbook.write(stream); 74 | stream.close(); 75 | } 76 | 77 | 78 | public static void main(String[] args) { 79 | try { 80 | //导入 81 | List> lists = PoiUtil.poiImport("C:/Users/Administrator/Desktop/工作1.xls"); 82 | System.out.println(); 83 | 84 | 85 | //导出 86 | 87 | PoiUtil.poiExport(lists, "C:/Users/Administrator/Desktop/工作1.xls"); 88 | 89 | // 90 | // List> list = new ArrayList<>(); 91 | // ArrayList dataList = new ArrayList<>(); 92 | // dataList.add("标题1"); 93 | // dataList.add("标题2"); 94 | // dataList.add("标题3"); 95 | // list.add(dataList); 96 | // // 追加数据 97 | // for (int i = 1; i < 10; i++) {// 这里的int 起始是1 也就是第二行开始 98 | // ArrayList dataList111 = new ArrayList<>(); 99 | // dataList111.add("内容" + i); 100 | // dataList111.add("内容1111111121222222222333333333377777777411111111477777777" + i); 101 | // dataList111.add("内容" + i); 102 | // list.add(dataList111); 103 | // } 104 | // PoiUtil.poiExport(list, "C:/Users/Administrator/Desktop/工作1.xls"); 105 | } catch (Exception e) { 106 | e.printStackTrace(); 107 | } 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /src/main/java/com/entity/vo/GonggaoVO.java: -------------------------------------------------------------------------------- 1 | package com.entity.vo; 2 | 3 | import com.entity.GonggaoEntity; 4 | import com.baomidou.mybatisplus.annotations.TableField; 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import com.fasterxml.jackson.annotation.JsonFormat; 7 | import java.util.Date; 8 | import org.springframework.format.annotation.DateTimeFormat; 9 | 10 | import java.io.Serializable; 11 | 12 | /** 13 | * 公告资讯 14 | * 手机端接口返回实体辅助类 15 | * (主要作用去除一些不必要的字段) 16 | */ 17 | @TableName("gonggao") 18 | public class GonggaoVO implements Serializable { 19 | private static final long serialVersionUID = 1L; 20 | 21 | 22 | /** 23 | * 主键 24 | */ 25 | 26 | @TableField(value = "id") 27 | private Integer id; 28 | 29 | 30 | /** 31 | * 公告名称 32 | */ 33 | 34 | @TableField(value = "gonggao_name") 35 | private String gonggaoName; 36 | 37 | 38 | /** 39 | * 公告图片 40 | */ 41 | 42 | @TableField(value = "gonggao_photo") 43 | private String gonggaoPhoto; 44 | 45 | 46 | /** 47 | * 公告类型 48 | */ 49 | 50 | @TableField(value = "gonggao_types") 51 | private Integer gonggaoTypes; 52 | 53 | 54 | /** 55 | * 发布时间 56 | */ 57 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 58 | @DateTimeFormat 59 | 60 | @TableField(value = "insert_time") 61 | private Date insertTime; 62 | 63 | 64 | /** 65 | * 公告详情 66 | */ 67 | 68 | @TableField(value = "gonggao_content") 69 | private String gonggaoContent; 70 | 71 | 72 | /** 73 | * 创建时间 show1 show2 nameShow 74 | */ 75 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 76 | @DateTimeFormat 77 | 78 | @TableField(value = "create_time") 79 | private Date createTime; 80 | 81 | 82 | /** 83 | * 设置:主键 84 | */ 85 | public Integer getId() { 86 | return id; 87 | } 88 | 89 | 90 | /** 91 | * 获取:主键 92 | */ 93 | 94 | public void setId(Integer id) { 95 | this.id = id; 96 | } 97 | /** 98 | * 设置:公告名称 99 | */ 100 | public String getGonggaoName() { 101 | return gonggaoName; 102 | } 103 | 104 | 105 | /** 106 | * 获取:公告名称 107 | */ 108 | 109 | public void setGonggaoName(String gonggaoName) { 110 | this.gonggaoName = gonggaoName; 111 | } 112 | /** 113 | * 设置:公告图片 114 | */ 115 | public String getGonggaoPhoto() { 116 | return gonggaoPhoto; 117 | } 118 | 119 | 120 | /** 121 | * 获取:公告图片 122 | */ 123 | 124 | public void setGonggaoPhoto(String gonggaoPhoto) { 125 | this.gonggaoPhoto = gonggaoPhoto; 126 | } 127 | /** 128 | * 设置:公告类型 129 | */ 130 | public Integer getGonggaoTypes() { 131 | return gonggaoTypes; 132 | } 133 | 134 | 135 | /** 136 | * 获取:公告类型 137 | */ 138 | 139 | public void setGonggaoTypes(Integer gonggaoTypes) { 140 | this.gonggaoTypes = gonggaoTypes; 141 | } 142 | /** 143 | * 设置:发布时间 144 | */ 145 | public Date getInsertTime() { 146 | return insertTime; 147 | } 148 | 149 | 150 | /** 151 | * 获取:发布时间 152 | */ 153 | 154 | public void setInsertTime(Date insertTime) { 155 | this.insertTime = insertTime; 156 | } 157 | /** 158 | * 设置:公告详情 159 | */ 160 | public String getGonggaoContent() { 161 | return gonggaoContent; 162 | } 163 | 164 | 165 | /** 166 | * 获取:公告详情 167 | */ 168 | 169 | public void setGonggaoContent(String gonggaoContent) { 170 | this.gonggaoContent = gonggaoContent; 171 | } 172 | /** 173 | * 设置:创建时间 show1 show2 nameShow 174 | */ 175 | public Date getCreateTime() { 176 | return createTime; 177 | } 178 | 179 | 180 | /** 181 | * 获取:创建时间 show1 show2 nameShow 182 | */ 183 | 184 | public void setCreateTime(Date createTime) { 185 | this.createTime = createTime; 186 | } 187 | 188 | } 189 | --------------------------------------------------------------------------------