├── .idea ├── .name ├── .gitignore ├── encodings.xml ├── modules.xml ├── webContexts.xml ├── misc.xml ├── libraries │ ├── Maven__junit_junit_4_12.xml │ ├── Maven__javax_servlet_jstl_1_2.xml │ ├── Maven__org_ow2_asm_asm_5_0_4.xml │ ├── Maven__com_alibaba_druid_1_1_10.xml │ ├── Maven__org_yaml_snakeyaml_1_23.xml │ ├── Maven__org_eclipse_jdt_ecj_3_18_0.xml │ ├── Maven__org_mybatis_mybatis_3_5_1.xml │ ├── Maven__com_zaxxer_HikariCP_3_2_0.xml │ ├── Maven__net_minidev_json_smart_2_3.xml │ ├── Maven__org_objenesis_objenesis_2_6.xml │ ├── Maven__cn_hutool_hutool_all_5_5_4.xml │ ├── Maven__org_slf4j_slf4j_api_1_7_26.xml │ ├── Maven__com_alibaba_fastjson_1_2_72.xml │ ├── Maven__com_google_code_gson_gson_2_8_5.xml │ ├── Maven__javax_xml_bind_jaxb_api_2_3_1.xml │ ├── Maven__com_fasterxml_classmate_1_4_0.xml │ ├── Maven__com_sun_mail_javax_mail_1_6_2.xml │ ├── Maven__org_projectlombok_lombok_1_18_2.xml │ ├── Maven__com_google_guava_guava_26_0_jre.xml │ ├── Maven__javax_activation_activation_1_1.xml │ ├── Maven__org_hamcrest_hamcrest_core_1_3.xml │ ├── Maven__org_slf4j_jul_to_slf4j_1_7_26.xml │ ├── Maven__org_xmlunit_xmlunit_core_2_6_3.xml │ ├── Maven__com_baomidou_mybatis_plus_3_1_2.xml │ ├── Maven__net_bytebuddy_byte_buddy_1_9_16.xml │ ├── Maven__org_apache_shiro_shiro_web_1_4_0.xml │ ├── Maven__org_skyscreamer_jsonassert_1_5_0.xml │ ├── Maven__net_minidev_accessors_smart_1_2.xml │ ├── Maven__org_apache_shiro_shiro_core_1_4_0.xml │ ├── Maven__org_apache_shiro_shiro_lang_1_4_0.xml │ ├── Maven__org_aspectj_aspectjweaver_1_9_4.xml │ ├── Maven__org_assertj_assertj_core_3_11_1.xml │ ├── Maven__org_mockito_mockito_core_2_23_4.xml │ ├── Maven__ch_qos_logback_logback_core_1_2_3.xml │ ├── Maven__com_github_jsqlparser_jsqlparser_1_2.xml │ ├── Maven__com_google_code_findbugs_jsr305_3_0_2.xml │ ├── Maven__com_jayway_jsonpath_json_path_2_4_0.xml │ ├── Maven__io_github_biezhi_oh_my_email_0_0_3.xml │ ├── Maven__org_apache_shiro_shiro_cache_1_4_0.xml │ ├── Maven__org_apache_shiro_shiro_event_1_4_0.xml │ ├── Maven__org_mybatis_mybatis_spring_2_0_1.xml │ ├── Maven__org_apache_shiro_shiro_spring_1_4_0.xml │ ├── Maven__org_hamcrest_hamcrest_library_1_3.xml │ ├── Maven__org_apache_commons_commons_lang3_3_8.xml │ ├── Maven__ch_qos_logback_logback_classic_1_2_3.xml │ ├── Maven__com_baomidou_mybatis_plus_core_3_1_2.xml │ ├── Maven__mysql_mysql_connector_java_8_0_17.xml │ ├── Maven__org_checkerframework_checker_qual_2_5_2.xml │ ├── Maven__net_bytebuddy_byte_buddy_agent_1_9_16.xml │ ├── Maven__org_apache_logging_log4j_log4j_api_2_11_2.xml │ ├── Maven__com_google_j2objc_j2objc_annotations_1_1.xml │ ├── Maven__org_apache_shiro_shiro_config_core_1_4_0.xml │ ├── Maven__org_apache_shiro_shiro_config_ogdl_1_4_0.xml │ ├── Maven__org_apache_shiro_shiro_crypto_core_1_4_0.xml │ ├── Maven__org_apache_shiro_shiro_crypto_hash_1_4_0.xml │ ├── Maven__commons_beanutils_commons_beanutils_1_9_3.xml │ ├── Maven__com_fasterxml_jackson_core_jackson_core_2_9_9.xml │ ├── Maven__org_springframework_spring_tx_5_1_9_RELEASE.xml │ ├── Maven__com_baomidou_mybatis_plus_extension_3_1_2.xml │ ├── Maven__org_apache_shiro_shiro_crypto_cipher_1_4_0.xml │ ├── Maven__javax_activation_javax_activation_api_1_2_0.xml │ ├── Maven__javax_annotation_javax_annotation_api_1_3_2.xml │ ├── Maven__javax_validation_validation_api_2_0_1_Final.xml │ ├── Maven__org_apache_logging_log4j_log4j_to_slf4j_2_11_2.xml │ ├── Maven__org_jboss_logging_jboss_logging_3_3_2_Final.xml │ ├── Maven__org_springframework_spring_aop_5_1_9_RELEASE.xml │ ├── Maven__org_springframework_spring_jcl_5_1_9_RELEASE.xml │ ├── Maven__org_springframework_spring_web_5_1_9_RELEASE.xml │ ├── Maven__com_baomidou_mybatis_plus_annotation_3_1_2.xml │ ├── Maven__org_apache_tomcat_embed_tomcat_embed_el_9_0_22.xml │ ├── Maven__commons_collections_commons_collections_3_2_2.xml │ ├── Maven__org_springframework_spring_core_5_1_9_RELEASE.xml │ ├── Maven__org_springframework_spring_jdbc_5_1_9_RELEASE.xml │ ├── Maven__org_springframework_spring_test_5_1_9_RELEASE.xml │ ├── Maven__org_springframework_spring_beans_5_1_9_RELEASE.xml │ ├── Maven__com_baomidou_mybatis_plus_boot_starter_3_1_2.xml │ ├── Maven__com_fasterxml_jackson_core_jackson_databind_2_9_9.xml │ ├── Maven__org_apache_tomcat_embed_tomcat_embed_core_9_0_22.xml │ ├── Maven__com_alibaba_druid_spring_boot_starter_1_1_10.xml │ ├── Maven__org_springframework_spring_webmvc_5_1_9_RELEASE.xml │ ├── Maven__org_apache_tomcat_tomcat_annotations_api_9_0_22.xml │ ├── Maven__org_springframework_spring_context_5_1_9_RELEASE.xml │ ├── Maven__org_apache_tomcat_embed_tomcat_embed_jasper_9_0_22.xml │ ├── Maven__org_springframework_boot_spring_boot_2_1_7_RELEASE.xml │ ├── Maven__com_fasterxml_jackson_core_jackson_annotations_2_9_0.xml │ ├── Maven__org_codehaus_mojo_animal_sniffer_annotations_1_14.xml │ ├── Maven__com_google_errorprone_error_prone_annotations_2_1_3.xml │ ├── Maven__org_springframework_spring_expression_5_1_9_RELEASE.xml │ ├── Maven__org_apache_tomcat_embed_tomcat_embed_websocket_9_0_22.xml │ ├── Maven__com_github_theborakompanioni_thymeleaf_extras_shiro_2_0_0.xml │ ├── Maven__org_springframework_boot_spring_boot_test_2_1_7_RELEASE.xml │ ├── Maven__com_fasterxml_jackson_datatype_jackson_datatype_jdk8_2_9_9.xml │ ├── Maven__org_hibernate_validator_hibernate_validator_6_0_17_Final.xml │ ├── Maven__com_fasterxml_jackson_datatype_jackson_datatype_jsr310_2_9_9.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_2_1_7_RELEASE.xml │ ├── Maven__com_vaadin_external_google_android_json_0_0_20131108_vaadin1.xml │ ├── Maven__org_springframework_boot_spring_boot_devtools_2_1_7_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_aop_2_1_7_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_web_2_1_7_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_jdbc_2_1_7_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_json_2_1_7_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_test_2_1_7_RELEASE.xml │ ├── Maven__com_fasterxml_jackson_module_jackson_module_parameter_names_2_9_9.xml │ ├── Maven__org_springframework_boot_spring_boot_autoconfigure_2_1_7_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_tomcat_2_1_7_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_logging_2_1_7_RELEASE.xml │ └── Maven__org_springframework_boot_spring_boot_test_autoconfigure_2_1_7_RELEASE.xml ├── compiler.xml ├── jarRepositories.xml └── inspectionProfiles │ └── Project_Default.xml ├── picture ├── picture1.png ├── picture10.png ├── picture11.png ├── picture12.png ├── picture13.png ├── picture14.png ├── picture15.png ├── picture16.png ├── picture17.png ├── picture2.png ├── picture3.png ├── picture4.png ├── picture5.png ├── picture6.png ├── picture7.png ├── picture8.png └── picture9.png ├── .gitattributes ├── src └── main │ ├── java │ └── com │ │ └── irental │ │ └── houserent │ │ ├── service │ │ ├── NewsService.java │ │ ├── FeedbackService.java │ │ ├── MarkService.java │ │ ├── OrderService.java │ │ ├── GiftcardService.java │ │ ├── UserService.java │ │ ├── HouseService.java │ │ └── impl │ │ │ ├── NewsServiceImpl.java │ │ │ ├── FeedbackServiceImpl.java │ │ │ ├── OrderServiceImpl.java │ │ │ ├── GiftcardServiceImpl.java │ │ │ ├── MarkServiceImpl.java │ │ │ └── UserServiceImpl.java │ │ ├── Test.java │ │ ├── mapper │ │ ├── NewsMapper.java │ │ ├── MarkMapper.java │ │ ├── FeedbackMapper.java │ │ ├── OrderMapper.java │ │ ├── UserMapper.java │ │ ├── GiftcardMapper.java │ │ └── HouseMapper.java │ │ ├── entity │ │ ├── UserStatus.java │ │ ├── News.java │ │ ├── Mark.java │ │ ├── Feedback.java │ │ ├── Giftcard.java │ │ ├── Order.java │ │ ├── User.java │ │ └── House.java │ │ ├── Application.java │ │ └── controller │ │ ├── front │ │ ├── ErrorController.java │ │ ├── IndexController.java │ │ ├── MarkController.java │ │ ├── NewsController.java │ │ ├── RegisterController.java │ │ ├── FeedbackController.java │ │ └── LoginController.java │ │ └── backend │ │ ├── ChargeController.java │ │ ├── FileController.java │ │ ├── HomeController.java │ │ ├── GiftcardController.java │ │ ├── ProfileController.java │ │ ├── MarkController.java │ │ ├── AdminController.java │ │ ├── FeedbackController.java │ │ └── UeditorController.java │ ├── resources │ ├── smart-doc.json │ ├── mapper │ │ └── HouseMapper.xml │ └── application.yml │ └── webapp │ └── jsp │ ├── common │ ├── 500.jsp │ ├── 404.jsp │ ├── 403.jsp │ ├── error.jsp │ └── page.jsp │ ├── front │ ├── news-list.jsp │ ├── news-detail.jsp │ ├── house-map.jsp │ └── pay.jsp │ └── admin │ ├── news-list.jsp │ ├── mark-list.jsp │ ├── password.jsp │ └── my-home.jsp └── README.md /.idea/.name: -------------------------------------------------------------------------------- 1 | houserent -------------------------------------------------------------------------------- /picture/picture1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ynwynw/houserent-public/HEAD/picture/picture1.png -------------------------------------------------------------------------------- /picture/picture10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ynwynw/houserent-public/HEAD/picture/picture10.png -------------------------------------------------------------------------------- /picture/picture11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ynwynw/houserent-public/HEAD/picture/picture11.png -------------------------------------------------------------------------------- /picture/picture12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ynwynw/houserent-public/HEAD/picture/picture12.png -------------------------------------------------------------------------------- /picture/picture13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ynwynw/houserent-public/HEAD/picture/picture13.png -------------------------------------------------------------------------------- /picture/picture14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ynwynw/houserent-public/HEAD/picture/picture14.png -------------------------------------------------------------------------------- /picture/picture15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ynwynw/houserent-public/HEAD/picture/picture15.png -------------------------------------------------------------------------------- /picture/picture16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ynwynw/houserent-public/HEAD/picture/picture16.png -------------------------------------------------------------------------------- /picture/picture17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ynwynw/houserent-public/HEAD/picture/picture17.png -------------------------------------------------------------------------------- /picture/picture2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ynwynw/houserent-public/HEAD/picture/picture2.png -------------------------------------------------------------------------------- /picture/picture3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ynwynw/houserent-public/HEAD/picture/picture3.png -------------------------------------------------------------------------------- /picture/picture4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ynwynw/houserent-public/HEAD/picture/picture4.png -------------------------------------------------------------------------------- /picture/picture5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ynwynw/houserent-public/HEAD/picture/picture5.png -------------------------------------------------------------------------------- /picture/picture6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ynwynw/houserent-public/HEAD/picture/picture6.png -------------------------------------------------------------------------------- /picture/picture7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ynwynw/houserent-public/HEAD/picture/picture7.png -------------------------------------------------------------------------------- /picture/picture8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ynwynw/houserent-public/HEAD/picture/picture8.png -------------------------------------------------------------------------------- /picture/picture9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ynwynw/houserent-public/HEAD/picture/picture9.png -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.js linguist-language=java 2 | 3 | *.css linguist-language=java 4 | 5 | *.html linguist-language=java 6 | -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Datasource local storage ignored files 5 | /dataSources/ 6 | /dataSources.local.xml 7 | # Editor-based HTTP Client requests 8 | /httpRequests/ 9 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/main/java/com/irental/houserent/service/NewsService.java: -------------------------------------------------------------------------------- 1 | package com.irental.houserent.service; 2 | 3 | import com.irental.houserent.common.base.BaseService; 4 | import com.irental.houserent.entity.News; 5 | 6 | /* 7 | * 新闻service 8 | * */ 9 | public interface NewsService extends BaseService { 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/irental/houserent/service/FeedbackService.java: -------------------------------------------------------------------------------- 1 | package com.irental.houserent.service; 2 | 3 | import com.irental.houserent.common.base.BaseService; 4 | import com.irental.houserent.entity.Feedback; 5 | 6 | /* 7 | * 新闻service 8 | * */ 9 | public interface FeedbackService extends BaseService { 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/irental/houserent/Test.java: -------------------------------------------------------------------------------- 1 | package com.irental.houserent; 2 | 3 | import org.springframework.util.ClassUtils; 4 | 5 | public class Test { 6 | public static void main(String[] args) { 7 | System.out.println(ClassUtils.getDefaultClassLoader().getResource("static").getPath().replaceFirst("/", "") + "static/uploads/"); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/irental/houserent/mapper/NewsMapper.java: -------------------------------------------------------------------------------- 1 | package com.irental.houserent.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.irental.houserent.entity.News; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | /* 8 | * 新闻资讯Mapper 9 | * */ 10 | @Mapper 11 | public interface NewsMapper extends BaseMapper { 12 | } 13 | -------------------------------------------------------------------------------- /.idea/webContexts.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /src/main/java/com/irental/houserent/mapper/MarkMapper.java: -------------------------------------------------------------------------------- 1 | package com.irental.houserent.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.irental.houserent.entity.Mark; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | /* 8 | * 收藏Mapper层 9 | * */ 10 | @Mapper 11 | public interface MarkMapper extends BaseMapper { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/irental/houserent/mapper/FeedbackMapper.java: -------------------------------------------------------------------------------- 1 | package com.irental.houserent.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.irental.houserent.entity.Feedback; 5 | import org.apache.ibatis.annotations.Mapper; 6 | 7 | /* 8 | * 用户反馈Mapper 9 | * */ 10 | @Mapper 11 | public interface FeedbackMapper extends BaseMapper { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/main/resources/smart-doc.json: -------------------------------------------------------------------------------- 1 | { 2 | "serverUrl": "http://localhost:9999", 3 | "outPath": "src/main/resources/static/doc", 4 | "isStrict": false, 5 | "allInOne": true, 6 | "createDebugPage": false, 7 | "packageFilters": "com.irental.houserent.controller.*", 8 | "style": "xt256", 9 | "projectName": "iRental", 10 | "showAuthor": false, 11 | "allInOneDocFileName": "index.html" 12 | } -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/main/java/com/irental/houserent/entity/UserStatus.java: -------------------------------------------------------------------------------- 1 | package com.irental.houserent.entity; 2 | 3 | /** 4 | * 用户状态 5 | * 6 | * @author shimh 7 | *

8 | * 2018年1月23日 9 | */ 10 | public enum UserStatus { 11 | 12 | normal("正常状态"), blocked("封禁状态"); 13 | 14 | private final String info; 15 | 16 | private UserStatus(String info) { 17 | this.info = info; 18 | } 19 | 20 | public String getInfo() { 21 | return info; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/irental/houserent/service/MarkService.java: -------------------------------------------------------------------------------- 1 | package com.irental.houserent.service; 2 | 3 | import com.irental.houserent.common.base.BaseService; 4 | import com.irental.houserent.entity.Mark; 5 | 6 | import java.util.List; 7 | 8 | /* 9 | * 收藏Service接口 10 | * */ 11 | public interface MarkService extends BaseService { 12 | 13 | /* 14 | * 根据用户ID和房屋ID查询该用户是否已经收藏过该房屋 15 | * */ 16 | List findByUserIdAndHouseId(Long userId, Long houseId); 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/irental/houserent/entity/News.java: -------------------------------------------------------------------------------- 1 | package com.irental.houserent.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import com.irental.houserent.common.base.BaseEntity; 5 | import lombok.Data; 6 | 7 | /* 8 | * 新闻资讯实体 9 | * */ 10 | @Data 11 | @TableName("t_news") 12 | public class News extends BaseEntity { 13 | //标题 14 | private String title; 15 | 16 | //摘要 17 | private String summary; 18 | 19 | //内容 20 | private String content; 21 | 22 | //作者 23 | private String author; 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/irental/houserent/service/OrderService.java: -------------------------------------------------------------------------------- 1 | package com.irental.houserent.service; 2 | 3 | import com.irental.houserent.common.base.BaseService; 4 | import com.irental.houserent.entity.Order; 5 | 6 | import java.util.List; 7 | 8 | /* 9 | * 订单服务接口 10 | * */ 11 | public interface OrderService extends BaseService { 12 | /* 13 | * 查询当前有效订单 14 | * */ 15 | Order getCurrentEffectiveOrder(Long houseId); 16 | 17 | /* 18 | * 查询到期的订单 19 | * */ 20 | List findOverDueOrderList(); 21 | 22 | String orderNum(); 23 | } 24 | -------------------------------------------------------------------------------- /src/main/webapp/jsp/common/500.jsp: -------------------------------------------------------------------------------- 1 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 2 | <%@ include file="../common/head.jsp" %> 3 |

4 |
5 |
6 |
7 |
8 |

服务器出现错误...请稍后再试。

9 | 返回首页 10 |
11 |
12 |
13 |
14 |
15 | <%@ include file="../common/footer.jsp" %> 16 | 17 | -------------------------------------------------------------------------------- /src/main/java/com/irental/houserent/service/GiftcardService.java: -------------------------------------------------------------------------------- 1 | package com.irental.houserent.service; 2 | 3 | import com.irental.houserent.common.base.BaseService; 4 | import com.irental.houserent.entity.Giftcard; 5 | 6 | import java.util.Date; 7 | 8 | /* 9 | * 用户服务接口 10 | * */ 11 | public interface GiftcardService extends BaseService { 12 | 13 | Double checkValidGiftcard(String series, Integer status); 14 | 15 | void redeemGiftcard(String series, Integer status, Date date, String user); 16 | 17 | Double currentBalance(String user); 18 | 19 | void addToUserBalance(String balance, String user); 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/irental/houserent/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.irental.houserent.service; 2 | 3 | import com.irental.houserent.common.base.BaseService; 4 | import com.irental.houserent.entity.User; 5 | 6 | /* 7 | * 用户服务接口 8 | * */ 9 | public interface UserService extends BaseService { 10 | 11 | /* 12 | * 根据用户名查询用户 13 | * */ 14 | User findByUserName(String userName); 15 | 16 | String findAllUserNums(); 17 | 18 | String findOwnerNums(); 19 | 20 | String userFeedbackCount(); 21 | 22 | Double getUserBlance(Long user); 23 | 24 | void updateUserBalance(Double balance, String user); 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/irental/houserent/mapper/OrderMapper.java: -------------------------------------------------------------------------------- 1 | package com.irental.houserent.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.irental.houserent.entity.Order; 5 | import org.apache.ibatis.annotations.Select; 6 | 7 | import java.util.List; 8 | 9 | /* 10 | * 订单mapper 11 | * */ 12 | public interface OrderMapper extends BaseMapper { 13 | /* 14 | * 查询到期的订单 15 | * */ 16 | @Select("select * from t_order where status = 0 and end_date findOverDueOrderList(); 18 | 19 | @Select("select count(id) as order_num from t_order;") 20 | String orderNum(); 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/irental/houserent/entity/Mark.java: -------------------------------------------------------------------------------- 1 | package com.irental.houserent.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableField; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | import com.irental.houserent.common.base.BaseEntity; 6 | import lombok.Data; 7 | 8 | /* 9 | * 收藏实体 10 | * */ 11 | @Data 12 | @TableName("t_mark") 13 | public class Mark extends BaseEntity { 14 | /* 15 | * 收藏者ID 16 | * */ 17 | private Long userId; 18 | 19 | /* 20 | * 房屋ID 21 | * */ 22 | private Long houseId; 23 | 24 | /* 25 | * 房屋信息 26 | * */ 27 | @TableField(exist = false) 28 | private House house; 29 | 30 | 31 | } 32 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__junit_junit_4_12.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/webapp/jsp/common/404.jsp: -------------------------------------------------------------------------------- 1 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 2 | <%@ include file="../common/head.jsp" %> 3 |
4 |
5 |
6 |
7 |
8 |

9 |

页面未找到...

10 | 返回首页 11 |
12 |
13 |
14 |
15 |
16 | <%@ include file="../common/footer.jsp" %> 17 | 18 | -------------------------------------------------------------------------------- /src/main/webapp/jsp/common/403.jsp: -------------------------------------------------------------------------------- 1 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 2 | <%@ include file="../common/head.jsp" %> 3 |
4 |
5 |
6 |
7 |
8 |

9 |

您当前没有权限访问此页面

10 | 返回首页 11 |
12 |
13 |
14 |
15 |
16 | <%@ include file="../common/footer.jsp" %> 17 | 18 | -------------------------------------------------------------------------------- /src/main/webapp/jsp/common/error.jsp: -------------------------------------------------------------------------------- 1 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 2 | <%@ include file="../common/head.jsp" %> 3 |
4 |
5 |
6 |
7 |
8 |

9 |

系统异常,请重新尝试进入。

10 | 返回首页 11 |
12 |
13 |
14 |
15 |
16 | <%@ include file="../common/footer.jsp" %> 17 | 18 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__javax_servlet_jstl_1_2.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__com_alibaba_druid_1_1_10.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_yaml_snakeyaml_1_23.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_eclipse_jdt_ecj_3_18_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_mybatis_mybatis_3_5_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_zaxxer_HikariCP_3_2_0.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__cn_hutool_hutool_all_5_5_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_slf4j_slf4j_api_1_7_26.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_alibaba_fastjson_1_2_72.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/java/com/irental/houserent/entity/Feedback.java: -------------------------------------------------------------------------------- 1 | package com.irental.houserent.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import com.irental.houserent.common.base.BaseEntity; 5 | import lombok.Data; 6 | 7 | /* 8 | * 用户反馈实体 9 | * */ 10 | @Data 11 | @TableName("t_feedback") 12 | public class Feedback extends BaseEntity { 13 | /*反馈内容的标题*/ 14 | private String title; 15 | 16 | /*反馈的内容*/ 17 | private String content; 18 | 19 | /*用户ID*/ 20 | private Long userId; 21 | 22 | /*处理状态 0待处理,1已处理*/ 23 | private Integer status; 24 | 25 | /*回复内容*/ 26 | private String reply; 27 | 28 | /*联系人姓名*/ 29 | private String contactName; 30 | 31 | /*联系人邮箱*/ 32 | private String contactEmail; 33 | } 34 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_google_code_gson_gson_2_8_5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__javax_xml_bind_jaxb_api_2_3_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_classmate_1_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_sun_mail_javax_mail_1_6_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_projectlombok_lombok_1_18_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_google_guava_guava_26_0_jre.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__javax_activation_activation_1_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_slf4j_jul_to_slf4j_1_7_26.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__com_baomidou_mybatis_plus_3_1_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__net_bytebuddy_byte_buddy_1_9_16.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_shiro_shiro_web_1_4_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__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_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_shiro_shiro_lang_1_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_aspectj_aspectjweaver_1_9_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_assertj_assertj_core_3_11_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_mockito_mockito_core_2_23_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.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_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_google_code_findbugs_jsr305_3_0_2.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__io_github_biezhi_oh_my_email_0_0_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_shiro_shiro_cache_1_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_shiro_shiro_event_1_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_mybatis_mybatis_spring_2_0_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_shiro_shiro_spring_1_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_hamcrest_hamcrest_library_1_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_commons_commons_lang3_3_8.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__com_baomidou_mybatis_plus_core_3_1_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__mysql_mysql_connector_java_8_0_17.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_checkerframework_checker_qual_2_5_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__net_bytebuddy_byte_buddy_agent_1_9_16.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_logging_log4j_log4j_api_2_11_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_google_j2objc_j2objc_annotations_1_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_shiro_shiro_config_core_1_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_shiro_shiro_config_ogdl_1_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_shiro_shiro_crypto_core_1_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_shiro_shiro_crypto_hash_1_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__commons_beanutils_commons_beanutils_1_9_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_9_9.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_tx_5_1_9_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_baomidou_mybatis_plus_extension_3_1_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_shiro_shiro_crypto_cipher_1_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__javax_activation_javax_activation_api_1_2_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__javax_annotation_javax_annotation_api_1_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_11_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_jboss_logging_jboss_logging_3_3_2_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_aop_5_1_9_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_jcl_5_1_9_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_web_5_1_9_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_baomidou_mybatis_plus_annotation_3_1_2.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_22.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__commons_collections_commons_collections_3_2_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_core_5_1_9_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_jdbc_5_1_9_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_test_5_1_9_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_beans_5_1_9_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_baomidou_mybatis_plus_boot_starter_3_1_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_9_9.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_core_9_0_22.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_alibaba_druid_spring_boot_starter_1_1_10.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_webmvc_5_1_9_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_tomcat_tomcat_annotations_api_9_0_22.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_context_5_1_9_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_jasper_9_0_22.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_2_1_7_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_9_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_codehaus_mojo_animal_sniffer_annotations_1_14.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_google_errorprone_error_prone_annotations_2_1_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_expression_5_1_9_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_22.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_github_theborakompanioni_thymeleaf_extras_shiro_2_0_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_test_2_1_7_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 | 18 | 21 | 22 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jdk8_2_9_9.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_hibernate_validator_hibernate_validator_6_0_17_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jsr310_2_9_9.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_2_1_7_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/java/com/irental/houserent/entity/Giftcard.java: -------------------------------------------------------------------------------- 1 | package com.irental.houserent.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import com.irental.houserent.common.base.BaseEntity; 5 | import lombok.Data; 6 | 7 | import java.util.Date; 8 | 9 | /* 10 | * 礼品卡实体 11 | * */ 12 | @Data 13 | @TableName("t_giftcard") 14 | public class Giftcard extends BaseEntity { 15 | /* 16 | * 礼品卡序列号 17 | * */ 18 | private String series; 19 | 20 | /* 21 | * 状态,1未使用 -1已使用 0已过期 22 | * */ 23 | private String status; 24 | 25 | /* 26 | * 价值金额 27 | * */ 28 | private double value; 29 | 30 | /* 31 | * 生产时间 32 | * */ 33 | private Date createDate; 34 | 35 | /* 36 | * 到期时间 37 | * */ 38 | private Date endDate; 39 | 40 | /* 41 | * 使用时间 42 | * */ 43 | private Date usedDate; 44 | 45 | /* 46 | * 使用者名字 47 | * */ 48 | private String usedBy; 49 | 50 | } 51 | -------------------------------------------------------------------------------- /.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_devtools_2_1_7_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_aop_2_1_7_RELEASE.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_1_7_RELEASE.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_1_7_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_1_7_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_1_7_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/java/com/irental/houserent/Application.java: -------------------------------------------------------------------------------- 1 | package com.irental.houserent; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.mybatis.spring.annotation.MapperScan; 5 | import org.springframework.boot.SpringApplication; 6 | import org.springframework.boot.autoconfigure.SpringBootApplication; 7 | import org.springframework.context.ApplicationContext; 8 | import org.springframework.scheduling.annotation.EnableScheduling; 9 | 10 | import java.util.TimeZone; 11 | 12 | @Slf4j 13 | @SpringBootApplication 14 | @EnableScheduling 15 | @MapperScan("com.irental.houserent.mapper") 16 | public class Application { 17 | public static void main(String[] args) { 18 | TimeZone.setDefault(TimeZone.getTimeZone("GMT+8")); 19 | ApplicationContext context = SpringApplication.run(Application.class, args); 20 | String serverPort = context.getEnvironment().getProperty("server.port"); 21 | log.info("House rental system started at http://localhost:" + serverPort); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_jackson_module_jackson_module_parameter_names_2_9_9.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_autoconfigure_2_1_7_RELEASE.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_1_7_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_1_7_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_1_7_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/java/com/irental/houserent/mapper/UserMapper.java: -------------------------------------------------------------------------------- 1 | package com.irental.houserent.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.irental.houserent.entity.User; 5 | import org.apache.ibatis.annotations.Mapper; 6 | import org.apache.ibatis.annotations.Select; 7 | import org.apache.ibatis.annotations.Update; 8 | 9 | /* 10 | * 用户数据访问层 11 | * */ 12 | @Mapper 13 | public interface UserMapper extends BaseMapper { 14 | 15 | /* 16 | * Admin页面获取用户总数 17 | * */ 18 | @Select("select count(id) as user_num from t_user;") 19 | String findAllUserNums(); 20 | 21 | @Select("select count(id) as owner_num from t_user where role = 'owner';") 22 | String findOwnerNums(); 23 | 24 | @Select("select count(id) as feedback_num from t_feedback;") 25 | String userFeedbackCount(); 26 | 27 | @Select("select balance from t_user where id = #{user};") 28 | Double getUserBlance(Long user); 29 | 30 | @Update("update t_user set balance = #{balance} where user_name = #{user};") 31 | void updateUserBalance(Double balance, String user); 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/irental/houserent/service/HouseService.java: -------------------------------------------------------------------------------- 1 | package com.irental.houserent.service; 2 | 3 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 4 | import com.irental.houserent.common.base.BaseService; 5 | import com.irental.houserent.common.vo.HouseSearchVO; 6 | import com.irental.houserent.entity.House; 7 | 8 | import java.util.List; 9 | 10 | /* 11 | * 房屋服务接口 12 | * */ 13 | public interface HouseService extends BaseService { 14 | /* 15 | * 根据用户ID和房产证号查询合租房屋 16 | * */ 17 | List findByUserIdAndCertificateNoAndRentType(Long userId, String certificateNo, String rentType); 18 | 19 | /* 20 | * 根据出租类型获取到最小的N条房屋信息 21 | * */ 22 | List findTopList(String rentType, Integer limit); 23 | 24 | /* 25 | * 根据用户所在的位置(城市)获取N条房屋信息 26 | * */ 27 | List findByLocation(String location, Integer limit); 28 | 29 | /* 30 | * 获取房屋的分页数据 31 | * */ 32 | Page getHousePage(HouseSearchVO houseSearchVO, Page page); 33 | 34 | /* 35 | * 管理员面板获取上线房屋数量 36 | * */ 37 | String houseCount(); 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/irental/houserent/service/impl/NewsServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.irental.houserent.service.impl; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import com.irental.houserent.entity.News; 6 | import com.irental.houserent.mapper.NewsMapper; 7 | import com.irental.houserent.service.NewsService; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Service; 10 | 11 | import java.util.Map; 12 | 13 | /* 14 | * 实现新闻 15 | * */ 16 | @Service 17 | public class NewsServiceImpl implements NewsService { 18 | @Autowired 19 | private NewsMapper newsMapper; 20 | 21 | @Override 22 | public BaseMapper getRepository() { 23 | return newsMapper; 24 | } 25 | 26 | @Override 27 | public QueryWrapper getQueryWrapper(News news) { 28 | QueryWrapper queryWrapper = new QueryWrapper<>(); 29 | return queryWrapper; 30 | } 31 | 32 | @Override 33 | public QueryWrapper getQueryWrapper(Map condition) { 34 | return null; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /.idea/jarRepositories.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 14 | 15 | 19 | 20 | 24 | 25 | -------------------------------------------------------------------------------- /src/main/java/com/irental/houserent/entity/Order.java: -------------------------------------------------------------------------------- 1 | package com.irental.houserent.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableField; 4 | import com.baomidou.mybatisplus.annotation.TableName; 5 | import com.irental.houserent.common.base.BaseEntity; 6 | import lombok.Data; 7 | 8 | import java.util.Date; 9 | 10 | /* 11 | * 订单实体 12 | * */ 13 | @Data 14 | @TableName("t_order") 15 | public class Order extends BaseEntity { 16 | //租客用户ID 17 | //@TableField(value = "customer_id") 18 | private Long customerUserId; 19 | 20 | //房东用户ID 21 | //@TableField(value = "owner_id") 22 | private Long ownerUserId; 23 | 24 | //房屋ID 25 | private Long houseId; 26 | 27 | //订单状态 28 | private Integer status; 29 | 30 | //月租金 31 | private Double monthRent; 32 | 33 | //出租天数 34 | private Integer dayNum; 35 | 36 | //总金额 37 | private Double totalAmount; 38 | 39 | //开始日期 40 | private Date startDate; 41 | 42 | //结束日期 43 | private Date endDate; 44 | 45 | //房屋信息 46 | @TableField(exist = false) 47 | private House house; 48 | 49 | //租客用户信息 50 | @TableField(exist = false) 51 | private User customerUser; 52 | 53 | //房东用户信息 54 | @TableField(exist = false) 55 | private User ownerUser; 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/com/irental/houserent/mapper/GiftcardMapper.java: -------------------------------------------------------------------------------- 1 | package com.irental.houserent.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.irental.houserent.entity.Order; 5 | import org.apache.ibatis.annotations.Mapper; 6 | import org.apache.ibatis.annotations.Param; 7 | import org.apache.ibatis.annotations.Select; 8 | import org.apache.ibatis.annotations.Update; 9 | 10 | import java.util.Date; 11 | 12 | /* 13 | * 订单mapper 14 | * */ 15 | @Mapper 16 | public interface GiftcardMapper extends BaseMapper { 17 | @Select("select value from t_giftcard where series = #{series} and status = #{status} and end_date>now();") 18 | Double checkValidGiftcard(@Param("series") String series, @Param("status") Integer status); 19 | 20 | @Update("update t_giftcard set status = #{status} , used_date = #{date} , used_by = #{user} where series = #{series};") 21 | void redeemGiftcard(@Param("series") String series, @Param("status") Integer status, @Param("date") Date date, @Param("user") String user); 22 | 23 | @Select("select balance from t_user where user_name = #{user};") 24 | Double currentBalance(@Param("user") String user); 25 | 26 | @Update("update t_user set balance = #{balance} where user_name = #{user};") 27 | void addToUserBalance(@Param("balance") String balance, @Param("user") String user); 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/irental/houserent/service/impl/FeedbackServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.irental.houserent.service.impl; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import com.irental.houserent.entity.Feedback; 6 | import com.irental.houserent.mapper.FeedbackMapper; 7 | import com.irental.houserent.service.FeedbackService; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Service; 10 | 11 | import java.util.Map; 12 | 13 | /* 14 | * 用户反馈service 实现类 15 | * */ 16 | @Service 17 | public class FeedbackServiceImpl implements FeedbackService { 18 | @Autowired 19 | private FeedbackMapper feedbackMapper; 20 | 21 | @Override 22 | public BaseMapper getRepository() { 23 | return feedbackMapper; 24 | } 25 | 26 | @Override 27 | public QueryWrapper getQueryWrapper(Feedback feedback) { 28 | QueryWrapper queryWrapper = new QueryWrapper<>(); 29 | if (feedback != null && feedback.getUserId() != null) { 30 | queryWrapper.eq("user_id", feedback.getUserId()); 31 | } 32 | return queryWrapper; 33 | } 34 | 35 | @Override 36 | public QueryWrapper getQueryWrapper(Map condition) { 37 | return null; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/irental/houserent/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.irental.houserent.entity; 2 | 3 | import com.baomidou.mybatisplus.annotation.TableName; 4 | import com.irental.houserent.common.base.BaseEntity; 5 | import lombok.Data; 6 | 7 | /* 8 | * 用户信息实体 9 | * */ 10 | @Data 11 | @TableName("t_user") 12 | public class User extends BaseEntity { 13 | /* 14 | * 登录名 15 | * */ 16 | private String userName; 17 | /* 18 | * 姓名 19 | * */ 20 | private String userDisplayName; 21 | 22 | /* 23 | * 手机号 24 | * */ 25 | private String phone; 26 | 27 | /* 28 | * 电子邮箱 29 | * */ 30 | private String email; 31 | 32 | /* 33 | * 密码 34 | * */ 35 | private String userPass; 36 | 37 | /* 38 | * 身份证 39 | * */ 40 | private String idCard; 41 | 42 | /* 43 | * 头像 44 | * */ 45 | private String userAvatar; 46 | 47 | /* 48 | * 个人描述 49 | * */ 50 | private String userDesc; 51 | 52 | /* 53 | * 状态码 1正常,0禁用 54 | * */ 55 | private Integer status; 56 | 57 | /* 58 | * 角色,管理员admin/房东owner/租客customer 59 | * */ 60 | private String role; 61 | 62 | /* 63 | * 业余爱好 64 | * */ 65 | private String hobby; 66 | 67 | /* 68 | * 职业 69 | * */ 70 | private String job; 71 | /* 72 | * 性别 73 | * */ 74 | private String sex; 75 | 76 | /* 77 | * 现金余额 78 | * */ 79 | private Double balance; 80 | 81 | } 82 | -------------------------------------------------------------------------------- /src/main/java/com/irental/houserent/controller/front/ErrorController.java: -------------------------------------------------------------------------------- 1 | package com.irental.houserent.controller.front; 2 | 3 | import com.irental.houserent.common.base.BaseController; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RequestMethod; 7 | 8 | /* 9 | * 转向错误页面的控制器 10 | * */ 11 | @Controller 12 | public class ErrorController extends BaseController { 13 | /* 14 | * 页面未找到 404 not found 15 | * */ 16 | @RequestMapping(value = "/404", method = RequestMethod.GET) 17 | public String to404() { 18 | return "common/404"; 19 | } 20 | 21 | /* 22 | * 页面未找到 403 没有权限 23 | * */ 24 | @RequestMapping(value = "/403", method = RequestMethod.GET) 25 | public String to403() { 26 | return "common/403"; 27 | } 28 | 29 | /* 30 | * 页面未找到 500 服务器错误 31 | * */ 32 | @RequestMapping(value = "/500", method = RequestMethod.GET) 33 | public String to500() { 34 | return "common/500"; 35 | } 36 | 37 | /* 38 | * ERROR 通用错误 39 | * */ 40 | @RequestMapping(value = "/error", method = RequestMethod.GET) 41 | public String error() { 42 | Integer statusCode = (Integer) request.getAttribute("javax.servlet.error.status_code"); 43 | if (statusCode.equals("404")) { 44 | return "redirect:/404"; 45 | } else if (statusCode.equals("500")) { 46 | return "redirect:/500"; 47 | } 48 | return "common/error"; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/irental/houserent/mapper/HouseMapper.java: -------------------------------------------------------------------------------- 1 | package com.irental.houserent.mapper; 2 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 5 | import com.irental.houserent.common.vo.HouseSearchVO; 6 | import com.irental.houserent.entity.House; 7 | import org.apache.ibatis.annotations.Mapper; 8 | import org.apache.ibatis.annotations.Param; 9 | import org.apache.ibatis.annotations.Select; 10 | 11 | import java.util.List; 12 | 13 | /* 14 | * 房屋数据访问层 15 | * */ 16 | @Mapper 17 | public interface HouseMapper extends BaseMapper { 18 | /* 19 | * 根据租房类型获取最新的N条房屋信息 20 | * 简单类可以直接通过注解方式来写 21 | * */ 22 | @Select("select * from t_house where status = 0 and rent_type = #{rentType} order by create_time desc limit #{limit}") 23 | List findTopList(@Param("rentType") String rentType, @Param("limit") Integer limit); 24 | 25 | /* 26 | * 搜索房屋 27 | * 一个参数的时候可以不写@Param,两个或两个以上必须要写@param 28 | * 复杂点的SQL,最好写在XML中,HouseMapper.xml 29 | * */ 30 | List searchHouse(@Param("houseSearchVO") HouseSearchVO houseSearchVO, @Param("page") Page page); 31 | 32 | /* 33 | * 根据所在城市进行搜索房屋 34 | * */ 35 | @Select("select * from t_house where status = 0 and city = #{location} order by create_time desc limit #{limit}") 36 | List findByLocation(@Param("location") String location, @Param("limit") Integer limit); 37 | 38 | /* 39 | * 管理员面板数据展示 - 上线房屋数量 40 | * */ 41 | @Select("select count(id) from t_house where status = 0;") 42 | String houseCount(); 43 | } 44 | -------------------------------------------------------------------------------- /src/main/webapp/jsp/front/news-list.jsp: -------------------------------------------------------------------------------- 1 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 2 | <%@ include file="../common/head.jsp" %> 3 |
5 |
6 |

新闻资讯

7 |

新闻信息

8 |
9 |
10 |
11 |
12 |
13 | 14 |
15 |
16 |
17 |

${c.title}

18 |
19 |
20 | ${c.summary} 21 |

作者:${c.author} | 发布时间:

23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 | <%@ include file="../common/page.jsp" %> 31 |
32 |
33 |
34 |
35 | <%@ include file="../common/footer.jsp" %> 36 | 37 | -------------------------------------------------------------------------------- /src/main/resources/mapper/HouseMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 36 | -------------------------------------------------------------------------------- /src/main/webapp/jsp/front/news-detail.jsp: -------------------------------------------------------------------------------- 1 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 2 | <%@ include file="../common/head.jsp" %> 3 |
5 |
6 |

${news.title}

7 |

${news.author} -

9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |

${news.title}

18 |
19 |
    20 |
  • ${news.author}
  • 21 |
  • 23 |
24 |
25 |
${news.content}
26 |
27 |
28 |
29 |
30 |
31 |
32 | <%@ include file="../common/footer.jsp" %> 33 | 34 | -------------------------------------------------------------------------------- /src/main/java/com/irental/houserent/service/impl/OrderServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.irental.houserent.service.impl; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import com.irental.houserent.common.enums.OrderStatusEnum; 6 | import com.irental.houserent.entity.Order; 7 | import com.irental.houserent.mapper.OrderMapper; 8 | import com.irental.houserent.service.OrderService; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Service; 11 | 12 | import java.util.List; 13 | import java.util.Map; 14 | 15 | /* 16 | * 订单服务实现类 17 | * */ 18 | @Service 19 | public class OrderServiceImpl implements OrderService { 20 | @Autowired 21 | private OrderMapper orderMapper; 22 | 23 | @Override 24 | public BaseMapper getRepository() { 25 | return orderMapper; 26 | } 27 | 28 | @Override 29 | public QueryWrapper getQueryWrapper(Order order) { 30 | return null; 31 | } 32 | 33 | @Override 34 | public QueryWrapper getQueryWrapper(Map condition) { 35 | return null; 36 | } 37 | 38 | @Override 39 | public Order getCurrentEffectiveOrder(Long houseId) { 40 | QueryWrapper queryWrapper = new QueryWrapper(); 41 | queryWrapper.eq("house_id", houseId); 42 | queryWrapper.eq("status", OrderStatusEnum.NORMAL); 43 | return orderMapper.selectOne(queryWrapper); 44 | } 45 | 46 | @Override 47 | public List findOverDueOrderList() { 48 | return orderMapper.findOverDueOrderList(); 49 | } 50 | 51 | @Override 52 | public String orderNum() { 53 | return orderMapper.orderNum(); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/com/irental/houserent/service/impl/GiftcardServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.irental.houserent.service.impl; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import com.irental.houserent.entity.Giftcard; 6 | import com.irental.houserent.mapper.GiftcardMapper; 7 | import com.irental.houserent.service.GiftcardService; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Service; 10 | 11 | import java.util.Date; 12 | import java.util.Map; 13 | 14 | @Service 15 | public class GiftcardServiceImpl implements GiftcardService { 16 | @Autowired 17 | private GiftcardMapper giftcardMapper; 18 | 19 | @Override 20 | public BaseMapper getRepository() { 21 | return null; 22 | } 23 | 24 | @Override 25 | public QueryWrapper getQueryWrapper(Giftcard giftcard) { 26 | return null; 27 | } 28 | 29 | @Override 30 | public QueryWrapper getQueryWrapper(Map condition) { 31 | return null; 32 | } 33 | 34 | @Override 35 | public Double checkValidGiftcard(String series, Integer status) { 36 | return giftcardMapper.checkValidGiftcard(series, status); 37 | } 38 | 39 | @Override 40 | public void redeemGiftcard(String series, Integer status, Date date, String user) { 41 | giftcardMapper.redeemGiftcard(series, status, date, user); 42 | } 43 | 44 | @Override 45 | public Double currentBalance(String user) { 46 | return giftcardMapper.currentBalance(user); 47 | } 48 | 49 | @Override 50 | public void addToUserBalance(String balance, String user) { 51 | giftcardMapper.addToUserBalance(balance, user); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/com/irental/houserent/controller/backend/ChargeController.java: -------------------------------------------------------------------------------- 1 | package com.irental.houserent.controller.backend; 2 | 3 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 4 | import com.irental.houserent.common.base.BaseController; 5 | import com.irental.houserent.common.util.PageUtil; 6 | import com.irental.houserent.entity.User; 7 | import com.irental.houserent.service.FeedbackService; 8 | import com.irental.houserent.service.HouseService; 9 | import com.irental.houserent.service.OrderService; 10 | import com.irental.houserent.service.UserService; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.stereotype.Controller; 13 | import org.springframework.ui.Model; 14 | import org.springframework.web.bind.annotation.RequestMapping; 15 | import org.springframework.web.bind.annotation.RequestParam; 16 | 17 | /* 18 | * 后台支付功能信息管理控制器 19 | * */ 20 | @Controller 21 | @RequestMapping("/admin/") 22 | public class ChargeController extends BaseController { 23 | @Autowired 24 | private UserService userService; 25 | 26 | @Autowired 27 | private HouseService houseService; 28 | 29 | @Autowired 30 | private OrderService orderService; 31 | 32 | @Autowired 33 | private FeedbackService feedbackService; 34 | 35 | /* 36 | * 个人信息页面 37 | * */ 38 | @RequestMapping("/charge") 39 | public String index(@RequestParam(value = "page", defaultValue = "1") Long pageNumber, @RequestParam(value = "size", defaultValue = "3") Long pageSize, Model model) { 40 | /*后台控制面板的*/ 41 | User user = getLoginUser(); 42 | model.addAttribute("user", user); 43 | model.addAttribute("tab", "payment"); 44 | Page page = PageUtil.initMpPage(pageNumber, pageSize); 45 | return "/admin/charge"; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 38 | -------------------------------------------------------------------------------- /src/main/java/com/irental/houserent/service/impl/MarkServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.irental.houserent.service.impl; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import com.irental.houserent.entity.Mark; 6 | import com.irental.houserent.mapper.MarkMapper; 7 | import com.irental.houserent.service.MarkService; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Service; 10 | 11 | import java.util.List; 12 | import java.util.Map; 13 | 14 | /* 15 | * 实现类 收藏Service 16 | * */ 17 | @Service 18 | public class MarkServiceImpl implements MarkService { 19 | @Autowired 20 | private MarkMapper markMapper; 21 | 22 | @Override 23 | public List findByUserIdAndHouseId(Long userId, Long houseId) { 24 | QueryWrapper queryWrapper = new QueryWrapper(); 25 | queryWrapper.eq("user_id", userId); 26 | queryWrapper.eq("house_id", houseId); 27 | return markMapper.selectList(queryWrapper); 28 | } 29 | 30 | 31 | @Override 32 | public BaseMapper getRepository() { 33 | return markMapper; 34 | } 35 | 36 | @Override 37 | public QueryWrapper getQueryWrapper(Mark mark) { 38 | QueryWrapper queryWrapper = new QueryWrapper(); 39 | if (mark != null) { 40 | if (mark.getUserId() != null) { 41 | queryWrapper.eq("user_id", mark.getUserId()); 42 | } 43 | if (mark.getHouseId() != null) { 44 | queryWrapper.eq("houseId", mark.getHouseId()); 45 | } 46 | } 47 | return queryWrapper; 48 | } 49 | 50 | @Override 51 | public QueryWrapper getQueryWrapper(Map condition) { 52 | return null; 53 | } 54 | 55 | 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/com/irental/houserent/controller/front/IndexController.java: -------------------------------------------------------------------------------- 1 | package com.irental.houserent.controller.front; 2 | 3 | 4 | import com.irental.houserent.common.base.BaseController; 5 | import com.irental.houserent.common.constant.Constant; 6 | import com.irental.houserent.common.enums.HouseRentTypeEnum; 7 | import com.irental.houserent.service.HouseService; 8 | import com.irental.houserent.service.OrderService; 9 | import com.irental.houserent.service.UserService; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.stereotype.Controller; 12 | import org.springframework.ui.Model; 13 | import org.springframework.web.bind.annotation.RequestMapping; 14 | 15 | import static com.irental.houserent.common.util.getLocation.getlocation; 16 | 17 | //前端首页控制器 18 | @Controller 19 | public class IndexController extends BaseController { 20 | @Autowired 21 | private OrderService orderService; 22 | 23 | @Autowired 24 | private HouseService houseService; 25 | 26 | @Autowired 27 | private UserService userService; 28 | 29 | /* 30 | * 前端首页*/ 31 | @RequestMapping(value = "/") 32 | public String index(Model model) { 33 | //获取用户现在的位置(以省级为单位) 34 | String location = getlocation(); 35 | //最新的整租 36 | model.addAttribute("recentWholeHouseList", houseService.findTopList(HouseRentTypeEnum.WHOLE.getValue(), Constant.INDEX_HOUSE_NUM)); 37 | //最新的合租 38 | model.addAttribute("recentShareHouseList", houseService.findTopList(HouseRentTypeEnum.SHARE.getValue(), Constant.INDEX_HOUSE_NUM)); 39 | //获取三条用户当前位置的民宿 40 | model.addAttribute("locationHouseList", houseService.findByLocation(location, Constant.INDEX_HOUSE_LOCATION_NUM)); 41 | //增加地理位置信息 42 | model.addAttribute("userLocation", location); 43 | 44 | return "front/index"; 45 | } 46 | 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/irental/houserent/controller/front/MarkController.java: -------------------------------------------------------------------------------- 1 | package com.irental.houserent.controller.front; 2 | 3 | import com.irental.houserent.common.base.BaseController; 4 | import com.irental.houserent.common.dto.JsonResult; 5 | import com.irental.houserent.entity.Mark; 6 | import com.irental.houserent.entity.User; 7 | import com.irental.houserent.service.MarkService; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Controller; 10 | import org.springframework.web.bind.annotation.RequestMapping; 11 | import org.springframework.web.bind.annotation.RequestMethod; 12 | import org.springframework.web.bind.annotation.RequestParam; 13 | import org.springframework.web.bind.annotation.ResponseBody; 14 | 15 | import java.util.Date; 16 | import java.util.List; 17 | 18 | /* 19 | * 收藏控制器 20 | * */ 21 | @Controller 22 | public class MarkController extends BaseController { 23 | @Autowired 24 | private MarkService markService; 25 | /* 26 | * 收藏提交 27 | * */ 28 | 29 | @RequestMapping(value = "/mark/submit", method = RequestMethod.POST) 30 | @ResponseBody 31 | public JsonResult submit(@RequestParam("houseId") Long houseId) { 32 | //判断用户是否已登录 33 | User loginUser = getLoginUser(); 34 | if (loginUser == null) { 35 | return JsonResult.error("请先登录"); 36 | } 37 | //判断是否已经收藏过 38 | List markList = markService.findByUserIdAndHouseId(loginUser.getId(), houseId); 39 | if (markList != null && markList.size() > 0) { 40 | return JsonResult.error("您已收藏过了。"); 41 | } 42 | Mark mark = new Mark(); 43 | mark.setCreateTime(new Date()); 44 | mark.setUserId(loginUser.getId()); 45 | mark.setHouseId(houseId); 46 | markService.insert(mark); 47 | return JsonResult.success("收藏成功!"); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 9999 3 | forward-headers-strategy: true 4 | undertow: 5 | io-threads: 2 6 | worker-threads: 36 7 | buffer-size: 1024 8 | directBuffers: true 9 | servlet: 10 | session: 11 | timeout: 86400 12 | 13 | spring: 14 | transaction: 15 | rollback-on-commit-failure: true 16 | datasource: 17 | type: com.alibaba.druid.pool.DruidDataSource 18 | #MySql配置 19 | driver-class-name: com.mysql.cj.jdbc.Driver 20 | url: jdbc:mysql://localhost:3306/houserent?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&allowMultiQueries=true 21 | username: root 22 | password: root 23 | servlet: 24 | multipart: 25 | max-file-size: 2MB 26 | max-request-size: 20MB 27 | #redis 28 | redis: 29 | database: 0 30 | host: 127.0.0.1 31 | port: 6379 32 | password: foobared 33 | timeout: 10000 34 | jedis: 35 | pool: 36 | max-active: 8 37 | max-wait: -1 38 | max-idle: 8 39 | min-idle: 0 40 | mybatis-plus: 41 | mapper-locations: classpath*:/mapper/**Mapper.xml 42 | #实体扫描,多个package用逗号或者分号分隔 43 | typeAliasesPackage: com.irental.houserent.entity 44 | global-config: 45 | #主键类型 0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID"; 46 | id-type: 0 47 | #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断" 48 | field-strategy: 2 49 | #驼峰下划线转换 50 | db-column-underline: true 51 | #刷新mapper 调试神器 52 | refresh-mapper: true 53 | #逻辑删除配置(下面3个配置) 54 | logic-delete-value: 1 55 | logic-not-delete-value: 0 56 | configuration: 57 | map-underscore-to-camel-case: true 58 | cache-enabled: true 59 | 60 | logging: 61 | file: ./logs/log.log 62 | level: 63 | org: 64 | springframework: 65 | boot: 66 | autoconfigure: error 67 | 68 | shiro: 69 | userNativeSessionManager: true 70 | 71 | application: 72 | version: 1.1.0 73 | staticCdnUrl: 74 | -------------------------------------------------------------------------------- /src/main/java/com/irental/houserent/controller/front/NewsController.java: -------------------------------------------------------------------------------- 1 | package com.irental.houserent.controller.front; 2 | 3 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 4 | import com.irental.houserent.common.base.BaseController; 5 | import com.irental.houserent.common.util.PageUtil; 6 | import com.irental.houserent.entity.News; 7 | import com.irental.houserent.service.NewsService; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Controller; 10 | import org.springframework.ui.Model; 11 | import org.springframework.web.bind.annotation.PathVariable; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | import org.springframework.web.bind.annotation.RequestParam; 14 | 15 | /* 16 | * 前端-新闻资讯控制器 17 | * */ 18 | @Controller("frontNewsController") 19 | @RequestMapping("/news") 20 | public class NewsController extends BaseController { 21 | @Autowired 22 | private NewsService newsService; 23 | 24 | /* 25 | * 进入新闻列表页面 26 | * */ 27 | @RequestMapping("") 28 | public String newsList(@RequestParam(value = "page", defaultValue = "1") Long pageNumber, @RequestParam(value = "size", defaultValue = "6") Long pageSize, Model model) { 29 | Page page = PageUtil.initMpPage(pageNumber, pageSize); 30 | News condition = new News(); 31 | Page newsPage = newsService.findAll(page, condition); 32 | model.addAttribute("pageInfo", newsPage); 33 | model.addAttribute("pagePrefix", "/news?"); 34 | return "front/news-list"; 35 | } 36 | 37 | /* 38 | * 新闻详情 39 | * */ 40 | @RequestMapping("/detail/{id}") 41 | public String publish(@PathVariable(value = "id", required = false) Long id, Model model) { 42 | News news = newsService.get(id); 43 | if (news == null) { 44 | return renderNotFound(); 45 | } 46 | model.addAttribute("news", news); 47 | return "front/news-detail"; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/irental/houserent/controller/backend/FileController.java: -------------------------------------------------------------------------------- 1 | package com.irental.houserent.controller.backend; 2 | 3 | import com.irental.houserent.common.base.BaseController; 4 | import com.irental.houserent.common.constant.Constant; 5 | import com.irental.houserent.common.dto.JsonResult; 6 | import com.irental.houserent.common.util.FileUtil; 7 | import org.springframework.stereotype.Controller; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RequestMethod; 10 | import org.springframework.web.bind.annotation.RequestParam; 11 | import org.springframework.web.bind.annotation.ResponseBody; 12 | import org.springframework.web.multipart.MultipartFile; 13 | 14 | import javax.servlet.http.HttpSession; 15 | import java.util.ArrayList; 16 | import java.util.HashMap; 17 | import java.util.List; 18 | import java.util.Map; 19 | 20 | /* 21 | * 文件上传控制器 22 | * */ 23 | @Controller 24 | @RequestMapping("/file") 25 | public class FileController extends BaseController { 26 | /* 27 | * 文件上传 28 | * */ 29 | @RequestMapping(value = "/upload", method = RequestMethod.POST) 30 | @ResponseBody 31 | public JsonResult upload(@RequestParam("file") MultipartFile file, @RequestParam("key") String key, HttpSession session) { 32 | Map map = new HashMap<>(); 33 | try { 34 | map = FileUtil.upload(file); 35 | } catch (Exception e) { 36 | e.printStackTrace(); 37 | return JsonResult.error("上传失败"); 38 | } 39 | String filePath = map.get("filePath"); 40 | //将图片URL存在SESSION里面 41 | String sessionKey = Constant.SESSION_IMG_PREFIX + key; 42 | List imgList = (List) session.getAttribute(sessionKey); 43 | if (imgList == null) { 44 | imgList = new ArrayList<>(); 45 | } 46 | imgList.add(filePath); 47 | session.setAttribute(sessionKey, imgList); 48 | return JsonResult.success("上传成功!"); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/irental/houserent/service/impl/UserServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.irental.houserent.service.impl; 2 | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 5 | import com.irental.houserent.entity.User; 6 | import com.irental.houserent.mapper.UserMapper; 7 | import com.irental.houserent.service.UserService; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Service; 10 | 11 | import java.util.Map; 12 | 13 | /* 14 | * 用户服务接口实现 15 | * */ 16 | @Service 17 | public class UserServiceImpl implements UserService { 18 | @Autowired 19 | private UserMapper userMapper; 20 | 21 | /* 22 | * mapper对象 23 | * */ 24 | @Override 25 | public BaseMapper getRepository() { 26 | return userMapper; 27 | } 28 | 29 | @Override 30 | public QueryWrapper getQueryWrapper(User user) { 31 | return null; 32 | } 33 | 34 | @Override 35 | public QueryWrapper getQueryWrapper(Map condition) { 36 | return null; 37 | } 38 | 39 | @Override 40 | public User findByUserName(String userName) { 41 | QueryWrapper queryWrapper = new QueryWrapper(); 42 | queryWrapper.eq("user_name", userName); 43 | return userMapper.selectOne(queryWrapper); 44 | } 45 | 46 | @Override 47 | public String findAllUserNums() { 48 | return userMapper.findAllUserNums(); 49 | } 50 | 51 | @Override 52 | public String findOwnerNums() { 53 | return userMapper.findOwnerNums(); 54 | } 55 | 56 | @Override 57 | public String userFeedbackCount() { 58 | return userMapper.userFeedbackCount(); 59 | } 60 | 61 | @Override 62 | public Double getUserBlance(Long user) { 63 | return userMapper.getUserBlance(user); 64 | } 65 | 66 | @Override 67 | public void updateUserBalance(Double balance, String user) { 68 | userMapper.updateUserBalance(balance, user); 69 | } 70 | 71 | 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/com/irental/houserent/controller/front/RegisterController.java: -------------------------------------------------------------------------------- 1 | package com.irental.houserent.controller.front; 2 | 3 | import com.irental.houserent.common.base.BaseController; 4 | import com.irental.houserent.common.constant.Constant; 5 | import com.irental.houserent.common.dto.JsonResult; 6 | import com.irental.houserent.entity.User; 7 | import com.irental.houserent.service.UserService; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Controller; 10 | import org.springframework.web.bind.annotation.RequestMapping; 11 | import org.springframework.web.bind.annotation.RequestMethod; 12 | import org.springframework.web.bind.annotation.ResponseBody; 13 | 14 | import javax.servlet.http.HttpSession; 15 | import java.util.Date; 16 | 17 | /* 18 | * 注册控制器 19 | * */ 20 | @Controller 21 | @RequestMapping("/register") 22 | public class RegisterController extends BaseController { 23 | @Autowired 24 | private UserService userService; 25 | 26 | /* 27 | * 注册提交 28 | * */ 29 | @RequestMapping(value = "/submit", method = RequestMethod.POST) 30 | @ResponseBody 31 | public JsonResult registerSubmit(User user, HttpSession session) { 32 | if (user == null) { 33 | return JsonResult.error("非法访问"); 34 | } 35 | User user1 = userService.findByUserName(user.getUserName()); 36 | if (user1 != null) { 37 | return JsonResult.error("用户已存在!"); 38 | } 39 | 40 | user.setIdCard(""); 41 | user.setUserAvatar("/assets/img/default-avatar.jpg"); 42 | user.setUserDesc("还未填写..."); 43 | user.setSex("保密"); 44 | user.setHobby("暂未填写"); 45 | user.setJob("暂未填写"); 46 | user.setCreateTime(new Date()); 47 | try { 48 | userService.insert(user); 49 | } catch (Exception e) { 50 | e.printStackTrace(); 51 | return JsonResult.error("注册失败。"); 52 | } 53 | session.setAttribute(Constant.SESSION_USER_KEY, user); 54 | return JsonResult.success("注册成功,即将前往完善个人资料。"); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/com/irental/houserent/controller/backend/HomeController.java: -------------------------------------------------------------------------------- 1 | package com.irental.houserent.controller.backend; 2 | 3 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 4 | import com.irental.houserent.common.base.BaseController; 5 | import com.irental.houserent.common.enums.OrderStatusEnum; 6 | import com.irental.houserent.common.util.PageUtil; 7 | import com.irental.houserent.entity.Order; 8 | import com.irental.houserent.service.HouseService; 9 | import com.irental.houserent.service.OrderService; 10 | import com.irental.houserent.service.UserService; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.stereotype.Controller; 13 | import org.springframework.ui.Model; 14 | import org.springframework.web.bind.annotation.RequestMapping; 15 | import org.springframework.web.bind.annotation.RequestParam; 16 | 17 | /* 18 | * 租客“我的家”功能控制器 19 | * */ 20 | @Controller("backHomeController") 21 | public class HomeController extends BaseController { 22 | @Autowired 23 | private OrderService orderService; 24 | 25 | @Autowired 26 | private HouseService houseService; 27 | 28 | @Autowired 29 | private UserService userService; 30 | 31 | /* 32 | * 租客房屋信息列表我的家 33 | * */ 34 | @RequestMapping("/admin/home") 35 | public String home(@RequestParam(value = "page", defaultValue = "1") Long pageNumber, @RequestParam(value = "size", defaultValue = "6") Long pageSize, Model model) { 36 | Page page = PageUtil.initMpPage(pageNumber, pageSize); 37 | Order condition = new Order(); 38 | condition.setCustomerUserId(getLoginUserId()); 39 | condition.setStatus(OrderStatusEnum.NORMAL.getValue()); 40 | 41 | Page orderPage = orderService.findAll(page, condition); 42 | for (Order order : orderPage.getRecords()) { 43 | //TODO 性能需要优化 44 | order.setHouse(houseService.get(order.getHouseId())); // 优化方案 id in ('1'.'2','3') 45 | order.setOwnerUser(userService.get(order.getOwnerUserId())); 46 | } 47 | model.addAttribute("pageInfo", orderPage); 48 | model.addAttribute("tab", "home"); 49 | model.addAttribute("pagePrefix", "/admin/home?"); 50 | return "admin/my-home"; 51 | } 52 | 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/irental/houserent/controller/backend/GiftcardController.java: -------------------------------------------------------------------------------- 1 | package com.irental.houserent.controller.backend; 2 | 3 | import com.irental.houserent.common.base.BaseController; 4 | import com.irental.houserent.common.dto.JsonResult; 5 | import com.irental.houserent.common.enums.GiftcardStatusEnum; 6 | import com.irental.houserent.entity.User; 7 | import com.irental.houserent.service.GiftcardService; 8 | import com.irental.houserent.service.UserService; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Controller; 11 | import org.springframework.web.bind.annotation.RequestMapping; 12 | import org.springframework.web.bind.annotation.RequestParam; 13 | import org.springframework.web.bind.annotation.ResponseBody; 14 | 15 | import java.util.Date; 16 | import java.util.Objects; 17 | 18 | @Controller 19 | @RequestMapping("/admin/giftcard") 20 | public class GiftcardController extends BaseController { 21 | @Autowired 22 | private UserService userService; 23 | 24 | @Autowired 25 | private GiftcardService giftcardService; 26 | 27 | /* 28 | * 充值兑换余额到账户 29 | * */ 30 | @RequestMapping("/redeem") 31 | @ResponseBody 32 | public JsonResult redeem(@RequestParam("series") String series) { 33 | if(series.equals("")){ 34 | return JsonResult.error("请填写礼品卡代码或PIN!"); 35 | } 36 | User user = userService.get(getLoginUserId()); 37 | if (user == null) { 38 | return JsonResult.error("您还未登录!"); 39 | } 40 | //判断序列号 是否存在、有效 41 | Double redeem_value = giftcardService.checkValidGiftcard(series, GiftcardStatusEnum.NORMAL.getValue()); 42 | if (Objects.equals(redeem_value, null) || Objects.equals(redeem_value, "")) { 43 | return JsonResult.error("兑换码不存在或已被使用或已到期"); 44 | } 45 | Date date = new Date(); 46 | //进行兑换,将礼品卡设置为 status = -1已使用并且,将使用者设置为当前用户 47 | giftcardService.redeemGiftcard(series, GiftcardStatusEnum.USED.getValue(), date, user.getUserName()); 48 | Double currentBalance = giftcardService.currentBalance(user.getUserName()); 49 | 50 | String afterBalance = String.format("%.2f", redeem_value + currentBalance); 51 | giftcardService.addToUserBalance(afterBalance, user.getUserName()); 52 | 53 | return JsonResult.success("兑换成功!礼品卡为您兑换了" + redeem_value + "元"); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/com/irental/houserent/controller/backend/ProfileController.java: -------------------------------------------------------------------------------- 1 | package com.irental.houserent.controller.backend; 2 | 3 | import com.alibaba.fastjson.JSON; 4 | import com.irental.houserent.common.base.BaseController; 5 | import com.irental.houserent.common.constant.Constant; 6 | import com.irental.houserent.common.dto.JsonResult; 7 | import com.irental.houserent.entity.User; 8 | import com.irental.houserent.service.UserService; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Controller; 11 | import org.springframework.ui.Model; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | import org.springframework.web.bind.annotation.RequestMethod; 14 | import org.springframework.web.bind.annotation.RequestParam; 15 | import org.springframework.web.bind.annotation.ResponseBody; 16 | 17 | import javax.servlet.http.HttpSession; 18 | import java.util.List; 19 | 20 | /* 21 | * 个人信息管理控制器 22 | * */ 23 | @Controller 24 | @RequestMapping("/admin/profile") 25 | public class ProfileController extends BaseController { 26 | @Autowired 27 | private UserService userService; 28 | 29 | /* 30 | * 个人信息页面 31 | * */ 32 | @RequestMapping("") 33 | public String profile(Model model) { 34 | User user = getLoginUser(); 35 | model.addAttribute("user", user); 36 | model.addAttribute("tab", "my-profile"); 37 | return "admin/my-profile"; 38 | } 39 | 40 | /* 41 | * 个人信息保存提交 42 | * */ 43 | @RequestMapping(value = "/submit", method = RequestMethod.POST) 44 | @ResponseBody 45 | public JsonResult submitProfile(User user, HttpSession session, @RequestParam("key") String key) { 46 | user.setId(getLoginUserId()); 47 | userService.update(user); 48 | //获取上传的用户头像 49 | String sessionKey = Constant.SESSION_IMG_PREFIX + key; 50 | List imgList = (List) session.getAttribute(sessionKey); 51 | if (imgList != null && imgList.size() > 0) { 52 | //设置头像,转换成JSON格式存储 53 | user.setUserAvatar(JSON.toJSONString(imgList)); 54 | //将第一个图设置为头像 55 | user.setUserAvatar(imgList.get(0)); 56 | } 57 | userService.insertOrUpdate(user); 58 | session.setAttribute(Constant.SESSION_USER_KEY, userService.get(getLoginUserId())); 59 | return JsonResult.success("保存成功"); 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /src/main/webapp/jsp/admin/news-list.jsp: -------------------------------------------------------------------------------- 1 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 2 | <%@ include file="../common/head.jsp" %> 3 |
4 |
5 |
6 | <%@ include file="../common/admin-left.jsp" %> 7 |
8 |
9 |
10 |
11 |

新闻管理 发布新闻

12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 25 | 28 | 33 | 34 | 35 | 36 | 37 |
标题时间操作
23 | ${c.title} 24 | 26 | 27 | 29 | 编辑 30 | 删除 32 |
38 |
39 |
40 |
41 | <%@ include file="../common/page.jsp" %> 42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 | <%@ include file="../common/footer.jsp" %> 50 | 51 | -------------------------------------------------------------------------------- /src/main/java/com/irental/houserent/controller/front/FeedbackController.java: -------------------------------------------------------------------------------- 1 | package com.irental.houserent.controller.front; 2 | 3 | import com.irental.houserent.common.base.BaseController; 4 | import com.irental.houserent.common.dto.JsonResult; 5 | import com.irental.houserent.common.enums.FeedbackStatusEnum; 6 | import com.irental.houserent.entity.Feedback; 7 | import com.irental.houserent.entity.User; 8 | import com.irental.houserent.service.FeedbackService; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Controller; 11 | import org.springframework.web.bind.annotation.RequestMapping; 12 | import org.springframework.web.bind.annotation.RequestMethod; 13 | import org.springframework.web.bind.annotation.RequestParam; 14 | import org.springframework.web.bind.annotation.ResponseBody; 15 | 16 | import java.util.Date; 17 | 18 | /* 19 | * 用户反馈前端控制器 20 | * */ 21 | @Controller("frontFeedbackController") 22 | public class FeedbackController extends BaseController { 23 | @Autowired 24 | private FeedbackService feedbackService; 25 | 26 | @RequestMapping("/feedback") 27 | public String feedbackSubmit() { 28 | return "front/feedback"; 29 | } 30 | 31 | /* 32 | * 反馈信息提交 33 | * */ 34 | 35 | @RequestMapping(value = "/feedback/submit", method = RequestMethod.POST) 36 | @ResponseBody 37 | public JsonResult submit(@RequestParam("contactName") String contactName, 38 | @RequestParam("contactEmail") String contactEmail, 39 | @RequestParam("title") String title, 40 | @RequestParam("content") String content) { 41 | //判断用户是否已登录 42 | User loginUser = getLoginUser(); 43 | if (loginUser == null) { 44 | return JsonResult.error("请先登录"); 45 | } 46 | if (contactName.equals("") || contactEmail.equals("") || title.equals("") || content.equals("")) { 47 | return JsonResult.error("请完善内容后再提交"); 48 | } 49 | Feedback feedback = new Feedback(); 50 | feedback.setContactEmail(contactEmail); 51 | feedback.setContactName(contactName); 52 | feedback.setStatus(FeedbackStatusEnum.NOT_HANDLE.getValue()); 53 | feedback.setTitle(title); 54 | feedback.setUserId(getLoginUserId()); 55 | feedback.setContent(content); 56 | feedback.setCreateTime(new Date()); 57 | feedbackService.insert(feedback); 58 | return JsonResult.success("反馈提交成功,请耐心等待处理"); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/com/irental/houserent/controller/backend/MarkController.java: -------------------------------------------------------------------------------- 1 | package com.irental.houserent.controller.backend; 2 | 3 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 4 | import com.irental.houserent.common.util.PageUtil; 5 | import com.irental.houserent.common.base.BaseController; 6 | import com.irental.houserent.common.dto.JsonResult; 7 | import com.irental.houserent.entity.Mark; 8 | import com.irental.houserent.service.HouseService; 9 | import com.irental.houserent.service.MarkService; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.stereotype.Controller; 12 | import org.springframework.ui.Model; 13 | import org.springframework.web.bind.annotation.RequestMapping; 14 | import org.springframework.web.bind.annotation.RequestMethod; 15 | import org.springframework.web.bind.annotation.RequestParam; 16 | import org.springframework.web.bind.annotation.ResponseBody; 17 | 18 | import java.util.Objects; 19 | 20 | /* 21 | * 我的收藏查询和取消收藏功能 控制器 22 | * */ 23 | @Controller("backMarkController") 24 | public class MarkController extends BaseController { 25 | @Autowired 26 | private HouseService houseService; 27 | 28 | @Autowired 29 | private MarkService markService; 30 | 31 | /* 32 | * 查询我的收藏列表 33 | * */ 34 | @RequestMapping("/admin/mark") 35 | public String markList(@RequestParam(value = "page", defaultValue = "1") Long pageNumber, @RequestParam(value = "size", defaultValue = "6") Long pageSize, Model model) { 36 | Page page = PageUtil.initMpPage(pageNumber, pageSize); 37 | Mark condition = new Mark(); 38 | condition.setUserId(getLoginUserId()); 39 | Page markPage = markService.findAll(page, condition); 40 | for (Mark mark : markPage.getRecords()) { 41 | mark.setHouse(houseService.get(mark.getHouseId())); 42 | } 43 | model.addAttribute("pageInfo", markPage); 44 | model.addAttribute("tab", "mark-list"); 45 | model.addAttribute("pagePrefix", "/admin/mark?"); 46 | return "admin/mark-list"; 47 | } 48 | 49 | /* 50 | * 取消收藏的方法 51 | * */ 52 | @RequestMapping(value = "/admin/mark/cancel", method = RequestMethod.POST) 53 | @ResponseBody 54 | public JsonResult cancelMark(@RequestParam("id") Long id) { 55 | Mark mark = markService.get(id); 56 | if (mark == null || !Objects.equals(mark.getUserId(), getLoginUserId())) { 57 | return JsonResult.error("取消收藏失败"); 58 | } 59 | markService.delete(id); 60 | return JsonResult.success("取消收藏成功"); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/main/webapp/jsp/front/house-map.jsp: -------------------------------------------------------------------------------- 1 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 2 | 3 | 4 | 5 | 6 | 地图 7 | 9 | 10 | 11 | 12 | 22 |
23 | 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /src/main/java/com/irental/houserent/controller/backend/AdminController.java: -------------------------------------------------------------------------------- 1 | package com.irental.houserent.controller.backend; 2 | 3 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 4 | import com.irental.houserent.common.base.BaseController; 5 | import com.irental.houserent.common.util.PageUtil; 6 | import com.irental.houserent.entity.Feedback; 7 | import com.irental.houserent.entity.User; 8 | import com.irental.houserent.service.FeedbackService; 9 | import com.irental.houserent.service.HouseService; 10 | import com.irental.houserent.service.OrderService; 11 | import com.irental.houserent.service.UserService; 12 | import org.springframework.beans.factory.annotation.Autowired; 13 | import org.springframework.stereotype.Controller; 14 | import org.springframework.ui.Model; 15 | import org.springframework.web.bind.annotation.RequestMapping; 16 | import org.springframework.web.bind.annotation.RequestParam; 17 | 18 | /* 19 | * 个人信息管理控制器 20 | * */ 21 | @Controller 22 | @RequestMapping("/admin/") 23 | public class AdminController extends BaseController { 24 | @Autowired 25 | private UserService userService; 26 | 27 | @Autowired 28 | private HouseService houseService; 29 | 30 | @Autowired 31 | private OrderService orderService; 32 | 33 | @Autowired 34 | private FeedbackService feedbackService; 35 | 36 | /* 37 | * 个人信息页面 38 | * */ 39 | @RequestMapping("/control") 40 | public String index(@RequestParam(value = "page", defaultValue = "1") Long pageNumber, @RequestParam(value = "size", defaultValue = "3") Long pageSize, Model model) { 41 | /*后台控制面板的*/ 42 | User user = getLoginUser(); 43 | model.addAttribute("user", user); 44 | model.addAttribute("tab", "admin-control"); 45 | 46 | Page page = PageUtil.initMpPage(pageNumber, pageSize); 47 | Feedback condition1 = new Feedback(); 48 | Page feedbackPage = feedbackService.findAll(page, condition1); 49 | model.addAttribute("pageInfo", feedbackPage); 50 | model.addAttribute("pagePrefix", "/news?"); 51 | 52 | String userCount = userService.findAllUserNums(); 53 | String ownerCount = userService.findOwnerNums(); 54 | String userFeedbackCount = userService.userFeedbackCount(); 55 | String orderNum = orderService.orderNum(); 56 | String houseCount = houseService.houseCount(); 57 | 58 | model.addAttribute("userCount", userCount); 59 | model.addAttribute("ownerCount", ownerCount); 60 | model.addAttribute("houseCount", houseCount); 61 | model.addAttribute("userFeedbackCount", userFeedbackCount); 62 | model.addAttribute("orderNum", orderNum); 63 | return "admin/admin-control"; 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /src/main/webapp/jsp/admin/mark-list.jsp: -------------------------------------------------------------------------------- 1 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 2 | <%@ include file="../common/head.jsp" %> 3 |
4 |
5 |
6 | <%@ include file="../common/admin-left.jsp" %> 7 |
8 |
9 |
10 |
11 |

我的收藏

12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 33 | 37 | 38 | 39 | 40 | 41 |
收藏列表
22 | 23 |
24 |

${c.house.title} 26 |

27 | ${c.house.address} 28 | 29 | ¥${c.house.monthRent} / 月 30 | 31 |
32 |
34 | 取消收藏 36 |
42 |
43 |
44 |
45 | <%@ include file="../common/page.jsp" %> 46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 | <%@ include file="../common/footer.jsp" %> 54 | 55 | -------------------------------------------------------------------------------- /src/main/java/com/irental/houserent/controller/backend/FeedbackController.java: -------------------------------------------------------------------------------- 1 | package com.irental.houserent.controller.backend; 2 | 3 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 4 | import com.irental.houserent.common.base.BaseController; 5 | import com.irental.houserent.common.dto.JsonResult; 6 | import com.irental.houserent.common.util.PageUtil; 7 | import com.irental.houserent.entity.Feedback; 8 | import com.irental.houserent.service.FeedbackService; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Controller; 11 | import org.springframework.ui.Model; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | import org.springframework.web.bind.annotation.RequestMethod; 14 | import org.springframework.web.bind.annotation.RequestParam; 15 | import org.springframework.web.bind.annotation.ResponseBody; 16 | 17 | import java.util.Objects; 18 | 19 | /* 20 | * 后端反馈控制器 21 | * */ 22 | @Controller("backFeedbackController") 23 | public class FeedbackController extends BaseController { 24 | @Autowired 25 | private FeedbackService feedbackService; 26 | 27 | @RequestMapping("/admin/feedback") 28 | public String feedback(@RequestParam(value = "page", defaultValue = "1") Long pageNumber, @RequestParam(value = "size", defaultValue = "6") Long pageSize, Model model) { 29 | Page page = PageUtil.initMpPage(pageNumber, pageSize); 30 | Feedback condition = new Feedback(); 31 | //如果不是管理员,只查询自己的反馈 32 | if (!loginUserIsAdmin()) { 33 | condition.setUserId(getLoginUserId()); 34 | } 35 | Page feedbackPage = feedbackService.findAll(page, condition); 36 | model.addAttribute("pageInfo", feedbackPage); 37 | model.addAttribute("pagePrefix", "/news?"); 38 | model.addAttribute("tab", "feedback-list"); 39 | model.addAttribute("isAdmin", loginUserIsAdmin()); 40 | return "admin/feedback-list"; 41 | } 42 | 43 | 44 | @RequestMapping(value = "/admin/feedback/reply/submit", method = RequestMethod.POST) 45 | @ResponseBody 46 | public JsonResult replySubmit(Feedback feedback) { 47 | feedbackService.update(feedback); 48 | return JsonResult.success("保存成功"); 49 | } 50 | 51 | 52 | /* 53 | * 删除反馈 54 | * */ 55 | @RequestMapping("/admin/feedback/delete") 56 | @ResponseBody 57 | public JsonResult deleteFeedback(@RequestParam("id") Long id) { 58 | try { 59 | Feedback feedback = feedbackService.get(id); 60 | if (feedback == null) { 61 | return JsonResult.error("删除失败,未找到反馈。"); 62 | } 63 | if (!loginUserIsAdmin() && !Objects.equals(feedback.getUserId(), getLoginUserId())) { 64 | return JsonResult.error("无权限"); 65 | } 66 | feedbackService.delete(id); 67 | } catch (Exception e) { 68 | return JsonResult.error("删除反馈信息失败,请重试。"); 69 | } 70 | 71 | return JsonResult.success("删除成功!"); 72 | } 73 | 74 | 75 | } 76 | -------------------------------------------------------------------------------- /src/main/java/com/irental/houserent/entity/House.java: -------------------------------------------------------------------------------- 1 | package com.irental.houserent.entity; 2 | 3 | 4 | import com.baomidou.mybatisplus.annotation.TableField; 5 | import com.baomidou.mybatisplus.annotation.TableName; 6 | import com.irental.houserent.common.base.BaseEntity; 7 | import lombok.Data; 8 | 9 | import java.util.Date; 10 | import java.util.List; 11 | 12 | /* 13 | * 房屋信息实体 14 | * */ 15 | @Data 16 | @TableName("t_house") 17 | public class House extends BaseEntity { 18 | 19 | /* 20 | * 房东用户ID 21 | * */ 22 | private Long userId; 23 | 24 | /* 25 | * 出租类型 26 | * */ 27 | private String rentType; 28 | 29 | /* 30 | * 房屋名称 31 | * */ 32 | private String title; 33 | 34 | /* 35 | * 房屋详细描述 36 | * */ 37 | private String content; 38 | 39 | /* 40 | * 城市名称 41 | * */ 42 | private String city; 43 | 44 | /* 45 | * 登录名 46 | * */ 47 | private String address; 48 | 49 | /* 50 | * 缩略图URL 51 | * */ 52 | private String thumbnailUrl; 53 | 54 | /* 55 | * 轮播图URL 56 | * */ 57 | private String slideUrl; 58 | 59 | /* 60 | * 月租金额 61 | * */ 62 | private Double monthRent; 63 | 64 | /* 65 | * 状态:0未租出/1已租出/-1下架/-2待审核/-3审核不通过 66 | * */ 67 | private Integer status; 68 | 69 | /* 70 | * 房产证号 71 | * */ 72 | private String certificateNo; 73 | /* 74 | * 卫生间数量 75 | * */ 76 | private Integer toiletNum; 77 | 78 | /* 79 | * 厨房数量 80 | * */ 81 | private Integer kitchenNum; 82 | 83 | 84 | /* 85 | * 客厅数量 86 | * */ 87 | private Integer livingRoomNum; 88 | 89 | /* 90 | * 卧室数量 91 | * */ 92 | private Integer bedroomNum; 93 | 94 | /* 95 | * 是否有空调 1有 0无 96 | * */ 97 | private String hasAirConditioner; 98 | 99 | /* 100 | * 面积 101 | * */ 102 | private Double area; 103 | 104 | /* 105 | * 当前所有楼层数 106 | * */ 107 | private Integer floor; 108 | 109 | /* 110 | * 房字最大楼层数 111 | * */ 112 | private Integer maxFloor; 113 | 114 | /* 115 | * 是否有电梯 1有 0无 116 | * */ 117 | private Integer hasElevator; 118 | 119 | /* 120 | * 建成年份 121 | * */ 122 | private Integer buildYear; 123 | 124 | /* 125 | * 朝向 126 | * */ 127 | private String direction; 128 | 129 | /* 130 | * 上次开始入住时间 131 | * */ 132 | private Date lastOrderStartTime; 133 | 134 | /* 135 | * 上次结束入住时间 136 | * */ 137 | private Date lastOrderEndTime; 138 | 139 | /* 140 | * 经纬度 141 | * */ 142 | private String longitudeLatitude; 143 | 144 | /* 145 | * 联系人姓名 146 | * */ 147 | private String contactName; 148 | 149 | /* 150 | * 联系人电话 151 | * */ 152 | private String contactPhone; 153 | 154 | /* 155 | * 轮播图列表 156 | * */ 157 | @TableField(exist = false) 158 | private List slideImgList; 159 | 160 | /* 161 | * 合租房屋列表 162 | * */ 163 | @TableField(exist = false) 164 | private List shareHouseList; 165 | 166 | /* 167 | * 该房屋的订单 168 | * */ 169 | @TableField(exist = false) 170 | private Order currentOrder; 171 | 172 | /* 173 | * 位置 174 | * */ 175 | @TableField(exist = false) 176 | private String location; 177 | 178 | } 179 | -------------------------------------------------------------------------------- /src/main/java/com/irental/houserent/controller/backend/UeditorController.java: -------------------------------------------------------------------------------- 1 | package com.irental.houserent.controller.backend; 2 | 3 | import com.irental.houserent.common.util.FileUtil; 4 | import org.springframework.web.bind.annotation.*; 5 | import org.springframework.web.multipart.MultipartFile; 6 | 7 | /* 8 | * 百度富文本编辑器 9 | * */ 10 | @RestController 11 | @RequestMapping("/api/ueditor") 12 | public class UeditorController { 13 | /** 14 | * 获取Ueditor的配置文件 15 | * 16 | * @return 17 | */ 18 | @GetMapping("/config") 19 | public String getConfig() { 20 | return "{\n" + 21 | " \"imageActionName\": \"uploadimage\",\n" + 22 | " \"imageFieldName\": \"file\",\n" + 23 | " \"imageMaxSize\": 2048000,\n" + 24 | " \"imageAllowFiles\": [\".png\", \".jpg\", \".jpeg\", \".gif\", \".bmp\"],\n" + 25 | " \"imageCompressEnable\": true,\n" + 26 | " \"imageCompressBorder\": 1600,\n" + 27 | " \"imageInsertAlign\": \"none\",\n" + 28 | " \"imageUrlPrefix\": \"\",\n" + 29 | " \"imagePathFormat\": \"/ueditor/jsp/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}\",\n" + 30 | "\n" + 31 | " /* 上传文件配置 */\n" + 32 | " \"fileActionName\": \"uploadfile\",\n" + 33 | " \"fileFieldName\": \"file\",\n" + 34 | " \"filePathFormat\": \"/ueditor/jsp/upload/file/{yyyy}{mm}{dd}/{time}{rand:6}\",\n" + 35 | " \"fileUrlPrefix\": \"\",\n" + 36 | " \"fileMaxSize\": 51200000,\n" + 37 | " \"fileAllowFiles\": [\n" + 38 | " \".png\", \".jpg\", \".jpeg\", \".gif\", \".bmp\",\n" + 39 | " \".flv\", \".swf\", \".mkv\", \".avi\", \".rm\", \".rmvb\", \".mpeg\", \".mpg\",\n" + 40 | " \".ogg\", \".ogv\", \".mov\", \".wmv\", \".mp4\", \".webm\", \".mp3\", \".wav\", \".mid\",\n" + 41 | " \".rar\", \".zip\", \".tar\", \".gz\", \".7z\", \".bz2\", \".cab\", \".iso\",\n" + 42 | " \".doc\", \".docx\", \".xls\", \".xlsx\", \".ppt\", \".pptx\", \".pdf\", \".txt\", \".md\", \".xml\"]\n" + 43 | " }"; 44 | } 45 | 46 | /** 47 | * Ueditor上传文件 48 | * 这里以上传图片为例,图片上传后,imgPath将存储图片的保存路径,返回到编辑器中做展示 49 | * 50 | * @param file 51 | * @return 52 | */ 53 | @PostMapping("/upload") 54 | public String upload(@RequestParam("file") MultipartFile file) { 55 | String result = ""; 56 | if (!file.isEmpty()) { 57 | String originalFileName = file.getOriginalFilename(); 58 | 59 | // 这里写你的文件上传逻辑 60 | // String imgPath = fileUtil.uploadImg(file); 61 | 62 | String imgPath = null; 63 | try { 64 | imgPath = FileUtil.upload(file).get("filePath"); 65 | } catch (Exception e) { 66 | e.printStackTrace(); 67 | } 68 | result = "{\n" + 69 | " \"state\": \"SUCCESS\",\n" + 70 | " \"url\": \"" + imgPath + "\",\n" + 71 | " \"title\": \"" + originalFileName + "\",\n" + 72 | " \"original\": \"" + originalFileName + "\"\n" + 73 | "}"; 74 | } 75 | return result; 76 | } 77 | 78 | 79 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | **完整代码收费 加qq 931708230 或者加微信 ynwwxid** 2 | 3 | **接毕业设计和论文** 4 | 5 | **[博客地址](https://blog.csdn.net/2303_76227485/article/details/128647426)** 6 | 7 | **视频演示:[视频演示地址](https://www.bilibili.com/video/BV1CP4y1i7RX/)** 8 | 9 | **毕业设计所有选题地址:[https://github.com/ynwynw/allProject](https://github.com/ynwynw/allProject)** 10 | 11 | ## 基于springboot房屋租赁管理系统 (源代码+数据库+15000字文档) 12 | 13 | ## 一、系统介绍 14 | 15 | 包括管理员、房东、租客三种角色,外加游客(未登录情况) 16 | 出租类型包含整租和合租 17 | 18 | 权限 游客 < 租客 < 房东 < 管理员 19 | 20 | 1、游客功能 21 | 22 | 登录、注册(可以注册房东或租客)、搜索房子、查看箱子信息、新闻咨询查询 23 | 24 | 搜索功能,根据价格范围,面积范围,城市,小区,整租/合租搜索 25 | 26 | 房子信息,基本信息、轮播图、地图定位 27 | 28 | 2、租客功能 29 | 30 | 预定房子(创建订单、签订合同、支付订单) 31 | 32 | 订单管理(取消订单、查看订单、查看合同、退租) 33 | 34 | 我的家(查看我的当前有效订单房子信息、查看合租情况) 35 | 36 | 反馈管理(提交反馈、反馈列表、删除反馈) 37 | 38 | 收藏管理(收藏房子、收藏列表、取消收藏) 39 | 40 | 个人信息修改、密码修改、联系房东(自动给房东发邮件) 41 | 42 | 3、房东功能 43 | 44 | 房子管理(发布出租/编辑房子信息,发布后需要管理员审核;删除房子;下架房子) 45 | 46 | 订单管理(订单列表、退租、查看合同) 47 | 48 | 发布出租(包括标题、描述、价格、各种配套信息、地图位置、轮播图等20多个字段信息) 49 | 50 | 反馈管理(提交反馈、反馈列表、删除反馈) 51 | 52 | 个人信息、密码修改 53 | 54 | 4、管理员功能 55 | 56 | 用户管理(禁用用户、启用用户) 57 | 58 | 房子管理(编辑房子、审核通过/驳回房子、下架房子) 59 | 60 | 订单管理(订单列表、退租、查看合同) 61 | 62 | 反馈管理(反馈列表、删除反馈、处理反馈) 63 | 64 | 新闻管理(新闻列表、发布新闻) 65 | 66 | ## 二、所用技术 67 | 68 | 后端技术栈: 69 | 70 | - springboot+mybatis+mysql+shiro 71 | 72 | 前端技术栈: 73 | 74 | - jsp 75 | - bootstrap 76 | 77 | 78 | ## 三、环境介绍 79 | 80 | 基础环境 :IDEA/eclipse, JDK 1.8, Mysql5.7及以上,Maven 81 | 82 | 源码+数据库脚本 83 | 84 | 所有项目以及源代码本人均调试运行无问题 可支持远程调试运行 85 | 86 | ## 四、页面截图 87 | 88 | 89 | 90 | ![在这里插入图片描述](https://img-blog.csdnimg.cn/d871edd8ecfc4a36b0cc8368e7e1f41f.png#pic_center) 91 | ![在这里插入图片描述](https://img-blog.csdnimg.cn/839d7076d9944d0c87eaeae3f8d68932.png#pic_center) 92 | ![在这里插入图片描述](https://img-blog.csdnimg.cn/f9c00097b71344a9b07dc3e31e14bacd.png#pic_center) 93 | ![在这里插入图片描述](https://img-blog.csdnimg.cn/1efc010aaa6e4e94978032357aa516fb.png#pic_center) 94 | ![在这里插入图片描述](https://img-blog.csdnimg.cn/231c5c0ba32b4f8cabe0b4d80e689959.png#pic_center) 95 | ![在这里插入图片描述](https://img-blog.csdnimg.cn/eaee67fc93e34686a6cc25f1c801d5ec.png#pic_center) 96 | ![在这里插入图片描述](https://img-blog.csdnimg.cn/dbff4692996244efb627e1097d27dc42.png#pic_center) 97 | ![在这里插入图片描述](https://img-blog.csdnimg.cn/d9914039748d49dc821792d322bc83fe.png#pic_center) 98 | ![contents](./picture/picture16.png) 99 | ![在这里插入图片描述](https://img-blog.csdnimg.cn/6f622494b8ba45f88c8f6ad2601e639c.png#pic_center) 100 | ![在这里插入图片描述](https://img-blog.csdnimg.cn/67bdbb7469cd4e5eb2b5addb44799cb1.png#pic_center) 101 | ![在这里插入图片描述](https://img-blog.csdnimg.cn/eca98b211c3c433489e442e790bb16b2.png#pic_center) 102 | ![在这里插入图片描述](https://img-blog.csdnimg.cn/319112e902524c0798d5dd04374ba082.png#pic_center) 103 | ![在这里插入图片描述](https://img-blog.csdnimg.cn/ce9378c25592446da124ed190223bfef.png#pic_center) 104 | ![在这里插入图片描述](https://img-blog.csdnimg.cn/057687ab6f4f4c97b3aa466520b4c3ef.png#pic_center) 105 | ![在这里插入图片描述](https://img-blog.csdnimg.cn/20b494c961564733a0ea9f5fb2151ac9.png#pic_center) 106 | ![在这里插入图片描述](https://img-blog.csdnimg.cn/e74a643c7823461291fd1bc5cc55c9f5.png#pic_center) 107 | 108 | ## 五、浏览地址 109 | 110 | http://localhost:9999/ 111 | 112 | ​ 账号 密码 113 | 114 | 管理员 admin 123456 115 | 116 | 租客 zuke 123456 117 | 118 | 房东 zhangsan admin 119 | 120 | ## 六、安装教程 121 | 122 | 1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 123 | 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven; 124 | 若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 125 | 3. 修改application.yml 里面的数据库配置配置 126 | 4. 启动项目后端项目 127 | 5. 访问 http://localhost:9999/ 128 | 129 | **需要完整代码可以加qq 931708230 或者加微信 ynwwxid** 130 | 131 | **需要完整代码可以加qq 931708230 或者加微信 ynwwxid** 132 | -------------------------------------------------------------------------------- /src/main/webapp/jsp/admin/password.jsp: -------------------------------------------------------------------------------- 1 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 2 | <%@ include file="../common/head.jsp" %> 3 |
4 |
5 |
6 | <%@ include file="../common/admin-left.jsp" %> 7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |

修改密码

18 |

您即将修改登录密码。

19 |

用户名:${sessionScope.user.userDisplayName}

20 |
21 |
22 | 23 | 25 |
26 |
27 | 28 | 30 |
31 |
32 | 33 | 35 |
36 |
37 |
38 |
39 |
40 | 43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 | <%@ include file="../common/footer.jsp" %> 58 | -------------------------------------------------------------------------------- /src/main/webapp/jsp/admin/my-home.jsp: -------------------------------------------------------------------------------- 1 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 2 | <%@ include file="../common/head.jsp" %> 3 |
4 |
5 |
6 | <%@ include file="../common/admin-left.jsp" %> 7 |
8 |
9 |
10 |
11 |

我的家

12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 37 | 48 | 51 | 52 | 53 | 54 | 55 |
我的家信息类型房东
23 | 24 |
25 |

${c.house.title} 27 |

28 | ${c.house.address} 29 | 30 | 开始时间:
32 | 到期时间: 34 |
35 |
36 |
38 | 39 | 40 | 合租
41 | 合租详情 42 |
43 | 44 | 整租
45 |
46 |
47 |
49 | ${c.ownerUser.userDisplayName}
${c.ownerUser.phone} 50 |
56 |
57 |
58 |
59 | <%@ include file="../common/page.jsp" %> 60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 | <%@ include file="../common/footer.jsp" %> 68 | 69 | -------------------------------------------------------------------------------- /src/main/webapp/jsp/common/page.jsp: -------------------------------------------------------------------------------- 1 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 2 | 3 |
    4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | <%--上一页--%> 23 | 24 | 25 | <%--当前页面为第一页,隐藏上一页按钮--%> 26 | 27 | 28 |
  • 29 | 30 |    31 | 上一页 32 | 33 |
  • 34 |
    35 |
    36 | <%--显示第一页的页码--%> 37 | 38 |
  • 1
  • 39 |
    40 | <%--显示 ... --%> 41 | 42 |
  • ...
  • 43 |
    44 | 45 | <%--打印 页码--%> 46 | 47 | 48 | 49 |
  • 50 | ${i} 51 |
  • 52 |
    53 | 54 |
  • 55 | ${i} 56 |
  • 57 |
    58 |
    59 |
    60 | 61 |
  • 62 | ... 63 |
  • 64 |
    65 | 66 | <%--显示最后一页的数字--%> 67 | 68 |
  • 69 | ${pageInfo.getPages()} 70 |
  • 71 |
    72 | <%--下一页--%> 73 | 74 | 75 | <%--到了尾页,隐藏下一页按钮--%> 76 | 77 | 78 |
  • 79 | 80 |    81 | 下一页 82 | 83 |
  • 84 | 85 |
    86 |
    87 |
88 |
-------------------------------------------------------------------------------- /src/main/java/com/irental/houserent/controller/front/LoginController.java: -------------------------------------------------------------------------------- 1 | package com.irental.houserent.controller.front; 2 | 3 | import com.irental.houserent.common.constant.Base; 4 | import com.irental.houserent.common.constant.Constant; 5 | import com.irental.houserent.common.constant.ResultCode; 6 | import com.irental.houserent.common.dto.JsonResult; 7 | import com.irental.houserent.common.enums.UserStatusEnum; 8 | import com.irental.houserent.entity.User; 9 | import com.irental.houserent.oauth.OAuthSessionManager; 10 | import com.irental.houserent.service.UserService; 11 | import org.apache.shiro.SecurityUtils; 12 | import org.apache.shiro.authc.AuthenticationException; 13 | import org.apache.shiro.authc.LockedAccountException; 14 | import org.apache.shiro.authc.UnknownAccountException; 15 | import org.apache.shiro.authc.UsernamePasswordToken; 16 | import org.apache.shiro.subject.Subject; 17 | import org.springframework.beans.factory.annotation.Autowired; 18 | import org.springframework.stereotype.Controller; 19 | import org.springframework.web.bind.annotation.RequestMapping; 20 | import org.springframework.web.bind.annotation.RequestMethod; 21 | import org.springframework.web.bind.annotation.ResponseBody; 22 | 23 | import javax.servlet.http.HttpSession; 24 | 25 | /* 26 | * 登录相关的控制器 27 | * */ 28 | @Controller 29 | @RequestMapping("/login") 30 | public class LoginController { 31 | @Autowired 32 | private UserService userService; 33 | 34 | /* 35 | * 注册提交 36 | * */ 37 | @RequestMapping(value = "/submit", method = RequestMethod.POST) 38 | @ResponseBody 39 | public JsonResult loginSubmit(User user, HttpSession session) { 40 | try { 41 | if (user == null) { 42 | return JsonResult.error("非法访问,请重试!"); 43 | } 44 | String userName = user.getUserName(); 45 | String password = user.getUserPass(); 46 | User user1 = userService.findByUserName(user.getUserName()); 47 | if (user1 == null) { 48 | return JsonResult.error("用户不存在,请重试。"); 49 | } 50 | Subject subject = SecurityUtils.getSubject(); 51 | UsernamePasswordToken token = new UsernamePasswordToken(userName, password); 52 | // 进行验证,然后返回对应信息 53 | subject.login(token); 54 | User currentUser = userService.findByUserName(userName); 55 | subject.getSession().setAttribute(Constant.SESSION_USER_KEY, currentUser); 56 | //判断密码是否正确 57 | if (!user.getUserPass().equals(user1.getUserPass())) { 58 | return JsonResult.error("密码错误,请重试。"); 59 | } 60 | if (UserStatusEnum.DISABLE.getValue().equals(user1.getStatus())) { 61 | return JsonResult.error("账户已被锁定,请联系我们获取更多帮助。"); 62 | } 63 | //session.setAttribute(Constant.SESSION_USER_KEY, user1); 64 | } catch (UnknownAccountException e) { 65 | JsonResult.error(ResultCode.USER_NOT_EXIST.code().toString(),ResultCode.USER_NOT_EXIST.message()); 66 | } catch (LockedAccountException e) { 67 | JsonResult.error(ResultCode.USER_ACCOUNT_FORBIDDEN.code().toString(),ResultCode.USER_ACCOUNT_FORBIDDEN.message()); 68 | } catch (AuthenticationException e) { 69 | JsonResult.error(ResultCode.USER_LOGIN_ERROR.code().toString(),ResultCode.USER_LOGIN_ERROR.message()); 70 | } catch (Exception e) { 71 | JsonResult.error(ResultCode.ERROR.code().toString(),ResultCode.ERROR.message()); 72 | } 73 | return JsonResult.success("登录成功!"); 74 | } 75 | 76 | /* 77 | * 退出登录,返回首页 78 | * */ 79 | @RequestMapping("/logout") 80 | public String logout(HttpSession session) { 81 | Subject subject = SecurityUtils.getSubject(); 82 | subject.getSession().removeAttribute(Constant.SESSION_USER_KEY); 83 | subject.logout(); 84 | //session.removeAttribute(Constant.SESSION_USER_KEY); 85 | //session.invalidate(); 86 | return "redirect:/"; 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /src/main/webapp/jsp/front/pay.jsp: -------------------------------------------------------------------------------- 1 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 2 | <%@ include file="../common/head.jsp" %> 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
11 |
12 |
13 |
14 |
15 | ${order.house.title} 16 |
17 |
18 | 订单ID:${order.id} 19 |
20 |
21 | ¥${order.totalAmount} 22 |
23 |
24 |

您当前账户余额:¥${sessionScope.user.balance}

25 |
26 |
27 | 29 |
30 |
31 |

支付完成后,将跳转到订单列表页面

32 |
33 |
34 |
35 | 支付方式: 36 | 40 | 44 | 48 |
49 |
50 | 51 |
52 |
53 | 54 | 62 | 66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 | 74 | <%@ include file="../common/footer.jsp" %> 75 | 76 | --------------------------------------------------------------------------------