Compare commits

...

No commits in common. 'a10b5957bf29ba1d75f2b6b8b427adc0d3b8d9fb' and '4e60a6c7cdc270d6ecda0bba20641e53607e0808' have entirely different histories.

18
.gitignore vendored

@ -0,0 +1,18 @@
# Build and Release Folders
bin-debug/
bin-release/
[Oo]bj/
[Bb]in/
# Other files and folders
.settings/
# Executables
*.swf
*.air
*.ipa
*.apk
# Project files, i.e. `.project`, `.actionScriptProperties` and `.flexProperties`
# should NOT be excluded as they contain compiler settings and other important
# information for Eclipse / Flash Builder.

8
.idea/.gitignore vendored

@ -0,0 +1,8 @@
# 默认忽略的文件
/shelf/
/workspace.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="springboot08hr3" />
<module name="houselease" />
</profile>
</annotationProcessing>
</component>
<component name="JavacSettings">
<option name="ADDITIONAL_OPTIONS_OVERRIDE">
<module name="houselease" options="-parameters" />
<module name="springboot08hr3" options="-parameters" />
</option>
</component>
</project>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
</component>
</project>

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4" />

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="https://repo.maven.apache.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="http://maven.aliyun.com/nexus/content/groups/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
</component>
</project>

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

@ -0,0 +1,50 @@
-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAACmFlczI1Ni1jdHIAAAAGYmNyeXB0AAAAGAAAABAeC5vEn9
SINTfMNBSQmUZTAAAAGAAAAAEAAAIXAAAAB3NzaC1yc2EAAAADAQABAAACAQDtk5Pp1MJJ
jawtWDrOXwykKmD7AiEpZMjJ/h9aW0oOH+y/xWX095+5m90vLcKQTMApT0Ev4tgcFh/HJB
fL6btZRys3K64RtBm0zuAtKXzguupFiNZcthATiPGyQAmEbzyLHBB4dMfjWrkl6CMiW+yE
aC30GOOVHcOEQHZZ6oeP93O+kNJnhjxZqLWV7qyMHWez1jT+I5XRBOP4oS1lEfRDUjI4v4
gDsDp/dlwO1vbOQsKysbxqT/fDJ0jvz3PEK8xWG7BpnJD6FH41l3NOK9+sFoF5DF4rY+I4
+oimVZuP27f9EtDi30/Rk0av+VGJ4TlBtLWyIVK548K20e0svADqiMn0IjTHC6iBW6Stf6
ze6VZf4Xk4oBhl2qXKNPaSo19Iru7FYeMJ03EVX5d+vFXHlBOpVqGkeiudHzewQPdb5bdt
cVR4A21nvALDBvh1867QxOyhI+Du95bFfzUZpZbhui3c2Go9ZtI9MejTEPL0Yf68UpNM/b
6q1jKGRsTbj/sHu5osd0fMawgTtQMVBbMPoz/96XjOaf+KwiCLQDmb8Jv5ZjuiE1tHMbTT
XhvXL2ke1jMzgY1fVGVPPyie+x7h1LVTikMTM2vnVNF7tFz7lC/7GH5Q1S5LEDMpNL3FCL
RDjmpA0J1tTGdp8FBNEIcZuqa0nlo7joSLTK88e87EqwAAB1C/PZQr9HF16Bo1vd6LgKKw
rXFlMC1yPPLv/hEBPicfholkxSDpohkFvzDZZ0A/cYqMMVZBfnr5uZ7gm5jfx3ry38Hcy3
jhQ4W6JANCESHuL9e4DvVes+IYaHCgQeTpVQfRliQSurLrop5mvlFY350yhUBfK4QQWud5
GbzJihKKyP029UnsRP8PjKWqdKMtURY0Gyl/9tQ3oGBonUE0i9hqkw3xUwL52Hf/OPnzTR
LToKBQTSStmCBSl774h8Gxuc6TcUsaUNnnPU5I/9Mrgofdns6lr0a0EjjQGzzBH4m+9sUx
OvwrOCMHZzkctTE5/RU20M19YuXEow1hg2LRe5YDrrFOjHbjj+Gt1ycEPclDehiBfg0dYq
o1DsSQMJ48JlVEQas2qjVjzgY1DVkbRA6juFdUnJ/J0Eu20QFExxJJX/3Pg7sRs3YS1hm9
mmSuu/LP4iD9BedoizK9aisenc4iyq3+Kuy7p4INo5s2vKdTi7Hn+5p+NwdP8uwK0UYXqi
/lij7x618TFQTgndgL7CMJS/mF3FD2skfVA+0+L5uEql4KoXfwYbXeHgIZs9OP5UBceTPd
zKo7jzdj6PxhO3RfIyKshwBHphdUTe7WmUBrHzoJKl0lC5ZucIeiOjZBoucKHcCYywyIJb
zOmFclthjHk1qyBaNjgSXdKCORinmE+q1HRKomWP0hP3zJ+OHjBv9u4k0Cw1uhhFwi8V2c
ZbMnZhs7CL066MMP7/6kE1908IWwDVQt/ctitSrpsNrRl00+HOwuR1pEh19nzysad3xdyL
sCJoW7sqAieAR/gRT0esH2S8AivUUxYnzRHN8un+lG/K3TMR88mqKQ73lN4lFpm2uMEEBp
viMxeCjJUMMGrx4CnziRPQF+9eLjunuBI+T/jy1ru5HsDX12FE4L9nPZfKMCxPAFcXRe8+
LGnzzvxMYOwRTzIgRSRxWQMmaTfncJRoQcCUfGsOxrFWoKCkP4TEsxZRJa5hYDt+7APcYO
/Hw1WtJEJz4/w/dEBCr+AxF5atVoNjZskJSVKSwzpcVC3MJD5gebnLW0x3TBO5ixBXiL80
VlKoA7i9UnLQqHjJsYR0nwhS9sEXlZgelJ6zJSJ8q2Wzx3oqE9FxAofI1qha0pm3rSxuWp
fZXJVPx6MTCK2JthO3OAbK0qcYLdhUoKsVfa6QW64kG/rBexfDHFQbH8K6qDmYhoru2IVC
F42CSJfq8oUAOAxsUL/iT3ZpeezKXsfr43qZWQURrQWo37fSTg7eNm+ynDb9LA4JmmX7+Y
eRF8I0hHgFxoIJGMhtZYpxzxKwf3hUsWb6ABEhKaaU2EDpiCKIT7cNW1HGoFk1Dyodkrzg
e3tUTchQ5S45ENAFR/PAj/8NTwCDVH5vsKpUfizBgsQDngTotxdIMwoLRXQDeW11wkWpRf
u50Un4QKGNSFmSRsiz+HjIlIoxVciBcwgJ1781OatFy5GgVWUXyzI49k6Sa7NDUQy+nCic
3z4GV9kvYWO+Pv9oxt3tWll3xe0iq6zKsTItUt0ms1kIsZcBjAnrTcFDu7KMZHu0JA/W5P
5cQpIDboQ/hKzy1XTdx4bH7LxR+cXDNp9oVt5E0nnB5NvdhACPaNatIv+gwlB0pPwJ2EaD
KB45iLjoMEX/6XFVVa2Dlep01mo8hj9w9ENqi3fg3erzo3Wgz8VnKR5xS4+daCJhb9P6Mu
VtzkIt+8ixH54qBotweP5up0CNn+6gPtFdfV/Y5mdh8omrpRPpgACU45NemLduVJFNA5Ej
uT6T8mKQ58DlL48IdJUcPe+zTriCq2ln9mHXBf+yZZZGaVRi9isKwuYr4anpuCiehHe3cO
zgQufTIiTgpcCTmoZFws7rRjQwAeH4ykaNBfIbR+RfZxq0CHluOPBVDmAY5kYUTJT4CW9D
cLqk2F+d0rZMaBTz+giybzy3tIEn94Vq89E0o7U61RNvuKNGCLKpkY/rXuTGAZZUBon6tv
8FVj8Y+puEdaRy14oZIEEcvWjfwmMApvtrjuQ0czOZCgGmSN1SSshyAhNZCvR57N42lXKq
yg+7aTWdYp3TwYE+ciIEpRCZGBF2n4Qt9AnazL8xqXP62lFE7riG1hQvoQMXOh6WErtK4x
tmPZMXmSHpiRbhRIMs1qBunz0w7cDUcizIt6IqXk+vMYArMRMWakrl239lVxpag7Gzl+yQ
zZPfOa+iEbBHYzt5sBX7i+ETMP/qjXsn7DJu4pxak7nmpoHvcXgpTXOBHOsmJFxk1EE4Tp
txQz8Px7U+BeHpWxcai/83Kvt3OivL5IIltPI7CvqlKJpNWZFNBfhSjTtVLLlh71i1WD+U
StXnOcVf1Xf7Tbrll6+BeM4+w511et1vFEGSOyqw8XV75vMsmTjL5NqLH3ufutQ6HX6cLg
9hecHwkCbA0cleNhN1RB7aS0Lf0f6kkopeG2f3SilXuHmgsfhkLh6K5yZLyjqk4G4d/V4A
BK0Df2ueXfubC+lTf2R4VjCIM=
-----END OPENSSH PRIVATE KEY-----

@ -0,0 +1 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDtk5Pp1MJJjawtWDrOXwykKmD7AiEpZMjJ/h9aW0oOH+y/xWX095+5m90vLcKQTMApT0Ev4tgcFh/HJBfL6btZRys3K64RtBm0zuAtKXzguupFiNZcthATiPGyQAmEbzyLHBB4dMfjWrkl6CMiW+yEaC30GOOVHcOEQHZZ6oeP93O+kNJnhjxZqLWV7qyMHWez1jT+I5XRBOP4oS1lEfRDUjI4v4gDsDp/dlwO1vbOQsKysbxqT/fDJ0jvz3PEK8xWG7BpnJD6FH41l3NOK9+sFoF5DF4rY+I4+oimVZuP27f9EtDi30/Rk0av+VGJ4TlBtLWyIVK548K20e0svADqiMn0IjTHC6iBW6Stf6ze6VZf4Xk4oBhl2qXKNPaSo19Iru7FYeMJ03EVX5d+vFXHlBOpVqGkeiudHzewQPdb5bdtcVR4A21nvALDBvh1867QxOyhI+Du95bFfzUZpZbhui3c2Go9ZtI9MejTEPL0Yf68UpNM/b6q1jKGRsTbj/sHu5osd0fMawgTtQMVBbMPoz/96XjOaf+KwiCLQDmb8Jv5ZjuiE1tHMbTTXhvXL2ke1jMzgY1fVGVPPyie+x7h1LVTikMTM2vnVNF7tFz7lC/7GH5Q1S5LEDMpNL3FCLRDjmpA0J1tTGdp8FBNEIcZuqa0nlo7joSLTK88e87Eqw== 1634482602@qq.com

@ -0,0 +1,194 @@
木兰宽松许可证第2版
木兰宽松许可证第2版
2020年1月 http://license.coscl.org.cn/MulanPSL2
您对“软件”的复制、使用、修改及分发受木兰宽松许可证第2版“本许可证”的如下条款的约束
0. 定义
“软件” 是指由“贡献”构成的许可在“本许可证”下的程序和相关文档的集合。
“贡献” 是指由任一“贡献者”许可在“本许可证”下的受版权法保护的作品。
“贡献者” 是指将受版权法保护的作品许可在“本许可证”下的自然人或“法人实体”。
“法人实体” 是指提交贡献的机构及其“关联实体”。
“关联实体” 是指,对“本许可证”下的行为方而言,控制、受控制或与其共同受控制的机构,此处的控制是
指有受控方或共同受控方至少50%直接或间接的投票权、资金或其他有价证券。
1. 授予版权许可
每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的版权许可,您可
以复制、使用、修改、分发其“贡献”,不论修改与否。
2. 授予专利许可
每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的(根据本条规定
撤销除外)专利许可,供您制造、委托制造、使用、许诺销售、销售、进口其“贡献”或以其他方式转移其“贡
献”。前述专利许可仅限于“贡献者”现在或将来拥有或控制的其“贡献”本身或其“贡献”与许可“贡献”时的“软
件”结合而将必然会侵犯的专利权利要求,不包括对“贡献”的修改或包含“贡献”的其他结合。如果您或您的“
关联实体”直接或间接地,就“软件”或其中的“贡献”对任何人发起专利侵权诉讼(包括反诉或交叉诉讼)或
其他专利维权行动,指控其侵犯专利权,则“本许可证”授予您对“软件”的专利许可自您提起诉讼或发起维权
行动之日终止。
3. 无商标许可
“本许可证”不提供对“贡献者”的商品名称、商标、服务标志或产品名称的商标许可但您为满足第4条规定
的声明义务而必须使用除外。
4. 分发限制
您可以在任何媒介中将“软件”以源程序形式或可执行形式重新分发,不论修改与否,但您必须向接收者提供“
本许可证”的副本,并保留“软件”中的版权、商标、专利及免责声明。
5. 免责声明与责任限制
“软件”及其中的“贡献”在提供时不带任何明示或默示的担保。在任何情况下,“贡献者”或版权所有者不对
任何人因使用“软件”或其中的“贡献”而引发的任何直接或间接损失承担责任,不论因何种原因导致或者基于
何种法律理论,即使其曾被建议有此种损失的可能性。
6. 语言
“本许可证”以中英文双语表述,中英文版本具有同等法律效力。如果中英文版本存在任何冲突不一致,以中文
版为准。
条款结束
如何将木兰宽松许可证第2版应用到您的软件
如果您希望将木兰宽松许可证第2版应用到您的新软件为了方便接收者查阅建议您完成如下三步
1 请您补充如下声明中的空白,包括软件名、软件的首次发表年份以及您作为版权人的名字;
2 请您在软件包的一级目录下创建以“LICENSE”为名的文件将整个许可证文本放入该文件中
3 请将如下声明文本放入每个源文件的头部注释中。
Copyright (c) [Year] [name of copyright holder]
[Software Name] is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan
PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.
Mulan Permissive Software LicenseVersion 2
Mulan Permissive Software LicenseVersion 2 (Mulan PSL v2)
January 2020 http://license.coscl.org.cn/MulanPSL2
Your reproduction, use, modification and distribution of the Software shall
be subject to Mulan PSL v2 (this License) with the following terms and
conditions:
0. Definition
Software means the program and related documents which are licensed under
this License and comprise all Contribution(s).
Contribution means the copyrightable work licensed by a particular
Contributor under this License.
Contributor means the Individual or Legal Entity who licenses its
copyrightable work under this License.
Legal Entity means the entity making a Contribution and all its
Affiliates.
Affiliates means entities that control, are controlled by, or are under
common control with the acting entity under this License, control means
direct or indirect ownership of at least fifty percent (50%) of the voting
power, capital or other securities of controlled or commonly controlled
entity.
1. Grant of Copyright License
Subject to the terms and conditions of this License, each Contributor hereby
grants to you a perpetual, worldwide, royalty-free, non-exclusive,
irrevocable copyright license to reproduce, use, modify, or distribute its
Contribution, with modification or not.
2. Grant of Patent License
Subject to the terms and conditions of this License, each Contributor hereby
grants to you a perpetual, worldwide, royalty-free, non-exclusive,
irrevocable (except for revocation under this Section) patent license to
make, have made, use, offer for sale, sell, import or otherwise transfer its
Contribution, where such patent license is only limited to the patent claims
owned or controlled by such Contributor now or in future which will be
necessarily infringed by its Contribution alone, or by combination of the
Contribution with the Software to which the Contribution was contributed.
The patent license shall not apply to any modification of the Contribution,
and any other combination which includes the Contribution. If you or your
Affiliates directly or indirectly institute patent litigation (including a
cross claim or counterclaim in a litigation) or other patent enforcement
activities against any individual or entity by alleging that the Software or
any Contribution in it infringes patents, then any patent license granted to
you under this License for the Software shall terminate as of the date such
litigation or activity is filed or taken.
3. No Trademark License
No trademark license is granted to use the trade names, trademarks, service
marks, or product names of Contributor, except as required to fulfill notice
requirements in section 4.
4. Distribution Restriction
You may distribute the Software in any medium with or without modification,
whether in source or executable forms, provided that you provide recipients
with a copy of this License and retain copyright, patent, trademark and
disclaimer statements in the Software.
5. Disclaimer of Warranty and Limitation of Liability
THE SOFTWARE AND CONTRIBUTION IN IT ARE PROVIDED WITHOUT WARRANTIES OF ANY
KIND, EITHER EXPRESS OR IMPLIED. IN NO EVENT SHALL ANY CONTRIBUTOR OR
COPYRIGHT HOLDER BE LIABLE TO YOU FOR ANY DAMAGES, INCLUDING, BUT NOT
LIMITED TO ANY DIRECT, OR INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING
FROM YOUR USE OR INABILITY TO USE THE SOFTWARE OR THE CONTRIBUTION IN IT, NO
MATTER HOW ITS CAUSED OR BASED ON WHICH LEGAL THEORY, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGES.
6. Language
THIS LICENSE IS WRITTEN IN BOTH CHINESE AND ENGLISH, AND THE CHINESE VERSION
AND ENGLISH VERSION SHALL HAVE THE SAME LEGAL EFFECT. IN THE CASE OF
DIVERGENCE BETWEEN THE CHINESE AND ENGLISH VERSIONS, THE CHINESE VERSION
SHALL PREVAIL.
END OF THE TERMS AND CONDITIONS
How to Apply the Mulan Permissive Software LicenseVersion 2
(Mulan PSL v2) to Your Software
To apply the Mulan PSL v2 to your work, for easy identification by
recipients, you are suggested to complete following three steps:
i. Fill in the blanks in following statement, including insert your software
name, the year of the first publication of your software, and your name
identified as the copyright owner;
ii. Create a file named "LICENSE" which contains the whole context of this
License in the first directory of your software package;
iii. Attach the statement to the appropriate annotated syntax at the
beginning of each source file.
Copyright (c) [Year] [name of copyright holder]
[Software Name] is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan
PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.

@ -0,0 +1,2 @@
Manifest-Version: 1.0

@ -0,0 +1,36 @@
# house
#### Description
{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**}
#### Software Architecture
Software architecture description
#### Installation
1. xxxx
2. xxxx
3. xxxx
#### Instructions
1. xxxx
2. xxxx
3. xxxx
#### Contribution
1. Fork the repository
2. Create Feat_xxx branch
3. Commit your code
4. Create Pull Request
#### Gitee Feature
1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
2. Gitee blog [blog.gitee.com](https://blog.gitee.com)
3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
4. The most valuable open source project [GVP](https://gitee.com/gvp)
5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)

@ -1,2 +1,39 @@
# house
#### 介绍
{**以下是 Gitee 平台说明,您可以替换此简介**
Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN。专为开发者提供稳定、高效、安全的云端软件开发协作平台
无论是个人、团队、或是企业,都能够用 Gitee 实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)}
#### 软件架构
软件架构说明
#### 安装教程
1. xxxx
2. xxxx
3. xxxx
#### 使用说明
1. xxxx
2. xxxx
3. xxxx
#### 参与贡献
1. Fork 本仓库
2. 新建 Feat_xxx 分支
3. 提交代码
4. 新建 Pull Request
#### 特技
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com)
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目
4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4" />

@ -0,0 +1,125 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.2.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.jlwl</groupId>
<!-- 导入项目的名称 -->
<artifactId>t020</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>springboot-schema</name>
<description>房屋租赁系统</description>
<!--http://localhost:8080/springboot08hr3/front/pages/login/login.html-->
<properties>
<java.version>1.8</java.version>
<fastjson.version>1.2.8</fastjson.version>
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.1.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.32</version>
</dependency>
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-spring</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus</artifactId>
<version>2.3</version>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatisplus-spring-boot-starter</artifactId>
<version>1.0.5</version>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>3.10.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>2.0.1.Final</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>4.0.12</version>
</dependency>
<!-- FastJson -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${fastjson.version}</version>
</dependency>
<!-- 百度人工智能 -->
<dependency>
<groupId>com.baidu.aip</groupId>
<artifactId>java-sdk</artifactId>
<version>4.4.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

@ -0,0 +1,33 @@
package com;
// 导入 MyBatis 的 MapperScan 注解,用于扫描 DAO 层接口
import org.mybatis.spring.annotation.MapperScan;
// 导入 Spring Boot 的核心注解,用于启动应用程序
import org.springframework.boot.SpringApplication;
// 导入 Spring Boot 的自动配置注解,启用自动配置功能
import org.springframework.boot.autoconfigure.SpringBootApplication;
// 导入 SpringApplicationBuilder用于构建 Spring Boot 应用程序
import org.springframework.boot.builder.SpringApplicationBuilder;
// 导入 SpringBootServletInitializer用于支持将应用部署到外部 Servlet 容器
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
// 标记该类为 Spring Boot 的主应用程序类
// 启用组件扫描和自动配置功能
@SpringBootApplication
// 使用 @MapperScan 指定 MyBatis 的 DAO 接口所在的包路径
@MapperScan(basePackages = {"com.dao"})
public class SpringbootSchemaApplication extends SpringBootServletInitializer {
// 主方法,应用程序的入口点
public static void main(String[] args) {
// 启动 Spring Boot 应用程序
SpringApplication.run(SpringbootSchemaApplication.class, args);
}
// 重写 configure 方法,支持将应用部署到外部 Servlet 容器
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder applicationBuilder) {
// 指定 Spring Boot 应用程序的主类
return applicationBuilder.sources(SpringbootSchemaApplication.class);
}
}

@ -0,0 +1,17 @@
package com.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
*
*/
// 该注解用于标识方法参数,表示该参数应注入当前登录的用户对象
@Target(ElementType.PARAMETER) // 限定该注解只能标注在方法参数上
@Retention(RetentionPolicy.RUNTIME) // 指定注解在运行时保留,可通过反射读取
public @interface APPLoginUser {
// 这是一个标记注解,不需要定义额外属性
// 框架处理器会根据该注解自动注入当前认证用户
}

@ -0,0 +1,15 @@
package com.annotation;
import java.lang.annotation.*;
/**
* Token
*/
// 忽略认证的标记注解,标注该注解的方法将跳过权限/登录校验
@Target(ElementType.METHOD) // 限定该注解只能标注在方法上
@Retention(RetentionPolicy.RUNTIME) // 注解在运行时保留,可通过反射读取
@Documented // 表明该注解应当被包含在Javadoc中
public @interface IgnoreAuth {
// 标记注解不包含任何属性
// 仅需标注在方法上即可使该方法跳过认证流程
}

@ -0,0 +1,17 @@
package com.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
*
*/
// 用户认证参数注解,用于自动注入当前登录用户信息
@Target(ElementType.PARAMETER) // 限定该注解只能标注在方法参数上
@Retention(RetentionPolicy.RUNTIME) // 注解在运行时保留,可通过反射机制获取
public @interface LoginUser {
// 标记型注解,不包含任何配置属性
// 框架会自动将当前登录用户对象注入到被注解的参数
}

@ -0,0 +1,54 @@
package com.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
import com.interceptor.AuthorizationInterceptor;
// 拦截器配置类用于配置Spring MVC的拦截器和静态资源处理
@Configuration // 标识这是一个Spring配置类
public class InterceptorConfig extends WebMvcConfigurationSupport {
/**
* Bean
* @return
*/
@Bean
public AuthorizationInterceptor getAuthorizationInterceptor() {
return new AuthorizationInterceptor(); // 实例化自定义的授权拦截器
}
/**
*
* @param registry
*/
@Override
public void addInterceptors(InterceptorRegistry registry) {
// 注册授权拦截器并配置拦截路径
registry.addInterceptor(getAuthorizationInterceptor())
.addPathPatterns("/**") // 拦截所有请求路径
.excludePathPatterns("/static/**"); // 排除静态资源路径
super.addInterceptors(registry); // 调用父类方法保持默认拦截器配置
}
/**
*
* WebMvcConfigurationSupport
* @param registry
*/
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
// 配置静态资源映射
registry.addResourceHandler("/**") // 匹配所有URL路径
// 添加静态资源位置(按优先级排序)
.addResourceLocations("classpath:/resources/") // 类路径下的resources目录
.addResourceLocations("classpath:/static/") // 类路径下的static目录
.addResourceLocations("classpath:/admin/") // 类路径下的admin目录
.addResourceLocations("classpath:/front/") // 类路径下的front目录
.addResourceLocations("classpath:/public/"); // 类路径下的public目录
super.addResourceHandlers(registry); // 调用父类方法保持默认资源处理配置
}
}

@ -0,0 +1,24 @@
package com.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.baomidou.mybatisplus.mapper.MetaObjectHandler;
import com.baomidou.mybatisplus.plugins.PaginationInterceptor;
/**
* mybatis-plus
*/
@Configuration
public class MybatisPlusConfig {
/**
*
*/
@Bean
public PaginationInterceptor paginationInterceptor() {
return new PaginationInterceptor();
}
}

@ -0,0 +1,359 @@
package com.controller;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ResourceUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.annotation.IgnoreAuth;
import com.baidu.aip.face.AipFace;
import com.baidu.aip.face.MatchRequest;
import com.baidu.aip.util.Base64Util;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.ConfigEntity;
import com.service.CommonService;
import com.service.ConfigService;
import com.utils.BaiduUtil;
import com.utils.FileUtil;
import com.utils.R;
/**
*
*/
@RestController // 声明为RESTful控制器自动将返回对象转为JSON
public class CommonController{
// 注入通用服务组件,用于处理通用业务逻辑
@Autowired
private CommonService commonService;
// 注入配置服务组件,用于获取系统配置信息
@Autowired
private ConfigService configService;
// 百度AI人脸识别客户端静态变量保证全局唯一
private static AipFace client = null;
// 百度地图API访问密钥静态变量保证全局唯一
private static String BAIDU_DITU_AK = null;
/**
*
* @param lng
* @param lat
* @return
*/
@RequestMapping("/location")
public R location(String lng,String lat) {
// 首次使用时初始化百度地图AK
if(BAIDU_DITU_AK==null) {
// 从数据库配置表查询AK值
BAIDU_DITU_AK = configService.selectOne(
new EntityWrapper<ConfigEntity>().eq("name", "baidu_ditu_ak")
).getValue();
// AK未配置时返回错误提示
if(BAIDU_DITU_AK==null) {
return R.error("请在配置管理中正确配置baidu_ditu_ak");
}
}
// 调用百度工具类获取地理位置信息
Map<String, String> map = BaiduUtil.getCityByLonLat(BAIDU_DITU_AK, lng, lat);
// 返回标准化成功响应
return R.ok().put("data", map);
}
/**
*
* @param face1
* @param face2
* @return
*/
@RequestMapping("/matchFace")
public R matchFace(String face1, String face2) {
// 初始化百度AI客户端
if(client==null) {
// 从数据库获取API认证信息
String APIKey = configService.selectOne(
new EntityWrapper<ConfigEntity>().eq("name", "APIKey")
).getValue();
String SecretKey = configService.selectOne(
new EntityWrapper<ConfigEntity>().eq("name", "SecretKey")
).getValue();
// 获取访问令牌
String token = BaiduUtil.getAuth(APIKey, SecretKey);
// 认证失败处理
if(token==null) {
return R.error("请在配置管理中正确配置APIKey和SecretKey");
}
// 创建客户端实例并设置超时参数
client = new AipFace(null, APIKey, SecretKey);
client.setConnectionTimeoutInMillis(2000); // 2秒连接超时
client.setSocketTimeoutInMillis(60000); // 60秒读写超时
}
JSONObject res = null;
try {
// 构建图片文件完整路径
File file1 = new File(
ResourceUtils.getFile("classpath:static/upload").getAbsolutePath()+"/"+face1
);
File file2 = new File(
ResourceUtils.getFile("classpath:static/upload").getAbsolutePath()+"/"+face2
);
// 将图片文件转为Base64编码
String img1 = Base64Util.encode(FileUtil.FileToByte(file1));
String img2 = Base64Util.encode(FileUtil.FileToByte(file2));
// 创建比对请求对象
MatchRequest req1 = new MatchRequest(img1, "BASE64");
MatchRequest req2 = new MatchRequest(img2, "BASE64");
// 添加请求到列表
ArrayList<MatchRequest> requests = new ArrayList<MatchRequest>();
requests.add(req1);
requests.add(req2);
// 执行人脸比对并获取结果
res = client.match(requests);
System.out.println(res.get("result")); // 调试输出结果
} catch (FileNotFoundException e) {
e.printStackTrace();
return R.error("文件不存在"); // 文件不存在异常处理
} catch (IOException e) {
e.printStackTrace();
}
// 返回标准化结果
return R.ok().put("data", com.alibaba.fastjson.JSONObject.parse(res.get("result").toString()));
}
/**
*
* @param tableName
* @param columnName
* @param level
* @param parent
* @return
*/
@IgnoreAuth // 跳过权限验证
@RequestMapping("/option/{tableName}/{columnName}")
public R getOption(
@PathVariable("tableName") String tableName,
@PathVariable("columnName") String columnName,
String level,
String parent
) {
// 构建查询参数Map
Map<String, Object> params = new HashMap<String, Object>();
params.put("table", tableName); // 设置表名参数
params.put("column", columnName); // 设置字段名参数
// 处理可选参数
if(StringUtils.isNotBlank(level)) {
params.put("level", level); // 设置层级参数
}
if(StringUtils.isNotBlank(parent)) {
params.put("parent", parent); // 设置父级参数
}
// 调用服务获取数据
List<String> data = commonService.getOption(params);
// 返回标准化响应
return R.ok().put("data", data);
}
/**
*
* @param tableName
* @param columnName
* @param columnValue
* @return
*/
@IgnoreAuth // 跳过权限验证
@RequestMapping("/follow/{tableName}/{columnName}")
public R getFollowByOption(
@PathVariable("tableName") String tableName,
@PathVariable("columnName") String columnName,
@RequestParam String columnValue
) {
// 构建查询参数Map
Map<String, Object> params = new HashMap<String, Object>();
params.put("table", tableName); // 设置表名参数
params.put("column", columnName); // 设置字段名参数
params.put("columnValue", columnValue); // 设置字段值参数
// 调用服务获取单条记录
Map<String, Object> result = commonService.getFollowByOption(params);
// 返回标准化响应
return R.ok().put("data", result);
}
/**
*
* @param tableName
* @param map Map
* @return
*/
@RequestMapping("/sh/{tableName}")
public R sh(
@PathVariable("tableName") String tableName,
@RequestBody Map<String, Object> map
) {
map.put("table", tableName); // 将表名添加到参数Map
commonService.sh(map); // 调用审核服务
return R.ok(); // 返回成功响应
}
/**
*
* @param tableName
* @param columnName
* @param type 1: 2:
* @param map Map
* @return
*/
@IgnoreAuth // 跳过权限验证
@RequestMapping("/remind/{tableName}/{columnName}/{type}")
public R remindCount(
@PathVariable("tableName") String tableName,
@PathVariable("columnName") String columnName,
@PathVariable("type") String type,
@RequestParam Map<String, Object> map
) {
// 设置基础参数
map.put("table", tableName); // 表名参数
map.put("column", columnName); // 字段名参数
map.put("type", type); // 类型参数
// 日期类型特殊处理
if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); // 日期格式化
Calendar c = Calendar.getInstance(); // 日历实例
Date remindStartDate = null; // 提醒开始日期
Date remindEndDate = null; // 提醒结束日期
// 处理提醒开始日期
if(map.get("remindstart")!=null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindStart); // 计算开始日期
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate)); // 格式化日期
}
// 处理提醒结束日期
if(map.get("remindend")!=null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd); // 计算结束日期
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate)); // 格式化日期
}
}
// 调用服务获取提醒记录数
int count = commonService.remindCount(map);
// 返回标准化响应
return R.ok().put("count", count);
}
/**
*
* @param tableName
* @param columnName
* @return
*/
@IgnoreAuth // 跳过权限验证
@RequestMapping("/cal/{tableName}/{columnName}")
public R cal(
@PathVariable("tableName") String tableName,
@PathVariable("columnName") String columnName
) {
// 构建查询参数
Map<String, Object> params = new HashMap<String, Object>();
params.put("table", tableName); // 表名参数
params.put("column", columnName); // 字段名参数
// 调用服务获取计算结果
Map<String, Object> result = commonService.selectCal(params);
// 返回标准化响应
return R.ok().put("data", result);
}
/**
*
* @param tableName
* @param columnName
* @return
*/
@IgnoreAuth // 跳过权限验证
@RequestMapping("/group/{tableName}/{columnName}")
public R group(
@PathVariable("tableName") String tableName,
@PathVariable("columnName") String columnName
) {
// 构建查询参数
Map<String, Object> params = new HashMap<String, Object>();
params.put("table", tableName); // 表名参数
params.put("column", columnName); // 分组字段参数
// 调用服务获取分组结果
List<Map<String, Object>> result = commonService.selectGroup(params);
// 返回标准化响应
return R.ok().put("data", result);
}
/**
*
* @param tableName
* @param yColumnName
* @param xColumnName
* @return
*/
@IgnoreAuth // 跳过权限验证
@RequestMapping("/value/{tableName}/{xColumnName}/{yColumnName}")
public R value(
@PathVariable("tableName") String tableName,
@PathVariable("yColumnName") String yColumnName,
@PathVariable("xColumnName") String xColumnName
) {
// 构建查询参数
Map<String, Object> params = new HashMap<String, Object>();
params.put("table", tableName); // 表名参数
params.put("xColumn", xColumnName); // 横轴字段参数
params.put("yColumn", yColumnName); // 纵轴字段参数
// 调用服务获取统计结果
List<Map<String, Object>> result = commonService.selectValue(params);
// 格式化日期类型数据
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
for(Map<String, Object> m : result) {
for(String k : m.keySet()) {
if(m.get(k) instanceof Date) {
m.put(k, sdf.format((Date)m.get(k))); // 日期转为字符串
}
}
}
// 返回标准化响应
return R.ok().put("data", result);
}
}

@ -0,0 +1,148 @@
package com.controller;
import java.util.Arrays;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.ConfigEntity;
import com.service.ConfigService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.ValidatorUtils;
/**
*
*/
// 定义该请求映射路径为 "config"
@RequestMapping("config")
// 声明这是一个 RESTful 风格的控制器
@RestController
public class ConfigController{
// 自动注入 ConfigService 实例
@Autowired
private ConfigService configService;
/**
*
*/
// 处理 "/page" 路径的请求
@RequestMapping("/page")
// 处理分页列表请求的方法,接收参数和配置实体
public R page(@RequestParam Map<String, Object> params,ConfigEntity config){
// 创建一个 ConfigEntity 的查询条件包装器
EntityWrapper<ConfigEntity> ew = new EntityWrapper<ConfigEntity>();
// 调用服务层方法进行分页查询
PageUtils page = configService.queryPage(params);
// 返回成功响应,并将分页数据放入响应体
return R.ok().put("data", page);
}
/**
*
*/
// 处理 "/list" 路径的请求,且该请求无需认证
@IgnoreAuth
@RequestMapping("/list")
// 处理列表请求的方法,接收参数和配置实体
public R list(@RequestParam Map<String, Object> params,ConfigEntity config){
// 创建一个 ConfigEntity 的查询条件包装器
EntityWrapper<ConfigEntity> ew = new EntityWrapper<ConfigEntity>();
// 调用服务层方法进行分页查询
PageUtils page = configService.queryPage(params);
// 返回成功响应,并将分页数据放入响应体
return R.ok().put("data", page);
}
/**
*
*/
// 处理 "/info/{id}" 路径的请求,接收路径参数 id
@RequestMapping("/info/{id}")
// 根据 id 获取配置信息的方法
public R info(@PathVariable("id") String id){
// 调用服务层方法根据 id 查询配置实体
ConfigEntity config = configService.selectById(id);
// 返回成功响应,并将配置信息放入响应体
return R.ok().put("data", config);
}
/**
*
*/
// 处理 "/detail/{id}" 路径的请求,且该请求无需认证
@IgnoreAuth
@RequestMapping("/detail/{id}")
// 根据 id 获取配置详情的方法
public R detail(@PathVariable("id") String id){
// 调用服务层方法根据 id 查询配置实体
ConfigEntity config = configService.selectById(id);
// 返回成功响应,并将配置信息放入响应体
return R.ok().put("data", config);
}
/**
* name
*/
// 处理 "/info" 路径的请求,接收请求参数 name
@RequestMapping("/info")
// 根据名称获取配置信息的方法
public R infoByName(@RequestParam String name){
// 调用服务层方法根据名称查询配置实体
ConfigEntity config = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));
// 返回成功响应,并将配置信息放入响应体
return R.ok().put("data", config);
}
/**
*
*/
// 处理 "/save" 路径的 POST 请求
@PostMapping("/save")
// 保存配置信息的方法,接收请求体中的配置实体
public R save(@RequestBody ConfigEntity config){
// ValidatorUtils.validateEntity(config);
// 调用服务层方法插入配置实体
configService.insert(config);
// 返回成功响应
return R.ok();
}
/**
*
*/
// 处理 "/update" 路径的请求
@RequestMapping("/update")
// 更新配置信息的方法,接收请求体中的配置实体
public R update(@RequestBody ConfigEntity config){
// ValidatorUtils.validateEntity(config);
// 调用服务层方法根据 id 更新配置实体
configService.updateById(config);//全部更新
// 返回成功响应
return R.ok();
}
/**
*
*/
// 处理 "/delete" 路径的请求
@RequestMapping("/delete")
// 删除配置信息的方法,接收请求体中的 id 数组
public R delete(@RequestBody Long[] ids){
// 调用服务层方法批量删除配置实体
configService.deleteBatchIds(Arrays.asList(ids));
// 返回成功响应
return R.ok();
}
}

@ -0,0 +1,274 @@
package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.DiscussfangwuxinxiEntity;
import com.entity.view.DiscussfangwuxinxiView;
import com.service.DiscussfangwuxinxiService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
/**
*
*
* @author
* @email
* @date 2025-04-04 18:46:21
*/
// 标记该类为 RESTful 风格的控制器,用于处理 HTTP 请求并返回 JSON 数据
@RestController
// 映射该控制器处理的请求路径前缀为 /discussfangwuxinxi
@RequestMapping("/discussfangwuxinxi")
public class DiscussfangwuxinxiController {
// 自动注入 DiscussfangwuxinxiService 服务实例,用于调用业务逻辑方法
@Autowired
private DiscussfangwuxinxiService discussfangwuxinxiService;
/**
*
*/
// 映射处理 /page 路径的请求,通常用于获取后端的分页列表数据
@RequestMapping("/page")
// 处理分页请求的方法,接收请求参数、实体对象和 HttpServletRequest 对象
public R page(@RequestParam Map<String, Object> params, DiscussfangwuxinxiEntity discussfangwuxinxi, HttpServletRequest request) {
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<DiscussfangwuxinxiEntity> ew = new EntityWrapper<DiscussfangwuxinxiEntity>();
// 调用服务层的 queryPage 方法进行分页查询,使用 MPUtil 工具类处理排序、范围查询和模糊查询
PageUtils page = discussfangwuxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, discussfangwuxinxi), params), params));
// 返回一个成功响应对象 R并将分页数据放入响应的 data 字段中
return R.ok().put("data", page);
}
/**
*
*/
// 标记该请求无需进行身份验证
@IgnoreAuth
// 映射处理 /list 路径的请求,通常用于获取前端的列表数据
@RequestMapping("/list")
// 处理列表请求的方法,接收请求参数、实体对象和 HttpServletRequest 对象
public R list(@RequestParam Map<String, Object> params, DiscussfangwuxinxiEntity discussfangwuxinxi, HttpServletRequest request) {
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<DiscussfangwuxinxiEntity> ew = new EntityWrapper<DiscussfangwuxinxiEntity>();
// 调用服务层的 queryPage 方法进行分页查询,使用 MPUtil 工具类处理排序、范围查询和模糊查询
PageUtils page = discussfangwuxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, discussfangwuxinxi), params), params));
// 返回一个成功响应对象 R并将分页数据放入响应的 data 字段中
return R.ok().put("data", page);
}
/**
*
*/
// 映射处理 /lists 路径的请求,用于获取列表数据
@RequestMapping("/lists")
// 处理列表请求的方法,接收实体对象
public R list(DiscussfangwuxinxiEntity discussfangwuxinxi) {
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<DiscussfangwuxinxiEntity> ew = new EntityWrapper<DiscussfangwuxinxiEntity>();
// 使用 MPUtil 工具类将实体对象的属性转换为查询条件,并设置到 EntityWrapper 中
ew.allEq(MPUtil.allEQMapPre(discussfangwuxinxi, "discussfangwuxinxi"));
// 调用服务层的 selectListView 方法,根据查询条件获取列表视图数据
return R.ok().put("data", discussfangwuxinxiService.selectListView(ew));
}
/**
*
*/
// 映射处理 /query 路径的请求,用于查询单个对象
@RequestMapping("/query")
// 处理查询请求的方法,接收实体对象
public R query(DiscussfangwuxinxiEntity discussfangwuxinxi) {
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<DiscussfangwuxinxiEntity> ew = new EntityWrapper<DiscussfangwuxinxiEntity>();
// 使用 MPUtil 工具类将实体对象的属性转换为查询条件,并设置到 EntityWrapper 中
ew.allEq(MPUtil.allEQMapPre(discussfangwuxinxi, "discussfangwuxinxi"));
// 调用服务层的 selectView 方法,根据查询条件获取单个视图对象
DiscussfangwuxinxiView discussfangwuxinxiView = discussfangwuxinxiService.selectView(ew);
// 返回一个成功响应对象 R并设置提示信息和查询结果到响应中
return R.ok("查询房屋信息评论表成功").put("data", discussfangwuxinxiView);
}
/**
*
*/
// 映射处理 /info/{id} 路径的请求,用于获取指定 ID 的详细信息
@RequestMapping("/info/{id}")
// 处理详情请求的方法,接收路径参数 id
public R info(@PathVariable("id") Long id) {
// 调用服务层的 selectById 方法,根据 ID 获取实体对象
DiscussfangwuxinxiEntity discussfangwuxinxi = discussfangwuxinxiService.selectById(id);
// 返回一个成功响应对象 R并将实体对象放入响应的 data 字段中
return R.ok().put("data", discussfangwuxinxi);
}
/**
*
*/
// 映射处理 /detail/{id} 路径的请求,用于获取指定 ID 的详细信息
@RequestMapping("/detail/{id}")
// 处理详情请求的方法,接收路径参数 id
public R detail(@PathVariable("id") Long id) {
// 调用服务层的 selectById 方法,根据 ID 获取实体对象
DiscussfangwuxinxiEntity discussfangwuxinxi = discussfangwuxinxiService.selectById(id);
// 返回一个成功响应对象 R并将实体对象放入响应的 data 字段中
return R.ok().put("data", discussfangwuxinxi);
}
/**
*
*/
// 映射处理 /save 路径的 POST 请求,用于保存新的实体对象
@RequestMapping("/save")
// 处理保存请求的方法,接收请求体中的实体对象和 HttpServletRequest 对象
public R save(@RequestBody DiscussfangwuxinxiEntity discussfangwuxinxi, HttpServletRequest request) {
// 为实体对象生成一个唯一的 ID由当前时间戳加上一个随机数组成
discussfangwuxinxi.setId(new Date().getTime() + new Double(Math.floor(Math.random() * 1000)).longValue());
// 注释掉的代码用于验证实体对象的合法性
//ValidatorUtils.validateEntity(discussfangwuxinxi);
// 调用服务层的 insert 方法,将实体对象插入数据库
discussfangwuxinxiService.insert(discussfangwuxinxi);
// 返回一个成功响应对象 R
return R.ok();
}
/**
*
*/
// 映射处理 /add 路径的请求,用于前端保存新的实体对象
@RequestMapping("/add")
// 处理保存请求的方法,接收请求体中的实体对象和 HttpServletRequest 对象
public R add(@RequestBody DiscussfangwuxinxiEntity discussfangwuxinxi, HttpServletRequest request) {
// 为实体对象生成一个唯一的 ID由当前时间戳加上一个随机数组成
discussfangwuxinxi.setId(new Date().getTime() + new Double(Math.floor(Math.random() * 1000)).longValue());
// 注释掉的代码用于验证实体对象的合法性
//ValidatorUtils.validateEntity(discussfangwuxinxi);
// 调用服务层的 insert 方法,将实体对象插入数据库
discussfangwuxinxiService.insert(discussfangwuxinxi);
// 返回一个成功响应对象 R
return R.ok();
}
/**
*
*/
// 映射处理 /update 路径的请求,用于更新实体对象
@RequestMapping("/update")
// 处理更新请求的方法,接收请求体中的实体对象和 HttpServletRequest 对象
public R update(@RequestBody DiscussfangwuxinxiEntity discussfangwuxinxi, HttpServletRequest request) {
// 注释掉的代码用于验证实体对象的合法性
//ValidatorUtils.validateEntity(discussfangwuxinxi);
// 调用服务层的 updateById 方法,根据 ID 更新实体对象的所有字段
discussfangwuxinxiService.updateById(discussfangwuxinxi);
// 返回一个成功响应对象 R
return R.ok();
}
/**
*
*/
// 映射处理 /delete 路径的请求,用于批量删除实体对象
@RequestMapping("/delete")
// 处理删除请求的方法,接收请求体中的 ID 数组
public R delete(@RequestBody Long[] ids) {
// 调用服务层的 deleteBatchIds 方法,根据 ID 数组批量删除实体对象
discussfangwuxinxiService.deleteBatchIds(Arrays.asList(ids));
// 返回一个成功响应对象 R
return R.ok();
}
/**
*
*/
// 映射处理 /remind/{columnName}/{type} 路径的请求,用于统计提醒数量
@RequestMapping("/remind/{columnName}/{type}")
// 处理提醒统计请求的方法,接收路径参数 columnName 和 type以及请求参数 map 和 HttpServletRequest 对象
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type, @RequestParam Map<String, Object> map) {
// 将列名和类型添加到请求参数 map 中
map.put("column", columnName);
map.put("type", type);
// 如果类型为 2表示需要处理提醒日期范围
if (type.equals("2")) {
// 创建一个 SimpleDateFormat 对象,用于格式化日期
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
// 获取当前日期的 Calendar 实例
Calendar c = Calendar.getInstance();
// 定义提醒开始日期和结束日期
Date remindStartDate = null;
Date remindEndDate = null;
// 如果请求参数中包含提醒开始日期
if (map.get("remindstart") != null) {
// 将提醒开始日期的偏移量转换为整数
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
// 设置 Calendar 实例的时间为当前日期
c.setTime(new Date());
// 在当前日期的基础上加上提醒开始日期的偏移量
c.add(Calendar.DAY_OF_MONTH, remindStart);
// 获取提醒开始日期
remindStartDate = c.getTime();
// 将格式化后的提醒开始日期添加到请求参数 map 中
map.put("remindstart", sdf.format(remindStartDate));
}
// 如果请求参数中包含提醒结束日期
if (map.get("remindend") != null) {
// 将提醒结束日期的偏移量转换为整数
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
// 设置 Calendar 实例的时间为当前日期
c.setTime(new Date());
// 在当前日期的基础上加上提醒结束日期的偏移量
c.add(Calendar.DAY_OF_MONTH, remindEnd);
// 获取提醒结束日期
remindEndDate = c.getTime();
// 将格式化后的提醒结束日期添加到请求参数 map 中
map.put("remindend", sdf.format(remindEndDate));
}
}
// 创建一个 MyBatis-Plus 的 Wrapper 对象,用于构建查询条件
Wrapper<DiscussfangwuxinxiEntity> wrapper = new EntityWrapper<DiscussfangwuxinxiEntity>();
// 如果请求参数中包含提醒开始日期
if (map.get("remindstart") != null) {
// 设置查询条件,要求列值大于等于提醒开始日期
wrapper.ge(columnName, map.get("remindstart"));
}
// 如果请求参数中包含提醒结束日期
if (map.get("remindend") != null) {
// 设置查询条件,要求列值小于等于提醒结束日期
wrapper.le(columnName, map.get("remindend"));
}
// 调用服务层的 selectCount 方法,根据查询条件统计符合条件的记录数量
int count = discussfangwuxinxiService.selectCount(wrapper);
// 返回一个成功响应对象 R并将统计数量放入响应的 count 字段中
return R.ok().put("count", count);
}
}

@ -0,0 +1,273 @@
package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.DiscusswoyaodangfangzhuEntity;
import com.entity.view.DiscusswoyaodangfangzhuView;
import com.service.DiscusswoyaodangfangzhuService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
/**
*
*
* @author
* @email
* @date 2025-04-04 18:46:21
*/
// 标记该类为 RESTful 风格的控制器,用于处理 HTTP 请求并返回 JSON 数据
@RestController
// 映射该控制器处理的请求路径前缀为 /discusswoyaodangfangzhu
@RequestMapping("/discusswoyaodangfangzhu")
public class DiscusswoyaodangfangzhuController {
// 自动注入 DiscusswoyaodangfangzhuService 服务实例,用于调用业务逻辑方法
@Autowired
private DiscusswoyaodangfangzhuService discusswoyaodangfangzhuService;
/**
*
*/
// 映射处理 /page 路径的请求,用于获取后端的分页列表数据
@RequestMapping("/page")
// 处理分页列表请求的方法,接收请求参数、实体对象和 HttpServletRequest 对象
public R page(@RequestParam Map<String, Object> params, DiscusswoyaodangfangzhuEntity discusswoyaodangfangzhu, HttpServletRequest request) {
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<DiscusswoyaodangfangzhuEntity> ew = new EntityWrapper<DiscusswoyaodangfangzhuEntity>();
// 调用服务层的 queryPage 方法进行分页查询,使用 MPUtil 工具类处理排序、范围查询和模糊查询
PageUtils page = discusswoyaodangfangzhuService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, discusswoyaodangfangzhu), params), params));
// 返回一个成功响应对象 R并将分页数据放入响应的 data 字段中
return R.ok().put("data", page);
}
/**
*
*/
// 标记该请求无需进行身份验证
@IgnoreAuth
// 映射处理 /list 路径的请求,用于获取前端的列表数据
@RequestMapping("/list")
// 处理列表请求的方法,接收请求参数、实体对象和 HttpServletRequest 对象
public R list(@RequestParam Map<String, Object> params, DiscusswoyaodangfangzhuEntity discusswoyaodangfangzhu, HttpServletRequest request) {
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<DiscusswoyaodangfangzhuEntity> ew = new EntityWrapper<DiscusswoyaodangfangzhuEntity>();
// 调用服务层的 queryPage 方法进行分页查询,使用 MPUtil 工具类处理排序、范围查询和模糊查询
PageUtils page = discusswoyaodangfangzhuService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, discusswoyaodangfangzhu), params), params));
// 返回一个成功响应对象 R并将分页数据放入响应的 data 字段中
return R.ok().put("data", page);
}
/**
*
*/
// 映射处理 /lists 路径的请求,用于获取列表数据
@RequestMapping("/lists")
// 处理列表请求的方法,接收实体对象
public R list(DiscusswoyaodangfangzhuEntity discusswoyaodangfangzhu) {
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<DiscusswoyaodangfangzhuEntity> ew = new EntityWrapper<DiscusswoyaodangfangzhuEntity>();
// 使用 MPUtil 工具类将实体对象的属性转换为查询条件,并设置到 EntityWrapper 中
ew.allEq(MPUtil.allEQMapPre(discusswoyaodangfangzhu, "discusswoyaodangfangzhu"));
// 调用服务层的 selectListView 方法,根据查询条件获取列表视图数据
return R.ok().put("data", discusswoyaodangfangzhuService.selectListView(ew));
}
/**
*
*/
// 映射处理 /query 路径的请求,用于查询单个对象
@RequestMapping("/query")
// 处理查询请求的方法,接收实体对象
public R query(DiscusswoyaodangfangzhuEntity discusswoyaodangfangzhu) {
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<DiscusswoyaodangfangzhuEntity> ew = new EntityWrapper<DiscusswoyaodangfangzhuEntity>();
// 使用 MPUtil 工具类将实体对象的属性转换为查询条件,并设置到 EntityWrapper 中
ew.allEq(MPUtil.allEQMapPre(discusswoyaodangfangzhu, "discusswoyaodangfangzhu"));
// 调用服务层的 selectView 方法,根据查询条件获取单个视图对象
DiscusswoyaodangfangzhuView discusswoyaodangfangzhuView = discusswoyaodangfangzhuService.selectView(ew);
// 返回一个成功响应对象 R并设置提示信息和查询结果到响应中
return R.ok("查询我要当房主评论表成功").put("data", discusswoyaodangfangzhuView);
}
/**
*
*/
// 映射处理 /info/{id} 路径的请求,用于获取指定 ID 的详细信息
@RequestMapping("/info/{id}")
// 处理详情请求的方法,接收路径参数 id
public R info(@PathVariable("id") Long id) {
// 调用服务层的 selectById 方法,根据 ID 获取实体对象
DiscusswoyaodangfangzhuEntity discusswoyaodangfangzhu = discusswoyaodangfangzhuService.selectById(id);
// 返回一个成功响应对象 R并将实体对象放入响应的 data 字段中
return R.ok().put("data", discusswoyaodangfangzhu);
}
/**
*
*/
// 映射处理 /detail/{id} 路径的请求,用于获取指定 ID 的详细信息
@RequestMapping("/detail/{id}")
// 处理详情请求的方法,接收路径参数 id
public R detail(@PathVariable("id") Long id) {
// 调用服务层的 selectById 方法,根据 ID 获取实体对象
DiscusswoyaodangfangzhuEntity discusswoyaodangfangzhu = discusswoyaodangfangzhuService.selectById(id);
// 返回一个成功响应对象 R并将实体对象放入响应的 data 字段中
return R.ok().put("data", discusswoyaodangfangzhu);
}
/**
*
*/
// 映射处理 /save 路径的 POST 请求,用于保存新的实体对象
@RequestMapping("/save")
// 处理保存请求的方法,接收请求体中的实体对象和 HttpServletRequest 对象
public R save(@RequestBody DiscusswoyaodangfangzhuEntity discusswoyaodangfangzhu, HttpServletRequest request) {
// 为实体对象生成一个唯一的 ID由当前时间戳加上一个随机数组成
discusswoyaodangfangzhu.setId(new Date().getTime() + new Double(Math.floor(Math.random() * 1000)).longValue());
// 注释掉的代码用于验证实体对象的合法性
//ValidatorUtils.validateEntity(discusswoyaodangfangzhu);
// 调用服务层的 insert 方法,将实体对象插入数据库
discusswoyaodangfangzhuService.insert(discusswoyaodangfangzhu);
// 返回一个成功响应对象 R
return R.ok();
}
/**
*
*/
// 映射处理 /add 路径的请求,用于前端保存新的实体对象
@RequestMapping("/add")
// 处理保存请求的方法,接收请求体中的实体对象和 HttpServletRequest 对象
public R add(@RequestBody DiscusswoyaodangfangzhuEntity discusswoyaodangfangzhu, HttpServletRequest request) {
// 为实体对象生成一个唯一的 ID由当前时间戳加上一个随机数组成
discusswoyaodangfangzhu.setId(new Date().getTime() + new Double(Math.floor(Math.random() * 1000)).longValue());
// 注释掉的代码用于验证实体对象的合法性
//ValidatorUtils.validateEntity(discusswoyaodangfangzhu);
// 调用服务层的 insert 方法,将实体对象插入数据库
discusswoyaodangfangzhuService.insert(discusswoyaodangfangzhu);
// 返回一个成功响应对象 R
return R.ok();
}
/**
*
*/
// 映射处理 /update 路径的请求,用于更新实体对象
@RequestMapping("/update")
// 处理更新请求的方法,接收请求体中的实体对象和 HttpServletRequest 对象
public R update(@RequestBody DiscusswoyaodangfangzhuEntity discusswoyaodangfangzhu, HttpServletRequest request) {
// 注释掉的代码用于验证实体对象的合法性
//ValidatorUtils.validateEntity(discusswoyaodangfangzhu);
// 调用服务层的 updateById 方法,根据 ID 更新实体对象的所有字段
discusswoyaodangfangzhuService.updateById(discusswoyaodangfangzhu);
// 返回一个成功响应对象 R
return R.ok();
}
/**
*
*/
// 映射处理 /delete 路径的请求,用于批量删除实体对象
@RequestMapping("/delete")
// 处理删除请求的方法,接收请求体中的 ID 数组
public R delete(@RequestBody Long[] ids) {
// 调用服务层的 deleteBatchIds 方法,根据 ID 数组批量删除实体对象
discusswoyaodangfangzhuService.deleteBatchIds(Arrays.asList(ids));
// 返回一个成功响应对象 R
return R.ok();
}
/**
*
*/
// 映射处理 /remind/{columnName}/{type} 路径的请求,用于统计提醒数量
@RequestMapping("/remind/{columnName}/{type}")
// 处理提醒统计请求的方法,接收路径参数 columnName 和 type以及请求参数 map 和 HttpServletRequest 对象
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type, @RequestParam Map<String, Object> map) {
// 将列名和类型添加到请求参数 map 中
map.put("column", columnName);
map.put("type", type);
// 如果类型为 2表示需要处理提醒日期范围
if (type.equals("2")) {
// 创建一个 SimpleDateFormat 对象,用于格式化日期
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
// 获取当前日期的 Calendar 实例
Calendar c = Calendar.getInstance();
// 定义提醒开始日期和结束日期
Date remindStartDate = null;
Date remindEndDate = null;
// 如果请求参数中包含提醒开始日期
if (map.get("remindstart") != null) {
// 将提醒开始日期的偏移量转换为整数
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
// 设置 Calendar 实例的时间为当前日期
c.setTime(new Date());
// 在当前日期的基础上加上提醒开始日期的偏移量
c.add(Calendar.DAY_OF_MONTH, remindStart);
// 获取提醒开始日期
remindStartDate = c.getTime();
// 将格式化后的提醒开始日期添加到请求参数 map 中
map.put("remindstart", sdf.format(remindStartDate));
}
// 如果请求参数中包含提醒结束日期
if (map.get("remindend") != null) {
// 将提醒结束日期的偏移量转换为整数
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
// 设置 Calendar 实例的时间为当前日期
c.setTime(new Date());
// 在当前日期的基础上加上提醒结束日期的偏移量
c.add(Calendar.DAY_OF_MONTH, remindEnd);
// 获取提醒结束日期
remindEndDate = c.getTime();
// 将格式化后的提醒结束日期添加到请求参数 map 中
map.put("remindend", sdf.format(remindEndDate));
}
}
// 创建一个 MyBatis-Plus 的 Wrapper 对象,用于构建查询条件
Wrapper<DiscusswoyaodangfangzhuEntity> wrapper = new EntityWrapper<DiscusswoyaodangfangzhuEntity>();
// 如果请求参数中包含提醒开始日期
if (map.get("remindstart") != null) {
// 设置查询条件,要求列值大于等于提醒开始日期
wrapper.ge(columnName, map.get("remindstart"));
}
// 如果请求参数中包含提醒结束日期
if (map.get("remindend") != null) {
// 设置查询条件,要求列值小于等于提醒结束日期
wrapper.le(columnName, map.get("remindend"));
}
// 调用服务层的 selectCount 方法,根据查询条件统计符合条件的记录数量
int count = discusswoyaodangfangzhuService.selectCount(wrapper);
// 返回一个成功响应对象 R并将统计数量放入响应的 count 字段中
return R.ok().put("count", count);
}
}

@ -0,0 +1,292 @@
package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.FangwubaoxiuEntity;
import com.entity.view.FangwubaoxiuView;
import com.service.FangwubaoxiuService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
/**
*
*
* @author
* @email
* @date 2025-04-04 18:46:21
*/
// 标记该类为 RESTful 风格的控制器,用于处理 HTTP 请求并返回 JSON 格式的数据
@RestController
// 该控制器处理的所有请求路径都以 /fangwubaoxiu 开头
@RequestMapping("/fangwubaoxiu")
public class FangwubaoxiuController {
// 自动注入 FangwubaoxiuService 服务类的实例,用于调用业务逻辑方法
@Autowired
private FangwubaoxiuService fangwubaoxiuService;
/**
*
*/
// 处理 /page 路径的请求,通常用于获取后端的分页数据列表
@RequestMapping("/page")
// 处理分页请求的方法,接收请求参数、房屋报修实体对象和 HttpServletRequest 对象
public R page(@RequestParam Map<String, Object> params, FangwubaoxiuEntity fangwubaoxiu, HttpServletRequest request) {
// 从请求的会话中获取 tableName 属性值,并转换为字符串
String tableName = request.getSession().getAttribute("tableName").toString();
// 如果 tableName 为 "fangzhu"(房主)
if (tableName.equals("fangzhu")) {
// 将当前会话中的用户名设置为房屋报修实体的房主账号
fangwubaoxiu.setFangzhuzhanghao((String) request.getSession().getAttribute("username"));
}
// 如果 tableName 为 "yonghu"(用户)
if (tableName.equals("yonghu")) {
// 将当前会话中的用户名设置为房屋报修实体的用户名
fangwubaoxiu.setYonghuming((String) request.getSession().getAttribute("username"));
}
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<FangwubaoxiuEntity> ew = new EntityWrapper<FangwubaoxiuEntity>();
// 调用服务层的 queryPage 方法进行分页查询,使用 MPUtil 工具类处理排序、范围查询和模糊查询
PageUtils page = fangwubaoxiuService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, fangwubaoxiu), params), params));
// 返回一个成功响应对象 R并将分页数据放入响应的 data 字段中
return R.ok().put("data", page);
}
/**
*
*/
// 处理 /list 路径的请求,通常用于获取前端的列表数据
@RequestMapping("/list")
// 处理列表请求的方法,接收请求参数、房屋报修实体对象和 HttpServletRequest 对象
public R list(@RequestParam Map<String, Object> params, FangwubaoxiuEntity fangwubaoxiu, HttpServletRequest request) {
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<FangwubaoxiuEntity> ew = new EntityWrapper<FangwubaoxiuEntity>();
// 调用服务层的 queryPage 方法进行分页查询,使用 MPUtil 工具类处理排序、范围查询和模糊查询
PageUtils page = fangwubaoxiuService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, fangwubaoxiu), params), params));
// 返回一个成功响应对象 R并将分页数据放入响应的 data 字段中
return R.ok().put("data", page);
}
/**
*
*/
// 处理 /lists 路径的请求,用于获取列表数据
@RequestMapping("/lists")
// 处理列表请求的方法,接收房屋报修实体对象
public R list(FangwubaoxiuEntity fangwubaoxiu) {
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<FangwubaoxiuEntity> ew = new EntityWrapper<FangwubaoxiuEntity>();
// 使用 MPUtil 工具类将实体对象的属性转换为查询条件,并设置到 EntityWrapper 中
ew.allEq(MPUtil.allEQMapPre(fangwubaoxiu, "fangwubaoxiu"));
// 调用服务层的 selectListView 方法,根据查询条件获取列表视图数据
return R.ok().put("data", fangwubaoxiuService.selectListView(ew));
}
/**
*
*/
// 处理 /query 路径的请求,用于查询单个房屋报修信息
@RequestMapping("/query")
// 处理查询请求的方法,接收房屋报修实体对象
public R query(FangwubaoxiuEntity fangwubaoxiu) {
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<FangwubaoxiuEntity> ew = new EntityWrapper<FangwubaoxiuEntity>();
// 使用 MPUtil 工具类将实体对象的属性转换为查询条件,并设置到 EntityWrapper 中
ew.allEq(MPUtil.allEQMapPre(fangwubaoxiu, "fangwubaoxiu"));
// 调用服务层的 selectView 方法,根据查询条件获取单个视图对象
FangwubaoxiuView fangwubaoxiuView = fangwubaoxiuService.selectView(ew);
// 返回一个成功响应对象 R并设置提示信息和查询结果到响应中
return R.ok("查询房屋报修成功").put("data", fangwubaoxiuView);
}
/**
*
*/
// 处理 /info/{id} 路径的请求,用于获取指定 ID 的房屋报修详细信息
@RequestMapping("/info/{id}")
// 处理详情请求的方法,接收路径参数 id
public R info(@PathVariable("id") Long id) {
// 调用服务层的 selectById 方法,根据 ID 获取房屋报修实体对象
FangwubaoxiuEntity fangwubaoxiu = fangwubaoxiuService.selectById(id);
// 返回一个成功响应对象 R并将实体对象放入响应的 data 字段中
return R.ok().put("data", fangwubaoxiu);
}
/**
*
*/
// 处理 /detail/{id} 路径的请求,用于获取指定 ID 的房屋报修详细信息
@RequestMapping("/detail/{id}")
// 处理详情请求的方法,接收路径参数 id
public R detail(@PathVariable("id") Long id) {
// 调用服务层的 selectById 方法,根据 ID 获取房屋报修实体对象
FangwubaoxiuEntity fangwubaoxiu = fangwubaoxiuService.selectById(id);
// 返回一个成功响应对象 R并将实体对象放入响应的 data 字段中
return R.ok().put("data", fangwubaoxiu);
}
/**
*
*/
// 处理 /save 路径的 POST 请求,用于保存新的房屋报修信息
@RequestMapping("/save")
// 处理保存请求的方法,接收请求体中的房屋报修实体对象和 HttpServletRequest 对象
public R save(@RequestBody FangwubaoxiuEntity fangwubaoxiu, HttpServletRequest request) {
// 为房屋报修实体对象生成一个唯一的 ID由当前时间戳加上一个随机数组成
fangwubaoxiu.setId(new Date().getTime() + new Double(Math.floor(Math.random() * 1000)).longValue());
// 注释掉的代码用于验证实体对象的合法性
//ValidatorUtils.validateEntity(fangwubaoxiu);
// 调用服务层的 insert 方法,将实体对象插入数据库
fangwubaoxiuService.insert(fangwubaoxiu);
// 返回一个成功响应对象 R
return R.ok();
}
/**
*
*/
// 处理 /add 路径的请求,用于前端保存新的房屋报修信息
@RequestMapping("/add")
// 处理保存请求的方法,接收请求体中的房屋报修实体对象和 HttpServletRequest 对象
public R add(@RequestBody FangwubaoxiuEntity fangwubaoxiu, HttpServletRequest request) {
// 为房屋报修实体对象生成一个唯一的 ID由当前时间戳加上一个随机数组成
fangwubaoxiu.setId(new Date().getTime() + new Double(Math.floor(Math.random() * 1000)).longValue());
// 注释掉的代码用于验证实体对象的合法性
//ValidatorUtils.validateEntity(fangwubaoxiu);
// 调用服务层的 insert 方法,将实体对象插入数据库
fangwubaoxiuService.insert(fangwubaoxiu);
// 返回一个成功响应对象 R
return R.ok();
}
/**
*
*/
// 处理 /update 路径的请求,用于更新房屋报修信息
@RequestMapping("/update")
// 处理更新请求的方法,接收请求体中的房屋报修实体对象和 HttpServletRequest 对象
public R update(@RequestBody FangwubaoxiuEntity fangwubaoxiu, HttpServletRequest request) {
// 注释掉的代码用于验证实体对象的合法性
//ValidatorUtils.validateEntity(fangwubaoxiu);
// 调用服务层的 updateById 方法,根据 ID 更新实体对象的所有字段
fangwubaoxiuService.updateById(fangwubaoxiu);
// 返回一个成功响应对象 R
return R.ok();
}
/**
*
*/
// 处理 /delete 路径的请求,用于批量删除房屋报修信息
@RequestMapping("/delete")
// 处理删除请求的方法,接收请求体中的 ID 数组
public R delete(@RequestBody Long[] ids) {
// 调用服务层的 deleteBatchIds 方法,根据 ID 数组批量删除实体对象
fangwubaoxiuService.deleteBatchIds(Arrays.asList(ids));
// 返回一个成功响应对象 R
return R.ok();
}
/**
*
*/
// 处理 /remind/{columnName}/{type} 路径的请求,用于统计提醒数量
@RequestMapping("/remind/{columnName}/{type}")
// 处理提醒统计请求的方法,接收路径参数 columnName 和 type以及请求参数 map 和 HttpServletRequest 对象
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type, @RequestParam Map<String, Object> map) {
// 将列名和类型添加到请求参数 map 中
map.put("column", columnName);
map.put("type", type);
// 如果类型为 "2",表示需要处理提醒日期范围
if (type.equals("2")) {
// 创建一个 SimpleDateFormat 对象,用于格式化日期
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
// 获取当前日期的 Calendar 实例
Calendar c = Calendar.getInstance();
// 定义提醒开始日期和结束日期
Date remindStartDate = null;
Date remindEndDate = null;
// 如果请求参数中包含提醒开始日期
if (map.get("remindstart") != null) {
// 将提醒开始日期的偏移量转换为整数
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
// 设置 Calendar 实例的时间为当前日期
c.setTime(new Date());
// 在当前日期的基础上加上提醒开始日期的偏移量
c.add(Calendar.DAY_OF_MONTH, remindStart);
// 获取提醒开始日期
remindStartDate = c.getTime();
// 将格式化后的提醒开始日期添加到请求参数 map 中
map.put("remindstart", sdf.format(remindStartDate));
}
// 如果请求参数中包含提醒结束日期
if (map.get("remindend") != null) {
// 将提醒结束日期的偏移量转换为整数
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
// 设置 Calendar 实例的时间为当前日期
c.setTime(new Date());
// 在当前日期的基础上加上提醒结束日期的偏移量
c.add(Calendar.DAY_OF_MONTH, remindEnd);
// 获取提醒结束日期
remindEndDate = c.getTime();
// 将格式化后的提醒结束日期添加到请求参数 map 中
map.put("remindend", sdf.format(remindEndDate));
}
}
// 创建一个 MyBatis-Plus 的 Wrapper 对象,用于构建查询条件
Wrapper<FangwubaoxiuEntity> wrapper = new EntityWrapper<FangwubaoxiuEntity>();
// 如果请求参数中包含提醒开始日期
if (map.get("remindstart") != null) {
// 设置查询条件,要求列值大于等于提醒开始日期
wrapper.ge(columnName, map.get("remindstart"));
}
// 如果请求参数中包含提醒结束日期
if (map.get("remindend") != null) {
// 设置查询条件,要求列值小于等于提醒结束日期
wrapper.le(columnName, map.get("remindend"));
}
// 从请求的会话中获取 tableName 属性值,并转换为字符串
String tableName = request.getSession().getAttribute("tableName").toString();
// 如果 tableName 为 "fangzhu"(房主)
if (tableName.equals("fangzhu")) {
// 设置查询条件,要求房主账号等于当前会话中的用户名
wrapper.eq("fangzhuzhanghao", (String) request.getSession().getAttribute("username"));
}
// 如果 tableName 为 "yonghu"(用户)
if (tableName.equals("yonghu")) {
// 设置查询条件,要求用户名等于当前会话中的用户名
wrapper.eq("yonghuming", (String) request.getSession().getAttribute("username"));
}
// 调用服务层的 selectCount 方法,根据查询条件统计符合条件的记录数量
int count = fangwubaoxiuService.selectCount(wrapper);
// 返回一个成功响应对象 R并将统计数量放入响应的 count 字段中
return R.ok().put("count", count);
}
}

@ -0,0 +1,268 @@
package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.FangwuleixingEntity;
import com.entity.view.FangwuleixingView;
import com.service.FangwuleixingService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
/**
*
*
* @author
* @email
* @date 2025-04-04 18:46:21
*/
// 标记该类为 RESTful 风格的控制器,用于处理 HTTP 请求并返回 JSON 格式响应
@RestController
// 映射该控制器处理的请求路径前缀为 /fangwuleixing
@RequestMapping("/fangwuleixing")
public class FangwuleixingController {
// 自动注入 FangwuleixingService 服务实例,用于调用业务逻辑方法
@Autowired
private FangwuleixingService fangwuleixingService;
/**
*
*/
// 映射处理 /page 路径的请求,用于获取后端的房屋类型分页列表数据
@RequestMapping("/page")
// 处理分页请求的方法,接收请求参数、房屋类型实体对象和 HttpServletRequest 对象
public R page(@RequestParam Map<String, Object> params, FangwuleixingEntity fangwuleixing, HttpServletRequest request) {
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<FangwuleixingEntity> ew = new EntityWrapper<FangwuleixingEntity>();
// 调用服务层的 queryPage 方法进行分页查询,使用 MPUtil 工具类处理排序、范围查询和模糊查询
PageUtils page = fangwuleixingService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, fangwuleixing), params), params));
// 返回一个成功响应对象 R并将分页数据放入响应的 data 字段中
return R.ok().put("data", page);
}
/**
*
*/
// 映射处理 /list 路径的请求,用于获取前端的房屋类型列表数据
@RequestMapping("/list")
// 处理列表请求的方法,接收请求参数、房屋类型实体对象和 HttpServletRequest 对象
public R list(@RequestParam Map<String, Object> params, FangwuleixingEntity fangwuleixing, HttpServletRequest request) {
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<FangwuleixingEntity> ew = new EntityWrapper<FangwuleixingEntity>();
// 调用服务层的 queryPage 方法进行分页查询,使用 MPUtil 工具类处理排序、范围查询和模糊查询
PageUtils page = fangwuleixingService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, fangwuleixing), params), params));
// 返回一个成功响应对象 R并将分页数据放入响应的 data 字段中
return R.ok().put("data", page);
}
/**
*
*/
// 映射处理 /lists 路径的请求,用于获取房屋类型列表数据
@RequestMapping("/lists")
// 处理列表请求的方法,接收房屋类型实体对象
public R list(FangwuleixingEntity fangwuleixing) {
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<FangwuleixingEntity> ew = new EntityWrapper<FangwuleixingEntity>();
// 使用 MPUtil 工具类将实体对象的属性转换为查询条件,并设置到 EntityWrapper 中
ew.allEq(MPUtil.allEQMapPre(fangwuleixing, "fangwuleixing"));
// 调用服务层的 selectListView 方法,根据查询条件获取列表视图数据
return R.ok().put("data", fangwuleixingService.selectListView(ew));
}
/**
*
*/
// 映射处理 /query 路径的请求,用于查询单个房屋类型信息
@RequestMapping("/query")
// 处理查询请求的方法,接收房屋类型实体对象
public R query(FangwuleixingEntity fangwuleixing) {
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<FangwuleixingEntity> ew = new EntityWrapper<FangwuleixingEntity>();
// 使用 MPUtil 工具类将实体对象的属性转换为查询条件,并设置到 EntityWrapper 中
ew.allEq(MPUtil.allEQMapPre(fangwuleixing, "fangwuleixing"));
// 调用服务层的 selectView 方法,根据查询条件获取单个视图对象
FangwuleixingView fangwuleixingView = fangwuleixingService.selectView(ew);
// 返回一个成功响应对象 R并设置提示信息和查询结果到响应中
return R.ok("查询房屋类型成功").put("data", fangwuleixingView);
}
/**
*
*/
// 映射处理 /info/{id} 路径的请求,用于获取指定 ID 的房屋类型详细信息
@RequestMapping("/info/{id}")
// 处理详情请求的方法,接收路径参数 id
public R info(@PathVariable("id") Long id) {
// 调用服务层的 selectById 方法,根据 ID 获取房屋类型实体对象
FangwuleixingEntity fangwuleixing = fangwuleixingService.selectById(id);
// 返回一个成功响应对象 R并将实体对象放入响应的 data 字段中
return R.ok().put("data", fangwuleixing);
}
/**
*
*/
// 映射处理 /detail/{id} 路径的请求,用于获取指定 ID 的房屋类型详细信息
@RequestMapping("/detail/{id}")
// 处理详情请求的方法,接收路径参数 id
public R detail(@PathVariable("id") Long id) {
// 调用服务层的 selectById 方法,根据 ID 获取房屋类型实体对象
FangwuleixingEntity fangwuleixing = fangwuleixingService.selectById(id);
// 返回一个成功响应对象 R并将实体对象放入响应的 data 字段中
return R.ok().put("data", fangwuleixing);
}
/**
*
*/
// 映射处理 /save 路径的 POST 请求,用于保存新的房屋类型信息
@RequestMapping("/save")
// 处理保存请求的方法,接收请求体中的房屋类型实体对象和 HttpServletRequest 对象
public R save(@RequestBody FangwuleixingEntity fangwuleixing, HttpServletRequest request) {
// 为房屋类型实体对象生成一个唯一的 ID由当前时间戳加上一个随机数组成
fangwuleixing.setId(new Date().getTime() + new Double(Math.floor(Math.random() * 1000)).longValue());
// 注释掉的代码用于验证实体对象的合法性
//ValidatorUtils.validateEntity(fangwuleixing);
// 调用服务层的 insert 方法,将实体对象插入数据库
fangwuleixingService.insert(fangwuleixing);
// 返回一个成功响应对象 R
return R.ok();
}
/**
*
*/
// 映射处理 /add 路径的请求,用于前端保存新的房屋类型信息
@RequestMapping("/add")
// 处理保存请求的方法,接收请求体中的房屋类型实体对象和 HttpServletRequest 对象
public R add(@RequestBody FangwuleixingEntity fangwuleixing, HttpServletRequest request) {
// 为房屋类型实体对象生成一个唯一的 ID由当前时间戳加上一个随机数组成
fangwuleixing.setId(new Date().getTime() + new Double(Math.floor(Math.random() * 1000)).longValue());
// 注释掉的代码用于验证实体对象的合法性
//ValidatorUtils.validateEntity(fangwuleixing);
// 调用服务层的 insert 方法,将实体对象插入数据库
fangwuleixingService.insert(fangwuleixing);
// 返回一个成功响应对象 R
return R.ok();
}
/**
*
*/
// 映射处理 /update 路径的请求,用于更新房屋类型信息
@RequestMapping("/update")
// 处理更新请求的方法,接收请求体中的房屋类型实体对象和 HttpServletRequest 对象
public R update(@RequestBody FangwuleixingEntity fangwuleixing, HttpServletRequest request) {
// 注释掉的代码用于验证实体对象的合法性
//ValidatorUtils.validateEntity(fangwuleixing);
// 调用服务层的 updateById 方法,根据 ID 更新实体对象的所有字段
fangwuleixingService.updateById(fangwuleixing);
// 返回一个成功响应对象 R
return R.ok();
}
/**
*
*/
// 映射处理 /delete 路径的请求,用于批量删除房屋类型信息
@RequestMapping("/delete")
// 处理删除请求的方法,接收请求体中的 ID 数组
public R delete(@RequestBody Long[] ids) {
// 调用服务层的 deleteBatchIds 方法,根据 ID 数组批量删除实体对象
fangwuleixingService.deleteBatchIds(Arrays.asList(ids));
// 返回一个成功响应对象 R
return R.ok();
}
/**
*
*/
// 映射处理 /remind/{columnName}/{type} 路径的请求,用于统计提醒数量
@RequestMapping("/remind/{columnName}/{type}")
// 处理提醒统计请求的方法,接收路径参数 columnName 和 type以及请求参数 map 和 HttpServletRequest 对象
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type, @RequestParam Map<String, Object> map) {
// 将列名和类型添加到请求参数 map 中
map.put("column", columnName);
map.put("type", type);
// 如果类型为 "2",表示需要处理提醒日期范围
if (type.equals("2")) {
// 创建一个 SimpleDateFormat 对象,用于格式化日期
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
// 获取当前日期的 Calendar 实例
Calendar c = Calendar.getInstance();
// 定义提醒开始日期和结束日期
Date remindStartDate = null;
Date remindEndDate = null;
// 如果请求参数中包含提醒开始日期
if (map.get("remindstart") != null) {
// 将提醒开始日期的偏移量转换为整数
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
// 设置 Calendar 实例的时间为当前日期
c.setTime(new Date());
// 在当前日期的基础上加上提醒开始日期的偏移量
c.add(Calendar.DAY_OF_MONTH, remindStart);
// 获取提醒开始日期
remindStartDate = c.getTime();
// 将格式化后的提醒开始日期添加到请求参数 map 中
map.put("remindstart", sdf.format(remindStartDate));
}
// 如果请求参数中包含提醒结束日期
if (map.get("remindend") != null) {
// 将提醒结束日期的偏移量转换为整数
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
// 设置 Calendar 实例的时间为当前日期
c.setTime(new Date());
// 在当前日期的基础上加上提醒结束日期的偏移量
c.add(Calendar.DAY_OF_MONTH, remindEnd);
// 获取提醒结束日期
remindEndDate = c.getTime();
// 将格式化后的提醒结束日期添加到请求参数 map 中
map.put("remindend", sdf.format(remindEndDate));
}
}
// 创建一个 MyBatis-Plus 的 Wrapper 对象,用于构建查询条件
Wrapper<FangwuleixingEntity> wrapper = new EntityWrapper<FangwuleixingEntity>();
// 如果请求参数中包含提醒开始日期
if (map.get("remindstart") != null) {
// 设置查询条件,要求列值大于等于提醒开始日期
wrapper.ge(columnName, map.get("remindstart"));
}
// 如果请求参数中包含提醒结束日期
if (map.get("remindend") != null) {
// 设置查询条件,要求列值小于等于提醒结束日期
wrapper.le(columnName, map.get("remindend"));
}
// 调用服务层的 selectCount 方法,根据查询条件统计符合条件的记录数量
int count = fangwuleixingService.selectCount(wrapper);
// 返回一个成功响应对象 R并将统计数量放入响应的 count 字段中
return R.ok().put("count", count);
}
}

@ -0,0 +1,292 @@
package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.FangwupingjiaEntity;
import com.entity.view.FangwupingjiaView;
import com.service.FangwupingjiaService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
/**
*
*
* @author
* @email
* @date 2025-04-04 18:46:21
*/
// 标记该类为 RESTful 控制器,用于处理 HTTP 请求并返回 JSON 格式的响应
@RestController
// 该控制器处理的请求路径前缀为 /fangwupingjia
@RequestMapping("/fangwupingjia")
public class FangwupingjiaController {
// 自动注入 FangwupingjiaService 服务实例,用于调用业务逻辑方法
@Autowired
private FangwupingjiaService fangwupingjiaService;
/**
*
*/
// 映射处理 /page 路径的请求,用于获取后端房屋评价的分页列表数据
@RequestMapping("/page")
// 处理分页请求的方法,接收请求参数、房屋评价实体对象和 HttpServletRequest 对象
public R page(@RequestParam Map<String, Object> params, FangwupingjiaEntity fangwupingjia, HttpServletRequest request) {
// 从请求会话中获取 tableName 属性值并转换为字符串
String tableName = request.getSession().getAttribute("tableName").toString();
// 如果 tableName 为 "fangzhu"(房主)
if (tableName.equals("fangzhu")) {
// 将会话中的用户名设置为房屋评价实体的房主账号
fangwupingjia.setFangzhuzhanghao((String) request.getSession().getAttribute("username"));
}
// 如果 tableName 为 "yonghu"(用户)
if (tableName.equals("yonghu")) {
// 将会话中的用户名设置为房屋评价实体的用户名
fangwupingjia.setYonghuming((String) request.getSession().getAttribute("username"));
}
// 创建 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<FangwupingjiaEntity> ew = new EntityWrapper<FangwupingjiaEntity>();
// 调用服务层的 queryPage 方法进行分页查询,使用 MPUtil 工具类处理排序、范围查询和模糊查询
PageUtils page = fangwupingjiaService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, fangwupingjia), params), params));
// 返回一个成功响应对象 R并将分页数据放入响应的 data 字段中
return R.ok().put("data", page);
}
/**
*
*/
// 映射处理 /list 路径的请求,用于获取前端房屋评价的列表数据
@RequestMapping("/list")
// 处理列表请求的方法,接收请求参数、房屋评价实体对象和 HttpServletRequest 对象
public R list(@RequestParam Map<String, Object> params, FangwupingjiaEntity fangwupingjia, HttpServletRequest request) {
// 创建 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<FangwupingjiaEntity> ew = new EntityWrapper<FangwupingjiaEntity>();
// 调用服务层的 queryPage 方法进行分页查询,使用 MPUtil 工具类处理排序、范围查询和模糊查询
PageUtils page = fangwupingjiaService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, fangwupingjia), params), params));
// 返回一个成功响应对象 R并将分页数据放入响应的 data 字段中
return R.ok().put("data", page);
}
/**
*
*/
// 映射处理 /lists 路径的请求,用于获取房屋评价列表数据
@RequestMapping("/lists")
// 处理列表请求的方法,接收房屋评价实体对象
public R list(FangwupingjiaEntity fangwupingjia) {
// 创建 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<FangwupingjiaEntity> ew = new EntityWrapper<FangwupingjiaEntity>();
// 使用 MPUtil 工具类将实体对象的属性转换为查询条件,并设置到 EntityWrapper 中
ew.allEq(MPUtil.allEQMapPre(fangwupingjia, "fangwupingjia"));
// 调用服务层的 selectListView 方法,根据查询条件获取列表视图数据
return R.ok().put("data", fangwupingjiaService.selectListView(ew));
}
/**
*
*/
// 映射处理 /query 路径的请求,用于查询单个房屋评价信息
@RequestMapping("/query")
// 处理查询请求的方法,接收房屋评价实体对象
public R query(FangwupingjiaEntity fangwupingjia) {
// 创建 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<FangwupingjiaEntity> ew = new EntityWrapper<FangwupingjiaEntity>();
// 使用 MPUtil 工具类将实体对象的属性转换为查询条件,并设置到 EntityWrapper 中
ew.allEq(MPUtil.allEQMapPre(fangwupingjia, "fangwupingjia"));
// 调用服务层的 selectView 方法,根据查询条件获取单个视图对象
FangwupingjiaView fangwupingjiaView = fangwupingjiaService.selectView(ew);
// 返回一个成功响应对象 R并设置提示信息和查询结果到响应中
return R.ok("查询房屋评价成功").put("data", fangwupingjiaView);
}
/**
*
*/
// 映射处理 /info/{id} 路径的请求,用于获取指定 ID 的房屋评价详细信息
@RequestMapping("/info/{id}")
// 处理详情请求的方法,接收路径参数 id
public R info(@PathVariable("id") Long id) {
// 调用服务层的 selectById 方法,根据 ID 获取房屋评价实体对象
FangwupingjiaEntity fangwupingjia = fangwupingjiaService.selectById(id);
// 返回一个成功响应对象 R并将实体对象放入响应的 data 字段中
return R.ok().put("data", fangwupingjia);
}
/**
*
*/
// 映射处理 /detail/{id} 路径的请求,用于获取指定 ID 的房屋评价详细信息
@RequestMapping("/detail/{id}")
// 处理详情请求的方法,接收路径参数 id
public R detail(@PathVariable("id") Long id) {
// 调用服务层的 selectById 方法,根据 ID 获取房屋评价实体对象
FangwupingjiaEntity fangwupingjia = fangwupingjiaService.selectById(id);
// 返回一个成功响应对象 R并将实体对象放入响应的 data 字段中
return R.ok().put("data", fangwupingjia);
}
/**
*
*/
// 映射处理 /save 路径的 POST 请求,用于保存新的房屋评价信息
@RequestMapping("/save")
// 处理保存请求的方法,接收请求体中的房屋评价实体对象和 HttpServletRequest 对象
public R save(@RequestBody FangwupingjiaEntity fangwupingjia, HttpServletRequest request) {
// 为房屋评价实体对象生成一个唯一的 ID由当前时间戳加上一个随机数组成
fangwupingjia.setId(new Date().getTime() + new Double(Math.floor(Math.random() * 1000)).longValue());
// 注释掉的代码用于验证实体对象的合法性
//ValidatorUtils.validateEntity(fangwupingjia);
// 调用服务层的 insert 方法,将实体对象插入数据库
fangwupingjiaService.insert(fangwupingjia);
// 返回一个成功响应对象 R
return R.ok();
}
/**
*
*/
// 映射处理 /add 路径的请求,用于前端保存新的房屋评价信息
@RequestMapping("/add")
// 处理保存请求的方法,接收请求体中的房屋评价实体对象和 HttpServletRequest 对象
public R add(@RequestBody FangwupingjiaEntity fangwupingjia, HttpServletRequest request) {
// 为房屋评价实体对象生成一个唯一的 ID由当前时间戳加上一个随机数组成
fangwupingjia.setId(new Date().getTime() + new Double(Math.floor(Math.random() * 1000)).longValue());
// 注释掉的代码用于验证实体对象的合法性
//ValidatorUtils.validateEntity(fangwupingjia);
// 调用服务层的 insert 方法,将实体对象插入数据库
fangwupingjiaService.insert(fangwupingjia);
// 返回一个成功响应对象 R
return R.ok();
}
/**
*
*/
// 映射处理 /update 路径的请求,用于更新房屋评价信息
@RequestMapping("/update")
// 处理更新请求的方法,接收请求体中的房屋评价实体对象和 HttpServletRequest 对象
public R update(@RequestBody FangwupingjiaEntity fangwupingjia, HttpServletRequest request) {
// 注释掉的代码用于验证实体对象的合法性
//ValidatorUtils.validateEntity(fangwupingjia);
// 调用服务层的 updateById 方法,根据 ID 更新实体对象的所有字段
fangwupingjiaService.updateById(fangwupingjia);
// 返回一个成功响应对象 R
return R.ok();
}
/**
*
*/
// 映射处理 /delete 路径的请求,用于批量删除房屋评价信息
@RequestMapping("/delete")
// 处理删除请求的方法,接收请求体中的 ID 数组
public R delete(@RequestBody Long[] ids) {
// 调用服务层的 deleteBatchIds 方法,根据 ID 数组批量删除实体对象
fangwupingjiaService.deleteBatchIds(Arrays.asList(ids));
// 返回一个成功响应对象 R
return R.ok();
}
/**
*
*/
// 映射处理 /remind/{columnName}/{type} 路径的请求,用于统计提醒数量
@RequestMapping("/remind/{columnName}/{type}")
// 处理提醒统计请求的方法,接收路径参数 columnName 和 type以及请求参数 map 和 HttpServletRequest 对象
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type, @RequestParam Map<String, Object> map) {
// 将列名和类型添加到请求参数 map 中
map.put("column", columnName);
map.put("type", type);
// 如果类型为 "2",表示需要处理提醒日期范围
if (type.equals("2")) {
// 创建一个 SimpleDateFormat 对象,用于格式化日期
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
// 获取当前日期的 Calendar 实例
Calendar c = Calendar.getInstance();
// 定义提醒开始日期和结束日期
Date remindStartDate = null;
Date remindEndDate = null;
// 如果请求参数中包含提醒开始日期
if (map.get("remindstart") != null) {
// 将提醒开始日期的偏移量转换为整数
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
// 设置 Calendar 实例的时间为当前日期
c.setTime(new Date());
// 在当前日期的基础上加上提醒开始日期的偏移量
c.add(Calendar.DAY_OF_MONTH, remindStart);
// 获取提醒开始日期
remindStartDate = c.getTime();
// 将格式化后的提醒开始日期添加到请求参数 map 中
map.put("remindstart", sdf.format(remindStartDate));
}
// 如果请求参数中包含提醒结束日期
if (map.get("remindend") != null) {
// 将提醒结束日期的偏移量转换为整数
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
// 设置 Calendar 实例的时间为当前日期
c.setTime(new Date());
// 在当前日期的基础上加上提醒结束日期的偏移量
c.add(Calendar.DAY_OF_MONTH, remindEnd);
// 获取提醒结束日期
remindEndDate = c.getTime();
// 将格式化后的提醒结束日期添加到请求参数 map 中
map.put("remindend", sdf.format(remindEndDate));
}
}
// 创建 MyBatis-Plus 的 Wrapper 对象,用于构建查询条件
Wrapper<FangwupingjiaEntity> wrapper = new EntityWrapper<FangwupingjiaEntity>();
// 如果请求参数中包含提醒开始日期
if (map.get("remindstart") != null) {
// 设置查询条件,要求列值大于等于提醒开始日期
wrapper.ge(columnName, map.get("remindstart"));
}
// 如果请求参数中包含提醒结束日期
if (map.get("remindend") != null) {
// 设置查询条件,要求列值小于等于提醒结束日期
wrapper.le(columnName, map.get("remindend"));
}
// 从请求会话中获取 tableName 属性值并转换为字符串
String tableName = request.getSession().getAttribute("tableName").toString();
// 如果 tableName 为 "fangzhu"(房主)
if (tableName.equals("fangzhu")) {
// 设置查询条件,要求房主账号等于会话中的用户名
wrapper.eq("fangzhuzhanghao", (String) request.getSession().getAttribute("username"));
}
// 如果 tableName 为 "yonghu"(用户)
if (tableName.equals("yonghu")) {
// 设置查询条件,要求用户名等于会话中的用户名
wrapper.eq("yonghuming", (String) request.getSession().getAttribute("username"));
}
// 调用服务层的 selectCount 方法,根据查询条件统计符合条件的记录数量
int count = fangwupingjiaService.selectCount(wrapper);
// 返回一个成功响应对象 R并将统计数量放入响应的 count 字段中
return R.ok().put("count", count);
}
}

@ -0,0 +1,286 @@
package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.FangwuxinxiEntity;
import com.entity.view.FangwuxinxiView;
import com.service.FangwuxinxiService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
/**
*
*
* @author
* @email
* @date 2025-04-04 18:46:21
*/
// 声明该类为 RESTful 风格的控制器,用于处理 HTTP 请求并返回 JSON 格式的响应
@RestController
// 映射该控制器处理的请求路径前缀为 /fangwuxinxi
@RequestMapping("/fangwuxinxi")
public class FangwuxinxiController {
// 自动注入 FangwuxinxiService 服务类的实例,用于调用相关业务逻辑方法
@Autowired
private FangwuxinxiService fangwuxinxiService;
/**
*
*/
// 映射处理 /page 路径的请求,用于获取后端的房屋信息分页列表
@RequestMapping("/page")
// 处理分页请求的方法,接收请求参数、房屋信息实体对象和 HttpServletRequest 对象
public R page(@RequestParam Map<String, Object> params, FangwuxinxiEntity fangwuxinxi, HttpServletRequest request) {
// 从请求的会话中获取 tableName 属性值并转换为字符串
String tableName = request.getSession().getAttribute("tableName").toString();
// 如果 tableName 为 "fangzhu"(房主)
if (tableName.equals("fangzhu")) {
// 将当前会话中的用户名设置为房屋信息实体的房主账号
fangwuxinxi.setFangzhuzhanghao((String) request.getSession().getAttribute("username"));
}
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<FangwuxinxiEntity> ew = new EntityWrapper<FangwuxinxiEntity>();
// 调用服务层的 queryPage 方法进行分页查询,使用 MPUtil 工具类处理排序、范围查询和模糊查询
PageUtils page = fangwuxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, fangwuxinxi), params), params));
// 返回一个成功响应对象 R并将分页数据放入响应的 data 字段中
return R.ok().put("data", page);
}
/**
*
*/
// @IgnoreAuth 注解表示该接口不需要进行身份验证
@IgnoreAuth
// 映射处理 /list 路径的请求,用于获取前端的房屋信息列表
@RequestMapping("/list")
// 处理列表请求的方法,接收请求参数、房屋信息实体对象和 HttpServletRequest 对象
public R list(@RequestParam Map<String, Object> params, FangwuxinxiEntity fangwuxinxi, HttpServletRequest request) {
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<FangwuxinxiEntity> ew = new EntityWrapper<FangwuxinxiEntity>();
// 调用服务层的 queryPage 方法进行分页查询,使用 MPUtil 工具类处理排序、范围查询和模糊查询
PageUtils page = fangwuxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, fangwuxinxi), params), params));
// 返回一个成功响应对象 R并将分页数据放入响应的 data 字段中
return R.ok().put("data", page);
}
/**
*
*/
// 映射处理 /lists 路径的请求,用于获取房屋信息列表
@RequestMapping("/lists")
// 处理列表请求的方法,接收房屋信息实体对象
public R list(FangwuxinxiEntity fangwuxinxi) {
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<FangwuxinxiEntity> ew = new EntityWrapper<FangwuxinxiEntity>();
// 使用 MPUtil 工具类将实体对象的属性转换为查询条件,并设置到 EntityWrapper 中
ew.allEq(MPUtil.allEQMapPre(fangwuxinxi, "fangwuxinxi"));
// 调用服务层的 selectListView 方法,根据查询条件获取列表视图数据
return R.ok().put("data", fangwuxinxiService.selectListView(ew));
}
/**
*
*/
// 映射处理 /query 路径的请求,用于查询单个房屋信息
@RequestMapping("/query")
// 处理查询请求的方法,接收房屋信息实体对象
public R query(FangwuxinxiEntity fangwuxinxi) {
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<FangwuxinxiEntity> ew = new EntityWrapper<FangwuxinxiEntity>();
// 使用 MPUtil 工具类将实体对象的属性转换为查询条件,并设置到 EntityWrapper 中
ew.allEq(MPUtil.allEQMapPre(fangwuxinxi, "fangwuxinxi"));
// 调用服务层的 selectView 方法,根据查询条件获取单个视图对象
FangwuxinxiView fangwuxinxiView = fangwuxinxiService.selectView(ew);
// 返回一个成功响应对象 R并设置提示信息和查询结果到响应中
return R.ok("查询房屋信息成功").put("data", fangwuxinxiView);
}
/**
*
*/
// 映射处理 /info/{id} 路径的请求,用于获取指定 ID 的房屋信息详细内容
@RequestMapping("/info/{id}")
// 处理详情请求的方法,接收路径参数 id
public R info(@PathVariable("id") Long id) {
// 调用服务层的 selectById 方法,根据 ID 获取房屋信息实体对象
FangwuxinxiEntity fangwuxinxi = fangwuxinxiService.selectById(id);
// 返回一个成功响应对象 R并将实体对象放入响应的 data 字段中
return R.ok().put("data", fangwuxinxi);
}
/**
*
*/
// @IgnoreAuth 注解表示该接口不需要进行身份验证
@IgnoreAuth
// 映射处理 /detail/{id} 路径的请求,用于获取指定 ID 的房屋信息详细内容
@RequestMapping("/detail/{id}")
// 处理详情请求的方法,接收路径参数 id
public R detail(@PathVariable("id") Long id) {
// 调用服务层的 selectById 方法,根据 ID 获取房屋信息实体对象
FangwuxinxiEntity fangwuxinxi = fangwuxinxiService.selectById(id);
// 返回一个成功响应对象 R并将实体对象放入响应的 data 字段中
return R.ok().put("data", fangwuxinxi);
}
/**
*
*/
// 映射处理 /save 路径的 POST 请求,用于保存新的房屋信息
@RequestMapping("/save")
// 处理保存请求的方法,接收请求体中的房屋信息实体对象和 HttpServletRequest 对象
public R save(@RequestBody FangwuxinxiEntity fangwuxinxi, HttpServletRequest request) {
// 为房屋信息实体对象生成一个唯一的 ID由当前时间戳加上一个随机数组成
fangwuxinxi.setId(new Date().getTime() + new Double(Math.floor(Math.random() * 1000)).longValue());
// 注释掉的代码用于验证实体对象的合法性
//ValidatorUtils.validateEntity(fangwuxinxi);
// 调用服务层的 insert 方法,将实体对象插入数据库
fangwuxinxiService.insert(fangwuxinxi);
// 返回一个成功响应对象 R
return R.ok();
}
/**
*
*/
// 映射处理 /add 路径的请求,用于前端保存新的房屋信息
@RequestMapping("/add")
// 处理保存请求的方法,接收请求体中的房屋信息实体对象和 HttpServletRequest 对象
public R add(@RequestBody FangwuxinxiEntity fangwuxinxi, HttpServletRequest request) {
// 为房屋信息实体对象生成一个唯一的 ID由当前时间戳加上一个随机数组成
fangwuxinxi.setId(new Date().getTime() + new Double(Math.floor(Math.random() * 1000)).longValue());
// 注释掉的代码用于验证实体对象的合法性
//ValidatorUtils.validateEntity(fangwuxinxi);
// 调用服务层的 insert 方法,将实体对象插入数据库
fangwuxinxiService.insert(fangwuxinxi);
// 返回一个成功响应对象 R
return R.ok();
}
/**
*
*/
// 映射处理 /update 路径的请求,用于更新房屋信息
@RequestMapping("/update")
// 处理更新请求的方法,接收请求体中的房屋信息实体对象和 HttpServletRequest 对象
public R update(@RequestBody FangwuxinxiEntity fangwuxinxi, HttpServletRequest request) {
// 注释掉的代码用于验证实体对象的合法性
//ValidatorUtils.validateEntity(fangwuxinxi);
// 调用服务层的 updateById 方法,根据 ID 更新实体对象的所有字段
fangwuxinxiService.updateById(fangwuxinxi);
// 返回一个成功响应对象 R
return R.ok();
}
/**
*
*/
// 映射处理 /delete 路径的请求,用于批量删除房屋信息
@RequestMapping("/delete")
// 处理删除请求的方法,接收请求体中的 ID 数组
public R delete(@RequestBody Long[] ids) {
// 调用服务层的 deleteBatchIds 方法,根据 ID 数组批量删除实体对象
fangwuxinxiService.deleteBatchIds(Arrays.asList(ids));
// 返回一个成功响应对象 R
return R.ok();
}
/**
*
*/
// 映射处理 /remind/{columnName}/{type} 路径的请求,用于统计提醒数量
@RequestMapping("/remind/{columnName}/{type}")
// 处理提醒统计请求的方法,接收路径参数 columnName 和 type以及请求参数 map 和 HttpServletRequest 对象
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type, @RequestParam Map<String, Object> map) {
// 将列名和类型添加到请求参数 map 中
map.put("column", columnName);
map.put("type", type);
// 如果类型为 "2",表示需要处理提醒日期范围
if (type.equals("2")) {
// 创建一个 SimpleDateFormat 对象,用于格式化日期
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
// 获取当前日期的 Calendar 实例
Calendar c = Calendar.getInstance();
// 定义提醒开始日期和结束日期
Date remindStartDate = null;
Date remindEndDate = null;
// 如果请求参数中包含提醒开始日期
if (map.get("remindstart") != null) {
// 将提醒开始日期的偏移量转换为整数
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
// 设置 Calendar 实例的时间为当前日期
c.setTime(new Date());
// 在当前日期的基础上加上提醒开始日期的偏移量
c.add(Calendar.DAY_OF_MONTH, remindStart);
// 获取提醒开始日期
remindStartDate = c.getTime();
// 将格式化后的提醒开始日期添加到请求参数 map 中
map.put("remindstart", sdf.format(remindStartDate));
}
// 如果请求参数中包含提醒结束日期
if (map.get("remindend") != null) {
// 将提醒结束日期的偏移量转换为整数
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
// 设置 Calendar 实例的时间为当前日期
c.setTime(new Date());
// 在当前日期的基础上加上提醒结束日期的偏移量
c.add(Calendar.DAY_OF_MONTH, remindEnd);
// 获取提醒结束日期
remindEndDate = c.getTime();
// 将格式化后的提醒结束日期添加到请求参数 map 中
map.put("remindend", sdf.format(remindEndDate));
}
}
// 创建一个 MyBatis-Plus 的 Wrapper 对象,用于构建查询条件
Wrapper<FangwuxinxiEntity> wrapper = new EntityWrapper<FangwuxinxiEntity>();
// 如果请求参数中包含提醒开始日期
if (map.get("remindstart") != null) {
// 设置查询条件,要求列值大于等于提醒开始日期
wrapper.ge(columnName, map.get("remindstart"));
}
// 如果请求参数中包含提醒结束日期
if (map.get("remindend") != null) {
// 设置查询条件,要求列值小于等于提醒结束日期
wrapper.le(columnName, map.get("remindend"));
}
// 从请求的会话中获取 tableName 属性值并转换为字符串
String tableName = request.getSession().getAttribute("tableName").toString();
// 如果 tableName 为 "fangzhu"(房主)
if (tableName.equals("fangzhu")) {
// 设置查询条件,要求房主账号等于当前会话中的用户名
wrapper.eq("fangzhuzhanghao", (String) request.getSession().getAttribute("username"));
}
// 调用服务层的 selectCount 方法,根据查询条件统计符合条件的记录数量
int count = fangwuxinxiService.selectCount(wrapper);
// 返回一个成功响应对象 R并将统计数量放入响应的 count 字段中
return R.ok().put("count", count);
}
}

@ -0,0 +1,391 @@
package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.FangzhuEntity;
import com.entity.view.FangzhuView;
import com.service.FangzhuService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
/**
*
*
* @author
* @email
* @date 2025-04-04 18:46:21
*/
// 标记该类为 RESTful 风格的控制器,用于处理 HTTP 请求并返回 JSON 格式的响应
@RestController
// 映射该控制器处理的请求路径前缀为 /fangzhu
@RequestMapping("/fangzhu")
public class FangzhuController {
// 自动注入 FangzhuService 服务实例,用于调用与房主相关的业务逻辑方法
@Autowired
private FangzhuService fangzhuService;
// 自动注入 TokenService 服务实例,用于生成和管理令牌
@Autowired
private TokenService tokenService;
/**
*
*/
// @IgnoreAuth 注解表示该接口不需要进行身份验证
@IgnoreAuth
// 映射处理 /login 路径的请求,用于房主登录
@RequestMapping(value = "/login")
// 处理登录请求的方法,接收用户名、密码、验证码和 HttpServletRequest 对象
public R login(String username, String password, String captcha, HttpServletRequest request) {
// 根据用户名查询房主实体对象
FangzhuEntity user = fangzhuService.selectOne(new EntityWrapper<FangzhuEntity>().eq("fangzhuzhanghao", username));
// 如果用户不存在或者密码不匹配
if (user == null || !user.getMima().equals(password)) {
// 返回错误响应,提示账号或密码不正确
return R.error("账号或密码不正确");
}
// 生成令牌,包含用户 ID、用户名、用户类型和用户角色信息
String token = tokenService.generateToken(user.getId(), username, "fangzhu", "房主");
// 返回成功响应,并将令牌放入响应的 token 字段中
return R.ok().put("token", token);
}
/**
*
*/
// @IgnoreAuth 注解表示该接口不需要进行身份验证
@IgnoreAuth
// 映射处理 /register 路径的请求,用于房主注册
@RequestMapping("/register")
// 处理注册请求的方法,接收请求体中的房主实体对象
public R register(@RequestBody FangzhuEntity fangzhu) {
// 注释掉的代码用于验证实体对象的合法性
//ValidatorUtils.validateEntity(fangzhu);
// 根据用户名查询房主实体对象
FangzhuEntity user = fangzhuService.selectOne(new EntityWrapper<FangzhuEntity>().eq("fangzhuzhanghao", fangzhu.getFangzhuzhanghao()));
// 如果用户已存在
if (user != null) {
// 返回错误响应,提示注册用户已存在
return R.error("注册用户已存在");
}
// 生成一个唯一的用户 ID使用当前时间戳
Long uId = new Date().getTime();
// 设置房主实体对象的 ID
fangzhu.setId(uId);
// 调用服务层的 insert 方法,将房主实体对象插入数据库
fangzhuService.insert(fangzhu);
// 返回成功响应
return R.ok();
}
/**
* 退
*/
// 映射处理 /logout 路径的请求,用于房主退出登录
@RequestMapping("/logout")
// 处理退出请求的方法,接收 HttpServletRequest 对象
public R logout(HttpServletRequest request) {
// 使当前会话失效
request.getSession().invalidate();
// 返回成功响应,提示退出成功
return R.ok("退出成功");
}
/**
* session
*/
// 映射处理 /session 路径的请求,用于获取当前会话中的房主信息
@RequestMapping("/session")
// 处理获取会话信息请求的方法,接收 HttpServletRequest 对象
public R getCurrUser(HttpServletRequest request) {
// 从会话中获取用户 ID
Long id = (Long) request.getSession().getAttribute("userId");
// 根据用户 ID 查询房主实体对象
FangzhuEntity user = fangzhuService.selectById(id);
// 返回成功响应,并将房主实体对象放入响应的 data 字段中
return R.ok().put("data", user);
}
/**
*
*/
// @IgnoreAuth 注解表示该接口不需要进行身份验证
@IgnoreAuth
// 映射处理 /resetPass 路径的请求,用于重置房主密码
@RequestMapping(value = "/resetPass")
// 处理密码重置请求的方法,接收用户名和 HttpServletRequest 对象
public R resetPass(String username, HttpServletRequest request) {
// 根据用户名查询房主实体对象
FangzhuEntity user = fangzhuService.selectOne(new EntityWrapper<FangzhuEntity>().eq("fangzhuzhanghao", username));
// 如果用户不存在
if (user == null) {
// 返回错误响应,提示账号不存在
return R.error("账号不存在");
}
// 将用户密码重置为 123456
user.setMima("123456");
// 调用服务层的 updateById 方法,更新用户信息
fangzhuService.updateById(user);
// 返回成功响应,提示密码已重置为 123456
return R.ok("密码已重置为123456");
}
/**
*
*/
// 映射处理 /page 路径的请求,用于获取后端的房主页列表数据
@RequestMapping("/page")
// 处理分页请求的方法,接收请求参数、房主实体对象和 HttpServletRequest 对象
public R page(@RequestParam Map<String, Object> params, FangzhuEntity fangzhu, HttpServletRequest request) {
// 创建 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<FangzhuEntity> ew = new EntityWrapper<FangzhuEntity>();
// 调用服务层的 queryPage 方法进行分页查询,使用 MPUtil 工具类处理排序、范围查询和模糊查询
PageUtils page = fangzhuService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, fangzhu), params), params));
// 返回一个成功响应对象 R并将分页数据放入响应的 data 字段中
return R.ok().put("data", page);
}
/**
*
*/
// 映射处理 /list 路径的请求,用于获取前端的房主列表数据
@RequestMapping("/list")
// 处理列表请求的方法,接收请求参数、房主实体对象和 HttpServletRequest 对象
public R list(@RequestParam Map<String, Object> params, FangzhuEntity fangzhu, HttpServletRequest request) {
// 创建 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<FangzhuEntity> ew = new EntityWrapper<FangzhuEntity>();
// 调用服务层的 queryPage 方法进行分页查询,使用 MPUtil 工具类处理排序、范围查询和模糊查询
PageUtils page = fangzhuService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, fangzhu), params), params));
// 返回一个成功响应对象 R并将分页数据放入响应的 data 字段中
return R.ok().put("data", page);
}
/**
*
*/
// 映射处理 /lists 路径的请求,用于获取房主列表数据
@RequestMapping("/lists")
// 处理列表请求的方法,接收房主实体对象
public R list(FangzhuEntity fangzhu) {
// 创建 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<FangzhuEntity> ew = new EntityWrapper<FangzhuEntity>();
// 使用 MPUtil 工具类将实体对象的属性转换为查询条件,并设置到 EntityWrapper 中
ew.allEq(MPUtil.allEQMapPre(fangzhu, "fangzhu"));
// 调用服务层的 selectListView 方法,根据查询条件获取列表视图数据
return R.ok().put("data", fangzhuService.selectListView(ew));
}
/**
*
*/
// 映射处理 /query 路径的请求,用于查询单个房主信息
@RequestMapping("/query")
// 处理查询请求的方法,接收房主实体对象
public R query(FangzhuEntity fangzhu) {
// 创建 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<FangzhuEntity> ew = new EntityWrapper<FangzhuEntity>();
// 使用 MPUtil 工具类将实体对象的属性转换为查询条件,并设置到 EntityWrapper 中
ew.allEq(MPUtil.allEQMapPre(fangzhu, "fangzhu"));
// 调用服务层的 selectView 方法,根据查询条件获取单个视图对象
FangzhuView fangzhuView = fangzhuService.selectView(ew);
// 返回一个成功响应对象 R并设置提示信息和查询结果到响应中
return R.ok("查询房主成功").put("data", fangzhuView);
}
/**
*
*/
// 映射处理 /info/{id} 路径的请求,用于获取指定 ID 的房主详细信息
@RequestMapping("/info/{id}")
// 处理详情请求的方法,接收路径参数 id
public R info(@PathVariable("id") Long id) {
// 调用服务层的 selectById 方法,根据 ID 获取房主实体对象
FangzhuEntity fangzhu = fangzhuService.selectById(id);
// 返回一个成功响应对象 R并将实体对象放入响应的 data 字段中
return R.ok().put("data", fangzhu);
}
/**
*
*/
// 映射处理 /detail/{id} 路径的请求,用于获取指定 ID 的房主详细信息
@RequestMapping("/detail/{id}")
// 处理详情请求的方法,接收路径参数 id
public R detail(@PathVariable("id") Long id) {
// 调用服务层的 selectById 方法,根据 ID 获取房主实体对象
FangzhuEntity fangzhu = fangzhuService.selectById(id);
// 返回一个成功响应对象 R并将实体对象放入响应的 data 字段中
return R.ok().put("data", fangzhu);
}
/**
*
*/
// 映射处理 /save 路径的 POST 请求,用于保存新的房主信息
@RequestMapping("/save")
// 处理保存请求的方法,接收请求体中的房主实体对象和 HttpServletRequest 对象
public R save(@RequestBody FangzhuEntity fangzhu, HttpServletRequest request) {
// 为房主实体对象生成一个唯一的 ID由当前时间戳加上一个随机数组成
fangzhu.setId(new Date().getTime() + new Double(Math.floor(Math.random() * 1000)).longValue());
// 注释掉的代码用于验证实体对象的合法性
//ValidatorUtils.validateEntity(fangzhu);
// 根据用户名查询房主实体对象
FangzhuEntity user = fangzhuService.selectOne(new EntityWrapper<FangzhuEntity>().eq("fangzhuzhanghao", fangzhu.getFangzhuzhanghao()));
// 如果用户已存在
if (user != null) {
// 返回错误响应,提示用户已存在
return R.error("用户已存在");
}
// 重新设置房主实体对象的 ID 为当前时间戳
fangzhu.setId(new Date().getTime());
// 调用服务层的 insert 方法,将房主实体对象插入数据库
fangzhuService.insert(fangzhu);
// 返回成功响应
return R.ok();
}
/**
*
*/
// 映射处理 /add 路径的请求,用于前端保存新的房主信息
@RequestMapping("/add")
// 处理保存请求的方法,接收请求体中的房主实体对象和 HttpServletRequest 对象
public R add(@RequestBody FangzhuEntity fangzhu, HttpServletRequest request) {
// 为房主实体对象生成一个唯一的 ID由当前时间戳加上一个随机数组成
fangzhu.setId(new Date().getTime() + new Double(Math.floor(Math.random() * 1000)).longValue());
// 注释掉的代码用于验证实体对象的合法性
//ValidatorUtils.validateEntity(fangzhu);
// 根据用户名查询房主实体对象
FangzhuEntity user = fangzhuService.selectOne(new EntityWrapper<FangzhuEntity>().eq("fangzhuzhanghao", fangzhu.getFangzhuzhanghao()));
// 如果用户已存在
if (user != null) {
// 返回错误响应,提示用户已存在
return R.error("用户已存在");
}
// 重新设置房主实体对象的 ID 为当前时间戳
fangzhu.setId(new Date().getTime());
// 调用服务层的 insert 方法,将房主实体对象插入数据库
fangzhuService.insert(fangzhu);
// 返回成功响应
return R.ok();
}
/**
*
*/
// 映射处理 /update 路径的请求,用于更新房主信息
@RequestMapping("/update")
// 处理更新请求的方法,接收请求体中的房主实体对象和 HttpServletRequest 对象
public R update(@RequestBody FangzhuEntity fangzhu, HttpServletRequest request) {
// 注释掉的代码用于验证实体对象的合法性
//ValidatorUtils.validateEntity(fangzhu);
// 调用服务层的 updateById 方法,根据 ID 更新实体对象的所有字段
fangzhuService.updateById(fangzhu);
// 返回成功响应
return R.ok();
}
/**
*
*/
// 映射处理 /delete 路径的请求,用于批量删除房主信息
@RequestMapping("/delete")
// 处理删除请求的方法,接收请求体中的 ID 数组
public R delete(@RequestBody Long[] ids) {
// 调用服务层的 deleteBatchIds 方法,根据 ID 数组批量删除实体对象
fangzhuService.deleteBatchIds(Arrays.asList(ids));
// 返回成功响应
return R.ok();
}
/**
*
*/
// 映射处理 /remind/{columnName}/{type} 路径的请求,用于统计提醒数量
@RequestMapping("/remind/{columnName}/{type}")
// 处理提醒统计请求的方法,接收路径参数 columnName 和 type以及请求参数 map 和 HttpServletRequest 对象
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type, @RequestParam Map<String, Object> map) {
// 将列名和类型添加到请求参数 map 中
map.put("column", columnName);
map.put("type", type);
// 如果类型为 "2",表示需要处理提醒日期范围
if (type.equals("2")) {
// 创建一个 SimpleDateFormat 对象,用于格式化日期
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
// 获取当前日期的 Calendar 实例
Calendar c = Calendar.getInstance();
// 定义提醒开始日期和结束日期
Date remindStartDate = null;
Date remindEndDate = null;
// 如果请求参数中包含提醒开始日期
if (map.get("remindstart") != null) {
// 将提醒开始日期的偏移量转换为整数
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
// 设置 Calendar 实例的时间为当前日期
c.setTime(new Date());
// 在当前日期的基础上加上提醒开始日期的偏移量
c.add(Calendar.DAY_OF_MONTH, remindStart);
// 获取提醒开始日期
remindStartDate = c.getTime();
// 将格式化后的提醒开始日期添加到请求参数 map 中
map.put("remindstart", sdf.format(remindStartDate));
}
// 如果请求参数中包含提醒结束日期
if (map.get("remindend") != null) {
// 将提醒结束日期的偏移量转换为整数
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
// 设置 Calendar 实例的时间为当前日期
c.setTime(new Date());
// 在当前日期的基础上加上提醒结束日期的偏移量
c.add(Calendar.DAY_OF_MONTH, remindEnd);
// 获取提醒结束日期
remindEndDate = c.getTime();
// 将格式化后的提醒结束日期添加到请求参数 map 中
map.put("remindend", sdf.format(remindEndDate));
}
}
// 创建 MyBatis-Plus 的 Wrapper 对象,用于构建查询条件
Wrapper<FangzhuEntity> wrapper = new EntityWrapper<FangzhuEntity>();
// 如果请求参数中包含提醒开始日期
if (map.get("remindstart") != null) {
// 设置查询条件,要求列值大于等于提醒开始日期
wrapper.ge(columnName, map.get("remindstart"));
}
// 如果请求参数中包含提醒结束日期
if (map.get("remindend") != null) {
// 设置查询条件,要求列值小于等于提醒结束日期
wrapper.le(columnName, map.get("remindend"));
}
// 调用服务层的 selectCount 方法,根据查询条件统计符合条件的记录数量
int count = fangzhuService.selectCount(wrapper);
// 返回一个成功响应对象 R并将统计数量放入响应的 count 字段中
return R.ok().put("count", count);
}
}

@ -0,0 +1,155 @@
package com.controller;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.UUID;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.util.ResourceUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.ConfigEntity;
import com.entity.EIException;
import com.service.ConfigService;
import com.utils.R;
/**
*
*/
// 标记该类为 RESTful 风格的控制器,用于处理 HTTP 请求并返回 JSON 格式的响应
@RestController
// 映射该控制器处理的请求路径前缀为 "file"
@RequestMapping("file")
// 抑制编译器的泛型类型检查警告
@SuppressWarnings({"unchecked", "rawtypes"})
public class FileController {
// 自动注入 ConfigService 服务实例,用于操作配置相关的数据
@Autowired
private ConfigService configService;
/**
*
*/
// 映射处理 /upload 路径的请求,用于文件上传
@RequestMapping("/upload")
// 处理文件上传请求的方法,接收上传的文件和类型参数,可能会抛出异常
public R upload(@RequestParam("file") MultipartFile file, String type) throws Exception {
// 检查上传的文件是否为空
if (file.isEmpty()) {
// 若为空,抛出异常提示上传文件不能为空
throw new EIException("上传文件不能为空");
}
// 获取文件扩展名
String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".") + 1);
// 获取 classpath 下 static 目录的路径
File path = new File(ResourceUtils.getURL("classpath:static").getPath());
// 检查该路径对应的目录是否存在
if (!path.exists()) {
// 若不存在,将路径设置为空字符串对应的文件对象
path = new File("");
}
// 构建上传文件的目录对象
File upload = new File(path.getAbsolutePath(), "/upload/");
// 检查上传目录是否存在
if (!upload.exists()) {
// 若不存在,创建该目录及其父目录
upload.mkdirs();
}
// 生成新的文件名,由当前时间戳和文件扩展名组成
String fileName = new Date().getTime() + "." + fileExt;
// 构建目标文件对象
File dest = new File(upload.getAbsolutePath() + "/" + fileName);
// 将上传的文件传输到目标文件
file.transferTo(dest);
// 检查类型参数是否不为空且等于 "1"
if (StringUtils.isNotBlank(type) && type.equals("1")) {
// 根据配置名称查询配置实体对象
ConfigEntity configEntity = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));
// 若配置实体对象不存在
if (configEntity == null) {
// 创建新的配置实体对象
configEntity = new ConfigEntity();
// 设置配置名称
configEntity.setName("faceFile");
// 设置配置值为新生成的文件名
configEntity.setValue(fileName);
} else {
// 若配置实体对象存在,更新配置值为新生成的文件名
configEntity.setValue(fileName);
}
// 插入或更新配置实体对象
configService.insertOrUpdate(configEntity);
}
// 返回成功响应,并将文件名放入响应的 file 字段中
return R.ok().put("file", fileName);
}
/**
*
*/
// @IgnoreAuth 注解表示该接口不需要进行身份验证
@IgnoreAuth
// 映射处理 /download 路径的请求,用于文件下载
@RequestMapping("/download")
// 处理文件下载请求的方法,接收文件名参数,返回包含文件字节数组的响应实体
public ResponseEntity<byte[]> download(@RequestParam String fileName) {
try {
// 获取 classpath 下 static 目录的路径
File path = new File(ResourceUtils.getURL("classpath:static").getPath());
// 检查该路径对应的目录是否存在
if (!path.exists()) {
// 若不存在,将路径设置为空字符串对应的文件对象
path = new File("");
}
// 构建上传文件的目录对象
File upload = new File(path.getAbsolutePath(), "/upload/");
// 检查上传目录是否存在
if (!upload.exists()) {
// 若不存在,创建该目录及其父目录
upload.mkdirs();
}
// 构建要下载的文件对象
File file = new File(upload.getAbsolutePath() + "/" + fileName);
// 检查文件是否存在
if (file.exists()) {
// 注释掉的代码用于检查用户是否有读取该文件的权限
/*if(!fileService.canRead(file, SessionManager.getSessionUser())){
getResponse().sendError(403);
}*/
// 创建 HTTP 响应头对象
HttpHeaders headers = new HttpHeaders();
// 设置响应内容类型为二进制流
headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
// 设置响应内容的处理方式为附件下载,并指定文件名
headers.setContentDispositionFormData("attachment", fileName);
// 将文件内容读取为字节数组,并封装在响应实体中返回,状态码为 201 Created
return new ResponseEntity<byte[]>(FileUtils.readFileToByteArray(file), headers, HttpStatus.CREATED);
}
} catch (IOException e) {
// 捕获并打印异常堆栈信息
e.printStackTrace();
}
// 若出现异常或文件不存在,返回状态码为 500 Internal Server Error 的响应实体
return new ResponseEntity<byte[]>(HttpStatus.INTERNAL_SERVER_ERROR);
}
}

@ -0,0 +1,298 @@
package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.HetongxinxiEntity;
import com.entity.view.HetongxinxiView;
import com.service.HetongxinxiService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
/**
*
*
* @author
* @email
* @date 2025-04-04 18:46:21
*/
// 声明该类为一个 RESTful 风格的控制器,用于处理 HTTP 请求并返回 JSON 格式的响应
@RestController
// 为该控制器映射请求路径前缀为 /hetongxinxi
@RequestMapping("/hetongxinxi")
public class HetongxinxiController {
// 自动注入 HetongxinxiService 服务类的实例,以便在本控制器中调用其业务方法
@Autowired
private HetongxinxiService hetongxinxiService;
/**
*
*/
// 映射处理 /page 路径的请求,用于获取后端的合同信息分页列表
@RequestMapping("/page")
// 处理分页请求的方法,接收请求参数、合同信息实体对象以及 HttpServletRequest 对象
public R page(@RequestParam Map<String, Object> params, HetongxinxiEntity hetongxinxi, HttpServletRequest request) {
// 从请求的会话中获取名为 "tableName" 的属性值,并转换为字符串类型
String tableName = request.getSession().getAttribute("tableName").toString();
// 如果获取到的 tableName 等于 "yonghu"(用户)
if (tableName.equals("yonghu")) {
// 将当前会话中名为 "username" 的属性值(用户名)设置到合同信息实体的 yonghuming 字段中
hetongxinxi.setYonghuming((String) request.getSession().getAttribute("username"));
}
// 如果获取到的 tableName 等于 "fangzhu"(房主)
if (tableName.equals("fangzhu")) {
// 将当前会话中名为 "username" 的属性值(用户名)设置到合同信息实体的 fangzhuzhanghao 字段中
hetongxinxi.setFangzhuzhanghao((String) request.getSession().getAttribute("username"));
}
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<HetongxinxiEntity> ew = new EntityWrapper<HetongxinxiEntity>();
// 调用 HetongxinxiService 的 queryPage 方法进行分页查询,使用 MPUtil 工具类处理排序、范围查询和模糊查询
PageUtils page = hetongxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, hetongxinxi), params), params));
// 返回一个成功的响应对象 R并将分页数据放置在响应的 "data" 字段中
return R.ok().put("data", page);
}
/**
*
*/
// 映射处理 /list 路径的请求,用于获取前端的合同信息列表
@RequestMapping("/list")
// 处理列表请求的方法,接收请求参数、合同信息实体对象以及 HttpServletRequest 对象
public R list(@RequestParam Map<String, Object> params, HetongxinxiEntity hetongxinxi, HttpServletRequest request) {
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<HetongxinxiEntity> ew = new EntityWrapper<HetongxinxiEntity>();
// 调用 HetongxinxiService 的 queryPage 方法进行分页查询,使用 MPUtil 工具类处理排序、范围查询和模糊查询
PageUtils page = hetongxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, hetongxinxi), params), params));
// 返回一个成功的响应对象 R并将分页数据放置在响应的 "data" 字段中
return R.ok().put("data", page);
}
/**
*
*/
// 映射处理 /lists 路径的请求,用于获取合同信息的列表
@RequestMapping("/lists")
// 处理列表请求的方法,接收合同信息实体对象
public R list(HetongxinxiEntity hetongxinxi) {
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<HetongxinxiEntity> ew = new EntityWrapper<HetongxinxiEntity>();
// 使用 MPUtil 工具类将实体对象的属性转换为查询条件,并设置到 EntityWrapper 中
ew.allEq(MPUtil.allEQMapPre(hetongxinxi, "hetongxinxi"));
// 调用 HetongxinxiService 的 selectListView 方法,根据查询条件获取列表视图数据
return R.ok().put("data", hetongxinxiService.selectListView(ew));
}
/**
*
*/
// 映射处理 /query 路径的请求,用于查询合同信息
@RequestMapping("/query")
// 处理查询请求的方法,接收合同信息实体对象
public R query(HetongxinxiEntity hetongxinxi) {
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<HetongxinxiEntity> ew = new EntityWrapper<HetongxinxiEntity>();
// 使用 MPUtil 工具类将实体对象的属性转换为查询条件,并设置到 EntityWrapper 中
ew.allEq(MPUtil.allEQMapPre(hetongxinxi, "hetongxinxi"));
// 调用 HetongxinxiService 的 selectView 方法,根据查询条件获取合同信息视图对象
HetongxinxiView hetongxinxiView = hetongxinxiService.selectView(ew);
// 返回一个成功的响应对象 R附带查询成功的提示信息并将查询到的数据放置在响应的 "data" 字段中
return R.ok("查询合同信息成功").put("data", hetongxinxiView);
}
/**
*
*/
// 映射处理 /info/{id} 路径的请求,用于获取指定 ID 的合同信息详情
@RequestMapping("/info/{id}")
// 处理详情请求的方法,接收路径参数 id
public R info(@PathVariable("id") Long id) {
// 调用 HetongxinxiService 的 selectById 方法,根据 ID 获取合同信息实体对象
HetongxinxiEntity hetongxinxi = hetongxinxiService.selectById(id);
// 返回一个成功的响应对象 R并将获取到的合同信息实体对象放置在响应的 "data" 字段中
return R.ok().put("data", hetongxinxi);
}
/**
*
*/
// 映射处理 /detail/{id} 路径的请求,用于获取指定 ID 的合同信息详情
@RequestMapping("/detail/{id}")
// 处理详情请求的方法,接收路径参数 id
public R detail(@PathVariable("id") Long id) {
// 调用 HetongxinxiService 的 selectById 方法,根据 ID 获取合同信息实体对象
HetongxinxiEntity hetongxinxi = hetongxinxiService.selectById(id);
// 返回一个成功的响应对象 R并将获取到的合同信息实体对象放置在响应的 "data" 字段中
return R.ok().put("data", hetongxinxi);
}
/**
*
*/
// 映射处理 /save 路径的请求,用于在后端保存合同信息
@RequestMapping("/save")
// 处理保存请求的方法,接收请求体中的合同信息实体对象以及 HttpServletRequest 对象
public R save(@RequestBody HetongxinxiEntity hetongxinxi, HttpServletRequest request) {
// 为合同信息实体对象生成一个唯一的 ID由当前时间戳加上一个 0 到 999 的随机整数组成
hetongxinxi.setId(new Date().getTime() + new Double(Math.floor(Math.random() * 1000)).longValue());
// 注释掉的代码用于验证实体对象的合法性
//ValidatorUtils.validateEntity(hetongxinxi);
// 调用 HetongxinxiService 的 insert 方法,将合同信息实体对象插入数据库
hetongxinxiService.insert(hetongxinxi);
// 返回一个成功的响应对象 R
return R.ok();
}
/**
*
*/
// 映射处理 /add 路径的请求,用于在前端保存合同信息
@RequestMapping("/add")
// 处理保存请求的方法,接收请求体中的合同信息实体对象以及 HttpServletRequest 对象
public R add(@RequestBody HetongxinxiEntity hetongxinxi, HttpServletRequest request) {
// 为合同信息实体对象生成一个唯一的 ID由当前时间戳加上一个 0 到 999 的随机整数组成
hetongxinxi.setId(new Date().getTime() + new Double(Math.floor(Math.random() * 1000)).longValue());
// 注释掉的代码用于验证实体对象的合法性
//ValidatorUtils.validateEntity(hetongxinxi);
// 调用 HetongxinxiService 的 insert 方法,将合同信息实体对象插入数据库
hetongxinxiService.insert(hetongxinxi);
// 返回一个成功的响应对象 R
return R.ok();
}
/**
*
*/
// 映射处理 /update 路径的请求,用于更新合同信息
@RequestMapping("/update")
// 处理更新请求的方法,接收请求体中的合同信息实体对象以及 HttpServletRequest 对象
public R update(@RequestBody HetongxinxiEntity hetongxinxi, HttpServletRequest request) {
// 注释掉的代码用于验证实体对象的合法性
//ValidatorUtils.validateEntity(hetongxinxi);
// 调用 HetongxinxiService 的 updateById 方法,根据 ID 更新合同信息实体对象的所有字段
hetongxinxiService.updateById(hetongxinxi);
// 返回一个成功的响应对象 R
return R.ok();
}
/**
*
*/
// 映射处理 /delete 路径的请求,用于删除合同信息
@RequestMapping("/delete")
// 处理删除请求的方法,接收请求体中的 ID 数组
public R delete(@RequestBody Long[] ids) {
// 调用 HetongxinxiService 的 deleteBatchIds 方法,根据 ID 数组批量删除合同信息实体对象
hetongxinxiService.deleteBatchIds(Arrays.asList(ids));
// 返回一个成功的响应对象 R
return R.ok();
}
/**
*
*/
// 映射处理 /remind/{columnName}/{type} 路径的请求,用于统计符合特定条件的合同信息数量(提醒相关)
@RequestMapping("/remind/{columnName}/{type}")
// 处理提醒统计请求的方法,接收路径参数 columnName 和 type请求参数 map 以及 HttpServletRequest 对象
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type, @RequestParam Map<String, Object> map) {
// 将路径参数 columnName 放入请求参数 map 中,键为 "column"
map.put("column", columnName);
// 将路径参数 type 放入请求参数 map 中,键为 "type"
map.put("type", type);
// 如果路径参数 type 的值等于 "2"
if (type.equals("2")) {
// 创建一个 SimpleDateFormat 对象,用于格式化日期,格式为 "yyyy-MM-dd"
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
// 获取当前的日历实例
Calendar c = Calendar.getInstance();
// 定义提醒开始日期变量,初始值为 null
Date remindStartDate = null;
// 定义提醒结束日期变量,初始值为 null
Date remindEndDate = null;
// 如果请求参数 map 中存在键为 "remindstart" 的值
if (map.get("remindstart") != null) {
// 将 "remindstart" 的值转换为整数类型,代表提醒开始的天数偏移量
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
// 设置日历实例的时间为当前日期
c.setTime(new Date());
// 在当前日期的基础上加上提醒开始的天数偏移量
c.add(Calendar.DAY_OF_MONTH, remindStart);
// 获取计算后的提醒开始日期
remindStartDate = c.getTime();
// 将格式化后的提醒开始日期放入请求参数 map 中,键为 "remindstart"
map.put("remindstart", sdf.format(remindStartDate));
}
// 如果请求参数 map 中存在键为 "remindend" 的值
if (map.get("remindend") != null) {
// 将 "remindend" 的值转换为整数类型,代表提醒结束的天数偏移量
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
// 设置日历实例的时间为当前日期
c.setTime(new Date());
// 在当前日期的基础上加上提醒结束的天数偏移量
c.add(Calendar.DAY_OF_MONTH, remindEnd);
// 获取计算后的提醒结束日期
remindEndDate = c.getTime();
// 将格式化后的提醒结束日期放入请求参数 map 中,键为 "remindend"
map.put("remindend", sdf.format(remindEndDate));
}
}
// 创建一个 MyBatis-Plus 的 Wrapper 对象,具体类型为 EntityWrapper<HetongxinxiEntity>,用于构建查询条件
Wrapper<HetongxinxiEntity> wrapper = new EntityWrapper<HetongxinxiEntity>();
// 如果请求参数 map 中存在键为 "remindstart" 的值
if (map.get("remindstart") != null) {
// 设置查询条件,要求查询结果中 columnName 对应的字段值大于等于提醒开始日期
wrapper.ge(columnName, map.get("remindstart"));
}
// 如果请求参数 map 中存在键为 "remindend" 的值
if (map.get("remindend") != null) {
// 设置查询条件,要求查询结果中 columnName 对应的字段值小于等于提醒结束日期
wrapper.le(columnName, map.get("remindend"));
}
// 从请求的会话中获取名为 "tableName" 的属性值,并转换为字符串类型
String tableName = request.getSession().getAttribute("tableName").toString();
// 如果获取到的 tableName 等于 "yonghu"(用户)
if (tableName.equals("yonghu")) {
// 设置查询条件,要求查询结果中 yonghuming 字段的值等于当前会话中名为 "username" 的属性值(用户名)
wrapper.eq("yonghuming", (String) request.getSession().getAttribute("username"));
}
// 如果获取到的 tableName 等于 "fangzhu"(房主)
if (tableName.equals("fangzhu")) {
// 设置查询条件,要求查询结果中 fangzhuzhanghao 字段的值等于当前会话中名为 "username" 的属性值(用户名)
wrapper.eq("fangzhuzhanghao", (String) request.getSession().getAttribute("username"));
}
// 调用 HetongxinxiService 的 selectCount 方法,根据构建的查询条件统计符合条件的记录数量
int count = hetongxinxiService.selectCount(wrapper);
// 返回一个成功的响应对象 R并将统计数量放置在响应的 "count" 字段中
return R.ok().put("count", count);
}
}

@ -0,0 +1,285 @@
package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.MessagesEntity;
import com.entity.view.MessagesView;
import com.service.MessagesService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
/**
*
*
* @author
* @email
* @date 2025-04-04 18:46:21
*/
// 声明该类为一个 RESTful 风格的控制器,用于处理 HTTP 请求并返回 JSON 格式的响应
@RestController
// 为该控制器映射请求路径前缀为 /messages
@RequestMapping("/messages")
public class MessagesController {
// 自动注入 MessagesService 服务类的实例,以便在本控制器中调用其业务方法
@Autowired
private MessagesService messagesService;
/**
*
*/
// 映射处理 /page 路径的请求,用于获取后端的留言板信息分页列表
@RequestMapping("/page")
// 处理分页请求的方法,接收请求参数、留言板信息实体对象以及 HttpServletRequest 对象
public R page(@RequestParam Map<String, Object> params, MessagesEntity messages, HttpServletRequest request) {
// 如果当前会话中的角色属性值不是 "管理员"
if (!request.getSession().getAttribute("role").toString().equals("管理员")) {
// 将当前会话中的用户 ID 属性值设置到留言板信息实体的 userid 字段中
messages.setUserid((Long) request.getSession().getAttribute("userId"));
}
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<MessagesEntity> ew = new EntityWrapper<MessagesEntity>();
// 调用 MessagesService 的 queryPage 方法进行分页查询,使用 MPUtil 工具类处理排序、范围查询和模糊查询
PageUtils page = messagesService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, messages), params), params));
// 返回一个成功的响应对象 R并将分页数据放置在响应的 "data" 字段中
return R.ok().put("data", page);
}
/**
*
*/
// 映射处理 /list 路径的请求,用于获取前端的留言板信息列表
@RequestMapping("/list")
// 处理列表请求的方法,接收请求参数、留言板信息实体对象以及 HttpServletRequest 对象
public R list(@RequestParam Map<String, Object> params, MessagesEntity messages, HttpServletRequest request) {
// 如果当前会话中的角色属性值不是 "管理员"
if (!request.getSession().getAttribute("role").toString().equals("管理员")) {
// 将当前会话中的用户 ID 属性值设置到留言板信息实体的 userid 字段中
messages.setUserid((Long) request.getSession().getAttribute("userId"));
}
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<MessagesEntity> ew = new EntityWrapper<MessagesEntity>();
// 调用 MessagesService 的 queryPage 方法进行分页查询,使用 MPUtil 工具类处理排序、范围查询和模糊查询
PageUtils page = messagesService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, messages), params), params));
// 返回一个成功的响应对象 R并将分页数据放置在响应的 "data" 字段中
return R.ok().put("data", page);
}
/**
*
*/
// 映射处理 /lists 路径的请求,用于获取留言板信息的列表
@RequestMapping("/lists")
// 处理列表请求的方法,接收留言板信息实体对象
public R list(MessagesEntity messages) {
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<MessagesEntity> ew = new EntityWrapper<MessagesEntity>();
// 使用 MPUtil 工具类将实体对象的属性转换为查询条件,并设置到 EntityWrapper 中
ew.allEq(MPUtil.allEQMapPre(messages, "messages"));
// 调用 MessagesService 的 selectListView 方法,根据查询条件获取列表视图数据
return R.ok().put("data", messagesService.selectListView(ew));
}
/**
*
*/
// 映射处理 /query 路径的请求,用于查询留言板信息
@RequestMapping("/query")
// 处理查询请求的方法,接收留言板信息实体对象
public R query(MessagesEntity messages) {
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<MessagesEntity> ew = new EntityWrapper<MessagesEntity>();
// 使用 MPUtil 工具类将实体对象的属性转换为查询条件,并设置到 EntityWrapper 中
ew.allEq(MPUtil.allEQMapPre(messages, "messages"));
// 调用 MessagesService 的 selectView 方法,根据查询条件获取留言板信息视图对象
MessagesView messagesView = messagesService.selectView(ew);
// 返回一个成功的响应对象 R附带查询成功的提示信息并将查询到的数据放置在响应的 "data" 字段中
return R.ok("查询留言板成功").put("data", messagesView);
}
/**
*
*/
// 映射处理 /info/{id} 路径的请求,用于获取指定 ID 的留言板信息详情
@RequestMapping("/info/{id}")
// 处理详情请求的方法,接收路径参数 id
public R info(@PathVariable("id") Long id) {
// 调用 MessagesService 的 selectById 方法,根据 ID 获取留言板信息实体对象
MessagesEntity messages = messagesService.selectById(id);
// 返回一个成功的响应对象 R并将获取到的留言板信息实体对象放置在响应的 "data" 字段中
return R.ok().put("data", messages);
}
/**
*
*/
// 映射处理 /detail/{id} 路径的请求,用于获取指定 ID 的留言板信息详情
@RequestMapping("/detail/{id}")
// 处理详情请求的方法,接收路径参数 id
public R detail(@PathVariable("id") Long id) {
// 调用 MessagesService 的 selectById 方法,根据 ID 获取留言板信息实体对象
MessagesEntity messages = messagesService.selectById(id);
// 返回一个成功的响应对象 R并将获取到的留言板信息实体对象放置在响应的 "data" 字段中
return R.ok().put("data", messages);
}
/**
*
*/
// 映射处理 /save 路径的请求,用于在后端保存留言板信息
@RequestMapping("/save")
// 处理保存请求的方法,接收请求体中的留言板信息实体对象以及 HttpServletRequest 对象
public R save(@RequestBody MessagesEntity messages, HttpServletRequest request) {
// 为留言板信息实体对象生成一个唯一的 ID由当前时间戳加上一个 0 到 999 的随机整数组成
messages.setId(new Date().getTime() + new Double(Math.floor(Math.random() * 1000)).longValue());
// 注释掉的代码用于验证实体对象的合法性
//ValidatorUtils.validateEntity(messages);
// 调用 MessagesService 的 insert 方法,将留言板信息实体对象插入数据库
messagesService.insert(messages);
// 返回一个成功的响应对象 R
return R.ok();
}
/**
*
*/
// 映射处理 /add 路径的请求,用于在前端保存留言板信息
@RequestMapping("/add")
// 处理保存请求的方法,接收请求体中的留言板信息实体对象以及 HttpServletRequest 对象
public R add(@RequestBody MessagesEntity messages, HttpServletRequest request) {
// 为留言板信息实体对象生成一个唯一的 ID由当前时间戳加上一个 0 到 999 的随机整数组成
messages.setId(new Date().getTime() + new Double(Math.floor(Math.random() * 1000)).longValue());
// 注释掉的代码用于验证实体对象的合法性
//ValidatorUtils.validateEntity(messages);
// 将当前会话中的用户 ID 属性值设置到留言板信息实体的 userid 字段中
messages.setUserid((Long) request.getSession().getAttribute("userId"));
// 调用 MessagesService 的 insert 方法,将留言板信息实体对象插入数据库
messagesService.insert(messages);
// 返回一个成功的响应对象 R
return R.ok();
}
/**
*
*/
// 映射处理 /update 路径的请求,用于更新留言板信息
@RequestMapping("/update")
// 处理更新请求的方法,接收请求体中的留言板信息实体对象以及 HttpServletRequest 对象
public R update(@RequestBody MessagesEntity messages, HttpServletRequest request) {
// 注释掉的代码用于验证实体对象的合法性
//ValidatorUtils.validateEntity(messages);
// 调用 MessagesService 的 updateById 方法,根据 ID 更新留言板信息实体对象的所有字段
messagesService.updateById(messages);
// 返回一个成功的响应对象 R
return R.ok();
}
/**
*
*/
// 映射处理 /delete 路径的请求,用于删除留言板信息
@RequestMapping("/delete")
// 处理删除请求的方法,接收请求体中的 ID 数组
public R delete(@RequestBody Long[] ids) {
// 调用 MessagesService 的 deleteBatchIds 方法,根据 ID 数组批量删除留言板信息实体对象
messagesService.deleteBatchIds(Arrays.asList(ids));
// 返回一个成功的响应对象 R
return R.ok();
}
/**
*
*/
// 映射处理 /remind/{columnName}/{type} 路径的请求,用于统计符合特定条件的留言板信息数量(提醒相关)
@RequestMapping("/remind/{columnName}/{type}")
// 处理提醒统计请求的方法,接收路径参数 columnName 和 type请求参数 map 以及 HttpServletRequest 对象
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type, @RequestParam Map<String, Object> map) {
// 将路径参数 columnName 放入请求参数 map 中,键为 "column"
map.put("column", columnName);
// 将路径参数 type 放入请求参数 map 中,键为 "type"
map.put("type", type);
// 如果路径参数 type 的值等于 "2"
if (type.equals("2")) {
// 创建一个 SimpleDateFormat 对象,用于格式化日期,格式为 "yyyy-MM-dd"
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
// 获取当前的日历实例
Calendar c = Calendar.getInstance();
// 定义提醒开始日期变量,初始值为 null
Date remindStartDate = null;
// 定义提醒结束日期变量,初始值为 null
Date remindEndDate = null;
// 如果请求参数 map 中存在键为 "remindstart" 的值
if (map.get("remindstart") != null) {
// 将 "remindstart" 的值转换为整数类型,代表提醒开始的天数偏移量
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
// 设置日历实例的时间为当前日期
c.setTime(new Date());
// 在当前日期的基础上加上提醒开始的天数偏移量
c.add(Calendar.DAY_OF_MONTH, remindStart);
// 获取计算后的提醒开始日期
remindStartDate = c.getTime();
// 将格式化后的提醒开始日期放入请求参数 map 中,键为 "remindstart"
map.put("remindstart", sdf.format(remindStartDate));
}
// 如果请求参数 map 中存在键为 "remindend" 的值
if (map.get("remindend") != null) {
// 将 "remindend" 的值转换为整数类型,代表提醒结束的天数偏移量
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
// 设置日历实例的时间为当前日期
c.setTime(new Date());
// 在当前日期的基础上加上提醒结束的天数偏移量
c.add(Calendar.DAY_OF_MONTH, remindEnd);
// 获取计算后的提醒结束日期
remindEndDate = c.getTime();
// 将格式化后的提醒结束日期放入请求参数 map 中,键为 "remindend"
map.put("remindend", sdf.format(remindEndDate));
}
}
// 创建一个 MyBatis-Plus 的 Wrapper 对象,具体类型为 EntityWrapper<MessagesEntity>,用于构建查询条件
Wrapper<MessagesEntity> wrapper = new EntityWrapper<MessagesEntity>();
// 如果请求参数 map 中存在键为 "remindstart" 的值
if (map.get("remindstart") != null) {
// 设置查询条件,要求查询结果中 columnName 对应的字段值大于等于提醒开始日期
wrapper.ge(columnName, map.get("remindstart"));
}
// 如果请求参数 map 中存在键为 "remindend" 的值
if (map.get("remindend") != null) {
// 设置查询条件,要求查询结果中 columnName 对应的字段值小于等于提醒结束日期
wrapper.le(columnName, map.get("remindend"));
}
// 调用 MessagesService 的 selectCount 方法,根据构建的查询条件统计符合条件的记录数量
int count = messagesService.selectCount(wrapper);
// 返回一个成功的响应对象 R并将统计数量放置在响应的 "count" 字段中
return R.ok().put("count", count);
}
}

@ -0,0 +1,277 @@
package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.NewsEntity;
import com.entity.view.NewsView;
import com.service.NewsService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
/**
*
*
* @author
* @email
* @date 2025-04-04 18:46:21
*/
// 声明该类为一个 RESTful 风格的控制器,用于处理 HTTP 请求并返回 JSON 格式的响应
@RestController
// 为该控制器映射请求路径前缀为 /news
@RequestMapping("/news")
public class NewsController {
// 自动注入 NewsService 服务类的实例,以便在本控制器中调用其业务方法
@Autowired
private NewsService newsService;
/**
*
*/
// 映射处理 /page 路径的请求,用于获取后端的公告信息分页列表
@RequestMapping("/page")
// 处理分页请求的方法,接收请求参数、公告信息实体对象以及 HttpServletRequest 对象
public R page(@RequestParam Map<String, Object> params, NewsEntity news, HttpServletRequest request) {
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<NewsEntity> ew = new EntityWrapper<NewsEntity>();
// 调用 NewsService 的 queryPage 方法进行分页查询,使用 MPUtil 工具类处理排序、范围查询和模糊查询
PageUtils page = newsService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, news), params), params));
// 返回一个成功的响应对象 R并将分页数据放置在响应的 "data" 字段中
return R.ok().put("data", page);
}
/**
*
*/
// @IgnoreAuth 注解表示该接口不需要进行身份验证
@IgnoreAuth
// 映射处理 /list 路径的请求,用于获取前端的公告信息列表
@RequestMapping("/list")
// 处理列表请求的方法,接收请求参数、公告信息实体对象以及 HttpServletRequest 对象
public R list(@RequestParam Map<String, Object> params, NewsEntity news, HttpServletRequest request) {
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<NewsEntity> ew = new EntityWrapper<NewsEntity>();
// 调用 NewsService 的 queryPage 方法进行分页查询,使用 MPUtil 工具类处理排序、范围查询和模糊查询
PageUtils page = newsService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, news), params), params));
// 返回一个成功的响应对象 R并将分页数据放置在响应的 "data" 字段中
return R.ok().put("data", page);
}
/**
*
*/
// 映射处理 /lists 路径的请求,用于获取公告信息的列表
@RequestMapping("/lists")
// 处理列表请求的方法,接收公告信息实体对象
public R list(NewsEntity news) {
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<NewsEntity> ew = new EntityWrapper<NewsEntity>();
// 使用 MPUtil 工具类将实体对象的属性转换为查询条件,并设置到 EntityWrapper 中
ew.allEq(MPUtil.allEQMapPre(news, "news"));
// 调用 NewsService 的 selectListView 方法,根据查询条件获取列表视图数据
return R.ok().put("data", newsService.selectListView(ew));
}
/**
*
*/
// 映射处理 /query 路径的请求,用于查询公告信息
@RequestMapping("/query")
// 处理查询请求的方法,接收公告信息实体对象
public R query(NewsEntity news) {
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<NewsEntity> ew = new EntityWrapper<NewsEntity>();
// 使用 MPUtil 工具类将实体对象的属性转换为查询条件,并设置到 EntityWrapper 中
ew.allEq(MPUtil.allEQMapPre(news, "news"));
// 调用 NewsService 的 selectView 方法,根据查询条件获取公告信息视图对象
NewsView newsView = newsService.selectView(ew);
// 返回一个成功的响应对象 R附带查询成功的提示信息并将查询到的数据放置在响应的 "data" 字段中
return R.ok("查询公告信息成功").put("data", newsView);
}
/**
*
*/
// 映射处理 /info/{id} 路径的请求,用于获取指定 ID 的公告信息详情
@RequestMapping("/info/{id}")
// 处理详情请求的方法,接收路径参数 id
public R info(@PathVariable("id") Long id) {
// 调用 NewsService 的 selectById 方法,根据 ID 获取公告信息实体对象
NewsEntity news = newsService.selectById(id);
// 返回一个成功的响应对象 R并将获取到的公告信息实体对象放置在响应的 "data" 字段中
return R.ok().put("data", news);
}
/**
*
*/
// @IgnoreAuth 注解表示该接口不需要进行身份验证
@IgnoreAuth
// 映射处理 /detail/{id} 路径的请求,用于获取指定 ID 的公告信息详情
@RequestMapping("/detail/{id}")
// 处理详情请求的方法,接收路径参数 id
public R detail(@PathVariable("id") Long id) {
// 调用 NewsService 的 selectById 方法,根据 ID 获取公告信息实体对象
NewsEntity news = newsService.selectById(id);
// 返回一个成功的响应对象 R并将获取到的公告信息实体对象放置在响应的 "data" 字段中
return R.ok().put("data", news);
}
/**
*
*/
// 映射处理 /save 路径的请求,用于在后端保存公告信息
@RequestMapping("/save")
// 处理保存请求的方法,接收请求体中的公告信息实体对象以及 HttpServletRequest 对象
public R save(@RequestBody NewsEntity news, HttpServletRequest request) {
// 为公告信息实体对象生成一个唯一的 ID由当前时间戳加上一个 0 到 999 的随机整数组成
news.setId(new Date().getTime() + new Double(Math.floor(Math.random() * 1000)).longValue());
// 注释掉的代码用于验证实体对象的合法性
//ValidatorUtils.validateEntity(news);
// 调用 NewsService 的 insert 方法,将公告信息实体对象插入数据库
newsService.insert(news);
// 返回一个成功的响应对象 R
return R.ok();
}
/**
*
*/
// 映射处理 /add 路径的请求,用于在前端保存公告信息
@RequestMapping("/add")
// 处理保存请求的方法,接收请求体中的公告信息实体对象以及 HttpServletRequest 对象
public R add(@RequestBody NewsEntity news, HttpServletRequest request) {
// 为公告信息实体对象生成一个唯一的 ID由当前时间戳加上一个 0 到 999 的随机整数组成
news.setId(new Date().getTime() + new Double(Math.floor(Math.random() * 1000)).longValue());
// 注释掉的代码用于验证实体对象的合法性
//ValidatorUtils.validateEntity(news);
// 调用 NewsService 的 insert 方法,将公告信息实体对象插入数据库
newsService.insert(news);
// 返回一个成功的响应对象 R
return R.ok();
}
/**
*
*/
// 映射处理 /update 路径的请求,用于更新公告信息
@RequestMapping("/update")
// 处理更新请求的方法,接收请求体中的公告信息实体对象以及 HttpServletRequest 对象
public R update(@RequestBody NewsEntity news, HttpServletRequest request) {
// 注释掉的代码用于验证实体对象的合法性
//ValidatorUtils.validateEntity(news);
// 调用 NewsService 的 updateById 方法,根据 ID 更新公告信息实体对象的所有字段
newsService.updateById(news);
// 返回一个成功的响应对象 R
return R.ok();
}
/**
*
*/
// 映射处理 /delete 路径的请求,用于删除公告信息
@RequestMapping("/delete")
// 处理删除请求的方法,接收请求体中的 ID 数组
public R delete(@RequestBody Long[] ids) {
// 调用 NewsService 的 deleteBatchIds 方法,根据 ID 数组批量删除公告信息实体对象
newsService.deleteBatchIds(Arrays.asList(ids));
// 返回一个成功的响应对象 R
return R.ok();
}
/**
*
*/
// 映射处理 /remind/{columnName}/{type} 路径的请求,用于统计符合特定条件的公告信息数量(提醒相关)
@RequestMapping("/remind/{columnName}/{type}")
// 处理提醒统计请求的方法,接收路径参数 columnName 和 type请求参数 map 以及 HttpServletRequest 对象
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type, @RequestParam Map<String, Object> map) {
// 将路径参数 columnName 放入请求参数 map 中,键为 "column"
map.put("column", columnName);
// 将路径参数 type 放入请求参数 map 中,键为 "type"
map.put("type", type);
// 如果路径参数 type 的值等于 "2"
if (type.equals("2")) {
// 创建一个 SimpleDateFormat 对象,用于格式化日期,格式为 "yyyy-MM-dd"
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
// 获取当前的日历实例
Calendar c = Calendar.getInstance();
// 定义提醒开始日期变量,初始值为 null
Date remindStartDate = null;
// 定义提醒结束日期变量,初始值为 null
Date remindEndDate = null;
// 如果请求参数 map 中存在键为 "remindstart" 的值
if (map.get("remindstart") != null) {
// 将 "remindstart" 的值转换为整数类型,代表提醒开始的天数偏移量
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
// 设置日历实例的时间为当前日期
c.setTime(new Date());
// 在当前日期的基础上加上提醒开始的天数偏移量
c.add(Calendar.DAY_OF_MONTH, remindStart);
// 获取计算后的提醒开始日期
remindStartDate = c.getTime();
// 将格式化后的提醒开始日期放入请求参数 map 中,键为 "remindstart"
map.put("remindstart", sdf.format(remindStartDate));
}
// 如果请求参数 map 中存在键为 "remindend" 的值
if (map.get("remindend") != null) {
// 将 "remindend" 的值转换为整数类型,代表提醒结束的天数偏移量
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
// 设置日历实例的时间为当前日期
c.setTime(new Date());
// 在当前日期的基础上加上提醒结束的天数偏移量
c.add(Calendar.DAY_OF_MONTH, remindEnd);
// 获取计算后的提醒结束日期
remindEndDate = c.getTime();
// 将格式化后的提醒结束日期放入请求参数 map 中,键为 "remindend"
map.put("remindend", sdf.format(remindEndDate));
}
}
// 创建一个 MyBatis-Plus 的 Wrapper 对象,具体类型为 EntityWrapper<NewsEntity>,用于构建查询条件
Wrapper<NewsEntity> wrapper = new EntityWrapper<NewsEntity>();
// 如果请求参数 map 中存在键为 "remindstart" 的值
if (map.get("remindstart") != null) {
// 设置查询条件,要求查询结果中 columnName 对应的字段值大于等于提醒开始日期
wrapper.ge(columnName, map.get("remindstart"));
}
// 如果请求参数 map 中存在键为 "remindend" 的值
if (map.get("remindend") != null) {
// 设置查询条件,要求查询结果中 columnName 对应的字段值小于等于提醒结束日期
wrapper.le(columnName, map.get("remindend"));
}
// 调用 NewsService 的 selectCount 方法,根据构建的查询条件统计符合条件的记录数量
int count = newsService.selectCount(wrapper);
// 返回一个成功的响应对象 R并将统计数量放置在响应的 "count" 字段中
return R.ok().put("count", count);
}
}

@ -0,0 +1,292 @@
package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.StoreupEntity;
import com.entity.view.StoreupView;
import com.service.StoreupService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
/**
*
*
* @author
* @email
* @date 2025-04-04 18:46:21
*/
// 声明该类为一个 RESTful 风格的控制器,用于处理 HTTP 请求并返回 JSON 格式的响应
@RestController
// 为该控制器映射请求路径前缀为 /storeup
@RequestMapping("/storeup")
public class StoreupController {
// 自动注入 StoreupService 服务类的实例,以便在本控制器中调用其业务方法
@Autowired
private StoreupService storeupService;
/**
*
*/
// 映射处理 /page 路径的请求,用于获取后端的收藏信息分页列表
@RequestMapping("/page")
// 处理分页请求的方法,接收请求参数、收藏信息实体对象以及 HttpServletRequest 对象
public R page(@RequestParam Map<String, Object> params, StoreupEntity storeup, HttpServletRequest request) {
// 如果当前会话中的角色属性值不是 "管理员"
if (!request.getSession().getAttribute("role").toString().equals("管理员")) {
// 将当前会话中的用户 ID 属性值设置到收藏信息实体的 userid 字段中
storeup.setUserid((Long) request.getSession().getAttribute("userId"));
}
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<StoreupEntity> ew = new EntityWrapper<StoreupEntity>();
// 调用 StoreupService 的 queryPage 方法进行分页查询,使用 MPUtil 工具类处理排序、范围查询和模糊查询
PageUtils page = storeupService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, storeup), params), params));
// 返回一个成功的响应对象 R并将分页数据放置在响应的 "data" 字段中
return R.ok().put("data", page);
}
/**
*
*/
// 映射处理 /list 路径的请求,用于获取前端的收藏信息列表
@RequestMapping("/list")
// 处理列表请求的方法,接收请求参数、收藏信息实体对象以及 HttpServletRequest 对象
public R list(@RequestParam Map<String, Object> params, StoreupEntity storeup, HttpServletRequest request) {
// 如果当前会话中的角色属性值不是 "管理员"
if (!request.getSession().getAttribute("role").toString().equals("管理员")) {
// 将当前会话中的用户 ID 属性值设置到收藏信息实体的 userid 字段中
storeup.setUserid((Long) request.getSession().getAttribute("userId"));
}
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<StoreupEntity> ew = new EntityWrapper<StoreupEntity>();
// 调用 StoreupService 的 queryPage 方法进行分页查询,使用 MPUtil 工具类处理排序、范围查询和模糊查询
PageUtils page = storeupService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, storeup), params), params));
// 返回一个成功的响应对象 R并将分页数据放置在响应的 "data" 字段中
return R.ok().put("data", page);
}
/**
*
*/
// 映射处理 /lists 路径的请求,用于获取收藏信息的列表
@RequestMapping("/lists")
// 处理列表请求的方法,接收收藏信息实体对象
public R list(StoreupEntity storeup) {
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<StoreupEntity> ew = new EntityWrapper<StoreupEntity>();
// 使用 MPUtil 工具类将实体对象的属性转换为查询条件,并设置到 EntityWrapper 中
ew.allEq(MPUtil.allEQMapPre(storeup, "storeup"));
// 调用 StoreupService 的 selectListView 方法,根据查询条件获取列表视图数据
return R.ok().put("data", storeupService.selectListView(ew));
}
/**
*
*/
// 映射处理 /query 路径的请求,用于查询收藏信息
@RequestMapping("/query")
// 处理查询请求的方法,接收收藏信息实体对象
public R query(StoreupEntity storeup) {
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<StoreupEntity> ew = new EntityWrapper<StoreupEntity>();
// 使用 MPUtil 工具类将实体对象的属性转换为查询条件,并设置到 EntityWrapper 中
ew.allEq(MPUtil.allEQMapPre(storeup, "storeup"));
// 调用 StoreupService 的 selectView 方法,根据查询条件获取收藏信息视图对象
StoreupView storeupView = storeupService.selectView(ew);
// 返回一个成功的响应对象 R附带查询成功的提示信息并将查询到的数据放置在响应的 "data" 字段中
return R.ok("查询收藏表成功").put("data", storeupView);
}
/**
*
*/
// 映射处理 /info/{id} 路径的请求,用于获取指定 ID 的收藏信息详情
@RequestMapping("/info/{id}")
// 处理详情请求的方法,接收路径参数 id
public R info(@PathVariable("id") Long id) {
// 调用 StoreupService 的 selectById 方法,根据 ID 获取收藏信息实体对象
StoreupEntity storeup = storeupService.selectById(id);
// 返回一个成功的响应对象 R并将获取到的收藏信息实体对象放置在响应的 "data" 字段中
return R.ok().put("data", storeup);
}
/**
*
*/
// 映射处理 /detail/{id} 路径的请求,用于获取指定 ID 的收藏信息详情
@RequestMapping("/detail/{id}")
// 处理详情请求的方法,接收路径参数 id
public R detail(@PathVariable("id") Long id) {
// 调用 StoreupService 的 selectById 方法,根据 ID 获取收藏信息实体对象
StoreupEntity storeup = storeupService.selectById(id);
// 返回一个成功的响应对象 R并将获取到的收藏信息实体对象放置在响应的 "data" 字段中
return R.ok().put("data", storeup);
}
/**
*
*/
// 映射处理 /save 路径的请求,用于在后端保存收藏信息
@RequestMapping("/save")
// 处理保存请求的方法,接收请求体中的收藏信息实体对象以及 HttpServletRequest 对象
public R save(@RequestBody StoreupEntity storeup, HttpServletRequest request) {
// 为收藏信息实体对象生成一个唯一的 ID由当前时间戳加上一个 0 到 999 的随机整数组成
storeup.setId(new Date().getTime() + new Double(Math.floor(Math.random() * 1000)).longValue());
// 注释掉的代码用于验证实体对象的合法性
//ValidatorUtils.validateEntity(storeup);
// 将当前会话中的用户 ID 属性值设置到收藏信息实体的 userid 字段中
storeup.setUserid((Long) request.getSession().getAttribute("userId"));
// 调用 StoreupService 的 insert 方法,将收藏信息实体对象插入数据库
storeupService.insert(storeup);
// 返回一个成功的响应对象 R
return R.ok();
}
/**
*
*/
// 映射处理 /add 路径的请求,用于在前端保存收藏信息
@RequestMapping("/add")
// 处理保存请求的方法,接收请求体中的收藏信息实体对象以及 HttpServletRequest 对象
public R add(@RequestBody StoreupEntity storeup, HttpServletRequest request) {
// 为收藏信息实体对象生成一个唯一的 ID由当前时间戳加上一个 0 到 999 的随机整数组成
storeup.setId(new Date().getTime() + new Double(Math.floor(Math.random() * 1000)).longValue());
// 注释掉的代码用于验证实体对象的合法性
//ValidatorUtils.validateEntity(storeup);
// 将当前会话中的用户 ID 属性值设置到收藏信息实体的 userid 字段中
storeup.setUserid((Long) request.getSession().getAttribute("userId"));
// 调用 StoreupService 的 insert 方法,将收藏信息实体对象插入数据库
storeupService.insert(storeup);
// 返回一个成功的响应对象 R
return R.ok();
}
/**
*
*/
// 映射处理 /update 路径的请求,用于更新收藏信息
@RequestMapping("/update")
// 处理更新请求的方法,接收请求体中的收藏信息实体对象以及 HttpServletRequest 对象
public R update(@RequestBody StoreupEntity storeup, HttpServletRequest request) {
// 注释掉的代码用于验证实体对象的合法性
//ValidatorUtils.validateEntity(storeup);
// 调用 StoreupService 的 updateById 方法,根据 ID 更新收藏信息实体对象的所有字段
storeupService.updateById(storeup);
// 返回一个成功的响应对象 R
return R.ok();
}
/**
*
*/
// 映射处理 /delete 路径的请求,用于删除收藏信息
@RequestMapping("/delete")
// 处理删除请求的方法,接收请求体中的 ID 数组
public R delete(@RequestBody Long[] ids) {
// 调用 StoreupService 的 deleteBatchIds 方法,根据 ID 数组批量删除收藏信息实体对象
storeupService.deleteBatchIds(Arrays.asList(ids));
// 返回一个成功的响应对象 R
return R.ok();
}
/**
*
*/
// 映射处理 /remind/{columnName}/{type} 路径的请求,用于统计符合特定条件的收藏信息数量(提醒相关)
@RequestMapping("/remind/{columnName}/{type}")
// 处理提醒统计请求的方法,接收路径参数 columnName 和 type请求参数 map 以及 HttpServletRequest 对象
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type, @RequestParam Map<String, Object> map) {
// 将路径参数 columnName 放入请求参数 map 中,键为 "column"
map.put("column", columnName);
// 将路径参数 type 放入请求参数 map 中,键为 "type"
map.put("type", type);
// 如果路径参数 type 的值等于 "2"
if (type.equals("2")) {
// 创建一个 SimpleDateFormat 对象,用于格式化日期,格式为 "yyyy-MM-dd"
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
// 获取当前的日历实例
Calendar c = Calendar.getInstance();
// 定义提醒开始日期变量,初始值为 null
Date remindStartDate = null;
// 定义提醒结束日期变量,初始值为 null
Date remindEndDate = null;
// 如果请求参数 map 中存在键为 "remindstart" 的值
if (map.get("remindstart") != null) {
// 将 "remindstart" 的值转换为整数类型,代表提醒开始的天数偏移量
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
// 设置日历实例的时间为当前日期
c.setTime(new Date());
// 在当前日期的基础上加上提醒开始的天数偏移量
c.add(Calendar.DAY_OF_MONTH, remindStart);
// 获取计算后的提醒开始日期
remindStartDate = c.getTime();
// 将格式化后的提醒开始日期放入请求参数 map 中,键为 "remindstart"
map.put("remindstart", sdf.format(remindStartDate));
}
// 如果请求参数 map 中存在键为 "remindend" 的值
if (map.get("remindend") != null) {
// 将 "remindend" 的值转换为整数类型,代表提醒结束的天数偏移量
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
// 设置日历实例的时间为当前日期
c.setTime(new Date());
// 在当前日期的基础上加上提醒结束的天数偏移量
c.add(Calendar.DAY_OF_MONTH, remindEnd);
// 获取计算后的提醒结束日期
remindEndDate = c.getTime();
// 将格式化后的提醒结束日期放入请求参数 map 中,键为 "remindend"
map.put("remindend", sdf.format(remindEndDate));
}
}
// 创建一个 MyBatis-Plus 的 Wrapper 对象,具体类型为 EntityWrapper<StoreupEntity>,用于构建查询条件
Wrapper<StoreupEntity> wrapper = new EntityWrapper<StoreupEntity>();
// 如果请求参数 map 中存在键为 "remindstart" 的值
if (map.get("remindstart") != null) {
// 设置查询条件,要求查询结果中 columnName 对应的字段值大于等于提醒开始日期
wrapper.ge(columnName, map.get("remindstart"));
}
// 如果请求参数 map 中存在键为 "remindend" 的值
if (map.get("remindend") != null) {
// 设置查询条件,要求查询结果中 columnName 对应的字段值小于等于提醒结束日期
wrapper.le(columnName, map.get("remindend"));
}
// 如果当前会话中的角色属性值不是 "管理员"
if (!request.getSession().getAttribute("role").toString().equals("管理员")) {
// 设置查询条件,要求查询结果中 userid 字段的值等于当前会话中的用户 ID 属性值
wrapper.eq("userid", (Long) request.getSession().getAttribute("userId"));
}
// 调用 StoreupService 的 selectCount 方法,根据构建的查询条件统计符合条件的记录数量
int count = storeupService.selectCount(wrapper);
// 返回一个成功的响应对象 R并将统计数量放置在响应的 "count" 字段中
return R.ok().put("count", count);
}
}

@ -0,0 +1,238 @@
package com.controller;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.TokenEntity;
import com.entity.UserEntity;
import com.service.TokenService;
import com.service.UserService;
import com.utils.CommonUtil;
import com.utils.MPUtil;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.ValidatorUtils;
/**
*
*/
// 映射请求路径前缀为 "users",即该控制器处理的请求 URL 都以 "users" 开头
@RequestMapping("users")
// 声明该类为一个 RESTful 风格的控制器,用于处理 HTTP 请求并返回 JSON 格式的响应
@RestController
public class UserController {
// 自动注入 UserService 服务类的实例,以便在本控制器中调用其业务方法来处理用户相关业务逻辑
@Autowired
private UserService userService;
// 自动注入 TokenService 服务类的实例,用于生成和管理用户的令牌
@Autowired
private TokenService tokenService;
/**
*
*/
// @IgnoreAuth 注解表示该接口不需要进行身份验证
@IgnoreAuth
// 映射处理 HTTP POST 请求,请求路径为 "/login"
@PostMapping(value = "/login")
// 处理用户登录请求的方法,接收用户名、密码、验证码和 HttpServletRequest 对象
public R login(String username, String password, String captcha, HttpServletRequest request) {
// 根据用户名从数据库中查询用户信息
UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
// 如果用户不存在或者密码不匹配
if (user == null || !user.getPassword().equals(password)) {
// 返回错误响应,提示账号或密码不正确
return R.error("账号或密码不正确");
}
// 调用 TokenService 生成用户令牌,包含用户 ID、用户名、用户类型和角色信息
String token = tokenService.generateToken(user.getId(), username, "users", user.getRole());
// 返回成功响应,并将生成的令牌放入响应数据中
return R.ok().put("token", token);
}
/**
*
*/
// @IgnoreAuth 注解表示该接口不需要进行身份验证
@IgnoreAuth
// 映射处理 HTTP POST 请求,请求路径为 "/register"
@PostMapping(value = "/register")
// 处理用户注册请求的方法,接收请求体中的用户实体对象
public R register(@RequestBody UserEntity user) {
// 注释掉的代码用于验证实体对象的合法性
// ValidatorUtils.validateEntity(user);
// 检查数据库中是否已存在相同用户名的用户
if (userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) != null) {
// 如果存在,返回错误响应,提示用户已存在
return R.error("用户已存在");
}
// 将用户信息插入数据库
userService.insert(user);
// 返回成功响应
return R.ok();
}
/**
* 退
*/
// 映射处理 HTTP GET 请求,请求路径为 "logout"
@GetMapping(value = "logout")
// 处理用户退出登录请求的方法,接收 HttpServletRequest 对象
public R logout(HttpServletRequest request) {
// 使当前用户的会话失效
request.getSession().invalidate();
// 返回成功响应,并附带退出成功的提示信息
return R.ok("退出成功");
}
/**
*
*/
// @IgnoreAuth 注解表示该接口不需要进行身份验证
@IgnoreAuth
// 映射处理请求路径为 "/resetPass" 的请求
@RequestMapping(value = "/resetPass")
// 处理用户密码重置请求的方法,接收用户名和 HttpServletRequest 对象
public R resetPass(String username, HttpServletRequest request) {
// 根据用户名从数据库中查询用户信息
UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
// 如果用户不存在
if (user == null) {
// 返回错误响应,提示账号不存在
return R.error("账号不存在");
}
// 将用户密码重置为 "123456"
user.setPassword("123456");
// 更新用户信息到数据库
userService.update(user, null);
// 返回成功响应,并附带密码重置成功的提示信息
return R.ok("密码已重置为123456");
}
/**
*
*/
// 映射处理请求路径为 "/page" 的请求,用于获取用户信息的分页列表
@RequestMapping("/page")
// 处理分页请求的方法,接收请求参数和用户实体对象
public R page(@RequestParam Map<String, Object> params, UserEntity user) {
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();
// 调用 UserService 的 queryPage 方法进行分页查询,使用 MPUtil 工具类处理排序、范围查询和模糊查询
PageUtils page = userService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));
// 返回一个成功的响应对象 R并将分页数据放置在响应的 "data" 字段中
return R.ok().put("data", page);
}
/**
*
*/
// 映射处理请求路径为 "/list" 的请求,用于获取用户信息的列表
@RequestMapping("/list")
// 处理列表请求的方法,接收用户实体对象
public R list(UserEntity user) {
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();
// 使用 MPUtil 工具类将实体对象的属性转换为查询条件,并设置到 EntityWrapper 中
ew.allEq(MPUtil.allEQMapPre(user, "user"));
// 调用 UserService 的 selectListView 方法,根据查询条件获取列表视图数据
return R.ok().put("data", userService.selectListView(ew));
}
/**
*
*/
// 映射处理请求路径为 "/info/{id}" 的请求,用于获取指定 ID 的用户信息详情
@RequestMapping("/info/{id}")
// 处理详情请求的方法,接收路径参数 id
public R info(@PathVariable("id") String id) {
// 调用 UserService 的 selectById 方法,根据 ID 获取用户信息实体对象
UserEntity user = userService.selectById(id);
// 返回一个成功的响应对象 R并将获取到的用户信息实体对象放置在响应的 "data" 字段中
return R.ok().put("data", user);
}
/**
* session
*/
// 映射处理请求路径为 "/session" 的请求,用于获取当前会话中的用户信息
@RequestMapping("/session")
// 处理获取会话用户信息请求的方法,接收 HttpServletRequest 对象
public R getCurrUser(HttpServletRequest request) {
// 从当前会话中获取用户 ID
Long id = (Long) request.getSession().getAttribute("userId");
// 调用 UserService 的 selectById 方法,根据 ID 获取用户信息实体对象
UserEntity user = userService.selectById(id);
// 返回一个成功的响应对象 R并将获取到的用户信息实体对象放置在响应的 "data" 字段中
return R.ok().put("data", user);
}
/**
*
*/
// 映射处理 HTTP POST 请求,请求路径为 "/save",用于保存用户信息
@PostMapping("/save")
// 处理保存请求的方法,接收请求体中的用户实体对象
public R save(@RequestBody UserEntity user) {
// 注释掉的代码用于验证实体对象的合法性
// ValidatorUtils.validateEntity(user);
// 检查数据库中是否已存在相同用户名的用户
if (userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) != null) {
// 如果存在,返回错误响应,提示用户已存在
return R.error("用户已存在");
}
// 将用户信息插入数据库
userService.insert(user);
// 返回成功响应
return R.ok();
}
/**
*
*/
// 映射处理请求路径为 "/update" 的请求,用于更新用户信息
@RequestMapping("/update")
// 处理更新请求的方法,接收请求体中的用户实体对象
public R update(@RequestBody UserEntity user) {
// 注释掉的代码用于验证实体对象的合法性
// ValidatorUtils.validateEntity(user);
// 调用 UserService 的 updateById 方法,根据 ID 更新用户信息实体对象的所有字段
userService.updateById(user);
// 返回成功响应
return R.ok();
}
/**
*
*/
// 映射处理请求路径为 "/delete" 的请求,用于删除用户信息
@RequestMapping("/delete")
// 处理删除请求的方法,接收请求体中的 ID 数组
public R delete(@RequestBody Long[] ids) {
// 调用 UserService 的 deleteBatchIds 方法,根据 ID 数组批量删除用户信息实体对象
userService.deleteBatchIds(Arrays.asList(ids));
// 返回成功响应
return R.ok();
}
}

@ -0,0 +1,298 @@
package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.WeixiuchuliEntity;
import com.entity.view.WeixiuchuliView;
import com.service.WeixiuchuliService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
/**
*
*
* @author
* @email
* @date 2025-04-04 18:46:21
*/
// 声明该类为一个 RESTful 风格的控制器,用于处理 HTTP 请求并返回 JSON 格式的响应
@RestController
// 为该控制器映射请求路径前缀为 /weixiuchuli
@RequestMapping("/weixiuchuli")
public class WeixiuchuliController {
// 自动注入 WeixiuchuliService 服务类的实例,以便在本控制器中调用其业务方法
@Autowired
private WeixiuchuliService weixiuchuliService;
/**
*
*/
// 映射处理 /page 路径的请求,用于获取后端的维修处理信息分页列表
@RequestMapping("/page")
// 处理分页请求的方法,接收请求参数、维修处理信息实体对象以及 HttpServletRequest 对象
public R page(@RequestParam Map<String, Object> params, WeixiuchuliEntity weixiuchuli, HttpServletRequest request) {
// 从请求的会话中获取名为 "tableName" 的属性值,并转换为字符串类型
String tableName = request.getSession().getAttribute("tableName").toString();
// 如果获取到的 tableName 等于 "fangzhu"(房主)
if (tableName.equals("fangzhu")) {
// 将当前会话中名为 "username" 的属性值(房主账号)设置到维修处理信息实体的 fangzhuzhanghao 字段中
weixiuchuli.setFangzhuzhanghao((String) request.getSession().getAttribute("username"));
}
// 如果获取到的 tableName 等于 "yonghu"(用户)
if (tableName.equals("yonghu")) {
// 将当前会话中名为 "username" 的属性值(用户名)设置到维修处理信息实体的 yonghuming 字段中
weixiuchuli.setYonghuming((String) request.getSession().getAttribute("username"));
}
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<WeixiuchuliEntity> ew = new EntityWrapper<WeixiuchuliEntity>();
// 调用 WeixiuchuliService 的 queryPage 方法进行分页查询,使用 MPUtil 工具类处理排序、范围查询和模糊查询
PageUtils page = weixiuchuliService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, weixiuchuli), params), params));
// 返回一个成功的响应对象 R并将分页数据放置在响应的 "data" 字段中
return R.ok().put("data", page);
}
/**
*
*/
// 映射处理 /list 路径的请求,用于获取前端的维修处理信息列表
@RequestMapping("/list")
// 处理列表请求的方法,接收请求参数、维修处理信息实体对象以及 HttpServletRequest 对象
public R list(@RequestParam Map<String, Object> params, WeixiuchuliEntity weixiuchuli, HttpServletRequest request) {
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<WeixiuchuliEntity> ew = new EntityWrapper<WeixiuchuliEntity>();
// 调用 WeixiuchuliService 的 queryPage 方法进行分页查询,使用 MPUtil 工具类处理排序、范围查询和模糊查询
PageUtils page = weixiuchuliService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, weixiuchuli), params), params));
// 返回一个成功的响应对象 R并将分页数据放置在响应的 "data" 字段中
return R.ok().put("data", page);
}
/**
*
*/
// 映射处理 /lists 路径的请求,用于获取维修处理信息的列表
@RequestMapping("/lists")
// 处理列表请求的方法,接收维修处理信息实体对象
public R list(WeixiuchuliEntity weixiuchuli) {
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<WeixiuchuliEntity> ew = new EntityWrapper<WeixiuchuliEntity>();
// 使用 MPUtil 工具类将实体对象的属性转换为查询条件,并设置到 EntityWrapper 中
ew.allEq(MPUtil.allEQMapPre(weixiuchuli, "weixiuchuli"));
// 调用 WeixiuchuliService 的 selectListView 方法,根据查询条件获取列表视图数据
return R.ok().put("data", weixiuchuliService.selectListView(ew));
}
/**
*
*/
// 映射处理 /query 路径的请求,用于查询维修处理信息
@RequestMapping("/query")
// 处理查询请求的方法,接收维修处理信息实体对象
public R query(WeixiuchuliEntity weixiuchuli) {
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<WeixiuchuliEntity> ew = new EntityWrapper<WeixiuchuliEntity>();
//使用 MPUtil 工具类将实体对象的属性转换为查询条件,并设置到 EntityWrapper 中
ew.allEq(MPUtil.allEQMapPre(weixiuchuli, "weixiuchuli"));
// 调用 WeixiuchuliService 的 selectView 方法,根据查询条件获取维修处理信息视图对象
WeixiuchuliView weixiuchuliView = weixiuchuliService.selectView(ew);
// 返回一个成功的响应对象 R附带查询成功的提示信息并将查询到的数据放置在响应的 "data" 字段中
return R.ok("查询维修处理成功").put("data", weixiuchuliView);
}
/**
*
*/
// 映射处理 /info/{id} 路径的请求,用于获取指定 ID 的维修处理信息详情
@RequestMapping("/info/{id}")
// 处理详情请求的方法,接收路径参数 id
public R info(@PathVariable("id") Long id) {
// 调用 WeixiuchuliService 的 selectById 方法,根据 ID 获取维修处理信息实体对象
WeixiuchuliEntity weixiuchuli = weixiuchuliService.selectById(id);
// 返回一个成功的响应对象 R并将获取到的维修处理信息实体对象放置在响应的 "data" 字段中
return R.ok().put("data", weixiuchuli);
}
/**
*
*/
// 映射处理 /detail/{id} 路径的请求,用于获取指定 ID 的维修处理信息详情
@RequestMapping("/detail/{id}")
// 处理详情请求的方法,接收路径参数 id
public R detail(@PathVariable("id") Long id) {
// 调用 WeixiuchuliService 的 selectById 方法,根据 ID 获取维修处理信息实体对象
WeixiuchuliEntity weixiuchuli = weixiuchuliService.selectById(id);
// 返回一个成功的响应对象 R并将获取到的维修处理信息实体对象放置在响应的 "data" 字段中
return R.ok().put("data", weixiuchuli);
}
/**
*
*/
// 映射处理 /save 路径的请求,用于在后端保存维修处理信息
@RequestMapping("/save")
// 处理保存请求的方法,接收请求体中的维修处理信息实体对象以及 HttpServletRequest 对象
public R save(@RequestBody WeixiuchuliEntity weixiuchuli, HttpServletRequest request) {
// 为维修处理信息实体对象生成一个唯一的 ID由当前时间戳加上一个 0 到 999 的随机整数组成
weixiuchuli.setId(new Date().getTime() + new Double(Math.floor(Math.random() * 1000)).longValue());
// 注释掉的代码用于验证实体对象的合法性
//ValidatorUtils.validateEntity(weixiuchuli);
// 调用 WeixiuchuliService 的 insert 方法,将维修处理信息实体对象插入数据库
weixiuchuliService.insert(weixiuchuli);
// 返回一个成功的响应对象 R
return R.ok();
}
/**
*
*/
// 映射处理 /add 路径的请求,用于在前端保存维修处理信息
@RequestMapping("/add")
// 处理保存请求的方法,接收请求体中的维修处理信息实体对象以及 HttpServletRequest 对象
public R add(@RequestBody WeixiuchuliEntity weixiuchuli, HttpServletRequest request) {
// 为维修处理信息实体对象生成一个唯一的 ID由当前时间戳加上一个 0 到 999 的随机整数组成
weixiuchuli.setId(new Date().getTime() + new Double(Math.floor(Math.random() * 1000)).longValue());
// 注释掉的代码用于验证实体对象的合法性
//ValidatorUtils.validateEntity(weixiuchuli);
// 调用 WeixiuchuliService 的 insert 方法,将维修处理信息实体对象插入数据库
weixiuchuliService.insert(weixiuchuli);
// 返回一个成功的响应对象 R
return R.ok();
}
/**
*
*/
// 映射处理 /update 路径的请求,用于更新维修处理信息
@RequestMapping("/update")
// 处理更新请求的方法,接收请求体中的维修处理信息实体对象以及 HttpServletRequest 对象
public R update(@RequestBody WeixiuchuliEntity weixiuchuli, HttpServletRequest request) {
// 注释掉的代码用于验证实体对象的合法性
//ValidatorUtils.validateEntity(weixiuchuli);
// 调用 WeixiuchuliService 的 updateById 方法,根据 ID 更新维修处理信息实体对象的所有字段
weixiuchuliService.updateById(weixiuchuli);
// 返回一个成功的响应对象 R
return R.ok();
}
/**
*
*/
// 映射处理 /delete 路径的请求,用于删除维修处理信息
@RequestMapping("/delete")
// 处理删除请求的方法,接收请求体中的 ID 数组
public R delete(@RequestBody Long[] ids) {
// 调用 WeixiuchuliService 的 deleteBatchIds 方法,根据 ID 数组批量删除维修处理信息实体对象
weixiuchuliService.deleteBatchIds(Arrays.asList(ids));
// 返回一个成功的响应对象 R
return R.ok();
}
/**
*
*/
// 映射处理 /remind/{columnName}/{type} 路径的请求,用于统计符合特定条件的维修处理信息数量(提醒相关)
@RequestMapping("/remind/{columnName}/{type}")
// 处理提醒统计请求的方法,接收路径参数 columnName 和 type请求参数 map 以及 HttpServletRequest 对象
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type, @RequestParam Map<String, Object> map) {
// 将路径参数 columnName 放入请求参数 map 中,键为 "column"
map.put("column", columnName);
// 将路径参数 type 放入请求参数 map 中,键为 "type"
map.put("type", type);
// 如果路径参数 type 的值等于 "2"
if (type.equals("2")) {
// 创建一个 SimpleDateFormat 对象,用于格式化日期,格式为 "yyyy-MM-dd"
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
// 获取当前的日历实例
Calendar c = Calendar.getInstance();
// 定义提醒开始日期变量,初始值为 null
Date remindStartDate = null;
// 定义提醒结束日期变量,初始值为 null
Date remindEndDate = null;
// 如果请求参数 map 中存在键为 "remindstart" 的值
if (map.get("remindstart") != null) {
// 将 "remindstart" 的值转换为整数类型,代表提醒开始的天数偏移量
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
// 设置日历实例的时间为当前日期
c.setTime(new Date());
// 在当前日期的基础上加上提醒开始的天数偏移量
c.add(Calendar.DAY_OF_MONTH, remindStart);
// 获取计算后的提醒开始日期
remindStartDate = c.getTime();
// 将格式化后的提醒开始日期放入请求参数 map 中,键为 "remindstart"
map.put("remindstart", sdf.format(remindStartDate));
}
// 如果请求参数 map 中存在键为 "remindend" 的值
if (map.get("remindend") != null) {
// 将 "remindend" 的值转换为整数类型,代表提醒结束的天数偏移量
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
// 设置日历实例的时间为当前日期
c.setTime(new Date());
// 在当前日期的基础上加上提醒结束的天数偏移量
c.add(Calendar.DAY_OF_MONTH, remindEnd);
// 获取计算后的提醒结束日期
remindEndDate = c.getTime();
// 将格式化后的提醒结束日期放入请求参数 map 中,键为 "remindend"
map.put("remindend", sdf.format(remindEndDate));
}
}
// 创建一个 MyBatis-Plus 的 Wrapper 对象,具体类型为 EntityWrapper<WeixiuchuliEntity>,用于构建查询条件
Wrapper<WeixiuchuliEntity> wrapper = new EntityWrapper<WeixiuchuliEntity>();
// 如果请求参数 map 中存在键为 "remindstart" 的值
if (map.get("remindstart") != null) {
// 设置查询条件,要求查询结果中 columnName 对应的字段值大于等于提醒开始日期
wrapper.ge(columnName, map.get("remindstart"));
}
// 如果请求参数 map 中存在键为 "remindend" 的值
if (map.get("remindend") != null) {
// 设置查询条件,要求查询结果中 columnName 对应的字段值小于等于提醒结束日期
wrapper.le(columnName, map.get("remindend"));
}
// 从请求的会话中获取名为 "tableName" 的属性值,并转换为字符串类型
String tableName = request.getSession().getAttribute("tableName").toString();
// 如果获取到的 tableName 等于 "fangzhu"(房主)
if (tableName.equals("fangzhu")) {
// 设置查询条件,要求查询结果中 fangzhuzhanghao 字段的值等于当前会话中名为 "username" 的属性值(房主账号)
wrapper.eq("fangzhuzhanghao", (String) request.getSession().getAttribute("username"));
}
// 如果获取到的 tableName 等于 "yonghu"(用户)
if (tableName.equals("yonghu")) {
// 设置查询条件,要求查询结果中 yonghuming 字段的值等于当前会话中名为 "username" 的属性值(用户名)
wrapper.eq("yonghuming", (String) request.getSession().getAttribute("username"));
}
// 调用 WeixiuchuliService 的 selectCount 方法,根据构建的查询条件统计符合条件的记录数量
int count = weixiuchuliService.selectCount(wrapper);
// 返回一个成功的响应对象 R并将统计数量放置在响应的 "count" 字段中
return R.ok().put("count", count);
}
}

@ -0,0 +1,292 @@
package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.WoyaodangfangzhuEntity;
import com.entity.view.WoyaodangfangzhuView;
import com.service.WoyaodangfangzhuService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
/**
*
*
* @author
* @email
* @date 2025-04-04 18:46:21
*/
// 声明该类为一个 RESTful 风格的控制器,用于处理 HTTP 请求并返回 JSON 格式的响应
@RestController
// 为该控制器映射请求路径前缀为 /woyaodangfangzhu
@RequestMapping("/woyaodangfangzhu")
public class WoyaodangfangzhuController {
// 自动注入 WoyaodangfangzhuService 服务类的实例,以便在本控制器中调用其业务方法
@Autowired
private WoyaodangfangzhuService woyaodangfangzhuService;
/**
*
*/
// 映射处理 /page 路径的请求,用于获取后端的“我要当房主”信息分页列表
@RequestMapping("/page")
// 处理分页请求的方法,接收请求参数、“我要当房主”信息实体对象以及 HttpServletRequest 对象
public R page(@RequestParam Map<String, Object> params, WoyaodangfangzhuEntity woyaodangfangzhu, HttpServletRequest request) {
// 从请求的会话中获取名为 "tableName" 的属性值,并转换为字符串类型
String tableName = request.getSession().getAttribute("tableName").toString();
// 如果获取到的 tableName 等于 "yonghu"(用户)
if (tableName.equals("yonghu")) {
// 将当前会话中名为 "username" 的属性值(用户名)设置到“我要当房主”信息实体的 yonghuming 字段中
woyaodangfangzhu.setYonghuming((String) request.getSession().getAttribute("username"));
}
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<WoyaodangfangzhuEntity> ew = new EntityWrapper<WoyaodangfangzhuEntity>();
// 调用 WoyaodangfangzhuService 的 queryPage 方法进行分页查询,使用 MPUtil 工具类处理排序、范围查询和模糊查询
PageUtils page = woyaodangfangzhuService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, woyaodangfangzhu), params), params));
// 返回一个成功的响应对象 R并将分页数据放置在响应的 "data" 字段中
return R.ok().put("data", page);
}
/**
*
*/
// @IgnoreAuth 注解表示该接口不需要进行身份验证
@IgnoreAuth
// 映射处理 /list 路径的请求,用于获取前端的“我要当房主”信息列表
@RequestMapping("/list")
// 处理列表请求的方法,接收请求参数、“我要当房主”信息实体对象以及 HttpServletRequest 对象
public R list(@RequestParam Map<String, Object> params, WoyaodangfangzhuEntity woyaodangfangzhu, HttpServletRequest request) {
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<WoyaodangfangzhuEntity> ew = new EntityWrapper<WoyaodangfangzhuEntity>();
// 调用 WoyaodangfangzhuService 的 queryPage 方法进行分页查询,使用 MPUtil 工具类处理排序、范围查询和模糊查询
PageUtils page = woyaodangfangzhuService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, woyaodangfangzhu), params), params));
// 返回一个成功的响应对象 R并将分页数据放置在响应的 "data" 字段中
return R.ok().put("data", page);
}
/**
*
*/
// 映射处理 /lists 路径的请求,用于获取“我要当房主”信息的列表
@RequestMapping("/lists")
// 处理列表请求的方法,接收“我要当房主”信息实体对象
public R list(WoyaodangfangzhuEntity woyaodangfangzhu) {
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<WoyaodangfangzhuEntity> ew = new EntityWrapper<WoyaodangfangzhuEntity>();
// 使用 MPUtil 工具类将实体对象的属性转换为查询条件,并设置到 EntityWrapper 中
ew.allEq(MPUtil.allEQMapPre(woyaodangfangzhu, "woyaodangfangzhu"));
// 调用 WoyaodangfangzhuService 的 selectListView 方法,根据查询条件获取列表视图数据
return R.ok().put("data", woyaodangfangzhuService.selectListView(ew));
}
/**
*
*/
// 映射处理 /query 路径的请求,用于查询“我要当房主”信息
@RequestMapping("/query")
// 处理查询请求的方法,接收“我要当房主”信息实体对象
public R query(WoyaodangfangzhuEntity woyaodangfangzhu) {
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<WoyaodangfangzhuEntity> ew = new EntityWrapper<WoyaodangfangzhuEntity>();
// 使用 MPUtil 工具类将实体对象的属性转换为查询条件,并设置到 EntityWrapper 中
ew.allEq(MPUtil.allEQMapPre(woyaodangfangzhu, "woyaodangfangzhu"));
// 调用 WoyaodangfangzhuService 的 selectView 方法,根据查询条件获取“我要当房主”信息视图对象
WoyaodangfangzhuView woyaodangfangzhuView = woyaodangfangzhuService.selectView(ew);
// 返回一个成功的响应对象 R附带查询成功的提示信息并将查询到的数据放置在响应的 "data" 字段中
return R.ok("查询我要当房主成功").put("data", woyaodangfangzhuView);
}
/**
*
*/
// 映射处理 /info/{id} 路径的请求,用于获取指定 ID 的“我要当房主”信息详情
@RequestMapping("/info/{id}")
// 处理详情请求的方法,接收路径参数 id
public R info(@PathVariable("id") Long id) {
// 调用 WoyaodangfangzhuService 的 selectById 方法,根据 ID 获取“我要当房主”信息实体对象
WoyaodangfangzhuEntity woyaodangfangzhu = woyaodangfangzhuService.selectById(id);
// 返回一个成功的响应对象 R并将获取到的“我要当房主”信息实体对象放置在响应的 "data" 字段中
return R.ok().put("data", woyaodangfangzhu);
}
/**
*
*/
// @IgnoreAuth 注解表示该接口不需要进行身份验证
@IgnoreAuth
// 映射处理 /detail/{id} 路径的请求,用于获取指定 ID 的“我要当房主”信息详情
@RequestMapping("/detail/{id}")
// 处理详情请求的方法,接收路径参数 id
public R detail(@PathVariable("id") Long id) {
// 调用 WoyaodangfangzhuService 的 selectById 方法,根据 ID 获取“我要当房主”信息实体对象
WoyaodangfangzhuEntity woyaodangfangzhu = woyaodangfangzhuService.selectById(id);
// 返回一个成功的响应对象 R并将获取到的“我要当房主”信息实体对象放置在响应的 "data" 字段中
return R.ok().put("data", woyaodangfangzhu);
}
/**
*
*/
// 映射处理 /save 路径的请求,用于在后端保存“我要当房主”信息
@RequestMapping("/save")
// 处理保存请求的方法,接收请求体中的“我要当房主”信息实体对象以及 HttpServletRequest 对象
public R save(@RequestBody WoyaodangfangzhuEntity woyaodangfangzhu, HttpServletRequest request) {
// 为“我要当房主”信息实体对象生成一个唯一的 ID由当前时间戳加上一个 0 到 999 的随机整数组成
woyaodangfangzhu.setId(new Date().getTime() + new Double(Math.floor(Math.random() * 1000)).longValue());
// 注释掉的代码用于验证实体对象的合法性
//ValidatorUtils.validateEntity(woyaodangfangzhu);
// 调用 WoyaodangfangzhuService 的 insert 方法,将“我要当房主”信息实体对象插入数据库
woyaodangfangzhuService.insert(woyaodangfangzhu);
// 返回一个成功的响应对象 R
return R.ok();
}
/**
*
*/
// 映射处理 /add 路径的请求,用于在前端保存“我要当房主”信息
@RequestMapping("/add")
// 处理保存请求的方法,接收请求体中的“我要当房主”信息实体对象以及 HttpServletRequest 对象
public R add(@RequestBody WoyaodangfangzhuEntity woyaodangfangzhu, HttpServletRequest request) {
// 为“我要当房主”信息实体对象生成一个唯一的 ID由当前时间戳加上一个 0 到 999 的随机整数组成
woyaodangfangzhu.setId(new Date().getTime() + new Double(Math.floor(Math.random() * 1000)).longValue());
// 注释掉的代码用于验证实体对象的合法性
//ValidatorUtils.validateEntity(woyaodangfangzhu);
// 调用 WoyaodangfangzhuService 的 insert 方法,将“我要当房主”信息实体对象插入数据库
woyaodangfangzhuService.insert(woyaodangfangzhu);
// 返回一个成功的响应对象 R
return R.ok();
}
/**
*
*/
// 映射处理 /update 路径的请求,用于更新“我要当房主”信息
@RequestMapping("/update")
// 处理更新请求的方法,接收请求体中的“我要当房主”信息实体对象以及 HttpServletRequest 对象
public R update(@RequestBody WoyaodangfangzhuEntity woyaodangfangzhu, HttpServletRequest request) {
// 注释掉的代码用于验证实体对象的合法性
//ValidatorUtils.validateEntity(woyaodangfangzhu);
// 调用 WoyaodangfangzhuService 的 updateById 方法,根据 ID 更新“我要当房主”信息实体对象的所有字段
woyaodangfangzhuService.updateById(woyaodangfangzhu);
// 返回一个成功的响应对象 R
return R.ok();
}
/**
*
*/
// 映射处理 /delete 路径的请求,用于删除“我要当房主”信息
@RequestMapping("/delete")
// 处理删除请求的方法,接收请求体中的 ID 数组
public R delete(@RequestBody Long[] ids) {
// 调用 WoyaodangfangzhuService 的 deleteBatchIds 方法,根据 ID 数组批量删除“我要当房主”信息实体对象
woyaodangfangzhuService.deleteBatchIds(Arrays.asList(ids));
// 返回一个成功的响应对象 R
return R.ok();
}
/**
*
*/
// 映射处理 /remind/{columnName}/{type} 路径的请求,用于统计符合特定条件的“我要当房主”信息数量(提醒相关)
@RequestMapping("/remind/{columnName}/{type}")
// 处理提醒统计请求的方法,接收路径参数 columnName 和 type请求参数 map 以及 HttpServletRequest 对象
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type, @RequestParam Map<String, Object> map) {
// 将路径参数 columnName 放入请求参数 map 中,键为 "column"
map.put("column", columnName);
// 将路径参数 type 放入请求参数 map 中,键为 "type"
map.put("type", type);
// 如果路径参数 type 的值等于 "2"
if (type.equals("2")) {
// 创建一个 SimpleDateFormat 对象,用于格式化日期,格式为 "yyyy-MM-dd"
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
// 获取当前的日历实例
Calendar c = Calendar.getInstance();
// 定义提醒开始日期变量,初始值为 null
Date remindStartDate = null;
// 定义提醒结束日期变量,初始值为 null
Date remindEndDate = null;
// 如果请求参数 map 中存在键为 "remindstart" 的值
if (map.get("remindstart") != null) {
// 将 "remindstart" 的值转换为整数类型,代表提醒开始的天数偏移量
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
// 设置日历实例的时间为当前日期
c.setTime(new Date());
// 在当前日期的基础上加上提醒开始的天数偏移量
c.add(Calendar.DAY_OF_MONTH, remindStart);
// 获取计算后的提醒开始日期
remindStartDate = c.getTime();
// 将格式化后的提醒开始日期放入请求参数 map 中,键为 "remindstart"
map.put("remindstart", sdf.format(remindStartDate));
}
// 如果请求参数 map 中存在键为 "remindend" 的值
if (map.get("remindend") != null) {
// 将 "remindend" 的值转换为整数类型,代表提醒结束的天数偏移量
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
// 设置日历实例的时间为当前日期
c.setTime(new Date());
// 在当前日期的基础上加上提醒结束的天数偏移量
c.add(Calendar.DAY_OF_MONTH, remindEnd);
// 获取计算后的提醒结束日期
remindEndDate = c.getTime();
// 将格式化后的提醒结束日期放入请求参数 map 中,键为 "remindend"
map.put("remindend", sdf.format(remindEndDate));
}
}
// 创建一个 MyBatis-Plus 的 Wrapper 对象,具体类型为 EntityWrapper<WoyaodangfangzhuEntity>,用于构建查询条件
Wrapper<WoyaodangfangzhuEntity> wrapper = new EntityWrapper<WoyaodangfangzhuEntity>();
// 如果请求参数 map 中存在键为 "remindstart" 的值
if (map.get("remindstart") != null) {
// 设置查询条件,要求查询结果中 columnName 对应的字段值大于等于提醒开始日期
wrapper.ge(columnName, map.get("remindstart"));
}
// 如果请求参数 map 中存在键为 "remindend" 的值
if (map.get("remindend") != null) {
// 设置查询条件,要求查询结果中 columnName 对应的字段值小于等于提醒结束日期
wrapper.le(columnName, map.get("remindend"));
}
// 从请求的会话中获取名为 "tableName" 的属性值,并转换为字符串类型
String tableName = request.getSession().getAttribute("tableName").toString();
// 如果获取到的 tableName 等于 "yonghu"(用户)
if (tableName.equals("yonghu")) {
// 设置查询条件,要求查询结果中 yonghuming 字段的值等于当前会话中名为 "username" 的属性值(用户名)
wrapper.eq("yonghuming", (String) request.getSession().getAttribute("username"));
}
// 调用 WoyaodangfangzhuService 的 selectCount 方法,根据构建的查询条件统计符合条件的记录数量
int count = woyaodangfangzhuService.selectCount(wrapper);
// 返回一个成功的响应对象 R并将统计数量放置在响应的 "count" 字段中
return R.ok().put("count", count);
}
}

@ -0,0 +1,394 @@
package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.YonghuEntity;
import com.entity.view.YonghuView;
import com.service.YonghuService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
/**
*
*
* @author
* @email
* @date 2025-04-04 18:46:21
*/
// 声明该类为一个 RESTful 风格的控制器,用于处理 HTTP 请求并返回 JSON 格式的响应
@RestController
// 为该控制器映射请求路径前缀为 "/yonghu",后续该控制器处理的请求都以这个路径为基础
@RequestMapping("/yonghu")
public class YonghuController {
// 自动注入 YonghuService 服务类的实例,以便在本控制器中调用其方法处理用户相关业务逻辑
@Autowired
private YonghuService yonghuService;
// 自动注入 TokenService 服务类的实例,用于生成和管理用户的令牌
@Autowired
private TokenService tokenService;
/**
*
*/
// @IgnoreAuth 注解表示该接口不需要进行身份验证
@IgnoreAuth
// 映射处理 HTTP 请求,路径为 "/login",处理用户登录操作
@RequestMapping(value = "/login")
// 处理用户登录请求的方法,接收用户名、密码、验证码和 HttpServletRequest 对象
public R login(String username, String password, String captcha, HttpServletRequest request) {
// 根据传入的用户名yonghuming 字段)从数据库中查询用户实体对象
YonghuEntity user = yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("yonghuming", username));
// 如果查询到的用户为空或者用户输入的密码与数据库中存储的密码mima 字段)不匹配
if (user == null || !user.getMima().equals(password)) {
// 返回错误响应,提示账号或密码不正确
return R.error("账号或密码不正确");
}
// 调用 TokenService 的 generateToken 方法生成用户令牌,传入用户 ID、用户名、用户类型"yonghu")和角色("用户"
String token = tokenService.generateToken(user.getId(), username, "yonghu", "用户");
// 返回成功响应,并将生成的令牌放入响应数据中(键为 "token"
return R.ok().put("token", token);
}
/**
*
*/
// @IgnoreAuth 注解表示该接口不需要进行身份验证
@IgnoreAuth
// 映射处理 HTTP 请求,路径为 "/register",处理用户注册操作
@RequestMapping("/register")
// 处理用户注册请求的方法,接收请求体中的用户实体对象
public R register(@RequestBody YonghuEntity yonghu) {
// 注释掉的代码,可能是用于验证实体对象的合法性(未实现或暂不使用)
//ValidatorUtils.validateEntity(yonghu);
// 根据传入的用户实体对象中的用户名yonghuming 字段)查询数据库中是否已存在该用户
YonghuEntity user = yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("yonghuming", yonghu.getYonghuming()));
// 如果查询到用户已存在
if (user != null) {
// 返回错误响应,提示注册用户已存在
return R.error("注册用户已存在");
}
// 生成一个以当前时间戳为值的用户 ID
Long uId = new Date().getTime();
// 将生成的用户 ID 设置到用户实体对象中
yonghu.setId(uId);
// 将用户实体对象插入到数据库中
yonghuService.insert(yonghu);
// 返回成功响应
return R.ok();
}
/**
* 退
*/
// 映射处理 HTTP 请求,路径为 "/logout",处理用户退出登录操作
@RequestMapping("/logout")
// 处理用户退出登录请求的方法,接收 HttpServletRequest 对象
public R logout(HttpServletRequest request) {
// 使当前用户的会话失效,即注销用户会话
request.getSession().invalidate();
// 返回成功响应,并附带退出成功的提示信息
return R.ok("退出成功");
}
/**
* session
*/
// 映射处理 HTTP 请求,路径为 "/session",用于获取当前会话中的用户信息
@RequestMapping("/session")
// 处理获取会话用户信息请求的方法,接收 HttpServletRequest 对象
public R getCurrUser(HttpServletRequest request) {
// 从当前会话中获取用户 ID假设存储在 "userId" 属性中)
Long id = (Long) request.getSession().getAttribute("userId");
// 根据获取到的用户 ID 从数据库中查询用户实体对象
YonghuEntity user = yonghuService.selectById(id);
// 返回成功响应,并将查询到的用户实体对象放入响应数据中(键为 "data"
return R.ok().put("data", user);
}
/**
*
*/
// @IgnoreAuth 注解表示该接口不需要进行身份验证
@IgnoreAuth
// 映射处理 HTTP 请求,路径为 "/resetPass",处理用户密码重置操作
@RequestMapping(value = "/resetPass")
// 处理用户密码重置请求的方法,接收用户名和 HttpServletRequest 对象
public R resetPass(String username, HttpServletRequest request) {
// 根据传入的用户名yonghuming 字段)从数据库中查询用户实体对象
YonghuEntity user = yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("yonghuming", username));
// 如果查询到的用户为空
if (user == null) {
// 返回错误响应,提示账号不存在
return R.error("账号不存在");
}
// 将用户的密码mima 字段)重置为 "123456"
user.setMima("123456");
// 根据用户 ID 更新数据库中的用户信息(只更新密码字段)
yonghuService.updateById(user);
// 返回成功响应,并附带密码已重置的提示信息
return R.ok("密码已重置为123456");
}
/**
*
*/
// 映射处理 HTTP 请求,路径为 "/page",用于获取后端的用户信息分页列表
@RequestMapping("/page")
// 处理分页请求的方法,接收请求参数、用户实体对象以及 HttpServletRequest 对象
public R page(@RequestParam Map<String, Object> params, YonghuEntity yonghu, HttpServletRequest request) {
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<YonghuEntity> ew = new EntityWrapper<YonghuEntity>();
// 调用 YonghuService 的 queryPage 方法进行分页查询,使用 MPUtil 工具类处理排序、范围查询和模糊查询
PageUtils page = yonghuService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, yonghu), params), params));
// 返回成功响应,并将分页数据放入响应数据中(键为 "data"
return R.ok().put("data", page);
}
/**
*
*/
// 映射处理 HTTP 请求,路径为 "/list",用于获取前端的用户信息列表
@RequestMapping("/list")
// 处理列表请求的方法,接收请求参数、用户实体对象以及 HttpServletRequest 对象
public R list(@RequestParam Map<String, Object> params, YonghuEntity yonghu, HttpServletRequest request) {
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<YonghuEntity> ew = new EntityWrapper<YonghuEntity>();
// 调用 YonghuService 的 queryPage 方法进行分页查询,使用 MPUtil 工具类处理排序、范围查询和模糊查询
PageUtils page = yonghuService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, yonghu), params), params));
// 返回成功响应,并将分页数据放入响应数据中(键为 "data"
return R.ok().put("data", page);
}
/**
*
*/
// 映射处理 HTTP 请求,路径为 "/lists",用于获取用户信息的列表
@RequestMapping("/lists")
// 处理列表请求的方法,接收用户实体对象
public R list(YonghuEntity yonghu) {
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<YonghuEntity> ew = new EntityWrapper<YonghuEntity>();
// 使用 MPUtil 工具类将实体对象的属性转换为查询条件,并设置到 EntityWrapper 中
ew.allEq(MPUtil.allEQMapPre(yonghu, "yonghu"));
// 调用 YonghuService 的 selectListView 方法,根据查询条件获取列表视图数据
return R.ok().put("data", yonghuService.selectListView(ew));
}
/**
*
*/
// 映射处理 HTTP 请求,路径为 "/query",用于查询用户信息
@RequestMapping("/query")
// 处理查询请求的方法,接收用户实体对象
public R query(YonghuEntity yonghu) {
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<YonghuEntity> ew = new EntityWrapper<YonghuEntity>();
// 使用 MPUtil 工具类将实体对象的属性转换为查询条件,并设置到 EntityWrapper 中
ew.allEq(MPUtil.allEQMapPre(yonghu, "yonghu"));
// 调用 YonghuService 的 selectView 方法,根据查询条件获取用户信息视图对象
YonghuView yonghuView = yonghuService.selectView(ew);
// 返回成功响应,附带查询成功的提示信息,并将查询到的数据放入响应数据中(键为 "data"
return R.ok("查询用户成功").put("data", yonghuView);
}
/**
*
*/
// 映射处理 HTTP 请求,路径为 "/info/{id}",用于获取指定 ID 的用户信息详情
@RequestMapping("/info/{id}")
// 处理详情请求的方法,接收路径参数 id
public R info(@PathVariable("id") Long id) {
// 根据传入的用户 ID 从数据库中查询用户实体对象
YonghuEntity yonghu = yonghuService.selectById(id);
// 返回成功响应,并将查询到的用户实体对象放入响应数据中(键为 "data"
return R.ok().put("data", yonghu);
}
/**
*
*/
// 映射处理 HTTP 请求,路径为 "/detail/{id}",用于获取指定 ID 的用户信息详情
@RequestMapping("/detail/{id}")
// 处理详情请求的方法,接收路径参数 id
public R detail(@PathVariable("id") Long id) {
// 根据传入的用户 ID 从数据库中查询用户实体对象
YonghuEntity yonghu = yonghuService.selectById(id);
// 返回成功响应,并将查询到的用户实体对象放入响应数据中(键为 "data"
return R.ok().put("data", yonghu);
}
/**
*
*/
// 映射处理 HTTP 请求,路径为 "/save",用于在后端保存用户信息
@RequestMapping("/save")
// 处理保存请求的方法,接收请求体中的用户实体对象以及 HttpServletRequest 对象
public R save(@RequestBody YonghuEntity yonghu, HttpServletRequest request) {
// 为用户实体对象生成一个唯一的 ID由当前时间戳加上一个 0 到 999 的随机整数组成
yonghu.setId(new Date().getTime() + new Double(Math.floor(Math.random() * 1000)).longValue());
// 注释掉的代码,可能是用于验证实体对象的合法性(未实现或暂不使用)
//ValidatorUtils.validateEntity(yonghu);
// 根据传入的用户实体对象中的用户名yonghuming 字段)查询数据库中是否已存在该用户
YonghuEntity user = yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("yonghuming", yonghu.getYonghuming()));
// 如果查询到用户已存在
if (user != null) {
// 返回错误响应,提示用户已存在
return R.error("用户已存在");
}
// 重新设置用户 ID 为当前时间戳
yonghu.setId(new Date().getTime());
// 将用户实体对象插入到数据库中
yonghuService.insert(yonghu);
// 返回成功响应
return R.ok();
}
/**
*
*/
// 映射处理 HTTP 请求,路径为 "/add",用于在前端保存用户信息
@RequestMapping("/add")
// 处理保存请求的方法,接收请求体中的用户实体对象以及 HttpServletRequest 对象
public R add(@RequestBody YonghuEntity yonghu, HttpServletRequest request) {
// 为用户实体对象生成一个唯一的 ID由当前时间戳加上一个 0 到 999 的随机整数组成
yonghu.setId(new Date().getTime() + new Double(Math.floor(Math.random() * 1000)).longValue());
// 注释掉的代码,可能是用于验证实体对象的合法性(未实现或暂不使用)
//ValidatorUtils.validateEntity(yonghu);
// 根据传入的用户实体对象中的用户名yonghuming 字段)查询数据库中是否已存在该用户
YonghuEntity user = yonghuService.selectOne(new EntityWrapper<YonghuEntity>().eq("yonghuming", yonghu.getYonghuming()));
// 如果查询到用户已存在
if (user != null) {
// 返回错误响应,提示用户已存在
return R.error("用户已存在");
}
// 重新设置用户 ID 为当前时间戳
yonghu.setId(new Date().getTime());
// 将用户实体对象插入到数据库中
yonghuService.insert(yonghu);
// 返回成功响应
return R.ok();
}
/**
*
*/
// 映射处理 HTTP 请求,路径为 "/update",用于更新用户信息
@RequestMapping("/update")
// 处理更新请求的方法,接收请求体中的用户实体对象以及 HttpServletRequest 对象
public R update(@RequestBody YonghuEntity yonghu, HttpServletRequest request) {
// 注释掉的代码,可能是用于验证实体对象的合法性(未实现或暂不使用)
//ValidatorUtils.validateEntity(yonghu);
// 根据用户 ID 更新数据库中的用户实体对象(更新所有字段)
yonghuService.updateById(yonghu);
// 返回成功响应
return R.ok();
}
/**
*
*/
// 映射处理 HTTP 请求,路径为 "/delete",用于删除用户信息
@RequestMapping("/delete")
// 处理删除请求的方法,接收请求体中的 ID 数组
public R delete(@RequestBody Long[] ids) {
// 根据传入的 ID 数组批量删除数据库中的用户实体对象
yonghuService.deleteBatchIds(Arrays.asList(ids));
// 返回成功响应
return R.ok();
}
/**
*
*/
// 映射处理 HTTP 请求,路径为 "/remind/{columnName}/{type}",用于统计符合特定条件的用户信息数量(提醒相关)
@RequestMapping("/remind/{columnName}/{type}")
// 处理提醒统计请求的方法,接收路径参数 columnName 和 type请求参数 map 以及 HttpServletRequest 对象
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type, @RequestParam Map<String, Object> map) {
// 将路径参数 columnName 放入请求参数 map 中,键为 "column"
map.put("column", columnName);
// 将路径参数 type 放入请求参数 map 中,键为 "type"
map.put("type", type);
// 如果路径参数 type 的值等于 "2"
if (type.equals("2")) {
// 创建一个 SimpleDateFormat 对象,用于格式化日期,格式为 "yyyy-MM-dd"
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
// 获取当前的日历实例
Calendar c = Calendar.getInstance();
// 定义提醒开始日期变量,初始值为 null
Date remindStartDate = null;
// 定义提醒结束日期变量,初始值为 null
Date remindEndDate = null;
// 如果请求参数 map 中存在键为 "remindstart" 的值
if (map.get("remindstart") != null) {
// 将 "remindstart" 的值转换为整数类型,代表提醒开始的天数偏移量
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
// 设置日历实例的时间为当前日期
c.setTime(new Date());
// 在当前日期的基础上加上提醒开始的天数偏移量
c.add(Calendar.DAY_OF_MONTH, remindStart);
// 获取计算后的提醒开始日期
remindStartDate = c.getTime();
// 将格式化后的提醒开始日期放入请求参数 map 中,键为 "remindstart"
map.put("remindstart", sdf.format(remindStartDate));
}
// 如果请求参数 map 中存在键为 "remindend" 的值
if (map.get("remindend") != null) {
// 将 "remindend" 的值转换为整数类型,代表提醒结束的天数偏移量
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
// 将日历实例 c 的时间设置为当前日期
c.setTime(new Date());
// 在当前日期的基础上,按照提醒结束的天数偏移量,增加相应的天数
c.add(Calendar.DAY_OF_MONTH,remindEnd);
// 获取增加天数后的日期,即提醒结束日期
remindEndDate = c.getTime();
// 将提醒结束日期按照 "yyyy-MM-dd" 的格式进行格式化,并将格式化后的日期重新放入请求参数 map 中,键为 "remindend"
map.put("remindend", sdf.format(remindEndDate));
}
}
// 创建一个 MyBatis-Plus 的 Wrapper 对象,具体类型为 EntityWrapper<YonghuEntity>,用于构建查询条件
Wrapper<YonghuEntity> wrapper = new EntityWrapper<YonghuEntity>();
if(map.get("remindstart")!=null) {
// 如果请求参数 map 中存在键为 "remindstart" 的值,
// 则在查询条件中设置 columnName 字段的值要大于等于提醒开始日期remindstart
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
// 如果请求参数 map 中存在键为 "remindend" 的值,
// 则在查询条件中设置 columnName 字段的值要小于等于提醒结束日期remindend
wrapper.le(columnName, map.get("remindend"));
}
// 调用 YonghuService 的 selectCount 方法根据构建的查询条件wrapper统计符合条件的记录数量
int count = yonghuService.selectCount(wrapper);
// 返回一个成功的响应对象 R并将统计得到的数量放置在响应的 "count" 字段中
return R.ok().put("count", count);
}
}

@ -0,0 +1,298 @@
package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.YuyuekanfangEntity;
import com.entity.view.YuyuekanfangView;
import com.service.YuyuekanfangService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
/**
*
*
* @author
* @email
* @date 2025-04-04 18:46:21
*/
// 声明该类为一个 RESTful 风格的控制器,用于处理 HTTP 请求并返回 JSON 格式的响应
@RestController
// 为该控制器映射请求路径前缀为 /yuyuekanfang后续该控制器处理的请求都以这个路径为基础
@RequestMapping("/yuyuekanfang")
public class YuyuekanfangController {
// 自动注入 YuyuekanfangService 服务类的实例,以便在本控制器中调用其方法处理预约看房相关业务逻辑
@Autowired
private YuyuekanfangService yuyuekanfangService;
/**
*
*/
// 映射处理 HTTP 请求,路径为 /page用于获取后端的预约看房信息分页列表
@RequestMapping("/page")
// 处理分页请求的方法,接收请求参数、预约看房信息实体对象以及 HttpServletRequest 对象
public R page(@RequestParam Map<String, Object> params, YuyuekanfangEntity yuyuekanfang, HttpServletRequest request) {
// 从请求的会话中获取名为 "tableName" 的属性值,并转换为字符串类型
String tableName = request.getSession().getAttribute("tableName").toString();
// 如果获取到的 tableName 等于 "yonghu"(用户)
if (tableName.equals("yonghu")) {
// 将当前会话中名为 "username" 的属性值(用户名)设置到预约看房信息实体的 yonghuming 字段中
yuyuekanfang.setYonghuming((String) request.getSession().getAttribute("username"));
}
// 如果获取到的 tableName 等于 "fangzhu"(房主)
if (tableName.equals("fangzhu")) {
// 将当前会话中名为 "username" 的属性值(房主账号)设置到预约看房信息实体的 fangzhuzhanghao 字段中
yuyuekanfang.setFangzhuzhanghao((String) request.getSession().getAttribute("username"));
}
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<YuyuekanfangEntity> ew = new EntityWrapper<YuyuekanfangEntity>();
// 调用 YuyuekanfangService 的 queryPage 方法进行分页查询,使用 MPUtil 工具类处理排序、范围查询和模糊查询
PageUtils page = yuyuekanfangService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, yuyuekanfang), params), params));
// 返回成功响应,并将分页数据放入响应数据中(键为 "data"
return R.ok().put("data", page);
}
/**
*
*/
// 映射处理 HTTP 请求,路径为 /list用于获取前端的预约看房信息列表
@RequestMapping("/list")
// 处理列表请求的方法,接收请求参数、预约看房信息实体对象以及 HttpServletRequest 对象
public R list(@RequestParam Map<String, Object> params, YuyuekanfangEntity yuyuekanfang, HttpServletRequest request) {
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<YuyuekanfangEntity> ew = new EntityWrapper<YuyuekanfangEntity>();
// 调用 YuyuekanfangService 的 queryPage 方法进行分页查询,使用 MPUtil 工具类处理排序、范围查询和模糊查询
PageUtils page = yuyuekanfangService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, yuyuekanfang), params), params));
// 返回成功响应,并将分页数据放入响应数据中(键为 "data"
return R.ok().put("data", page);
}
/**
*
*/
// 映射处理 HTTP 请求,路径为 /lists用于获取预约看房信息的列表
@RequestMapping("/lists")
// 处理列表请求的方法,接收预约看房信息实体对象
public R list(YuyuekanfangEntity yuyuekanfang) {
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<YuyuekanfangEntity> ew = new EntityWrapper<YuyuekanfangEntity>();
// 使用 MPUtil 工具类将实体对象的属性转换为查询条件,并设置到 EntityWrapper 中
ew.allEq(MPUtil.allEQMapPre(yuyuekanfang, "yuyuekanfang"));
// 调用 YuyuekanfangService 的 selectListView 方法,根据查询条件获取列表视图数据
return R.ok().put("data", yuyuekanfangService.selectListView(ew));
}
/**
*
*/
// 映射处理 HTTP 请求,路径为 /query用于查询预约看房信息
@RequestMapping("/query")
// 处理查询请求的方法,接收预约看房信息实体对象
public R query(YuyuekanfangEntity yuyuekanfang) {
// 创建一个 MyBatis-Plus 的 EntityWrapper 对象,用于构建查询条件
EntityWrapper<YuyuekanfangEntity> ew = new EntityWrapper<YuyuekanfangEntity>();
// 使用 MPUtil 工具类将实体对象的属性转换为查询条件,并设置到 EntityWrapper 中
ew.allEq(MPUtil.allEQMapPre(yuyuekanfang, "yuyuekanfang"));
// 调用 YuyuekanfangService 的 selectView 方法,根据查询条件获取预约看房信息视图对象
YuyuekanfangView yuyuekanfangView = yuyuekanfangService.selectView(ew);
// 返回成功响应,附带查询成功的提示信息,并将查询到的数据放入响应数据中(键为 "data"
return R.ok("查询预约看房成功").put("data", yuyuekanfangView);
}
/**
*
*/
// 映射处理 HTTP 请求,路径为 /info/{id},用于获取指定 ID 的预约看房信息详情
@RequestMapping("/info/{id}")
// 处理详情请求的方法,接收路径参数 id
public R info(@PathVariable("id") Long id) {
// 根据传入的预约看房信息 ID 从数据库中查询预约看房信息实体对象
YuyuekanfangEntity yuyuekanfang = yuyuekanfangService.selectById(id);
// 返回成功响应,并将查询到的预约看房信息实体对象放入响应数据中(键为 "data"
return R.ok().put("data", yuyuekanfang);
}
/**
*
*/
// 映射处理 HTTP 请求,路径为 /detail/{id},用于获取指定 ID 的预约看房信息详情
@RequestMapping("/detail/{id}")
// 处理详情请求的方法,接收路径参数 id
public R detail(@PathVariable("id") Long id) {
// 根据传入的预约看房信息 ID 从数据库中查询预约看房信息实体对象
YuyuekanfangEntity yuyuekanfang = yuyuekanfangService.selectById(id);
// 返回成功响应,并将查询到的预约看房信息实体对象放入响应数据中(键为 "data"
return R.ok().put("data", yuyuekanfang);
}
/**
*
*/
// 映射处理 HTTP 请求,路径为 /save用于在后端保存预约看房信息
@RequestMapping("/save")
// 处理保存请求的方法,接收请求体中的预约看房信息实体对象以及 HttpServletRequest 对象
public R save(@RequestBody YuyuekanfangEntity yuyuekanfang, HttpServletRequest request) {
// 为预约看房信息实体对象生成一个唯一的 ID由当前时间戳加上一个 0 到 999 的随机整数组成
yuyuekanfang.setId(new Date().getTime() + new Double(Math.floor(Math.random() * 1000)).longValue());
// 注释掉的代码,可能是用于验证实体对象的合法性(未实现或暂不使用)
//ValidatorUtils.validateEntity(yuyuekanfang);
// 将预约看房信息实体对象插入到数据库中
yuyuekanfangService.insert(yuyuekanfang);
// 返回成功响应
return R.ok();
}
/**
*
*/
// 映射处理 HTTP 请求,路径为 /add用于在前端保存预约看房信息
@RequestMapping("/add")
// 处理保存请求的方法,接收请求体中的预约看房信息实体对象以及 HttpServletRequest 对象
public R add(@RequestBody YuyuekanfangEntity yuyuekanfang, HttpServletRequest request) {
// 为预约看房信息实体对象生成一个唯一的 ID由当前时间戳加上一个 0 到 999 的随机整数组成
yuyuekanfang.setId(new Date().getTime() + new Double(Math.floor(Math.random() * 1000)).longValue());
// 注释掉的代码,可能是用于验证实体对象的合法性(未实现或暂不使用)
//ValidatorUtils.validateEntity(yuyuekanfang);
// 将预约看房信息实体对象插入到数据库中
yuyuekanfangService.insert(yuyuekanfang);
// 返回成功响应
return R.ok();
}
/**
*
*/
// 映射处理 HTTP 请求,路径为 /update用于更新预约看房信息
@RequestMapping("/update")
// 处理更新请求的方法,接收请求体中的预约看房信息实体对象以及 HttpServletRequest 对象
public R update(@RequestBody YuyuekanfangEntity yuyuekanfang, HttpServletRequest request) {
// 注释掉的代码,可能是用于验证实体对象的合法性(未实现或暂不使用)
//ValidatorUtils.validateEntity(yuyuekanfang);
// 根据预约看房信息实体对象的 ID 更新数据库中的该对象(更新所有字段)
yuyuekanfangService.updateById(yuyuekanfang);
// 返回成功响应
return R.ok();
}
/**
*
*/
// 映射处理 HTTP 请求,路径为 /delete用于删除预约看房信息
@RequestMapping("/delete")
// 处理删除请求的方法,接收请求体中的 ID 数组
public R delete(@RequestBody Long[] ids) {
// 根据传入的 ID 数组批量删除数据库中的预约看房信息实体对象
yuyuekanfangService.deleteBatchIds(Arrays.asList(ids));
// 返回成功响应
return R.ok();
}
/**
*
*/
// 映射处理 HTTP 请求,路径为 /remind/{columnName}/{type},用于统计符合特定条件的预约看房信息数量(提醒相关)
@RequestMapping("/remind/{columnName}/{type}")
// 处理提醒统计请求的方法,接收路径参数 columnName 和 type请求参数 map 以及 HttpServletRequest 对象
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type, @RequestParam Map<String, Object> map) {
// 将路径参数 columnName 放入请求参数 map 中,键为 "column"
map.put("column", columnName);
// 将路径参数 type 放入请求参数 map 中,键为 "type"
map.put("type", type);
// 如果路径参数 type 的值等于 "2"
if (type.equals("2")) {
// 创建一个 SimpleDateFormat 对象,用于格式化日期,格式为 "yyyy-MM-dd"
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
// 获取当前的日历实例
Calendar c = Calendar.getInstance();
// 定义提醒开始日期变量,初始值为 null
Date remindStartDate = null;
// 定义提醒结束日期变量,初始值为 null
Date remindEndDate = null;
// 如果请求参数 map 中存在键为 "remindstart" 的值
if (map.get("remindstart") != null) {
// 将 "remindstart" 的值转换为整数类型,代表提醒开始的天数偏移量
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
// 设置日历实例的时间为当前日期
c.setTime(new Date());
// 在当前日期的基础上加上提醒开始的天数偏移量
c.add(Calendar.DAY_OF_MONTH, remindStart);
// 获取计算后的提醒开始日期
remindStartDate = c.getTime();
// 将格式化后的提醒开始日期放入请求参数 map 中,键为 "remindstart"
map.put("remindstart", sdf.format(remindStartDate));
}
// 如果请求参数 map 中存在键为 "remindend" 的值
if (map.get("remindend") != null) {
// 将 "remindend" 的值转换为整数类型,代表提醒结束的天数偏移量
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
// 设置日历实例的时间为当前日期
c.setTime(new Date());
// 在当前日期的基础上加上提醒结束的天数偏移量
c.add(Calendar.DAY_OF_MONTH, remindEnd);
// 获取计算后的提醒结束日期
remindEndDate = c.getTime();
// 将格式化后的提醒结束日期放入请求参数 map 中,键为 "remindend"
map.put("remindend", sdf.format(remindEndDate));
}
}
// 创建一个 MyBatis-Plus 的 Wrapper 对象,具体类型为 EntityWrapper<YuyuekanfangEntity>,用于构建查询条件
Wrapper<YuyuekanfangEntity> wrapper = new EntityWrapper<YuyuekanfangEntity>();
// 如果请求参数 map 中存在键为 "remindstart" 的值
if (map.get("remindstart") != null) {
// 在查询条件中设置 columnName 字段的值要大于等于提醒开始日期remindstart
wrapper.ge(columnName, map.get("remindstart"));
}
// 如果请求参数 map 中存在键为 "remindend" 的值
if (map.get("remindend") != null) {
// 在查询条件中设置 columnName 字段的值要小于等于提醒结束日期remindend
wrapper.le(columnName, map.get("remindend"));
}
// 从请求的会话中获取名为 "tableName" 的属性值,并转换为字符串类型
String tableName = request.getSession().getAttribute("tableName").toString();
// 如果获取到的 tableName 等于 "yonghu"(用户)
if (tableName.equals("yonghu")) {
// 在查询条件中设置 yonghuming 字段的值等于当前会话中名为 "username" 的属性值(用户名)
wrapper.eq("yonghuming", (String) request.getSession().getAttribute("username"));
}
// 如果获取到的 tableName 等于 "fangzhu"(房主)
if (tableName.equals("fangzhu")) {
// 在查询条件中设置 fangzhuzhanghao 字段的值等于当前会话中名为 "username" 的属性值(房主账号)
wrapper.eq("fangzhuzhanghao", (String) request.getSession().getAttribute("username"));
}
// 调用 YuyuekanfangService 的 selectCount 方法根据构建的查询条件wrapper统计符合条件的记录数量
int count = yuyuekanfangService.selectCount(wrapper);
// 返回一个成功的响应对象 R并将统计得到的数量放置在响应的 "count" 字段中
return R.ok().put("count", count);
}
}

@ -0,0 +1,34 @@
package com.dao;
import java.util.List;
import java.util.Map;
/**
*
*/
public interface CommonDao{
// 获取选项列表根据传入的参数Map<String, Object> params进行查询返回值为包含字符串的列表
List<String> getOption(Map<String, Object> params);
// 根据传入的参数Map<String, Object> params进行查询返回一个包含各种属性的Map对象具体含义由业务逻辑决定
Map<String, Object> getFollowByOption(Map<String, Object> params);
// 获取另一组选项列表根据传入的参数Map<String, Object> params进行查询返回值为包含字符串的列表与getOption方法的区别可能在于查询逻辑或返回数据不同
List<String> getFollowByOption2(Map<String, Object> params);
// 执行名为sh的操作具体功能由实现类决定传入参数为Map<String, Object> params
void sh(Map<String, Object> params);
// 根据传入的参数Map<String, Object> params进行查询统计符合条件的数量返回统计的数量值
int remindCount(Map<String, Object> params);
// 根据传入的参数Map<String, Object> params进行查询返回一个包含计算结果或相关数据的Map对象具体计算逻辑由业务决定
Map<String, Object> selectCal(Map<String, Object> params);
// 根据传入的参数Map<String, Object> params进行查询返回一个包含多个Map对象的列表每个Map对象可能代表分组后的统计数据或相关信息分组逻辑由业务决定
List<Map<String, Object>> selectGroup(Map<String, Object> params);
// 根据传入的参数Map<String, Object> params进行查询返回一个包含多个Map对象的列表每个Map对象可能代表特定的值或相关数据具体含义由业务逻辑决定
List<Map<String, Object>> selectValue(Map<String, Object> params);
}

@ -0,0 +1,12 @@
package com.dao;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.entity.ConfigEntity;
/**
*
*/
public interface ConfigDao extends BaseMapper<ConfigEntity> {
}

@ -0,0 +1,40 @@
package com.dao;
import com.entity.DiscussfangwuxinxiEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.vo.DiscussfangwuxinxiVO;
import com.entity.view.DiscussfangwuxinxiView;
/**
*
*
* @author
* @email
* @date 2025-04-04 18:46:21
*/
// 定义一个名为DiscussfangwuxinxiDao的接口它继承自BaseMapper<DiscussfangwuxinxiEntity>
// 意味着该接口具备对DiscussfangwuxinxiEntity实体进行基本数据库操作的能力如插入、更新、删除、查询等
public interface DiscussfangwuxinxiDao extends BaseMapper<DiscussfangwuxinxiEntity> {
// 根据传入的查询条件Wrapper<DiscussfangwuxinxiEntity> wrapper查询符合条件的房屋信息评论视图对象DiscussfangwuxinxiVO列表
List<DiscussfangwuxinxiVO> selectListVO(@Param("ew") Wrapper<DiscussfangwuxinxiEntity> wrapper);
// 根据传入的查询条件Wrapper<DiscussfangwuxinxiEntity> wrapper查询符合条件的单个房屋信息评论视图对象DiscussfangwuxinxiVO
DiscussfangwuxinxiVO selectVO(@Param("ew") Wrapper<DiscussfangwuxinxiEntity> wrapper);
// 根据传入的查询条件Wrapper<DiscussfangwuxinxiEntity> wrapper查询符合条件的房屋信息评论视图DiscussfangwuxinxiView列表
List<DiscussfangwuxinxiView> selectListView(@Param("ew") Wrapper<DiscussfangwuxinxiEntity> wrapper);
// 根据传入的分页信息Pagination page和查询条件Wrapper<DiscussfangwuxinxiEntity> wrapper
// 分页查询符合条件的房屋信息评论视图DiscussfangwuxinxiView列表
List<DiscussfangwuxinxiView> selectListView(Pagination page, @Param("ew") Wrapper<DiscussfangwuxinxiEntity> wrapper);
// 根据传入的查询条件Wrapper<DiscussfangwuxinxiEntity> wrapper查询符合条件的单个房屋信息评论视图DiscussfangwuxinxiView
DiscussfangwuxinxiView selectView(@Param("ew") Wrapper<DiscussfangwuxinxiEntity> wrapper);
}

@ -0,0 +1,44 @@
package com.dao;
import com.entity.DiscusswoyaodangfangzhuEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.vo.DiscusswoyaodangfangzhuVO;
import com.entity.view.DiscusswoyaodangfangzhuView;
/**
*
*
* @author
* @email
* @date 2025-04-04 18:46:21
*/
// 定义一个名为DiscusswoyaodangfangzhuDao的接口它继承自BaseMapper<DiscusswoyaodangfangzhuEntity>
// 这意味着该接口具备对DiscusswoyaodangfangzhuEntity实体进行基础数据库操作如插入、更新、删除、查询等的能力
public interface DiscusswoyaodangfangzhuDao extends BaseMapper<DiscusswoyaodangfangzhuEntity> {
// 根据传入的查询条件Wrapper<DiscusswoyaodangfangzhuEntity> wrapper
// 查询并返回符合条件的“我要当房主”评论视图对象DiscusswoyaodangfangzhuVO的列表
List<DiscusswoyaodangfangzhuVO> selectListVO(@Param("ew") Wrapper<DiscusswoyaodangfangzhuEntity> wrapper);
// 根据传入的查询条件Wrapper<DiscusswoyaodangfangzhuEntity> wrapper
// 查询并返回符合条件的单个“我要当房主”评论视图对象DiscusswoyaodangfangzhuVO
DiscusswoyaodangfangzhuVO selectVO(@Param("ew") Wrapper<DiscusswoyaodangfangzhuEntity> wrapper);
// 根据传入的查询条件Wrapper<DiscusswoyaodangfangzhuEntity> wrapper
// 查询并返回符合条件的“我要当房主”评论视图DiscusswoyaodangfangzhuView的列表
List<DiscusswoyaodangfangzhuView> selectListView(@Param("ew") Wrapper<DiscusswoyaodangfangzhuEntity> wrapper);
// 根据传入的分页信息Pagination page和查询条件Wrapper<DiscusswoyaodangfangzhuEntity> wrapper
// 进行分页查询返回符合条件的“我要当房主”评论视图DiscusswoyaodangfangzhuView的列表
List<DiscusswoyaodangfangzhuView> selectListView(Pagination page, @Param("ew") Wrapper<DiscusswoyaodangfangzhuEntity> wrapper);
// 根据传入的查询条件Wrapper<DiscusswoyaodangfangzhuEntity> wrapper
// 查询并返回符合条件的单个“我要当房主”评论视图DiscusswoyaodangfangzhuView
DiscusswoyaodangfangzhuView selectView(@Param("ew") Wrapper<DiscusswoyaodangfangzhuEntity> wrapper);
}

@ -0,0 +1,45 @@
package com.dao;
import com.entity.FangwubaoxiuEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.vo.FangwubaoxiuVO;
import com.entity.view.FangwubaoxiuView;
/**
*
*
* @author
* @email
* @date 2025-04-04 18:46:21
*/
// 定义一个名为FangwubaoxiuDao的接口继承自BaseMapper<FangwubaoxiuEntity>
// 表明该接口可以使用MyBatis-Plus提供的针对FangwubaoxiuEntity实体的基础数据库操作方法
public interface FangwubaoxiuDao extends BaseMapper<FangwubaoxiuEntity> {
// 根据传入的查询条件Wrapper<FangwubaoxiuEntity> wrapper查询符合条件的房屋报修视图对象列表
// 返回一个包含FangwubaoxiuVO对象的List集合
List<FangwubaoxiuVO> selectListVO(@Param("ew") Wrapper<FangwubaoxiuEntity> wrapper);
// 根据传入的查询条件Wrapper<FangwubaoxiuEntity> wrapper查询符合条件的单个房屋报修视图对象
// 返回一个FangwubaoxiuVO对象
FangwubaoxiuVO selectVO(@Param("ew") Wrapper<FangwubaoxiuEntity> wrapper);
// 根据传入的查询条件Wrapper<FangwubaoxiuEntity> wrapper查询符合条件的房屋报修视图列表
// 返回一个包含FangwubaoxiuView对象的List集合
List<FangwubaoxiuView> selectListView(@Param("ew") Wrapper<FangwubaoxiuEntity> wrapper);
// 根据传入的分页信息Pagination page和查询条件Wrapper<FangwubaoxiuEntity> wrapper
// 进行分页查询,返回符合条件的房屋报修视图列表
// 返回一个包含FangwubaoxiuView对象的List集合
List<FangwubaoxiuView> selectListView(Pagination page, @Param("ew") Wrapper<FangwubaoxiuEntity> wrapper);
// 根据传入的查询条件Wrapper<FangwubaoxiuEntity> wrapper查询符合条件的单个房屋报修视图
// 返回一个FangwubaoxiuView对象
FangwubaoxiuView selectView(@Param("ew") Wrapper<FangwubaoxiuEntity> wrapper);
}

@ -0,0 +1,45 @@
package com.dao;
import com.entity.FangwuleixingEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.vo.FangwuleixingVO;
import com.entity.view.FangwuleixingView;
/**
*
*
* @author
* @email
* @date 2025-04-04 18:46:21
*/
// 定义一个名为FangwuleixingDao的接口继承自BaseMapper<FangwuleixingEntity>
// 意味着该接口具备对FangwuleixingEntity实体进行基本数据库操作如增删改查的能力
public interface FangwuleixingDao extends BaseMapper<FangwuleixingEntity> {
// 根据传入的查询条件Wrapper<FangwuleixingEntity> wrapper查询符合条件的房屋类型视图对象列表
// 以List形式返回FangwuleixingVO对象@Param("ew")用于给查询条件参数命名
List<FangwuleixingVO> selectListVO(@Param("ew") Wrapper<FangwuleixingEntity> wrapper);
// 根据传入的查询条件Wrapper<FangwuleixingEntity> wrapper查询符合条件的单个房屋类型视图对象
// 返回一个FangwuleixingVO对象@Param("ew")用于给查询条件参数命名
FangwuleixingVO selectVO(@Param("ew") Wrapper<FangwuleixingEntity> wrapper);
// 根据传入的查询条件Wrapper<FangwuleixingEntity> wrapper查询符合条件的房屋类型视图列表
// 以List形式返回FangwuleixingView对象@Param("ew")用于给查询条件参数命名
List<FangwuleixingView> selectListView(@Param("ew") Wrapper<FangwuleixingEntity> wrapper);
// 根据传入的分页信息Pagination page和查询条件Wrapper<FangwuleixingEntity> wrapper
// 进行分页查询,返回符合条件的房屋类型视图列表
// 以List形式返回FangwuleixingView对象@Param("ew")用于给查询条件参数命名
List<FangwuleixingView> selectListView(Pagination page, @Param("ew") Wrapper<FangwuleixingEntity> wrapper);
// 根据传入的查询条件Wrapper<FangwuleixingEntity> wrapper查询符合条件的单个房屋类型视图
// 返回一个FangwuleixingView对象@Param("ew")用于给查询条件参数命名
FangwuleixingView selectView(@Param("ew") Wrapper<FangwuleixingEntity> wrapper);
}

@ -0,0 +1,45 @@
package com.dao;
import com.entity.FangwupingjiaEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.vo.FangwupingjiaVO;
import com.entity.view.FangwupingjiaView;
/**
*
*
* @author
* @email
* @date 2025-04-04 18:46:21
*/
// 定义一个名为FangwupingjiaDao的接口它继承自BaseMapper<FangwupingjiaEntity>
// 这使得该接口具备了对FangwupingjiaEntity实体进行基础数据库操作如插入、更新、删除、查询等的能力
public interface FangwupingjiaDao extends BaseMapper<FangwupingjiaEntity> {
// 根据传入的查询条件Wrapper<FangwupingjiaEntity> wrapper查询符合条件的房屋评价视图对象列表
// 返回值为包含FangwupingjiaVO对象的List集合@Param("ew")注解用于指定传入的查询条件参数名
List<FangwupingjiaVO> selectListVO(@Param("ew") Wrapper<FangwupingjiaEntity> wrapper);
// 根据传入的查询条件Wrapper<FangwupingjiaEntity> wrapper查询符合条件的单个房屋评价视图对象
// 返回一个FangwupingjiaVO对象@Param("ew")用于指定查询条件参数名
FangwupingjiaVO selectVO(@Param("ew") Wrapper<FangwupingjiaEntity> wrapper);
// 根据传入的查询条件Wrapper<FangwupingjiaEntity> wrapper查询符合条件的房屋评价视图列表
// 返回值为包含FangwupingjiaView对象的List集合@Param("ew")指定查询条件参数名
List<FangwupingjiaView> selectListView(@Param("ew") Wrapper<FangwupingjiaEntity> wrapper);
// 根据传入的分页信息Pagination page和查询条件Wrapper<FangwupingjiaEntity> wrapper
// 进行分页查询,返回符合条件的房屋评价视图列表
// 返回值为包含FangwupingjiaView对象的List集合@Param("ew")指定查询条件参数名
List<FangwupingjiaView> selectListView(Pagination page, @Param("ew") Wrapper<FangwupingjiaEntity> wrapper);
// 根据传入的查询条件Wrapper<FangwupingjiaEntity> wrapper查询符合条件的单个房屋评价视图
// 返回一个FangwupingjiaView对象@Param("ew")指定查询条件参数名
FangwupingjiaView selectView(@Param("ew") Wrapper<FangwupingjiaEntity> wrapper);
}

@ -0,0 +1,45 @@
package com.dao;
import com.entity.FangwuxinxiEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.vo.FangwuxinxiVO;
import com.entity.view.FangwuxinxiView;
/**
*
*
* @author
* @email
* @date 2025-04-04 18:46:21
*/
// 定义一个名为FangwuxinxiDao的接口继承自BaseMapper<FangwuxinxiEntity>
// 表明该接口可使用MyBatis-Plus提供的对FangwuxinxiEntity实体的基本数据库操作功能
public interface FangwuxinxiDao extends BaseMapper<FangwuxinxiEntity> {
// 根据传入的查询条件Wrapper<FangwuxinxiEntity> wrapper查询符合条件的房屋信息视图对象列表
// 返回一个包含FangwuxinxiVO对象的列表@Param("ew")用于指定参数名方便在SQL映射中引用
List<FangwuxinxiVO> selectListVO(@Param("ew") Wrapper<FangwuxinxiEntity> wrapper);
// 根据传入的查询条件Wrapper<FangwuxinxiEntity> wrapper查询符合条件的单个房屋信息视图对象
// 返回一个FangwuxinxiVO对象@Param("ew")用于指定参数名
FangwuxinxiVO selectVO(@Param("ew") Wrapper<FangwuxinxiEntity> wrapper);
// 根据传入的查询条件Wrapper<FangwuxinxiEntity> wrapper查询符合条件的房屋信息视图列表
// 返回一个包含FangwuxinxiView对象的列表@Param("ew")用于指定参数名
List<FangwuxinxiView> selectListView(@Param("ew") Wrapper<FangwuxinxiEntity> wrapper);
// 根据传入的分页信息Pagination page和查询条件Wrapper<FangwuxinxiEntity> wrapper
// 进行分页查询,返回符合条件的房屋信息视图列表
// 返回一个包含FangwuxinxiView对象的列表@Param("ew")用于指定参数名
List<FangwuxinxiView> selectListView(Pagination page, @Param("ew") Wrapper<FangwuxinxiEntity> wrapper);
// 根据传入的查询条件Wrapper<FangwuxinxiEntity> wrapper查询符合条件的单个房屋信息视图
// 返回一个FangwuxinxiView对象@Param("ew")用于指定参数名
FangwuxinxiView selectView(@Param("ew") Wrapper<FangwuxinxiEntity> wrapper);
}

@ -0,0 +1,45 @@
package com.dao;
import com.entity.FangzhuEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.vo.FangzhuVO;
import com.entity.view.FangzhuView;
/**
*
*
* @author
* @email
* @date 2025-04-04 18:46:21
*/
// 定义一个名为FangzhuDao的接口继承自BaseMapper<FangzhuEntity>
// 意味着该接口具备对FangzhuEntity实体进行基本数据库操作如增删改查的能力
public interface FangzhuDao extends BaseMapper<FangzhuEntity> {
// 根据传入的查询条件Wrapper<FangzhuEntity> wrapper查询符合条件的房主视图对象列表
// 返回一个包含FangzhuVO对象的列表@Param("ew")用于指定查询条件的参数名
List<FangzhuVO> selectListVO(@Param("ew") Wrapper<FangzhuEntity> wrapper);
// 根据传入的查询条件Wrapper<FangzhuEntity> wrapper查询符合条件的单个房主视图对象
// 返回一个FangzhuVO对象@Param("ew")用于指定查询条件的参数名
FangzhuVO selectVO(@Param("ew") Wrapper<FangzhuEntity> wrapper);
// 根据传入的查询条件Wrapper<FangzhuEntity> wrapper查询符合条件的房主视图列表
// 返回一个包含FangzhuView对象的列表@Param("ew")用于指定查询条件的参数名
List<FangzhuView> selectListView(@Param("ew") Wrapper<FangzhuEntity> wrapper);
// 根据传入的分页信息Pagination page和查询条件Wrapper<FangzhuEntity> wrapper
// 进行分页查询,返回符合条件的房主视图列表
// 返回一个包含FangzhuView对象的列表@Param("ew")用于指定查询条件的参数名
List<FangzhuView> selectListView(Pagination page, @Param("ew") Wrapper<FangzhuEntity> wrapper);
// 根据传入的查询条件Wrapper<FangzhuEntity> wrapper查询符合条件的单个房主视图
// 返回一个FangzhuView对象@Param("ew")用于指定查询条件的参数名
FangzhuView selectView(@Param("ew") Wrapper<FangzhuEntity> wrapper);
}

@ -0,0 +1,45 @@
package com.dao;
import com.entity.HetongxinxiEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.vo.HetongxinxiVO;
import com.entity.view.HetongxinxiView;
/**
*
*
* @author
* @email
* @date 2025-04-04 18:46:21
*/
// 定义一个名为HetongxinxiDao的接口它继承自BaseMapper<HetongxinxiEntity>
// 表明该接口能够使用MyBatis-Plus提供的针对HetongxinxiEntity实体的基础数据库操作方法如增、删、改、查
public interface HetongxinxiDao extends BaseMapper<HetongxinxiEntity> {
// 根据传入的查询条件Wrapper<HetongxinxiEntity> wrapper查询并返回符合条件的合同信息视图对象列表
// 返回值为一个包含HetongxinxiVO对象的List集合@Param("ew")用于指定参数名方便在SQL映射中引用该查询条件
List<HetongxinxiVO> selectListVO(@Param("ew") Wrapper<HetongxinxiEntity> wrapper);
// 根据传入的查询条件Wrapper<HetongxinxiEntity> wrapper查询并返回符合条件的单个合同信息视图对象
// 返回一个HetongxinxiVO对象@Param("ew")用于指定参数名
HetongxinxiVO selectVO(@Param("ew") Wrapper<HetongxinxiEntity> wrapper);
// 根据传入的查询条件Wrapper<HetongxinxiEntity> wrapper查询并返回符合条件的合同信息视图列表
// 返回值为一个包含HetongxinxiView对象的List集合@Param("ew")用于指定参数名
List<HetongxinxiView> selectListView(@Param("ew") Wrapper<HetongxinxiEntity> wrapper);
// 根据传入的分页信息Pagination page和查询条件Wrapper<HetongxinxiEntity> wrapper
// 进行分页查询,返回符合条件的合同信息视图列表
// 返回值为一个包含HetongxinxiView对象的List集合@Param("ew")用于指定参数名
List<HetongxinxiView> selectListView(Pagination page, @Param("ew") Wrapper<HetongxinxiEntity> wrapper);
// 根据传入的查询条件Wrapper<HetongxinxiEntity> wrapper查询并返回符合条件的单个合同信息视图
// 返回一个HetongxinxiView对象@Param("ew")用于指定参数名
HetongxinxiView selectView(@Param("ew") Wrapper<HetongxinxiEntity> wrapper);
}

@ -0,0 +1,45 @@
package com.dao;
import com.entity.MessagesEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.vo.MessagesVO;
import com.entity.view.MessagesView;
/**
*
*
* @author
* @email
* @date 2025-04-04 18:46:21
*/
// 定义一个名为MessagesDao的接口继承自BaseMapper<MessagesEntity>
// 表明该接口具备对MessagesEntity实体进行基本数据库操作如插入、更新、删除、查询等的能力
public interface MessagesDao extends BaseMapper<MessagesEntity> {
// 根据传入的查询条件Wrapper<MessagesEntity> wrapper查询符合条件的消息视图对象列表
// 返回一个包含MessagesVO对象的列表@Param("ew")用于指定查询条件的参数名
List<MessagesVO> selectListVO(@Param("ew") Wrapper<MessagesEntity> wrapper);
// 根据传入的查询条件Wrapper<MessagesEntity> wrapper查询符合条件的单个消息视图对象
// 返回一个MessagesVO对象@Param("ew")用于指定查询条件的参数名
MessagesVO selectVO(@Param("ew") Wrapper<MessagesEntity> wrapper);
// 根据传入的查询条件Wrapper<MessagesEntity> wrapper查询符合条件的消息视图列表
// 返回一个包含MessagesView对象的列表@Param("ew")用于指定查询条件的参数名
List<MessagesView> selectListView(@Param("ew") Wrapper<MessagesEntity> wrapper);
// 根据传入的分页信息Pagination page和查询条件Wrapper<MessagesEntity> wrapper
// 进行分页查询,返回符合条件的消息视图列表
// 返回一个包含MessagesView对象的列表@Param("ew")用于指定查询条件的参数名
List<MessagesView> selectListView(Pagination page, @Param("ew") Wrapper<MessagesEntity> wrapper);
// 根据传入的查询条件Wrapper<MessagesEntity> wrapper查询符合条件的单个消息视图
// 返回一个MessagesView对象@Param("ew")用于指定查询条件的参数名
MessagesView selectView(@Param("ew") Wrapper<MessagesEntity> wrapper);
}

@ -0,0 +1,45 @@
package com.dao;
import com.entity.NewsEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.vo.NewsVO;
import com.entity.view.NewsView;
/**
*
*
* @author
* @email
* @date 2025-04-04 18:46:21
*/
// 定义一个名为NewsDao的接口继承自BaseMapper<NewsEntity>
// 这意味着该接口拥有对NewsEntity实体进行基本数据库操作如插入、更新、删除、查询等的能力
public interface NewsDao extends BaseMapper<NewsEntity> {
// 根据传入的查询条件Wrapper<NewsEntity> wrapper查询并返回符合条件的新闻视图对象列表
// 返回一个包含NewsVO对象的List集合@Param("ew")用于指定查询条件参数的名称
List<NewsVO> selectListVO(@Param("ew") Wrapper<NewsEntity> wrapper);
// 根据传入的查询条件Wrapper<NewsEntity> wrapper查询并返回符合条件的单个新闻视图对象
// 返回一个NewsVO对象@Param("ew")用于指定查询条件参数的名称
NewsVO selectVO(@Param("ew") Wrapper<NewsEntity> wrapper);
// 根据传入的查询条件Wrapper<NewsEntity> wrapper查询并返回符合条件的新闻视图列表
// 返回一个包含NewsView对象的List集合@Param("ew")用于指定查询条件参数的名称
List<NewsView> selectListView(@Param("ew") Wrapper<NewsEntity> wrapper);
// 根据传入的分页信息Pagination page和查询条件Wrapper<NewsEntity> wrapper
// 进行分页查询,返回符合条件的新闻视图列表
// 返回一个包含NewsView对象的List集合@Param("ew")用于指定查询条件参数的名称
List<NewsView> selectListView(Pagination page, @Param("ew") Wrapper<NewsEntity> wrapper);
// 根据传入的查询条件Wrapper<NewsEntity> wrapper查询并返回符合条件的单个新闻视图
// 返回一个NewsView对象@Param("ew")用于指定查询条件参数的名称
NewsView selectView(@Param("ew") Wrapper<NewsEntity> wrapper);
}

@ -0,0 +1,45 @@
package com.dao;
import com.entity.StoreupEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.vo.StoreupVO;
import com.entity.view.StoreupView;
/**
*
*
* @author
* @email
* @date 2025-04-04 18:46:21
*/
// 定义一个名为StoreupDao的接口继承自BaseMapper<StoreupEntity>
// 这表明该接口可以使用MyBatis-Plus提供的对StoreupEntity实体的基础数据库操作功能
public interface StoreupDao extends BaseMapper<StoreupEntity> {
// 根据传入的查询条件Wrapper<StoreupEntity> wrapper查询符合条件的收藏视图对象列表
// 返回一个包含StoreupVO对象的列表@Param("ew")用于指定查询条件参数名方便在SQL映射中引用
List<StoreupVO> selectListVO(@Param("ew") Wrapper<StoreupEntity> wrapper);
// 根据传入的查询条件Wrapper<StoreupEntity> wrapper查询符合条件的单个收藏视图对象
// 返回一个StoreupVO对象@Param("ew")用于指定查询条件参数名
StoreupVO selectVO(@Param("ew") Wrapper<StoreupEntity> wrapper);
// 根据传入的查询条件Wrapper<StoreupEntity> wrapper查询符合条件的收藏视图列表
// 返回一个包含StoreupView对象的列表@Param("ew")用于指定查询条件参数名
List<StoreupView> selectListView(@Param("ew") Wrapper<StoreupEntity> wrapper);
// 根据传入的分页信息Pagination page和查询条件Wrapper<StoreupEntity> wrapper
// 进行分页查询,返回符合条件的收藏视图列表
// 返回一个包含StoreupView对象的列表@Param("ew")用于指定查询条件参数名
List<StoreupView> selectListView(Pagination page, @Param("ew") Wrapper<StoreupEntity> wrapper);
// 根据传入的查询条件Wrapper<StoreupEntity> wrapper查询符合条件的单个收藏视图
// 返回一个StoreupView对象@Param("ew")用于指定查询条件参数名
StoreupView selectView(@Param("ew") Wrapper<StoreupEntity> wrapper);
}

@ -0,0 +1,28 @@
package com.dao;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import com.entity.TokenEntity;
/**
* token
*/
// 定义一个名为TokenDao的接口继承自BaseMapper<TokenEntity>
// 意味着该接口具备对TokenEntity实体进行基本数据库操作如增删改查的能力
public interface TokenDao extends BaseMapper<TokenEntity> {
// 根据传入的查询条件Wrapper<TokenEntity> wrapper查询符合条件的Token实体列表
// 返回一个包含TokenEntity对象的列表@Param("ew")用于指定查询条件的参数名
List<TokenEntity> selectListView(@Param("ew") Wrapper<TokenEntity> wrapper);
// 根据传入的分页信息Pagination page和查询条件Wrapper<TokenEntity> wrapper
// 进行分页查询返回符合条件的Token实体列表
// 返回一个包含TokenEntity对象的列表@Param("ew")用于指定查询条件的参数名
List<TokenEntity> selectListView(Pagination page, @Param("ew") Wrapper<TokenEntity> wrapper);
}

@ -0,0 +1,28 @@
package com.dao;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import com.entity.UserEntity;
/**
*
*/
// 定义一个名为UserDao的接口继承自BaseMapper<UserEntity>
// 这表明该接口可以使用MyBatis-Plus提供的针对UserEntity实体的基础数据库操作如插入、更新、删除、查询等
public interface UserDao extends BaseMapper<UserEntity> {
// 根据传入的查询条件Wrapper<UserEntity> wrapper查询符合条件的用户实体列表
// 返回一个包含UserEntity对象的列表@Param("ew")用于指定查询条件的参数名方便在SQL映射中引用该条件
List<UserEntity> selectListView(@Param("ew") Wrapper<UserEntity> wrapper);
// 根据传入的分页信息Pagination page和查询条件Wrapper<UserEntity> wrapper
// 进行分页查询,返回符合条件的用户实体列表
// 返回一个包含UserEntity对象的列表@Param("ew")用于指定查询条件的参数名
List<UserEntity> selectListView(Pagination page, @Param("ew") Wrapper<UserEntity> wrapper);
}

@ -0,0 +1,45 @@
package com.dao;
import com.entity.WeixiuchuliEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.vo.WeixiuchuliVO;
import com.entity.view.WeixiuchuliView;
/**
*
*
* @author
* @email
* @date 2025-04-04 18:46:21
*/
// 定义一个名为WeixiuchuliDao的接口继承自BaseMapper<WeixiuchuliEntity>
// 这表明该接口具备对WeixiuchuliEntity实体进行基本数据库操作如增、删、改、查的能力
public interface WeixiuchuliDao extends BaseMapper<WeixiuchuliEntity> {
// 根据传入的查询条件Wrapper<WeixiuchuliEntity> wrapper查询符合条件的维修处理视图对象列表
// 返回一个包含WeixiuchuliVO对象的列表@Param("ew")用于指定查询条件参数名方便在SQL映射中引用
List<WeixiuchuliVO> selectListVO(@Param("ew") Wrapper<WeixiuchuliEntity> wrapper);
// 根据传入的查询条件Wrapper<WeixiuchuliEntity> wrapper查询符合条件的单个维修处理视图对象
// 返回一个WeixiuchuliVO对象@Param("ew")用于指定查询条件参数名
WeixiuchuliVO selectVO(@Param("ew") Wrapper<WeixiuchuliEntity> wrapper);
// 根据传入的查询条件Wrapper<WeixiuchuliEntity> wrapper查询符合条件的维修处理视图列表
// 返回一个包含WeixiuchuliView对象的列表@Param("ew")用于指定查询条件参数名
List<WeixiuchuliView> selectListView(@Param("ew") Wrapper<WeixiuchuliEntity> wrapper);
// 根据传入的分页信息Pagination page和查询条件Wrapper<WeixiuchuliEntity> wrapper
// 进行分页查询,返回符合条件的维修处理视图列表
// 返回一个包含WeixiuchuliView对象的列表@Param("ew")用于指定查询条件参数名
List<WeixiuchuliView> selectListView(Pagination page, @Param("ew") Wrapper<WeixiuchuliEntity> wrapper);
// 根据传入的查询条件Wrapper<WeixiuchuliEntity> wrapper查询符合条件的单个维修处理视图
// 返回一个WeixiuchuliView对象@Param("ew")用于指定查询条件参数名
WeixiuchuliView selectView(@Param("ew") Wrapper<WeixiuchuliEntity> wrapper);
}

@ -0,0 +1,45 @@
package com.dao;
import com.entity.WoyaodangfangzhuEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.vo.WoyaodangfangzhuVO;
import com.entity.view.WoyaodangfangzhuView;
/**
*
*
* @author
* @email
* @date 2025-04-04 18:46:21
*/
// 定义一个名为WoyaodangfangzhuDao的接口继承自BaseMapper<WoyaodangfangzhuEntity>
// 表明该接口具备对WoyaodangfangzhuEntity实体进行基本数据库操作如增、删、改、查的能力
public interface WoyaodangfangzhuDao extends BaseMapper<WoyaodangfangzhuEntity> {
// 根据传入的查询条件Wrapper<WoyaodangfangzhuEntity> wrapper查询符合条件的“我要当房主”视图对象列表
// 返回一个包含WoyaodangfangzhuVO对象的列表@Param("ew")用于指定查询条件参数名便于在SQL映射中引用
List<WoyaodangfangzhuVO> selectListVO(@Param("ew") Wrapper<WoyaodangfangzhuEntity> wrapper);
// 根据传入的查询条件Wrapper<WoyaodangfangzhuEntity> wrapper查询符合条件的单个“我要当房主”视图对象
// 返回一个WoyaodangfangzhuVO对象@Param("ew")用于指定查询条件参数名
WoyaodangfangzhuVO selectVO(@Param("ew") Wrapper<WoyaodangfangzhuEntity> wrapper);
// 根据传入的查询条件Wrapper<WoyaodangfangzhuEntity> wrapper查询符合条件的“我要当房主”视图列表
// 返回一个包含WoyaodangfangzhuView对象的列表@Param("ew")用于指定查询条件参数名
List<WoyaodangfangzhuView> selectListView(@Param("ew") Wrapper<WoyaodangfangzhuEntity> wrapper);
// 根据传入的分页信息Pagination page和查询条件Wrapper<WoyaodangfangzhuEntity> wrapper
// 进行分页查询,返回符合条件的“我要当房主”视图列表
// 返回一个包含WoyaodangfangzhuView对象的列表@Param("ew")用于指定查询条件参数名
List<WoyaodangfangzhuView> selectListView(Pagination page, @Param("ew") Wrapper<WoyaodangfangzhuEntity> wrapper);
// 根据传入的查询条件Wrapper<WoyaodangfangzhuEntity> wrapper查询符合条件的单个“我要当房主”视图
// 返回一个WoyaodangfangzhuView对象@Param("ew")用于指定查询条件参数名
WoyaodangfangzhuView selectView(@Param("ew") Wrapper<WoyaodangfangzhuEntity> wrapper);
}

@ -0,0 +1,45 @@
package com.dao;
import com.entity.YonghuEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.vo.YonghuVO;
import com.entity.view.YonghuView;
/**
*
*
* @author
* @email
* @date 2025-04-04 18:46:21
*/
// 定义一个名为YonghuDao的接口继承自BaseMapper<YonghuEntity>
// 这意味着该接口可以使用MyBatis-Plus提供的对YonghuEntity实体的基础数据库操作功能
public interface YonghuDao extends BaseMapper<YonghuEntity> {
// 根据传入的查询条件Wrapper<YonghuEntity> wrapper查询符合条件的用户视图对象列表
// 返回一个包含YonghuVO对象的列表@Param("ew")用于指定查询条件参数名方便在SQL映射中引用
List<YonghuVO> selectListVO(@Param("ew") Wrapper<YonghuEntity> wrapper);
// 根据传入的查询条件Wrapper<YonghuEntity> wrapper查询符合条件的单个用户视图对象
// 返回一个YonghuVO对象@Param("ew")用于指定查询条件参数名
YonghuVO selectVO(@Param("ew") Wrapper<YonghuEntity> wrapper);
// 根据传入的查询条件Wrapper<YonghuEntity> wrapper查询符合条件的用户视图列表
// 返回一个包含YonghuView对象的列表@Param("ew")用于指定查询条件参数名
List<YonghuView> selectListView(@Param("ew") Wrapper<YonghuEntity> wrapper);
// 根据传入的分页信息Pagination page和查询条件Wrapper<YonghuEntity> wrapper
// 进行分页查询,返回符合条件的用户视图列表
// 返回一个包含YonghuView对象的列表@Param("ew")用于指定查询条件参数名
List<YonghuView> selectListView(Pagination page, @Param("ew") Wrapper<YonghuEntity> wrapper);
// 根据传入的查询条件Wrapper<YonghuEntity> wrapper查询符合条件的单个用户视图
// 返回一个YonghuView对象@Param("ew")用于指定查询条件参数名
YonghuView selectView(@Param("ew") Wrapper<YonghuEntity> wrapper);
}

@ -0,0 +1,45 @@
package com.dao;
import com.entity.YuyuekanfangEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import org.apache.ibatis.annotations.Param;
import com.entity.vo.YuyuekanfangVO;
import com.entity.view.YuyuekanfangView;
/**
*
*
* @author
* @email
* @date 2025-04-04 18:46:21
*/
// 定义一个名为YuyuekanfangDao的接口继承自BaseMapper<YuyuekanfangEntity>
// 表明该接口具备对YuyuekanfangEntity实体进行基本数据库操作如插入、更新、删除、查询等的能力
public interface YuyuekanfangDao extends BaseMapper<YuyuekanfangEntity> {
// 根据传入的查询条件Wrapper<YuyuekanfangEntity> wrapper查询符合条件的预约看房视图对象列表
// 返回一个包含YuyuekanfangVO对象的列表@Param("ew")用于指定查询条件的参数名方便在SQL映射中引用
List<YuyuekanfangVO> selectListVO(@Param("ew") Wrapper<YuyuekanfangEntity> wrapper);
// 根据传入的查询条件Wrapper<YuyuekanfangEntity> wrapper查询符合条件的单个预约看房视图对象
// 返回一个YuyuekanfangVO对象@Param("ew")用于指定查询条件的参数名
YuyuekanfangVO selectVO(@Param("ew") Wrapper<YuyuekanfangEntity> wrapper);
// 根据传入的查询条件Wrapper<YuyuekanfangEntity> wrapper查询符合条件的预约看房视图列表
// 返回一个包含YuyuekanfangView对象的列表@Param("ew")用于指定查询条件的参数名
List<YuyuekanfangView> selectListView(@Param("ew") Wrapper<YuyuekanfangEntity> wrapper);
// 根据传入的分页信息Pagination page和查询条件Wrapper<YuyuekanfangEntity> wrapper
// 进行分页查询,返回符合条件的预约看房视图列表
// 返回一个包含YuyuekanfangView对象的列表@Param("ew")用于指定查询条件的参数名
List<YuyuekanfangView> selectListView(Pagination page, @Param("ew") Wrapper<YuyuekanfangEntity> wrapper);
// 根据传入的查询条件Wrapper<YuyuekanfangEntity> wrapper查询符合条件的单个预约看房视图
// 返回一个YuyuekanfangView对象@Param("ew")用于指定查询条件的参数名
YuyuekanfangView selectView(@Param("ew") Wrapper<YuyuekanfangEntity> wrapper);
}

@ -0,0 +1,63 @@
package com.entity;
// 导入序列化接口,用于支持对象的序列化
import java.io.Serializable;
// 导入 MyBatis-Plus 的注解,用于标识表和字段
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
/**
* config
*/
@TableName("config") // 使用 @TableName 注解指定对应的数据库表名
public class ConfigEntity implements Serializable { // 继承 Serializable用于支持序列化
private static final long serialVersionUID = 1L; // 定义序列化版本号
/**
* id
*/
@TableId(type = IdType.AUTO) // 使用 @TableId 注解标识主键,并设置自增类型
private Long id; // 主键id
/**
* key
*/
private String name; // 配置项的键
/**
* value
*/
private String value; // 配置项的值
// 获取主键id
public Long getId() {
return id;
}
// 设置主键id
public void setId(Long id) {
this.id = id;
}
// 获取配置项的键
public String getName() {
return name;
}
// 设置配置项的键
public void setName(String name) {
this.name = name;
}
// 获取配置项的值
public String getValue() {
return value;
}
// 设置配置项的值
public void setValue(String value) {
this.value = value;
}
}

@ -0,0 +1,158 @@
package com.entity;
// 导入 MyBatis-Plus 的注解,用于标识表和字段
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
// 导入 Java Bean 验证相关注解
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
// 导入 Jackson 注解,用于 JSON 格式化
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonFormat;
// 导入 Spring 的日期格式化注解
import org.springframework.format.annotation.DateTimeFormat;
// 导入常用工具类
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import org.apache.commons.beanutils.BeanUtils;
/**
* discussfangwuxinxi
*
* @author
* @email
* @date 2021-03-04 18:46:21
*/
@TableName("discussfangwuxinxi") // 使用 @TableName 注解指定对应的数据库表名
public class DiscussfangwuxinxiEntity<T> implements Serializable { // 继承 Serializable用于支持序列化
private static final long serialVersionUID = 1L; // 定义序列化版本号
// 构造方法,无参
public DiscussfangwuxinxiEntity() {
}
// 构造方法,通过传入的对象复制属性值
public DiscussfangwuxinxiEntity(T t) {
try {
BeanUtils.copyProperties(this, t); // 使用 Apache Commons 工具类复制属性值
} catch (IllegalAccessException | InvocationTargetException e) {
e.printStackTrace(); // 捕获并打印异常信息
}
}
/**
* id
*/
@TableId(type = IdType.AUTO) // 使用 @TableId 注解标识主键,并设置自增类型
private Long id; // 主键id
/**
* id
*/
private Long refid; // 关联表id
/**
* id
*/
private Long userid; // 用户id
/**
*
*/
private String content; // 评论内容
/**
*
*/
private String reply; // 回复内容
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") // 使用 @JsonFormat 注解格式化日期
@DateTimeFormat // 使用 @DateTimeFormat 注解支持日期格式化输入
private Date addtime; // 添加时间
// 获取添加时间
public Date getAddtime() {
return addtime;
}
// 设置添加时间
public void setAddtime(Date addtime) {
this.addtime = addtime;
}
// 获取主键id
public Long getId() {
return id;
}
// 设置主键id
public void setId(Long id) {
this.id = id;
}
/**
* id
*/
public void setRefid(Long refid) {
this.refid = refid;
}
/**
* id
*/
public Long getRefid() {
return refid;
}
/**
* id
*/
public void setUserid(Long userid) {
this.userid = userid;
}
/**
* id
*/
public Long getUserid() {
return userid;
}
/**
*
*/
public void setContent(String content) {
this.content = content;
}
/**
*
*/
public String getContent() {
return content;
}
/**
*
*/
public void setReply(String reply) {
this.reply = reply;
}
/**
*
*/
public String getReply() {
return reply;
}
}

@ -0,0 +1,158 @@
package com.entity;
// 导入 MyBatis-Plus 的注解,用于标识表和字段
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
// 导入 Java Bean 验证相关注解
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
// 导入 Jackson 注解,用于 JSON 格式化
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonFormat;
// 导入 Spring 的日期格式化注解
import org.springframework.format.annotation.DateTimeFormat;
// 导入常用工具类
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import org.apache.commons.beanutils.BeanUtils;
/**
* discusswoyaodangfangzhu
*
* @author
* @email
* @date 2021-03-04 18:46:21
*/
@TableName("discusswoyaodangfangzhu") // 使用 @TableName 注解指定对应的数据库表名
public class DiscusswoyaodangfangzhuEntity<T> implements Serializable { // 继承 Serializable用于支持序列化
private static final long serialVersionUID = 1L; // 定义序列化版本号
// 构造方法,无参
public DiscusswoyaodangfangzhuEntity() {
}
// 构造方法,通过传入的对象复制属性值
public DiscusswoyaodangfangzhuEntity(T t) {
try {
BeanUtils.copyProperties(this, t); // 使用 Apache Commons 工具类复制属性值
} catch (IllegalAccessException | InvocationTargetException e) {
e.printStackTrace(); // 捕获并打印异常信息
}
}
/**
* id
*/
@TableId(type = IdType.AUTO) // 使用 @TableId 注解标识主键,并设置自增类型
private Long id; // 主键id
/**
* id
*/
private Long refid; // 关联表id
/**
* id
*/
private Long userid; // 用户id
/**
*
*/
private String content; // 评论内容
/**
*
*/
private String reply; // 回复内容
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") // 使用 @JsonFormat 注解格式化日期
@DateTimeFormat // 使用 @DateTimeFormat 注解支持日期格式化输入
private Date addtime; // 添加时间
// 获取添加时间
public Date getAddtime() {
return addtime;
}
// 设置添加时间
public void setAddtime(Date addtime) {
this.addtime = addtime;
}
// 获取主键id
public Long getId() {
return id;
}
// 设置主键id
public void setId(Long id) {
this.id = id;
}
/**
* id
*/
public void setRefid(Long refid) {
this.refid = refid;
}
/**
* id
*/
public Long getRefid() {
return refid;
}
/**
* id
*/
public void setUserid(Long userid) {
this.userid = userid;
}
/**
* id
*/
public Long getUserid() {
return userid;
}
/**
*
*/
public void setContent(String content) {
this.content = content;
}
/**
*
*/
public String getContent() {
return content;
}
/**
*
*/
public void setReply(String reply) {
this.reply = reply;
}
/**
*
*/
public String getReply() {
return reply;
}
}

@ -0,0 +1,73 @@
package com.entity;
/**
*
*/
public class EIException extends RuntimeException { // 继承 RuntimeException表示运行时异常
private static final long serialVersionUID = 1L; // 定义序列化版本号
private String msg; // 异常信息
private int code = 500; // 异常代码,默认为 500
/**
*
*/
public EIException(String msg) {
super(msg); // 调用父类构造方法,设置异常信息
this.msg = msg; // 设置自定义异常信息
}
/**
*
*/
public EIException(String msg, Throwable e) {
super(msg, e); // 调用父类构造方法,设置异常信息和异常对象
this.msg = msg; // 设置自定义异常信息
}
/**
*
*/
public EIException(String msg, int code) {
super(msg); // 调用父类构造方法,设置异常信息
this.msg = msg; // 设置自定义异常信息
this.code = code; // 设置自定义异常代码
}
/**
*
*/
public EIException(String msg, int code, Throwable e) {
super(msg, e); // 调用父类构造方法,设置异常信息和异常对象
this.msg = msg; // 设置自定义异常信息
this.code = code; // 设置自定义异常代码
}
/**
*
*/
public String getMsg() {
return msg;
}
/**
*
*/
public void setMsg(String msg) {
this.msg = msg;
}
/**
*
*/
public int getCode() {
return code;
}
/**
*
*/
public void setCode(int code) {
this.code = code;
}
}

@ -0,0 +1,369 @@
package com.entity;
// 导入 MyBatis-Plus 的注解,用于标识表和字段
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
// 导入 Java Bean 验证相关注解
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
// 导入 Jackson 注解,用于 JSON 格式化
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonFormat;
// 导入 Spring 的日期格式化注解
import org.springframework.format.annotation.DateTimeFormat;
// 导入常用工具类
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import org.apache.commons.beanutils.BeanUtils;
/**
* fangwubaoxiu
*
* @author
* @email
* @date 2021-03-04 18:46:21
*/
@TableName("fangwubaoxiu") // 使用 @TableName 注解指定对应的数据库表名
public class FangwubaoxiuEntity<T> implements Serializable { // 继承 Serializable用于支持序列化
private static final long serialVersionUID = 1L; // 定义序列化版本号
// 构造方法,无参
public FangwubaoxiuEntity() {
}
// 构造方法,通过传入的对象复制属性值
public FangwubaoxiuEntity(T t) {
try {
BeanUtils.copyProperties(this, t); // 使用 Apache Commons 工具类复制属性值
} catch (IllegalAccessException | InvocationTargetException e) {
e.printStackTrace(); // 捕获并打印异常信息
}
}
/**
* id
*/
@TableId(type = IdType.AUTO) // 使用 @TableId 注解标识主键,并设置自增类型
private Long id; // 主键id
/**
*
*/
private String hetongbianhao; // 合同编号
/**
*
*/
private String fangwumingcheng; // 房屋名称
/**
*
*/
private String fangwuleixing; // 房屋类型
/**
*
*/
private String xiaoqu; // 小区
/**
*
*/
private String baoxiumingcheng; // 报修名称
/**
*
*/
private String leixing; // 类型
/**
*
*/
private String baoxiuneirong; // 报修内容
/**
*
*/
private String tupian; // 图片
/**
*
*/
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd") // 使用 @JsonFormat 注解格式化日期
@DateTimeFormat // 使用 @DateTimeFormat 注解支持日期格式化输入
private Date baoxiuriqi; // 报修日期
/**
*
*/
private String fangzhuzhanghao; // 房主账号
/**
*
*/
private String fangzhuxingming; // 房主姓名
/**
*
*/
private String yonghuming; // 用户名
/**
*
*/
private String lianxidianhua; // 联系电话
/**
*
*/
private String sfsh; // 是否审核
/**
*
*/
private String shhf; // 审核回复
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") // 使用 @JsonFormat 注解格式化日期
@DateTimeFormat // 使用 @DateTimeFormat 注解支持日期格式化输入
private Date addtime; // 添加时间
// 获取添加时间
public Date getAddtime() {
return addtime;
}
// 设置添加时间
public void setAddtime(Date addtime) {
this.addtime = addtime;
}
// 获取主键id
public Long getId() {
return id;
}
// 设置主键id
public void setId(Long id) {
this.id = id;
}
/**
*
*/
public void setHetongbianhao(String hetongbianhao) {
this.hetongbianhao = hetongbianhao;
}
/**
*
*/
public String getHetongbianhao() {
return hetongbianhao;
}
/**
*
*/
public void setFangwumingcheng(String fangwumingcheng) {
this.fangwumingcheng = fangwumingcheng;
}
/**
*
*/
public String getFangwumingcheng() {
return fangwumingcheng;
}
/**
*
*/
public void setFangwuleixing(String fangwuleixing) {
this.fangwuleixing = fangwuleixing;
}
/**
*
*/
public String getFangwuleixing() {
return fangwuleixing;
}
/**
*
*/
public void setXiaoqu(String xiaoqu) {
this.xiaoqu = xiaoqu;
}
/**
*
*/
public String getXiaoqu() {
return xiaoqu;
}
/**
*
*/
public void setBaoxiumingcheng(String baoxiumingcheng) {
this.baoxiumingcheng = baoxiumingcheng;
}
/**
*
*/
public String getBaoxiumingcheng() {
return baoxiumingcheng;
}
/**
*
*/
public void setLeixing(String leixing) {
this.leixing = leixing;
}
/**
*
*/
public String getLeixing() {
return leixing;
}
/**
*
*/
public void setBaoxiuneirong(String baoxiuneirong) {
this.baoxiuneirong = baoxiuneirong;
}
/**
*
*/
public String getBaoxiuneirong() {
return baoxiuneirong;
}
/**
*
*/
public void setTupian(String tupian) {
this.tupian = tupian;
}
/**
*
*/
public String getTupian() {
return tupian;
}
/**
*
*/
public void setBaoxiuriqi(Date baoxiuriqi) {
this.baoxiuriqi = baoxiuriqi;
}
/**
*
*/
public Date getBaoxiuriqi() {
return baoxiuriqi;
}
/**
*
*/
public void setFangzhuzhanghao(String fangzhuzhanghao) {
this.fangzhuzhanghao = fangzhuzhanghao;
}
/**
*
*/
public String getFangzhuzhanghao() {
return fangzhuzhanghao;
}
/**
*
*/
public void setFangzhuxingming(String fangzhuxingming) {
this.fangzhuxingming = fangzhuxingming;
}
/**
*
*/
public String getFangzhuxingming() {
return fangzhuxingming;
}
/**
*
*/
public void setYonghuming(String yonghuming) {
this.yonghuming = yonghuming;
}
/**
*
*/
public String getYonghuming() {
return yonghuming;
}
/**
*
*/
public void setLianxidianhua(String lianxidianhua) {
this.lianxidianhua = lianxidianhua;
}
/**
*
*/
public String getLianxidianhua() {
return lianxidianhua;
}
/**
*
*/
public void setSfsh(String sfsh) {
this.sfsh = sfsh;
}
/**
*
*/
public String getSfsh() {
return sfsh;
}
/**
*
*/
public void setShhf(String shhf) {
this.shhf = shhf;
}
/**
*
*/
public String getShhf() {
return shhf;
}
}

@ -0,0 +1,101 @@
package com.entity;
// 导入 MyBatis-Plus 的注解,用于标识表和字段
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
// 导入 Java Bean 验证相关注解
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
// 导入 Jackson 注解,用于 JSON 格式化
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonFormat;
// 导入 Spring 的日期格式化注解
import org.springframework.format.annotation.DateTimeFormat;
// 导入常用工具类
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import org.apache.commons.beanutils.BeanUtils;
/**
* fangwuleixing
*
* @author
* @email
* @date 2021-03-04 18:46:21
*/
@TableName("fangwuleixing") // 使用 @TableName 注解指定对应的数据库表名
public class FangwuleixingEntity<T> implements Serializable { // 继承 Serializable用于支持序列化
private static final long serialVersionUID = 1L; // 定义序列化版本号
// 构造方法,无参
public FangwuleixingEntity() {
}
// 构造方法,通过传入的对象复制属性值
public FangwuleixingEntity(T t) {
try {
BeanUtils.copyProperties(this, t); // 使用 Apache Commons 工具类复制属性值
} catch (IllegalAccessException | InvocationTargetException e) {
e.printStackTrace(); // 捕获并打印异常信息
}
}
/**
* id
*/
@TableId(type = IdType.AUTO) // 使用 @TableId 注解标识主键,并设置自增类型
private Long id; // 主键id
/**
*
*/
private String fangwuleixing; // 房屋类型
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") // 使用 @JsonFormat 注解格式化日期
@DateTimeFormat // 使用 @DateTimeFormat 注解支持日期格式化输入
private Date addtime; // 添加时间
// 获取添加时间
public Date getAddtime() {
return addtime;
}
// 设置添加时间
public void setAddtime(Date addtime) {
this.addtime = addtime;
}
// 获取主键id
public Long getId() {
return id;
}
// 设置主键id
public void setId(Long id) {
this.id = id;
}
/**
*
*/
public void setFangwuleixing(String fangwuleixing) {
this.fangwuleixing = fangwuleixing;
}
/**
*
*/
public String getFangwuleixing() {
return fangwuleixing;
}
}

@ -0,0 +1,312 @@
package com.entity;
// 导入 MyBatis-Plus 的注解,用于标识表和字段
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
// 导入 Java Bean 验证相关注解
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
// 导入 Jackson 注解,用于 JSON 格式化
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonFormat;
// 导入 Spring 的日期格式化注解
import org.springframework.format.annotation.DateTimeFormat;
// 导入常用工具类
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import org.apache.commons.beanutils.BeanUtils;
/**
* fangwupingjia
*
* @author
* @email
* @date 2021-03-04 18:46:21
*/
@TableName("fangwupingjia") // 使用 @TableName 注解指定对应的数据库表名
public class FangwupingjiaEntity<T> implements Serializable { // 继承 Serializable用于支持序列化
private static final long serialVersionUID = 1L; // 定义序列化版本号
// 构造方法,无参
public FangwupingjiaEntity() {
}
// 构造方法,通过传入的对象复制属性值
public FangwupingjiaEntity(T t) {
try {
BeanUtils.copyProperties(this, t); // 使用 Apache Commons 工具类复制属性值
} catch (IllegalAccessException | InvocationTargetException e) {
e.printStackTrace(); // 捕获并打印异常信息
}
}
/**
* id
*/
@TableId(type = IdType.AUTO) // 使用 @TableId 注解标识主键,并设置自增类型
private Long id; // 主键id
/**
*
*/
private String hetongbianhao; // 合同编号
/**
*
*/
private String fangwumingcheng; // 房屋名称
/**
*
*/
private String fangwuleixing; // 房屋类型
/**
*
*/
private String xiaoqu; // 小区
/**
*
*/
private String pingfen; // 评分
/**
*
*/
private String pingjianeirong; // 评价内容
/**
*
*/
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd") // 使用 @JsonFormat 注解格式化日期
@DateTimeFormat // 使用 @DateTimeFormat 注解支持日期格式化输入
private Date pingjiariqi; // 评价日期
/**
*
*/
private String fangzhuzhanghao; // 房主账号
/**
*
*/
private String yonghuming; // 用户名
/**
*
*/
private String lianxidianhua; // 联系电话
/**
*
*/
private String sfsh; // 是否审核
/**
*
*/
private String shhf; // 审核回复
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") // 使用 @JsonFormat 注解格式化日期
@DateTimeFormat // 使用 @DateTimeFormat 注解支持日期格式化输入
private Date addtime; // 添加时间
// 获取添加时间
public Date getAddtime() {
return addtime;
}
// 设置添加时间
public void setAddtime(Date addtime) {
this.addtime = addtime;
}
// 获取主键id
public Long getId() {
return id;
}
// 设置主键id
public void setId(Long id) {
this.id = id;
}
/**
*
*/
public void setHetongbianhao(String hetongbianhao) {
this.hetongbianhao = hetongbianhao;
}
/**
*
*/
public String getHetongbianhao() {
return hetongbianhao;
}
/**
*
*/
public void setFangwumingcheng(String fangwumingcheng) {
this.fangwumingcheng = fangwumingcheng;
}
/**
*
*/
public String getFangwumingcheng() {
return fangwumingcheng;
}
/**
*
*/
public void setFangwuleixing(String fangwuleixing) {
this.fangwuleixing = fangwuleixing;
}
/**
*
*/
public String getFangwuleixing() {
return fangwuleixing;
}
/**
*
*/
public void setXiaoqu(String xiaoqu) {
this.xiaoqu = xiaoqu;
}
/**
*
*/
public String getXiaoqu() {
return xiaoqu;
}
/**
*
*/
public void setPingfen(String pingfen) {
this.pingfen = pingfen;
}
/**
*
*/
public String getPingfen() {
return pingfen;
}
/**
*
*/
public void setPingjianeirong(String pingjianeirong) {
this.pingjianeirong = pingjianeirong;
}
/**
*
*/
public String getPingjianeirong() {
return pingjianeirong;
}
/**
*
*/
public void setPingjiariqi(Date pingjiariqi) {
this.pingjiariqi = pingjiariqi;
}
/**
*
*/
public Date getPingjiariqi() {
return pingjiariqi;
}
/**
*
*/
public void setFangzhuzhanghao(String fangzhuzhanghao) {
this.fangzhuzhanghao = fangzhuzhanghao;
}
/**
*
*/
public String getFangzhuzhanghao() {
return fangzhuzhanghao;
}
/**
*
*/
public void setYonghuming(String yonghuming) {
this.yonghuming = yonghuming;
}
/**
*
*/
public String getYonghuming() {
return yonghuming;
}
/**
*
*/
public void setLianxidianhua(String lianxidianhua) {
this.lianxidianhua = lianxidianhua;
}
/**
*
*/
public String getLianxidianhua() {
return lianxidianhua;
}
/**
*
*/
public void setSfsh(String sfsh) {
this.sfsh = sfsh;
}
/**
*
*/
public String getSfsh() {
return sfsh;
}
/**
*
*/
public void setShhf(String shhf) {
this.shhf = shhf;
}
/**
*
*/
public String getShhf() {
return shhf;
}
}

@ -0,0 +1,388 @@
package com.entity;
// 导入 MyBatis-Plus 的注解,用于标识表和字段
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
// 导入 Java Bean 验证相关注解
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
// 导入 Jackson 注解,用于 JSON 格式化
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonFormat;
// 导入 Spring 的日期格式化注解
import org.springframework.format.annotation.DateTimeFormat;
// 导入常用工具类
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import org.apache.commons.beanutils.BeanUtils;
/**
* fangwuxinxi
*
* @author
* @email
* @date 2021-03-04 18:46:21
*/
@TableName("fangwuxinxi") // 使用 @TableName 注解指定对应的数据库表名
public class FangwuxinxiEntity<T> implements Serializable { // 继承 Serializable用于支持序列化
private static final long serialVersionUID = 1L; // 定义序列化版本号
// 构造方法,无参
public FangwuxinxiEntity() {
}
// 构造方法,通过传入的对象复制属性值
public FangwuxinxiEntity(T t) {
try {
BeanUtils.copyProperties(this, t); // 使用 Apache Commons 工具类复制属性值
} catch (IllegalAccessException | InvocationTargetException e) {
e.printStackTrace(); // 捕获并打印异常信息
}
}
/**
* id
*/
@TableId(type = IdType.AUTO) // 使用 @TableId 注解标识主键,并设置自增类型
private Long id; // 主键id
/**
*
*/
private String fangwumingcheng; // 房屋名称
/**
*
*/
private String fangwuleixing; // 房屋类型
/**
*
*/
private String tupian; // 图片
/**
*
*/
private String zulinfangshi; // 租赁方式
/**
*
*/
private String chaoxianglouceng; // 朝向楼层
/**
*
*/
private String mianji; // 面积
/**
*
*/
private String fangwuzhuangtai; // 房屋状态
/**
*
*/
private String xiaoqu; // 小区
/**
*
*/
private String xiangxidizhi; // 详细地址
/**
*
*/
private Integer yuezujiage; // 月租价格
/**
*
*/
private Integer yajin; // 押金
/**
*
*/
private String fangwusheshi; // 房屋设施
/**
*
*/
private String fangwuxiangqing; // 房屋详情
/**
*
*/
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd") // 使用 @JsonFormat 注解格式化日期
@DateTimeFormat // 使用 @DateTimeFormat 注解支持日期格式化输入
private Date faburiqi; // 发布日期
/**
*
*/
private String fangzhuzhanghao; // 房主账号
/**
*
*/
private String fangzhuxingming; // 房主姓名
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") // 使用 @JsonFormat 注解格式化日期
@DateTimeFormat // 使用 @DateTimeFormat 注解支持日期格式化输入
private Date addtime; // 添加时间
// 获取添加时间
public Date getAddtime() {
return addtime;
}
// 设置添加时间
public void setAddtime(Date addtime) {
this.addtime = addtime;
}
// 获取主键id
public Long getId() {
return id;
}
// 设置主键id
public void setId(Long id) {
this.id = id;
}
/**
*
*/
public void setFangwumingcheng(String fangwumingcheng) {
this.fangwumingcheng = fangwumingcheng;
}
/**
*
*/
public String getFangwumingcheng() {
return fangwumingcheng;
}
/**
*
*/
public void setFangwuleixing(String fangwuleixing) {
this.fangwuleixing = fangwuleixing;
}
/**
*
*/
public String getFangwuleixing() {
return fangwuleixing;
}
/**
*
*/
public void setTupian(String tupian) {
this.tupian = tupian;
}
/**
*
*/
public String getTupian() {
return tupian;
}
/**
*
*/
public void setZulinfangshi(String zulinfangshi) {
this.zulinfangshi = zulinfangshi;
}
/**
*
*/
public String getZulinfangshi() {
return zulinfangshi;
}
/**
*
*/
public void setChaoxianglouceng(String chaoxianglouceng) {
this.chaoxianglouceng = chaoxianglouceng;
}
/**
*
*/
public String getChaoxianglouceng() {
return chaoxianglouceng;
}
/**
*
*/
public void setMianji(String mianji) {
this.mianji = mianji;
}
/**
*
*/
public String getMianji() {
return mianji;
}
/**
*
*/
public void setFangwuzhuangtai(String fangwuzhuangtai) {
this.fangwuzhuangtai = fangwuzhuangtai;
}
/**
*
*/
public String getFangwuzhuangtai() {
return fangwuzhuangtai;
}
/**
*
*/
public void setXiaoqu(String xiaoqu) {
this.xiaoqu = xiaoqu;
}
/**
*
*/
public String getXiaoqu() {
return xiaoqu;
}
/**
*
*/
public void setXiangxidizhi(String xiangxidizhi) {
this.xiangxidizhi = xiangxidizhi;
}
/**
*
*/
public String getXiangxidizhi() {
return xiangxidizhi;
}
/**
*
*/
public void setYuezujiage(Integer yuezujiage) {
this.yuezujiage = yuezujiage;
}
/**
*
*/
public Integer getYuezujiage() {
return yuezujiage;
}
/**
*
*/
public void setYajin(Integer yajin) {
this.yajin = yajin;
}
/**
*
*/
public Integer getYajin() {
return yajin;
}
/**
*
*/
public void setFangwusheshi(String fangwusheshi) {
this.fangwusheshi = fangwusheshi;
}
/**
*
*/
public String getFangwusheshi() {
return fangwusheshi;
}
/**
*
*/
public void setFangwuxiangqing(String fangwuxiangqing) {
this.fangwuxiangqing = fangwuxiangqing;
}
/**
*
*/
public String getFangwuxiangqing() {
return fangwuxiangqing;
}
/**
*
*/
public void setFaburiqi(Date faburiqi) {
this.faburiqi = faburiqi;
}
/**
*
*/
public Date getFaburiqi() {
return faburiqi;
}
/**
*
*/
public void setFangzhuzhanghao(String fangzhuzhanghao) {
this.fangzhuzhanghao = fangzhuzhanghao;
}
/**
*
*/
public String getFangzhuzhanghao() {
return fangzhuzhanghao;
}
/**
*
*/
public void setFangzhuxingming(String fangzhuxingming) {
this.fangzhuxingming = fangzhuxingming;
}
/**
*
*/
public String getFangzhuxingming() {
return fangzhuxingming;
}
}

@ -0,0 +1,215 @@
package com.entity;
// 导入 MyBatis-Plus 的注解,用于标识表和字段
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
// 导入 Java Bean 验证相关注解
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
// 导入 Jackson 注解,用于 JSON 格式化
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonFormat;
// 导入 Spring 的日期格式化注解
import org.springframework.format.annotation.DateTimeFormat;
// 导入常用工具类
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import org.apache.commons.beanutils.BeanUtils;
/**
* fangzhu
*
* @author
* @email
* @date 2021-03-04 18:46:21
*/
@TableName("fangzhu") // 使用 @TableName 注解指定对应的数据库表名
public class FangzhuEntity<T> implements Serializable { // 继承 Serializable用于支持序列化
private static final long serialVersionUID = 1L; // 定义序列化版本号
// 构造方法,无参
public FangzhuEntity() {
}
// 构造方法,通过传入的对象复制属性值
public FangzhuEntity(T t) {
try {
BeanUtils.copyProperties(this, t); // 使用 Apache Commons 工具类复制属性值
} catch (IllegalAccessException | InvocationTargetException e) {
e.printStackTrace(); // 捕获并打印异常信息
}
}
/**
* id
*/
@TableId(type = IdType.AUTO) // 使用 @TableId 注解标识主键,并设置自增类型
private Long id; // 主键id
/**
*
*/
private String fangzhuzhanghao; // 房主账号
/**
*
*/
private String mima; // 密码
/**
*
*/
private String fangzhuxingming; // 房主姓名
/**
*
*/
private String xingbie; // 性别
/**
*
*/
private String touxiang; // 头像
/**
*
*/
private String shouji; // 手机
/**
*
*/
private String shenfenzheng; // 身份证
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") // 使用 @JsonFormat 注解格式化日期
@DateTimeFormat // 使用 @DateTimeFormat 注解支持日期格式化输入
private Date addtime; // 添加时间
// 获取添加时间
public Date getAddtime() {
return addtime;
}
// 设置添加时间
public void setAddtime(Date addtime) {
this.addtime = addtime;
}
// 获取主键id
public Long getId() {
return id;
}
// 设置主键id
public void setId(Long id) {
this.id = id;
}
/**
*
*/
public void setFangzhuzhanghao(String fangzhuzhanghao) {
this.fangzhuzhanghao = fangzhuzhanghao;
}
/**
*
*/
public String getFangzhuzhanghao() {
return fangzhuzhanghao;
}
/**
*
*/
public void setMima(String mima) {
this.mima = mima;
}
/**
*
*/
public String getMima() {
return mima;
}
/**
*
*/
public void setFangzhuxingming(String fangzhuxingming) {
this.fangzhuxingming = fangzhuxingming;
}
/**
*
*/
public String getFangzhuxingming() {
return fangzhuxingming;
}
/**
*
*/
public void setXingbie(String xingbie) {
this.xingbie = xingbie;
}
/**
*
*/
public String getXingbie() {
return xingbie;
}
/**
*
*/
public void setTouxiang(String touxiang) {
this.touxiang = touxiang;
}
/**
*
*/
public String getTouxiang() {
return touxiang;
}
/**
*
*/
public void setShouji(String shouji) {
this.shouji = shouji;
}
/**
*
*/
public String getShouji() {
return shouji;
}
/**
*
*/
public void setShenfenzheng(String shenfenzheng) {
this.shenfenzheng = shenfenzheng;
}
/**
*
*/
public String getShenfenzheng() {
return shenfenzheng;
}
}

@ -0,0 +1,466 @@
package com.entity;
// 导入 MyBatis-Plus 的注解,用于标识表和字段
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
// 导入 Java Bean 验证相关注解
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
// 导入 Jackson 注解,用于 JSON 格式化
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonFormat;
// 导入 Spring 的日期格式化注解
import org.springframework.format.annotation.DateTimeFormat;
// 导入常用工具类
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import org.apache.commons.beanutils.BeanUtils;
/**
* hetongxinxi
*
* @author
* @email
* @date 2021-03-04 18:46:21
*/
@TableName("hetongxinxi") // 使用 @TableName 注解指定对应的数据库表名
public class HetongxinxiEntity<T> implements Serializable { // 继承 Serializable用于支持序列化
private static final long serialVersionUID = 1L; // 定义序列化版本号
// 构造方法,无参
public HetongxinxiEntity() {
}
// 构造方法,通过传入的对象复制属性值
public HetongxinxiEntity(T t) {
try {
BeanUtils.copyProperties(this, t); // 使用 Apache Commons 工具类复制属性值
} catch (IllegalAccessException | InvocationTargetException e) {
e.printStackTrace(); // 捕获并打印异常信息
}
}
/**
* id
*/
@TableId(type = IdType.AUTO) // 使用 @TableId 注解标识主键,并设置自增类型
private Long id; // 主键id
/**
*
*/
private String hetongbianhao; // 合同编号
/**
*
*/
private String fangwumingcheng; // 房屋名称
/**
*
*/
private String fangwuleixing; // 房屋类型
/**
*
*/
private String xiaoqu; // 小区
/**
*
*/
private String yuezujiage; // 月租价格
/**
*
*/
private String zuyongyueshu; // 租用月数
/**
*
*/
private Integer zuyongjine; // 租用金额
/**
*
*/
private Integer yajin; // 押金
/**
*
*/
private String fangzuzhuangtai; // 房租状态
/**
*
*/
private String hetongjine; // 合同金额
/**
*
*/
private String hetongneirong; // 合同内容
/**
*
*/
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd") // 使用 @JsonFormat 注解格式化日期
@DateTimeFormat // 使用 @DateTimeFormat 注解支持日期格式化输入
private Date shengxiaori; // 生效日
/**
*
*/
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd") // 使用 @JsonFormat 注解格式化日期
@DateTimeFormat // 使用 @DateTimeFormat 注解支持日期格式化输入
private Date youxianqizhi; // 有限期至
/**
*
*/
private String yonghuming; // 用户名
/**
*
*/
private String lianxidianhua; // 联系电话
/**
*
*/
private String fangzhuzhanghao; // 房主账号
/**
*
*/
private String fangzhuxingming; // 房主姓名
/**
*
*/
private String sfsh; // 是否审核
/**
*
*/
private String shhf; // 审核回复
/**
*
*/
private String ispay; // 是否支付
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") // 使用 @JsonFormat 注解格式化日期
@DateTimeFormat // 使用 @DateTimeFormat 注解支持日期格式化输入
private Date addtime; // 添加时间
// 获取添加时间
public Date getAddtime() {
return addtime;
}
// 设置添加时间
public void setAddtime(Date addtime) {
this.addtime = addtime;
}
// 获取主键id
public Long getId() {
return id;
}
// 设置主键id
public void setId(Long id) {
this.id = id;
}
/**
*
*/
public void setHetongbianhao(String hetongbianhao) {
this.hetongbianhao = hetongbianhao;
}
/**
*
*/
public String getHetongbianhao() {
return hetongbianhao;
}
/**
*
*/
public void setFangwumingcheng(String fangwumingcheng) {
this.fangwumingcheng = fangwumingcheng;
}
/**
*
*/
public String getFangwumingcheng() {
return fangwumingcheng;
}
/**
*
*/
public void setFangwuleixing(String fangwuleixing) {
this.fangwuleixing = fangwuleixing;
}
/**
*
*/
public String getFangwuleixing() {
return fangwuleixing;
}
/**
*
*/
public void setXiaoqu(String xiaoqu) {
this.xiaoqu = xiaoqu;
}
/**
*
*/
public String getXiaoqu() {
return xiaoqu;
}
/**
*
*/
public void setYuezujiage(String yuezujiage) {
this.yuezujiage = yuezujiage;
}
/**
*
*/
public String getYuezujiage() {
return yuezujiage;
}
/**
*
*/
public void setZuyongyueshu(String zuyongyueshu) {
this.zuyongyueshu = zuyongyueshu;
}
/**
*
*/
public String getZuyongyueshu() {
return zuyongyueshu;
}
/**
*
*/
public void setZuyongjine(Integer zuyongjine) {
this.zuyongjine = zuyongjine;
}
/**
*
*/
public Integer getZuyongjine() {
return zuyongjine;
}
/**
*
*/
public void setYajin(Integer yajin) {
this.yajin = yajin;
}
/**
*
*/
public Integer getYajin() {
return yajin;
}
/**
*
*/
public void setFangzuzhuangtai(String fangzuzhuangtai) {
this.fangzuzhuangtai = fangzuzhuangtai;
}
/**
*
*/
public String getFangzuzhuangtai() {
return fangzuzhuangtai;
}
/**
*
*/
public void setHetongjine(String hetongjine) {
this.hetongjine = hetongjine;
}
/**
*
*/
public String getHetongjine() {
return hetongjine;
}
/**
*
*/
public void setHetongneirong(String hetongneirong) {
this.hetongneirong = hetongneirong;
}
/**
*
*/
public String getHetongneirong() {
return hetongneirong;
}
/**
*
*/
public void setShengxiaori(Date shengxiaori) {
this.shengxiaori = shengxiaori;
}
/**
*
*/
public Date getShengxiaori() {
return shengxiaori;
}
/**
*
*/
public void setYouxianqizhi(Date youxianqizhi) {
this.youxianqizhi = youxianqizhi;
}
/**
*
*/
public Date getYouxianqizhi() {
return youxianqizhi;
}
/**
*
*/
public void setYonghuming(String yonghuming) {
this.yonghuming = yonghuming;
}
/**
*
*/
public String getYonghuming() {
return yonghuming;
}
/**
*
*/
public void setLianxidianhua(String lianxidianhua) {
this.lianxidianhua = lianxidianhua;
}
/**
*
*/
public String getLianxidianhua() {
return lianxidianhua;
}
/**
*
*/
public void setFangzhuzhanghao(String fangzhuzhanghao) {
this.fangzhuzhanghao = fangzhuzhanghao;
}
/**
*
*/
public String getFangzhuzhanghao() {
return fangzhuzhanghao;
}
/**
*
*/
public void setFangzhuxingming(String fangzhuxingming) {
this.fangzhuxingming = fangzhuxingming;
}
/**
*
*/
public String getFangzhuxingming() {
return fangzhuxingming;
}
/**
*
*/
public void setSfsh(String sfsh) {
this.sfsh = sfsh;
}
/**
*
*/
public String getSfsh() {
return sfsh;
}
/**
*
*/
public void setShhf(String shhf) {
this.shhf = shhf;
}
/**
*
*/
public String getShhf() {
return shhf;
}
/**
*
*/
public void setIspay(String ispay) {
this.ispay = ispay;
}
/**
*
*/
public String getIspay() {
return ispay;
}
}

@ -0,0 +1,158 @@
package com.entity;
// 导入 MyBatis-Plus 的注解,用于标识表和字段
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
// 导入 Java Bean 验证相关注解
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
// 导入 Jackson 注解,用于 JSON 格式化
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonFormat;
// 导入 Spring 的日期格式化注解
import org.springframework.format.annotation.DateTimeFormat;
// 导入常用工具类
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import org.apache.commons.beanutils.BeanUtils;
/**
* messages
*
* @author
* @email
* @date 2021-03-04 18:46:21
*/
@TableName("messages") // 使用 @TableName 注解指定对应的数据库表名
public class MessagesEntity<T> implements Serializable { // 继承 Serializable用于支持序列化
private static final long serialVersionUID = 1L; // 定义序列化版本号
// 构造方法,无参
public MessagesEntity() {
}
// 构造方法,通过传入的对象复制属性值
public MessagesEntity(T t) {
try {
BeanUtils.copyProperties(this, t); // 使用 Apache Commons 工具类复制属性值
} catch (IllegalAccessException | InvocationTargetException e) {
e.printStackTrace(); // 捕获并打印异常信息
}
}
/**
* id
*/
@TableId(type = IdType.AUTO) // 使用 @TableId 注解标识主键,并设置自增类型
private Long id; // 主键id
/**
* id
*/
private Long userid; // 留言人id
/**
*
*/
private String username; // 用户名
/**
*
*/
private String content; // 留言内容
/**
*
*/
private String reply; // 回复内容
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") // 使用 @JsonFormat 注解格式化日期
@DateTimeFormat // 使用 @DateTimeFormat 注解支持日期格式化输入
private Date addtime; // 添加时间
// 获取添加时间
public Date getAddtime() {
return addtime;
}
// 设置添加时间
public void setAddtime(Date addtime) {
this.addtime = addtime;
}
// 获取主键id
public Long getId() {
return id;
}
// 设置主键id
public void setId(Long id) {
this.id = id;
}
/**
* id
*/
public void setUserid(Long userid) {
this.userid = userid;
}
/**
* id
*/
public Long getUserid() {
return userid;
}
/**
*
*/
public void setUsername(String username) {
this.username = username;
}
/**
*
*/
public String getUsername() {
return username;
}
/**
*
*/
public void setContent(String content) {
this.content = content;
}
/**
*
*/
public String getContent() {
return content;
}
/**
*
*/
public void setReply(String reply) {
this.reply = reply;
}
/**
*
*/
public String getReply() {
return reply;
}
}

@ -0,0 +1,158 @@
package com.entity;
// 导入 MyBatis-Plus 的注解,用于标识表和字段
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
// 导入 Java Bean 验证相关注解
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
// 导入 Jackson 注解,用于 JSON 格式化
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonFormat;
// 导入 Spring 的日期格式化注解
import org.springframework.format.annotation.DateTimeFormat;
// 导入常用工具类
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import org.apache.commons.beanutils.BeanUtils;
/**
* news
*
* @author
* @email
* @date 2021-03-04 18:46:21
*/
@TableName("news") // 使用 @TableName 注解指定对应的数据库表名
public class NewsEntity<T> implements Serializable { // 继承 Serializable用于支持序列化
private static final long serialVersionUID = 1L; // 定义序列化版本号
// 构造方法,无参
public NewsEntity() {
}
// 构造方法,通过传入的对象复制属性值
public NewsEntity(T t) {
try {
BeanUtils.copyProperties(this, t); // 使用 Apache Commons 工具类复制属性值
} catch (IllegalAccessException | InvocationTargetException e) {
e.printStackTrace(); // 捕获并打印异常信息
}
}
/**
* id
*/
@TableId(type = IdType.AUTO) // 使用 @TableId 注解标识主键,并设置自增类型
private Long id; // 主键id
/**
*
*/
private String title; // 标题
/**
*
*/
private String introduction; // 简介
/**
*
*/
private String picture; // 图片
/**
*
*/
private String content; // 内容
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") // 使用 @JsonFormat 注解格式化日期
@DateTimeFormat // 使用 @DateTimeFormat 注解支持日期格式化输入
private Date addtime; // 添加时间
// 获取添加时间
public Date getAddtime() {
return addtime;
}
// 设置添加时间
public void setAddtime(Date addtime) {
this.addtime = addtime;
}
// 获取主键id
public Long getId() {
return id;
}
// 设置主键id
public void setId(Long id) {
this.id = id;
}
/**
*
*/
public void setTitle(String title) {
this.title = title;
}
/**
*
*/
public String getTitle() {
return title;
}
/**
*
*/
public void setIntroduction(String introduction) {
this.introduction = introduction;
}
/**
*
*/
public String getIntroduction() {
return introduction;
}
/**
*
*/
public void setPicture(String picture) {
this.picture = picture;
}
/**
*
*/
public String getPicture() {
return picture;
}
/**
*
*/
public void setContent(String content) {
this.content = content;
}
/**
*
*/
public String getContent() {
return content;
}
}

@ -0,0 +1,177 @@
package com.entity;
// 导入 MyBatis-Plus 的注解,用于标识表和字段
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
// 导入 Java Bean 验证相关注解
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
// 导入 Jackson 注解,用于 JSON 格式化
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonFormat;
// 导入 Spring 的日期格式化注解
import org.springframework.format.annotation.DateTimeFormat;
// 导入常用工具类
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import org.apache.commons.beanutils.BeanUtils;
/**
* storeup
*
* @author
* @email
* @date 2021-03-04 18:46:21
*/
@TableName("storeup") // 使用 @TableName 注解指定对应的数据库表名
public class StoreupEntity<T> implements Serializable { // 继承 Serializable用于支持序列化
private static final long serialVersionUID = 1L; // 定义序列化版本号
// 构造方法,无参
public StoreupEntity() {
}
// 构造方法,通过传入的对象复制属性值
public StoreupEntity(T t) {
try {
BeanUtils.copyProperties(this, t); // 使用 Apache Commons 工具类复制属性值
} catch (IllegalAccessException | InvocationTargetException e) {
e.printStackTrace(); // 捕获并打印异常信息
}
}
/**
* id
*/
@TableId(type = IdType.AUTO) // 使用 @TableId 注解标识主键,并设置自增类型
private Long id; // 主键id
/**
* id
*/
private Long userid; // 用户id
/**
* id
*/
private Long refid; // 收藏id
/**
*
*/
private String tablename; // 表名
/**
*
*/
private String name; // 收藏名称
/**
*
*/
private String picture; // 收藏图片
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") // 使用 @JsonFormat 注解格式化日期
@DateTimeFormat // 使用 @DateTimeFormat 注解支持日期格式化输入
private Date addtime; // 添加时间
// 获取添加时间
public Date getAddtime() {
return addtime;
}
// 设置添加时间
public void setAddtime(Date addtime) {
this.addtime = addtime;
}
// 获取主键id
public Long getId() {
return id;
}
// 设置主键id
public void setId(Long id) {
this.id = id;
}
/**
* id
*/
public void setUserid(Long userid) {
this.userid = userid;
}
/**
* id
*/
public Long getUserid() {
return userid;
}
/**
* id
*/
public void setRefid(Long refid) {
this.refid = refid;
}
/**
* id
*/
public Long getRefid() {
return refid;
}
/**
*
*/
public void setTablename(String tablename) {
this.tablename = tablename;
}
/**
*
*/
public String getTablename() {
return tablename;
}
/**
*
*/
public void setName(String name) {
this.name = name;
}
/**
*
*/
public String getName() {
return name;
}
/**
*
*/
public void setPicture(String picture) {
this.picture = picture;
}
/**
*
*/
public String getPicture() {
return picture;
}
}

@ -0,0 +1,151 @@
package com.entity;
// 导入必要的 Java 类
import java.io.Serializable;
import java.util.Date;
// 导入 MyBatis-Plus 的注解,用于标识表和字段
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
/**
* token token
*/
@TableName("token") // 使用 @TableName 注解指定对应的数据库表名
public class TokenEntity implements Serializable { // 继承 Serializable用于支持序列化
private static final long serialVersionUID = 1L; // 定义序列化版本号
@TableId(type = IdType.AUTO) // 使用 @TableId 注解标识主键,并设置自增类型
private Long id; // 主键id
/**
* id
*/
private Long userid; // 用户id
/**
*
*/
private String username; // 用户名
/**
*
*/
private String tablename; // 表名
/**
*
*/
private String role; // 角色
/**
* token
*/
private String token; // token
/**
*
*/
private Date expiratedtime; // 过期时间
/**
*
*/
private Date addtime; // 新增时间
// 获取主键id
public Long getId() {
return id;
}
// 设置主键id
public void setId(Long id) {
this.id = id;
}
// 获取用户id
public Long getUserid() {
return userid;
}
// 设置用户id
public void setUserid(Long userid) {
this.userid = userid;
}
// 获取角色
public String getRole() {
return role;
}
// 设置角色
public void setRole(String role) {
this.role = role;
}
// 获取token
public String getToken() {
return token;
}
// 获取表名
public String getTablename() {
return tablename;
}
// 设置表名
public void setTablename(String tablename) {
this.tablename = tablename;
}
// 设置token
public void setToken(String token) {
this.token = token;
}
// 获取过期时间
public Date getExpiratedtime() {
return expiratedtime;
}
// 设置过期时间
public void setExpiratedtime(Date expiratedtime) {
this.expiratedtime = expiratedtime;
}
// 获取新增时间
public Date getAddtime() {
return addtime;
}
// 设置新增时间
public void setAddtime(Date addtime) {
this.addtime = addtime;
}
// 获取用户名
public String getUsername() {
return username;
}
// 设置用户名
public void setUsername(String username) {
this.username = username;
}
// 带参数的构造方法
public TokenEntity(Long userid, String username, String tablename, String role, String token, Date expiratedtime) {
super();
this.userid = userid;
this.username = username;
this.tablename = tablename;
this.role = role;
this.token = token;
this.expiratedtime = expiratedtime;
}
// 无参构造方法
public TokenEntity() {
}
}

@ -0,0 +1,88 @@
package com.entity;
// 导入必要的 Java 类
import java.io.Serializable;
import java.util.Date;
// 导入 MyBatis-Plus 的注解,用于标识表和字段
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
/**
* users
*/
@TableName("users") // 使用 @TableName 注解指定对应的数据库表名
public class UserEntity implements Serializable { // 继承 Serializable用于支持序列化
private static final long serialVersionUID = 1L; // 定义序列化版本号
@TableId(type = IdType.AUTO) // 使用 @TableId 注解标识主键,并设置自增类型
private Long id; // 主键id
/**
*
*/
private String username; // 用户账号
/**
*
*/
private String password; // 密码
/**
*
*/
private String role; // 用户类型
private Date addtime; // 添加时间
// 获取用户账号
public String getUsername() {
return username;
}
// 设置用户账号
public void setUsername(String username) {
this.username = username;
}
// 获取密码
public String getPassword() {
return password;
}
// 设置密码
public void setPassword(String password) {
this.password = password;
}
// 获取用户类型
public String getRole() {
return role;
}
// 设置用户类型
public void setRole(String role) {
this.role = role;
}
// 获取添加时间
public Date getAddtime() {
return addtime;
}
// 设置添加时间
public void setAddtime(Date addtime) {
this.addtime = addtime;
}
// 获取主键id
public Long getId() {
return id;
}
// 设置主键id
public void setId(Long id) {
this.id = id;
}
}

@ -0,0 +1,312 @@
package com.entity;
// 导入 MyBatis-Plus 的注解,用于标识表和字段
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
// 导入 Java Bean 验证相关注解
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
// 导入 Jackson 注解,用于 JSON 格式化
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonFormat;
// 导入 Spring 的日期格式化注解
import org.springframework.format.annotation.DateTimeFormat;
// 导入常用工具类
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import org.apache.commons.beanutils.BeanUtils;
/**
* weixiuchuli
*
* @author
* @email
* @date 2021-03-04 18:46:21
*/
@TableName("weixiuchuli") // 使用 @TableName 注解指定对应的数据库表名
public class WeixiuchuliEntity<T> implements Serializable { // 继承 Serializable用于支持序列化
private static final long serialVersionUID = 1L; // 定义序列化版本号
// 构造方法,无参
public WeixiuchuliEntity() {
}
// 构造方法,通过传入的对象复制属性值
public WeixiuchuliEntity(T t) {
try {
BeanUtils.copyProperties(this, t); // 使用 Apache Commons 工具类复制属性值
} catch (IllegalAccessException | InvocationTargetException e) {
e.printStackTrace(); // 捕获并打印异常信息
}
}
/**
* id
*/
@TableId(type = IdType.AUTO) // 使用 @TableId 注解标识主键,并设置自增类型
private Long id;
/**
*
*/
private String fangwumingcheng;
/**
*
*/
private String fangwuleixing;
/**
*
*/
private String baoxiumingcheng;
/**
*
*/
private String leixing;
/**
*
*/
private String baoxiuriqi;
/**
*
*/
private String weixiufankui;
/**
*
*/
private String weixiujindu;
/**
*
*/
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd") // 使用 @JsonFormat 注解格式化日期
@DateTimeFormat // 使用 @DateTimeFormat 注解支持日期格式化输入
private Date gengxinriqi;
/**
*
*/
private String fangzhuzhanghao;
/**
*
*/
private String fangzhuxingming;
/**
*
*/
private String yonghuming;
/**
*
*/
private String lianxidianhua;
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") // 使用 @JsonFormat 注解格式化日期
@DateTimeFormat // 使用 @DateTimeFormat 注解支持日期格式化输入
private Date addtime;
// 获取添加时间
public Date getAddtime() {
return addtime;
}
// 设置添加时间
public void setAddtime(Date addtime) {
this.addtime = addtime;
}
// 获取主键id
public Long getId() {
return id;
}
// 设置主键id
public void setId(Long id) {
this.id = id;
}
/**
*
*/
public void setFangwumingcheng(String fangwumingcheng) {
this.fangwumingcheng = fangwumingcheng;
}
/**
*
*/
public String getFangwumingcheng() {
return fangwumingcheng;
}
/**
*
*/
public void setFangwuleixing(String fangwuleixing) {
this.fangwuleixing = fangwuleixing;
}
/**
*
*/
public String getFangwuleixing() {
return fangwuleixing;
}
/**
*
*/
public void setBaoxiumingcheng(String baoxiumingcheng) {
this.baoxiumingcheng = baoxiumingcheng;
}
/**
*
*/
public String getBaoxiumingcheng() {
return baoxiumingcheng;
}
/**
*
*/
public void setLeixing(String leixing) {
this.leixing = leixing;
}
/**
*
*/
public String getLeixing() {
return leixing;
}
/**
*
*/
public void setBaoxiuriqi(String baoxiuriqi) {
this.baoxiuriqi = baoxiuriqi;
}
/**
*
*/
public String getBaoxiuriqi() {
return baoxiuriqi;
}
/**
*
*/
public void setWeixiufankui(String weixiufankui) {
this.weixiufankui = weixiufankui;
}
/**
*
*/
public String getWeixiufankui() {
return weixiufankui;
}
/**
*
*/
public void setWeixiujindu(String weixiujindu) {
this.weixiujindu = weixiujindu;
}
/**
*
*/
public String getWeixiujindu() {
return weixiujindu;
}
/**
*
*/
public void setGengxinriqi(Date gengxinriqi) {
this.gengxinriqi = gengxinriqi;
}
/**
*
*/
public Date getGengxinriqi() {
return gengxinriqi;
}
/**
*
*/
public void setFangzhuzhanghao(String fangzhuzhanghao) {
this.fangzhuzhanghao = fangzhuzhanghao;
}
/**
*
*/
public String getFangzhuzhanghao() {
return fangzhuzhanghao;
}
/**
*
*/
public void setFangzhuxingming(String fangzhuxingming) {
this.fangzhuxingming = fangzhuxingming;
}
/**
*
*/
public String getFangzhuxingming() {
return fangzhuxingming;
}
/**
*
*/
public void setYonghuming(String yonghuming) {
this.yonghuming = yonghuming;
}
/**
*
*/
public String getYonghuming() {
return yonghuming;
}
/**
*
*/
public void setLianxidianhua(String lianxidianhua) {
this.lianxidianhua = lianxidianhua;
}
/**
*
*/
public String getLianxidianhua() {
return lianxidianhua;
}
}

@ -0,0 +1,350 @@
package com.entity;
// 导入 MyBatis-Plus 的注解,用于标识表和字段
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
// 导入 Java Bean 验证相关注解
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
// 导入 Jackson 注解,用于 JSON 格式化
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonFormat;
// 导入 Spring 的日期格式化注解
import org.springframework.format.annotation.DateTimeFormat;
// 导入常用工具类
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import org.apache.commons.beanutils.BeanUtils;
/**
* woyaodangfangzhu
*
* @author
* @email
* @date 2021-03-04 18:46:21
*/
@TableName("woyaodangfangzhu") // 使用 @TableName 注解指定对应的数据库表名
public class WoyaodangfangzhuEntity<T> implements Serializable { // 继承 Serializable用于支持序列化
private static final long serialVersionUID = 1L; // 定义序列化版本号
// 构造方法,无参
public WoyaodangfangzhuEntity() {
}
// 构造方法,通过传入的对象复制属性值
public WoyaodangfangzhuEntity(T t) {
try {
BeanUtils.copyProperties(this, t); // 使用 Apache Commons 工具类复制属性值
} catch (IllegalAccessException | InvocationTargetException e) {
e.printStackTrace(); // 捕获并打印异常信息
}
}
/**
* id
*/
@TableId(type = IdType.AUTO) // 使用 @TableId 注解标识主键,并设置自增类型
private Long id;
/**
*
*/
private String fangwumingcheng;
/**
*
*/
private String fangwuleixing;
/**
*
*/
private String tupian;
/**
*
*/
private String zulinfangshi;
/**
*
*/
private String chaoxianglouceng;
/**
*
*/
private String xiaoqu;
/**
*
*/
private String mianji;
/**
*
*/
private Integer yuezujiage;
/**
*
*/
private String fangwuxiangqing;
/**
*
*/
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd") // 使用 @JsonFormat 注解格式化日期
@DateTimeFormat // 使用 @DateTimeFormat 注解支持日期格式化输入
private Date faburiqi;
/**
*
*/
private String yonghuming;
/**
*
*/
private String lianxidianhua;
/**
*
*/
private String sfsh;
/**
*
*/
private String shhf;
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") // 使用 @JsonFormat 注解格式化日期
@DateTimeFormat // 使用 @DateTimeFormat 注解支持日期格式化输入
private Date addtime;
// 获取添加时间
public Date getAddtime() {
return addtime;
}
// 设置添加时间
public void setAddtime(Date addtime) {
this.addtime = addtime;
}
// 获取主键id
public Long getId() {
return id;
}
// 设置主键id
public void setId(Long id) {
this.id = id;
}
/**
*
*/
public void setFangwumingcheng(String fangwumingcheng) {
this.fangwumingcheng = fangwumingcheng;
}
/**
*
*/
public String getFangwumingcheng() {
return fangwumingcheng;
}
/**
*
*/
public void setFangwuleixing(String fangwuleixing) {
this.fangwuleixing = fangwuleixing;
}
/**
*
*/
public String getFangwuleixing() {
return fangwuleixing;
}
/**
*
*/
public void setTupian(String tupian) {
this.tupian = tupian;
}
/**
*
*/
public String getTupian() {
return tupian;
}
/**
*
*/
public void setZulinfangshi(String zulinfangshi) {
this.zulinfangshi = zulinfangshi;
}
/**
*
*/
public String getZulinfangshi() {
return zulinfangshi;
}
/**
*
*/
public void setChaoxianglouceng(String chaoxianglouceng) {
this.chaoxianglouceng = chaoxianglouceng;
}
/**
*
*/
public String getChaoxianglouceng() {
return chaoxianglouceng;
}
/**
*
*/
public void setXiaoqu(String xiaoqu) {
this.xiaoqu = xiaoqu;
}
/**
*
*/
public String getXiaoqu() {
return xiaoqu;
}
/**
*
*/
public void setMianji(String mianji) {
this.mianji = mianji;
}
/**
*
*/
public String getMianji() {
return mianji;
}
/**
*
*/
public void setYuezujiage(Integer yuezujiage) {
this.yuezujiage = yuezujiage;
}
/**
*
*/
public Integer getYuezujiage() {
return yuezujiage;
}
/**
*
*/
public void setFangwuxiangqing(String fangwuxiangqing) {
this.fangwuxiangqing = fangwuxiangqing;
}
/**
*
*/
public String getFangwuxiangqing() {
return fangwuxiangqing;
}
/**
*
*/
public void setFaburiqi(Date faburiqi) {
this.faburiqi = faburiqi;
}
/**
*
*/
public Date getFaburiqi() {
return faburiqi;
}
/**
*
*/
public void setYonghuming(String yonghuming) {
this.yonghuming = yonghuming;
}
/**
*
*/
public String getYonghuming() {
return yonghuming;
}
/**
*
*/
public void setLianxidianhua(String lianxidianhua) {
this.lianxidianhua = lianxidianhua;
}
/**
*
*/
public String getLianxidianhua() {
return lianxidianhua;
}
/**
*
*/
public void setSfsh(String sfsh) {
this.sfsh = sfsh;
}
/**
*
*/
public String getSfsh() {
return sfsh;
}
/**
*
*/
public void setShhf(String shhf) {
this.shhf = shhf;
}
/**
*
*/
public String getShhf() {
return shhf;
}
}

@ -0,0 +1,270 @@
package com.entity;
// 导入 MyBatis-Plus 的注解,用于标识表和字段
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
// 导入 Java Bean 验证相关注解
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
// 导入 Jackson 注解,用于 JSON 格式化
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonFormat;
// 导入 Spring 的日期格式化注解
import org.springframework.format.annotation.DateTimeFormat;
// 导入常用工具类
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import org.apache.commons.beanutils.BeanUtils;
/**
* yonghu
*
* @author
* @email
* @date 2021-03-04 18:46:21
*/
@TableName("yonghu") // 使用 @TableName 注解指定对应的数据库表名
public class YonghuEntity<T> implements Serializable {
private static final long serialVersionUID = 1L; // 定义序列化版本号
/**
*
*/
public YonghuEntity() {
}
/**
*
* @param t
*/
public YonghuEntity(T t) {
try {
BeanUtils.copyProperties(this, t); // 使用 Apache Commons 工具类复制属性值
} catch (IllegalAccessException | InvocationTargetException e) {
e.printStackTrace(); // 捕获并打印异常信息
}
}
/**
* id
*/
@TableId(type = IdType.AUTO) // 使用 @TableId 注解标识主键,并设置自增类型
private Long id;
/**
*
*/
private String yonghuming;
/**
*
*/
private String mima;
/**
*
*/
private String xingming;
/**
*
*/
private String touxiang;
/**
*
*/
private String xingbie;
/**
*
*/
private String zhiye;
/**
*
*/
private String lianxidianhua;
/**
*
*/
private String shenfenzheng;
/**
*
*/
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") // 使用 @JsonFormat 注解格式化日期
@DateTimeFormat // 使用 @DateTimeFormat 注解支持日期格式化输入
private Date addtime;
/**
*
* @return
*/
public Date getAddtime() {
return addtime;
}
/**
*
* @param addtime
*/
public void setAddtime(Date addtime) {
this.addtime = addtime;
}
/**
* id
* @return id
*/
public Long getId() {
return id;
}
/**
* id
* @param id id
*/
public void setId(Long id) {
this.id = id;
}
/**
*
* @param yonghuming
*/
public void setYonghuming(String yonghuming) {
this.yonghuming = yonghuming;
}
/**
*
* @return
*/
public String getYonghuming() {
return yonghuming;
}
/**
*
* @param mima
*/
public void setMima(String mima) {
this.mima = mima;
}
/**
*
* @return
*/
public String getMima() {
return mima;
}
/**
*
* @param xingming
*/
public void setXingming(String xingming) {
this.xingming = xingming;
}
/**
*
* @return
*/
public String getXingming() {
return xingming;
}
/**
*
* @param touxiang
*/
public void setTouxiang(String touxiang) {
this.touxiang = touxiang;
}
/**
*
* @return
*/
public String getTouxiang() {
return touxiang;
}
/**
*
* @param xingbie
*/
public void setXingbie(String xingbie) {
this.xingbie = xingbie;
}
/**
*
* @return
*/
public String getXingbie() {
return xingbie;
}
/**
*
* @param zhiye
*/
public void setZhiye(String zhiye) {
this.zhiye = zhiye;
}
/**
*
* @return
*/
public String getZhiye() {
return zhiye;
}
/**
*
* @param lianxidianhua
*/
public void setLianxidianhua(String lianxidianhua) {
this.lianxidianhua = lianxidianhua;
}
/**
*
* @return
*/
public String getLianxidianhua() {
return lianxidianhua;
}
/**
*
* @param shenfenzheng
*/
public void setShenfenzheng(String shenfenzheng) {
this.shenfenzheng = shenfenzheng;
}
/**
*
* @return
*/
public String getShenfenzheng() {
return shenfenzheng;
}
}

@ -0,0 +1,426 @@
package com.entity;
// 导入 MyBatis-Plus 的注解,用于标识表和字段
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
// 导入 Java Bean 验证相关注解
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
// 导入 Jackson 注解,用于 JSON 格式化
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonFormat;
// 导入 Spring 的日期格式化注解
import org.springframework.format.annotation.DateTimeFormat;
// 导入常用工具类
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import org.apache.commons.beanutils.BeanUtils;
/**
* yuyuekanfang
*
* @author
* @email
* @date 2021-03-04 18:46:21
*/
@TableName("yuyuekanfang") // 使用 @TableName 注解指定对应的数据库表名
public class YuyuekanfangEntity<T> implements Serializable { // 继承 Serializable用于支持序列化
private static final long serialVersionUID = 1L; // 定义序列化版本号
// 构造方法,无参
public YuyuekanfangEntity() {
}
// 构造方法,通过传入的对象复制属性值
public YuyuekanfangEntity(T t) {
try {
BeanUtils.copyProperties(this, t); // 使用 Apache Commons 工具类复制属性值
} catch (IllegalAccessException | InvocationTargetException e) {
e.printStackTrace(); // 捕获并打印异常信息
}
}
/**
* id
*/
@TableId(type = IdType.AUTO) // 使用 @TableId 注解标识主键,并设置自增类型
private Long id;
/**
*
*/
private String yuyuebianhao;
/**
*
*/
private String fangwumingcheng;
/**
*
*/
private String fangwuleixing;
/**
*
*/
private String fangwuzhuangtai;
/**
*
*/
private String xiaoqu;
/**
*
*/
private Integer yuezujiage;
/**
*
*/
private String yajin;
/**
*
*/
private Integer zuyongyueshu;
/**
*
*/
private String zuyongjine;
/**
*
*/
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") // 使用 @JsonFormat 注解格式化日期
@DateTimeFormat // 使用 @DateTimeFormat 注解支持日期格式化输入
private Date yuyueshijian;
/**
*
*/
private String yonghuming;
/**
*
*/
private String xingming;
/**
*
*/
private String shenfenzheng;
/**
*
*/
private String lianxidianhua;
/**
*
*/
private String fangzhuzhanghao;
/**
*
*/
private String fangzhuxingming;
/**
*
*/
private String sfsh;
/**
*
*/
private String shhf;
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") // 使用 @JsonFormat 注解格式化日期
@DateTimeFormat // 使用 @DateTimeFormat 注解支持日期格式化输入
private Date addtime;
// 获取添加时间
public Date getAddtime() {
return addtime;
}
// 设置添加时间
public void setAddtime(Date addtime) {
this.addtime = addtime;
}
// 获取主键id
public Long getId() {
return id;
}
// 设置主键id
public void setId(Long id) {
this.id = id;
}
/**
*
*/
public void setYuyuebianhao(String yuyuebianhao) {
this.yuyuebianhao = yuyuebianhao;
}
/**
*
*/
public String getYuyuebianhao() {
return yuyuebianhao;
}
/**
*
*/
public void setFangwumingcheng(String fangwumingcheng) {
this.fangwumingcheng = fangwumingcheng;
}
/**
*
*/
public String getFangwumingcheng() {
return fangwumingcheng;
}
/**
*
*/
public void setFangwuleixing(String fangwuleixing) {
this.fangwuleixing = fangwuleixing;
}
/**
*
*/
public String getFangwuleixing() {
return fangwuleixing;
}
/**
*
*/
public void setFangwuzhuangtai(String fangwuzhuangtai) {
this.fangwuzhuangtai = fangwuzhuangtai;
}
/**
*
*/
public String getFangwuzhuangtai() {
return fangwuzhuangtai;
}
/**
*
*/
public void setXiaoqu(String xiaoqu) {
this.xiaoqu = xiaoqu;
}
/**
*
*/
public String getXiaoqu() {
return xiaoqu;
}
/**
*
*/
public void setYuezujiage(Integer yuezujiage) {
this.yuezujiage = yuezujiage;
}
/**
*
*/
public Integer getYuezujiage() {
return yuezujiage;
}
/**
*
*/
public void setYajin(String yajin) {
this.yajin = yajin;
}
/**
*
*/
public String getYajin() {
return yajin;
}
/**
*
*/
public void setZuyongyueshu(Integer zuyongyueshu) {
this.zuyongyueshu = zuyongyueshu;
}
/**
*
*/
public Integer getZuyongyueshu() {
return zuyongyueshu;
}
/**
*
*/
public void setZuyongjine(String zuyongjine) {
this.zuyongjine = zuyongjine;
}
/**
*
*/
public String getZuyongjine() {
return zuyongjine;
}
/**
*
*/
public void setYuyueshijian(Date yuyueshijian) {
this.yuyueshijian = yuyueshijian;
}
/**
*
*/
public Date getYuyueshijian() {
return yuyueshijian;
}
/**
*
*/
public void setYonghuming(String yonghuming) {
this.yonghuming = yonghuming;
}
/**
*
*/
public String getYonghuming() {
return yonghuming;
}
/**
*
*/
public void setXingming(String xingming) {
this.xingming = xingming;
}
/**
*
*/
public String getXingming() {
return xingming;
}
/**
*
*/
public void setShenfenzheng(String shenfenzheng) {
this.shenfenzheng = shenfenzheng;
}
/**
*
*/
public String getShenfenzheng() {
return shenfenzheng;
}
/**
*
*/
public void setLianxidianhua(String lianxidianhua) {
this.lianxidianhua = lianxidianhua;
}
/**
*
*/
public String getLianxidianhua() {
return lianxidianhua;
}
/**
*
*/
public void setFangzhuzhanghao(String fangzhuzhanghao) {
this.fangzhuzhanghao = fangzhuzhanghao;
}
/**
*
*/
public String getFangzhuzhanghao() {
return fangzhuzhanghao;
}
/**
*
*/
public void setFangzhuxingming(String fangzhuxingming) {
this.fangzhuxingming = fangzhuxingming;
}
/**
*
*/
public String getFangzhuxingming() {
return fangzhuxingming;
}
/**
*
*/
public void setSfsh(String sfsh) {
this.sfsh = sfsh;
}
/**
*
*/
public String getSfsh() {
return sfsh;
}
/**
*
*/
public void setShhf(String shhf) {
this.shhf = shhf;
}
/**
*
*/
public String getShhf() {
return shhf;
}
}

@ -0,0 +1,92 @@
package com.entity.model;
import com.entity.DiscussfangwuxinxiEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
* @author
* @email
* @date 2025-04-04 18:46:21
*/
public class DiscussfangwuxinxiModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
private Long userid;
/**
*
*/
private String content;
/**
*
*/
private String reply;
/**
* id
*/
public void setUserid(Long userid) {
this.userid = userid;
}
/**
* id
*/
public Long getUserid() {
return userid;
}
/**
*
*/
public void setContent(String content) {
this.content = content;
}
/**
*
*/
public String getContent() {
return content;
}
/**
*
*/
public void setReply(String reply) {
this.reply = reply;
}
/**
*
*/
public String getReply() {
return reply;
}
}

@ -0,0 +1,92 @@
package com.entity.model;
import com.entity.DiscusswoyaodangfangzhuEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
* @author
* @email
* @date 2025-04-04 18:46:21
*/
public class DiscusswoyaodangfangzhuModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
private Long userid;
/**
*
*/
private String content;
/**
*
*/
private String reply;
/**
* id
*/
public void setUserid(Long userid) {
this.userid = userid;
}
/**
* id
*/
public Long getUserid() {
return userid;
}
/**
*
*/
public void setContent(String content) {
this.content = content;
}
/**
*
*/
public String getContent() {
return content;
}
/**
*
*/
public void setReply(String reply) {
this.reply = reply;
}
/**
*
*/
public String getReply() {
return reply;
}
}

@ -0,0 +1,336 @@
package com.entity.model;
import com.entity.FangwubaoxiuEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
* @author
* @email
* @date 2025-04-04 18:46:21
*/
public class FangwubaoxiuModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private String fangwumingcheng;
/**
*
*/
private String fangwuleixing;
/**
*
*/
private String xiaoqu;
/**
*
*/
private String baoxiumingcheng;
/**
*
*/
private String leixing;
/**
*
*/
private String baoxiuneirong;
/**
*
*/
private String tupian;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date baoxiuriqi;
/**
*
*/
private String fangzhuzhanghao;
/**
*
*/
private String fangzhuxingming;
/**
*
*/
private String yonghuming;
/**
*
*/
private String lianxidianhua;
/**
*
*/
private String sfsh;
/**
*
*/
private String shhf;
/**
*
*/
public void setFangwumingcheng(String fangwumingcheng) {
this.fangwumingcheng = fangwumingcheng;
}
/**
*
*/
public String getFangwumingcheng() {
return fangwumingcheng;
}
/**
*
*/
public void setFangwuleixing(String fangwuleixing) {
this.fangwuleixing = fangwuleixing;
}
/**
*
*/
public String getFangwuleixing() {
return fangwuleixing;
}
/**
*
*/
public void setXiaoqu(String xiaoqu) {
this.xiaoqu = xiaoqu;
}
/**
*
*/
public String getXiaoqu() {
return xiaoqu;
}
/**
*
*/
public void setBaoxiumingcheng(String baoxiumingcheng) {
this.baoxiumingcheng = baoxiumingcheng;
}
/**
*
*/
public String getBaoxiumingcheng() {
return baoxiumingcheng;
}
/**
*
*/
public void setLeixing(String leixing) {
this.leixing = leixing;
}
/**
*
*/
public String getLeixing() {
return leixing;
}
/**
*
*/
public void setBaoxiuneirong(String baoxiuneirong) {
this.baoxiuneirong = baoxiuneirong;
}
/**
*
*/
public String getBaoxiuneirong() {
return baoxiuneirong;
}
/**
*
*/
public void setTupian(String tupian) {
this.tupian = tupian;
}
/**
*
*/
public String getTupian() {
return tupian;
}
/**
*
*/
public void setBaoxiuriqi(Date baoxiuriqi) {
this.baoxiuriqi = baoxiuriqi;
}
/**
*
*/
public Date getBaoxiuriqi() {
return baoxiuriqi;
}
/**
*
*/
public void setFangzhuzhanghao(String fangzhuzhanghao) {
this.fangzhuzhanghao = fangzhuzhanghao;
}
/**
*
*/
public String getFangzhuzhanghao() {
return fangzhuzhanghao;
}
/**
*
*/
public void setFangzhuxingming(String fangzhuxingming) {
this.fangzhuxingming = fangzhuxingming;
}
/**
*
*/
public String getFangzhuxingming() {
return fangzhuxingming;
}
/**
*
*/
public void setYonghuming(String yonghuming) {
this.yonghuming = yonghuming;
}
/**
*
*/
public String getYonghuming() {
return yonghuming;
}
/**
*
*/
public void setLianxidianhua(String lianxidianhua) {
this.lianxidianhua = lianxidianhua;
}
/**
*
*/
public String getLianxidianhua() {
return lianxidianhua;
}
/**
*
*/
public void setSfsh(String sfsh) {
this.sfsh = sfsh;
}
/**
*
*/
public String getSfsh() {
return sfsh;
}
/**
*
*/
public void setShhf(String shhf) {
this.shhf = shhf;
}
/**
*
*/
public String getShhf() {
return shhf;
}
}

@ -0,0 +1,26 @@
package com.entity.model;
import com.entity.FangwuleixingEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
* @author
* @email
* @date 2025-04-04 18:46:21
*/
public class FangwuleixingModel implements Serializable {
private static final long serialVersionUID = 1L;
}

@ -0,0 +1,270 @@
package com.entity.model;
import com.entity.FangwupingjiaEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
* @author
* @email
* @date 2025-04-04 18:46:21
*/
public class FangwupingjiaModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private String fangwumingcheng;
/**
*
*/
private String fangwuleixing;
/**
*
*/
private String xiaoqu;
/**
*
*/
private String pingfen;
/**
*
*/
private String pingjianeirong;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date pingjiariqi;
/**
*
*/
private String fangzhuzhanghao;
/**
*
*/
private String yonghuming;
/**
*
*/
private String lianxidianhua;
/**
*
*/
private String sfsh;
/**
*
*/
private String shhf;
/**
*
*/
public void setFangwumingcheng(String fangwumingcheng) {
this.fangwumingcheng = fangwumingcheng;
}
/**
*
*/
public String getFangwumingcheng() {
return fangwumingcheng;
}
/**
*
*/
public void setFangwuleixing(String fangwuleixing) {
this.fangwuleixing = fangwuleixing;
}
/**
*
*/
public String getFangwuleixing() {
return fangwuleixing;
}
/**
*
*/
public void setXiaoqu(String xiaoqu) {
this.xiaoqu = xiaoqu;
}
/**
*
*/
public String getXiaoqu() {
return xiaoqu;
}
/**
*
*/
public void setPingfen(String pingfen) {
this.pingfen = pingfen;
}
/**
*
*/
public String getPingfen() {
return pingfen;
}
/**
*
*/
public void setPingjianeirong(String pingjianeirong) {
this.pingjianeirong = pingjianeirong;
}
/**
*
*/
public String getPingjianeirong() {
return pingjianeirong;
}
/**
*
*/
public void setPingjiariqi(Date pingjiariqi) {
this.pingjiariqi = pingjiariqi;
}
/**
*
*/
public Date getPingjiariqi() {
return pingjiariqi;
}
/**
*
*/
public void setFangzhuzhanghao(String fangzhuzhanghao) {
this.fangzhuzhanghao = fangzhuzhanghao;
}
/**
*
*/
public String getFangzhuzhanghao() {
return fangzhuzhanghao;
}
/**
*
*/
public void setYonghuming(String yonghuming) {
this.yonghuming = yonghuming;
}
/**
*
*/
public String getYonghuming() {
return yonghuming;
}
/**
*
*/
public void setLianxidianhua(String lianxidianhua) {
this.lianxidianhua = lianxidianhua;
}
/**
*
*/
public String getLianxidianhua() {
return lianxidianhua;
}
/**
*
*/
public void setSfsh(String sfsh) {
this.sfsh = sfsh;
}
/**
*
*/
public String getSfsh() {
return sfsh;
}
/**
*
*/
public void setShhf(String shhf) {
this.shhf = shhf;
}
/**
*
*/
public String getShhf() {
return shhf;
}
}

@ -0,0 +1,358 @@
package com.entity.model;
import com.entity.FangwuxinxiEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
* @author
* @email
* @date 2025-04-04 18:46:21
*/
public class FangwuxinxiModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private String fangwuleixing;
/**
*
*/
private String tupian;
/**
*
*/
private String zulinfangshi;
/**
*
*/
private String chaoxianglouceng;
/**
*
*/
private String mianji;
/**
*
*/
private String fangwuzhuangtai;
/**
*
*/
private String xiaoqu;
/**
*
*/
private String xiangxidizhi;
/**
*
*/
private Integer yuezujiage;
/**
*
*/
private Integer yajin;
/**
*
*/
private String fangwusheshi;
/**
*
*/
private String fangwuxiangqing;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date faburiqi;
/**
*
*/
private String fangzhuzhanghao;
/**
*
*/
private String fangzhuxingming;
/**
*
*/
public void setFangwuleixing(String fangwuleixing) {
this.fangwuleixing = fangwuleixing;
}
/**
*
*/
public String getFangwuleixing() {
return fangwuleixing;
}
/**
*
*/
public void setTupian(String tupian) {
this.tupian = tupian;
}
/**
*
*/
public String getTupian() {
return tupian;
}
/**
*
*/
public void setZulinfangshi(String zulinfangshi) {
this.zulinfangshi = zulinfangshi;
}
/**
*
*/
public String getZulinfangshi() {
return zulinfangshi;
}
/**
*
*/
public void setChaoxianglouceng(String chaoxianglouceng) {
this.chaoxianglouceng = chaoxianglouceng;
}
/**
*
*/
public String getChaoxianglouceng() {
return chaoxianglouceng;
}
/**
*
*/
public void setMianji(String mianji) {
this.mianji = mianji;
}
/**
*
*/
public String getMianji() {
return mianji;
}
/**
*
*/
public void setFangwuzhuangtai(String fangwuzhuangtai) {
this.fangwuzhuangtai = fangwuzhuangtai;
}
/**
*
*/
public String getFangwuzhuangtai() {
return fangwuzhuangtai;
}
/**
*
*/
public void setXiaoqu(String xiaoqu) {
this.xiaoqu = xiaoqu;
}
/**
*
*/
public String getXiaoqu() {
return xiaoqu;
}
/**
*
*/
public void setXiangxidizhi(String xiangxidizhi) {
this.xiangxidizhi = xiangxidizhi;
}
/**
*
*/
public String getXiangxidizhi() {
return xiangxidizhi;
}
/**
*
*/
public void setYuezujiage(Integer yuezujiage) {
this.yuezujiage = yuezujiage;
}
/**
*
*/
public Integer getYuezujiage() {
return yuezujiage;
}
/**
*
*/
public void setYajin(Integer yajin) {
this.yajin = yajin;
}
/**
*
*/
public Integer getYajin() {
return yajin;
}
/**
*
*/
public void setFangwusheshi(String fangwusheshi) {
this.fangwusheshi = fangwusheshi;
}
/**
*
*/
public String getFangwusheshi() {
return fangwusheshi;
}
/**
*
*/
public void setFangwuxiangqing(String fangwuxiangqing) {
this.fangwuxiangqing = fangwuxiangqing;
}
/**
*
*/
public String getFangwuxiangqing() {
return fangwuxiangqing;
}
/**
*
*/
public void setFaburiqi(Date faburiqi) {
this.faburiqi = faburiqi;
}
/**
*
*/
public Date getFaburiqi() {
return faburiqi;
}
/**
*
*/
public void setFangzhuzhanghao(String fangzhuzhanghao) {
this.fangzhuzhanghao = fangzhuzhanghao;
}
/**
*
*/
public String getFangzhuzhanghao() {
return fangzhuzhanghao;
}
/**
*
*/
public void setFangzhuxingming(String fangzhuxingming) {
this.fangzhuxingming = fangzhuxingming;
}
/**
*
*/
public String getFangzhuxingming() {
return fangzhuxingming;
}
}

@ -0,0 +1,158 @@
package com.entity.model;
import com.entity.FangzhuEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
* @author
* @email
* @date 2025-04-04 18:46:21
*/
public class FangzhuModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private String mima;
/**
*
*/
private String fangzhuxingming;
/**
*
*/
private String xingbie;
/**
*
*/
private String touxiang;
/**
*
*/
private String shouji;
/**
*
*/
private String shenfenzheng;
/**
*
*/
public void setMima(String mima) {
this.mima = mima;
}
/**
*
*/
public String getMima() {
return mima;
}
/**
*
*/
public void setFangzhuxingming(String fangzhuxingming) {
this.fangzhuxingming = fangzhuxingming;
}
/**
*
*/
public String getFangzhuxingming() {
return fangzhuxingming;
}
/**
*
*/
public void setXingbie(String xingbie) {
this.xingbie = xingbie;
}
/**
*
*/
public String getXingbie() {
return xingbie;
}
/**
*
*/
public void setTouxiang(String touxiang) {
this.touxiang = touxiang;
}
/**
*
*/
public String getTouxiang() {
return touxiang;
}
/**
*
*/
public void setShouji(String shouji) {
this.shouji = shouji;
}
/**
*
*/
public String getShouji() {
return shouji;
}
/**
*
*/
public void setShenfenzheng(String shenfenzheng) {
this.shenfenzheng = shenfenzheng;
}
/**
*
*/
public String getShenfenzheng() {
return shenfenzheng;
}
}

@ -0,0 +1,448 @@
package com.entity.model;
import com.entity.HetongxinxiEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
* @author
* @email
* @date 2025-04-04 18:46:21
*/
public class HetongxinxiModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private String fangwumingcheng;
/**
*
*/
private String fangwuleixing;
/**
*
*/
private String xiaoqu;
/**
*
*/
private String yuezujiage;
/**
*
*/
private String zuyongyueshu;
/**
*
*/
private Integer zuyongjine;
/**
*
*/
private Integer yajin;
/**
*
*/
private String fangzuzhuangtai;
/**
*
*/
private String hetongjine;
/**
*
*/
private String hetongneirong;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date shengxiaori;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date youxianqizhi;
/**
*
*/
private String yonghuming;
/**
*
*/
private String lianxidianhua;
/**
*
*/
private String fangzhuzhanghao;
/**
*
*/
private String fangzhuxingming;
/**
*
*/
private String sfsh;
/**
*
*/
private String shhf;
/**
*
*/
private String ispay;
/**
*
*/
public void setFangwumingcheng(String fangwumingcheng) {
this.fangwumingcheng = fangwumingcheng;
}
/**
*
*/
public String getFangwumingcheng() {
return fangwumingcheng;
}
/**
*
*/
public void setFangwuleixing(String fangwuleixing) {
this.fangwuleixing = fangwuleixing;
}
/**
*
*/
public String getFangwuleixing() {
return fangwuleixing;
}
/**
*
*/
public void setXiaoqu(String xiaoqu) {
this.xiaoqu = xiaoqu;
}
/**
*
*/
public String getXiaoqu() {
return xiaoqu;
}
/**
*
*/
public void setYuezujiage(String yuezujiage) {
this.yuezujiage = yuezujiage;
}
/**
*
*/
public String getYuezujiage() {
return yuezujiage;
}
/**
*
*/
public void setZuyongyueshu(String zuyongyueshu) {
this.zuyongyueshu = zuyongyueshu;
}
/**
*
*/
public String getZuyongyueshu() {
return zuyongyueshu;
}
/**
*
*/
public void setZuyongjine(Integer zuyongjine) {
this.zuyongjine = zuyongjine;
}
/**
*
*/
public Integer getZuyongjine() {
return zuyongjine;
}
/**
*
*/
public void setYajin(Integer yajin) {
this.yajin = yajin;
}
/**
*
*/
public Integer getYajin() {
return yajin;
}
/**
*
*/
public void setFangzuzhuangtai(String fangzuzhuangtai) {
this.fangzuzhuangtai = fangzuzhuangtai;
}
/**
*
*/
public String getFangzuzhuangtai() {
return fangzuzhuangtai;
}
/**
*
*/
public void setHetongjine(String hetongjine) {
this.hetongjine = hetongjine;
}
/**
*
*/
public String getHetongjine() {
return hetongjine;
}
/**
*
*/
public void setHetongneirong(String hetongneirong) {
this.hetongneirong = hetongneirong;
}
/**
*
*/
public String getHetongneirong() {
return hetongneirong;
}
/**
*
*/
public void setShengxiaori(Date shengxiaori) {
this.shengxiaori = shengxiaori;
}
/**
*
*/
public Date getShengxiaori() {
return shengxiaori;
}
/**
*
*/
public void setYouxianqizhi(Date youxianqizhi) {
this.youxianqizhi = youxianqizhi;
}
/**
*
*/
public Date getYouxianqizhi() {
return youxianqizhi;
}
/**
*
*/
public void setYonghuming(String yonghuming) {
this.yonghuming = yonghuming;
}
/**
*
*/
public String getYonghuming() {
return yonghuming;
}
/**
*
*/
public void setLianxidianhua(String lianxidianhua) {
this.lianxidianhua = lianxidianhua;
}
/**
*
*/
public String getLianxidianhua() {
return lianxidianhua;
}
/**
*
*/
public void setFangzhuzhanghao(String fangzhuzhanghao) {
this.fangzhuzhanghao = fangzhuzhanghao;
}
/**
*
*/
public String getFangzhuzhanghao() {
return fangzhuzhanghao;
}
/**
*
*/
public void setFangzhuxingming(String fangzhuxingming) {
this.fangzhuxingming = fangzhuxingming;
}
/**
*
*/
public String getFangzhuxingming() {
return fangzhuxingming;
}
/**
*
*/
public void setSfsh(String sfsh) {
this.sfsh = sfsh;
}
/**
*
*/
public String getSfsh() {
return sfsh;
}
/**
*
*/
public void setShhf(String shhf) {
this.shhf = shhf;
}
/**
*
*/
public String getShhf() {
return shhf;
}
/**
*
*/
public void setIspay(String ispay) {
this.ispay = ispay;
}
/**
*
*/
public String getIspay() {
return ispay;
}
}

@ -0,0 +1,92 @@
package com.entity.model;
import com.entity.MessagesEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
* @author
* @email
* @date 2025-04-04 18:46:21
*/
public class MessagesModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private String username;
/**
*
*/
private String content;
/**
*
*/
private String reply;
/**
*
*/
public void setUsername(String username) {
this.username = username;
}
/**
*
*/
public String getUsername() {
return username;
}
/**
*
*/
public void setContent(String content) {
this.content = content;
}
/**
*
*/
public String getContent() {
return content;
}
/**
*
*/
public void setReply(String reply) {
this.reply = reply;
}
/**
*
*/
public String getReply() {
return reply;
}
}

@ -0,0 +1,92 @@
package com.entity.model;
import com.entity.NewsEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
* @author
* @email
* @date 2025-04-04 18:46:21
*/
public class NewsModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private String introduction;
/**
*
*/
private String picture;
/**
*
*/
private String content;
/**
*
*/
public void setIntroduction(String introduction) {
this.introduction = introduction;
}
/**
*
*/
public String getIntroduction() {
return introduction;
}
/**
*
*/
public void setPicture(String picture) {
this.picture = picture;
}
/**
*
*/
public String getPicture() {
return picture;
}
/**
*
*/
public void setContent(String content) {
this.content = content;
}
/**
*
*/
public String getContent() {
return content;
}
}

@ -0,0 +1,114 @@
package com.entity.model;
import com.entity.StoreupEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
* @author
* @email
* @date 2025-04-04 18:46:21
*/
public class StoreupModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
private Long refid;
/**
*
*/
private String tablename;
/**
*
*/
private String name;
/**
*
*/
private String picture;
/**
* id
*/
public void setRefid(Long refid) {
this.refid = refid;
}
/**
* id
*/
public Long getRefid() {
return refid;
}
/**
*
*/
public void setTablename(String tablename) {
this.tablename = tablename;
}
/**
*
*/
public String getTablename() {
return tablename;
}
/**
*
*/
public void setName(String name) {
this.name = name;
}
/**
*
*/
public String getName() {
return name;
}
/**
*
*/
public void setPicture(String picture) {
this.picture = picture;
}
/**
*
*/
public String getPicture() {
return picture;
}
}

@ -0,0 +1,270 @@
package com.entity.model;
import com.entity.WeixiuchuliEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
* @author
* @email
* @date 2025-04-04 18:46:21
*/
public class WeixiuchuliModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private String fangwuleixing;
/**
*
*/
private String baoxiumingcheng;
/**
*
*/
private String leixing;
/**
*
*/
private String baoxiuriqi;
/**
*
*/
private String weixiufankui;
/**
*
*/
private String weixiujindu;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date gengxinriqi;
/**
*
*/
private String fangzhuzhanghao;
/**
*
*/
private String fangzhuxingming;
/**
*
*/
private String yonghuming;
/**
*
*/
private String lianxidianhua;
/**
*
*/
public void setFangwuleixing(String fangwuleixing) {
this.fangwuleixing = fangwuleixing;
}
/**
*
*/
public String getFangwuleixing() {
return fangwuleixing;
}
/**
*
*/
public void setBaoxiumingcheng(String baoxiumingcheng) {
this.baoxiumingcheng = baoxiumingcheng;
}
/**
*
*/
public String getBaoxiumingcheng() {
return baoxiumingcheng;
}
/**
*
*/
public void setLeixing(String leixing) {
this.leixing = leixing;
}
/**
*
*/
public String getLeixing() {
return leixing;
}
/**
*
*/
public void setBaoxiuriqi(String baoxiuriqi) {
this.baoxiuriqi = baoxiuriqi;
}
/**
*
*/
public String getBaoxiuriqi() {
return baoxiuriqi;
}
/**
*
*/
public void setWeixiufankui(String weixiufankui) {
this.weixiufankui = weixiufankui;
}
/**
*
*/
public String getWeixiufankui() {
return weixiufankui;
}
/**
*
*/
public void setWeixiujindu(String weixiujindu) {
this.weixiujindu = weixiujindu;
}
/**
*
*/
public String getWeixiujindu() {
return weixiujindu;
}
/**
*
*/
public void setGengxinriqi(Date gengxinriqi) {
this.gengxinriqi = gengxinriqi;
}
/**
*
*/
public Date getGengxinriqi() {
return gengxinriqi;
}
/**
*
*/
public void setFangzhuzhanghao(String fangzhuzhanghao) {
this.fangzhuzhanghao = fangzhuzhanghao;
}
/**
*
*/
public String getFangzhuzhanghao() {
return fangzhuzhanghao;
}
/**
*
*/
public void setFangzhuxingming(String fangzhuxingming) {
this.fangzhuxingming = fangzhuxingming;
}
/**
*
*/
public String getFangzhuxingming() {
return fangzhuxingming;
}
/**
*
*/
public void setYonghuming(String yonghuming) {
this.yonghuming = yonghuming;
}
/**
*
*/
public String getYonghuming() {
return yonghuming;
}
/**
*
*/
public void setLianxidianhua(String lianxidianhua) {
this.lianxidianhua = lianxidianhua;
}
/**
*
*/
public String getLianxidianhua() {
return lianxidianhua;
}
}

@ -0,0 +1,314 @@
package com.entity.model;
import com.entity.WoyaodangfangzhuEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
* @author
* @email
* @date 2025-04-04 18:46:21
*/
public class WoyaodangfangzhuModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private String fangwuleixing;
/**
*
*/
private String tupian;
/**
*
*/
private String zulinfangshi;
/**
*
*/
private String chaoxianglouceng;
/**
*
*/
private String xiaoqu;
/**
*
*/
private String mianji;
/**
*
*/
private Integer yuezujiage;
/**
*
*/
private String fangwuxiangqing;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date faburiqi;
/**
*
*/
private String yonghuming;
/**
*
*/
private String lianxidianhua;
/**
*
*/
private String sfsh;
/**
*
*/
private String shhf;
/**
*
*/
public void setFangwuleixing(String fangwuleixing) {
this.fangwuleixing = fangwuleixing;
}
/**
*
*/
public String getFangwuleixing() {
return fangwuleixing;
}
/**
*
*/
public void setTupian(String tupian) {
this.tupian = tupian;
}
/**
*
*/
public String getTupian() {
return tupian;
}
/**
*
*/
public void setZulinfangshi(String zulinfangshi) {
this.zulinfangshi = zulinfangshi;
}
/**
*
*/
public String getZulinfangshi() {
return zulinfangshi;
}
/**
*
*/
public void setChaoxianglouceng(String chaoxianglouceng) {
this.chaoxianglouceng = chaoxianglouceng;
}
/**
*
*/
public String getChaoxianglouceng() {
return chaoxianglouceng;
}
/**
*
*/
public void setXiaoqu(String xiaoqu) {
this.xiaoqu = xiaoqu;
}
/**
*
*/
public String getXiaoqu() {
return xiaoqu;
}
/**
*
*/
public void setMianji(String mianji) {
this.mianji = mianji;
}
/**
*
*/
public String getMianji() {
return mianji;
}
/**
*
*/
public void setYuezujiage(Integer yuezujiage) {
this.yuezujiage = yuezujiage;
}
/**
*
*/
public Integer getYuezujiage() {
return yuezujiage;
}
/**
*
*/
public void setFangwuxiangqing(String fangwuxiangqing) {
this.fangwuxiangqing = fangwuxiangqing;
}
/**
*
*/
public String getFangwuxiangqing() {
return fangwuxiangqing;
}
/**
*
*/
public void setFaburiqi(Date faburiqi) {
this.faburiqi = faburiqi;
}
/**
*
*/
public Date getFaburiqi() {
return faburiqi;
}
/**
*
*/
public void setYonghuming(String yonghuming) {
this.yonghuming = yonghuming;
}
/**
*
*/
public String getYonghuming() {
return yonghuming;
}
/**
*
*/
public void setLianxidianhua(String lianxidianhua) {
this.lianxidianhua = lianxidianhua;
}
/**
*
*/
public String getLianxidianhua() {
return lianxidianhua;
}
/**
*
*/
public void setSfsh(String sfsh) {
this.sfsh = sfsh;
}
/**
*
*/
public String getSfsh() {
return sfsh;
}
/**
*
*/
public void setShhf(String shhf) {
this.shhf = shhf;
}
/**
*
*/
public String getShhf() {
return shhf;
}
}

@ -0,0 +1,180 @@
package com.entity.model;
import com.entity.YonghuEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
* @author
* @email
* @date 2025-04-04 18:46:21
*/
public class YonghuModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private String mima;
/**
*
*/
private String xingming;
/**
*
*/
private String touxiang;
/**
*
*/
private String xingbie;
/**
*
*/
private String zhiye;
/**
*
*/
private String lianxidianhua;
/**
*
*/
private String shenfenzheng;
/**
*
*/
public void setMima(String mima) {
this.mima = mima;
}
/**
*
*/
public String getMima() {
return mima;
}
/**
*
*/
public void setXingming(String xingming) {
this.xingming = xingming;
}
/**
*
*/
public String getXingming() {
return xingming;
}
/**
*
*/
public void setTouxiang(String touxiang) {
this.touxiang = touxiang;
}
/**
*
*/
public String getTouxiang() {
return touxiang;
}
/**
*
*/
public void setXingbie(String xingbie) {
this.xingbie = xingbie;
}
/**
*
*/
public String getXingbie() {
return xingbie;
}
/**
*
*/
public void setZhiye(String zhiye) {
this.zhiye = zhiye;
}
/**
*
*/
public String getZhiye() {
return zhiye;
}
/**
*
*/
public void setLianxidianhua(String lianxidianhua) {
this.lianxidianhua = lianxidianhua;
}
/**
*
*/
public String getLianxidianhua() {
return lianxidianhua;
}
/**
*
*/
public void setShenfenzheng(String shenfenzheng) {
this.shenfenzheng = shenfenzheng;
}
/**
*
*/
public String getShenfenzheng() {
return shenfenzheng;
}
}

@ -0,0 +1,402 @@
package com.entity.model;
import com.entity.YuyuekanfangEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import java.util.Date;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
/**
*
*
* entity
* ModelAndView model
* @author
* @email
* @date 2025-04-04 18:46:21
*/
public class YuyuekanfangModel implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private String fangwumingcheng;
/**
*
*/
private String fangwuleixing;
/**
*
*/
private String fangwuzhuangtai;
/**
*
*/
private String xiaoqu;
/**
*
*/
private Integer yuezujiage;
/**
*
*/
private String yajin;
/**
*
*/
private Integer zuyongyueshu;
/**
*
*/
private String zuyongjine;
/**
*
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@DateTimeFormat
private Date yuyueshijian;
/**
*
*/
private String yonghuming;
/**
*
*/
private String xingming;
/**
*
*/
private String shenfenzheng;
/**
*
*/
private String lianxidianhua;
/**
*
*/
private String fangzhuzhanghao;
/**
*
*/
private String fangzhuxingming;
/**
*
*/
private String sfsh;
/**
*
*/
private String shhf;
/**
*
*/
public void setFangwumingcheng(String fangwumingcheng) {
this.fangwumingcheng = fangwumingcheng;
}
/**
*
*/
public String getFangwumingcheng() {
return fangwumingcheng;
}
/**
*
*/
public void setFangwuleixing(String fangwuleixing) {
this.fangwuleixing = fangwuleixing;
}
/**
*
*/
public String getFangwuleixing() {
return fangwuleixing;
}
/**
*
*/
public void setFangwuzhuangtai(String fangwuzhuangtai) {
this.fangwuzhuangtai = fangwuzhuangtai;
}
/**
*
*/
public String getFangwuzhuangtai() {
return fangwuzhuangtai;
}
/**
*
*/
public void setXiaoqu(String xiaoqu) {
this.xiaoqu = xiaoqu;
}
/**
*
*/
public String getXiaoqu() {
return xiaoqu;
}
/**
*
*/
public void setYuezujiage(Integer yuezujiage) {
this.yuezujiage = yuezujiage;
}
/**
*
*/
public Integer getYuezujiage() {
return yuezujiage;
}
/**
*
*/
public void setYajin(String yajin) {
this.yajin = yajin;
}
/**
*
*/
public String getYajin() {
return yajin;
}
/**
*
*/
public void setZuyongyueshu(Integer zuyongyueshu) {
this.zuyongyueshu = zuyongyueshu;
}
/**
*
*/
public Integer getZuyongyueshu() {
return zuyongyueshu;
}
/**
*
*/
public void setZuyongjine(String zuyongjine) {
this.zuyongjine = zuyongjine;
}
/**
*
*/
public String getZuyongjine() {
return zuyongjine;
}
/**
*
*/
public void setYuyueshijian(Date yuyueshijian) {
this.yuyueshijian = yuyueshijian;
}
/**
*
*/
public Date getYuyueshijian() {
return yuyueshijian;
}
/**
*
*/
public void setYonghuming(String yonghuming) {
this.yonghuming = yonghuming;
}
/**
*
*/
public String getYonghuming() {
return yonghuming;
}
/**
*
*/
public void setXingming(String xingming) {
this.xingming = xingming;
}
/**
*
*/
public String getXingming() {
return xingming;
}
/**
*
*/
public void setShenfenzheng(String shenfenzheng) {
this.shenfenzheng = shenfenzheng;
}
/**
*
*/
public String getShenfenzheng() {
return shenfenzheng;
}
/**
*
*/
public void setLianxidianhua(String lianxidianhua) {
this.lianxidianhua = lianxidianhua;
}
/**
*
*/
public String getLianxidianhua() {
return lianxidianhua;
}
/**
*
*/
public void setFangzhuzhanghao(String fangzhuzhanghao) {
this.fangzhuzhanghao = fangzhuzhanghao;
}
/**
*
*/
public String getFangzhuzhanghao() {
return fangzhuzhanghao;
}
/**
*
*/
public void setFangzhuxingming(String fangzhuxingming) {
this.fangzhuxingming = fangzhuxingming;
}
/**
*
*/
public String getFangzhuxingming() {
return fangzhuxingming;
}
/**
*
*/
public void setSfsh(String sfsh) {
this.sfsh = sfsh;
}
/**
*
*/
public String getSfsh() {
return sfsh;
}
/**
*
*/
public void setShhf(String shhf) {
this.shhf = shhf;
}
/**
*
*/
public String getShhf() {
return shhf;
}
}

@ -0,0 +1,46 @@
package com.entity.view;
import com.entity.DiscussfangwuxinxiEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
/**
*
*
* 使
* @author
* @email
* @date 2025-04-04 18:46:21
*/
// 使用 @TableName 注解指定该实体类对应的数据库表名为 "discussfangwuxinxi"
@TableName("discussfangwuxinxi")
// 定义一个名为 DiscussfangwuxinxiView 的类,它继承自 DiscussfangwuxinxiEntity 类,同时实现了 Serializable 接口,
// 实现 Serializable 接口意味着该类的对象可以被序列化,即可以在网络上传输或保存到文件中
public class DiscussfangwuxinxiView extends DiscussfangwuxinxiEntity implements Serializable {
// 定义一个序列化版本号,用于在反序列化时验证版本的一致性,确保序列化和反序列化的对象版本相同
private static final long serialVersionUID = 1L;
// 定义一个无参构造函数,当创建 DiscussfangwuxinxiView 对象时,如果不传入任何参数,会调用此构造函数
public DiscussfangwuxinxiView(){
}
// 定义一个带参构造函数,接收一个 DiscussfangwuxinxiEntity 类型的参数 discussfangwuxinxiEntity
// 该构造函数的作用是将传入的 DiscussfangwuxinxiEntity 对象的属性值复制到当前 DiscussfangwuxinxiView 对象中
public DiscussfangwuxinxiView(DiscussfangwuxinxiEntity discussfangwuxinxiEntity){
try {
// 使用 BeanUtils 类的 copyProperties 方法将 discussfangwuxinxiEntity 对象的属性值复制到当前对象中
// 此方法会自动匹配两个对象中相同名称和类型的属性并进行复制
BeanUtils.copyProperties(this, discussfangwuxinxiEntity);
} catch (IllegalAccessException | InvocationTargetException e) {
// 如果在复制属性过程中出现非法访问异常IllegalAccessException或调用目标异常InvocationTargetException
// 会捕获该异常,并在控制台打印异常堆栈信息,方便调试和定位问题
// TODO Auto-generated catch block 这是 IDE 自动生成的提示信息,提示开发者需要在这里添加具体的异常处理逻辑
e.printStackTrace();
}
}
}

@ -0,0 +1,47 @@
package com.entity.view;
import com.entity.DiscusswoyaodangfangzhuEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
/**
*
*
* 使
* @author
* @email
* @date 2025-04-04 18:46:21
*/
// 使用 @TableName 注解指定该类在数据库中对应的表名为 "discusswoyaodangfangzhu"
@TableName("discusswoyaodangfangzhu")
// 定义一个名为 DiscusswoyaodangfangzhuView 的类,它继承自 DiscusswoyaodangfangzhuEntity 类,
// 同时实现了 Serializable 接口,这意味着该类的对象可以被序列化,以便在网络传输或存储到文件等场景中使用
public class DiscusswoyaodangfangzhuView extends DiscusswoyaodangfangzhuEntity implements Serializable {
// 定义一个序列化版本号,用于在反序列化时确保对象版本的一致性
// 当对象被序列化后,如果类的结构发生了变化,通过这个版本号可以判断是否能正确反序列化
private static final long serialVersionUID = 1L;
// 定义一个无参构造函数,当创建 DiscusswoyaodangfangzhuView 类的对象且不传入任何参数时,会调用此构造函数
public DiscusswoyaodangfangzhuView(){
}
// 定义一个带参构造函数,接收一个 DiscusswoyaodangfangzhuEntity 类型的参数 discusswoyaodangfangzhuEntity
// 该构造函数的作用是将传入的 DiscusswoyaodangfangzhuEntity 对象的属性值复制到当前 DiscusswoyaodangfangzhuView 对象中
public DiscusswoyaodangfangzhuView(DiscusswoyaodangfangzhuEntity discusswoyaodangfangzhuEntity){
try {
// 使用 BeanUtils 类的 copyProperties 方法将 discusswoyaodangfangzhuEntity 对象的属性值复制到当前对象
// 此方法会自动匹配两个对象中相同名称和类型的属性并进行复制
BeanUtils.copyProperties(this, discusswoyaodangfangzhuEntity);
} catch (IllegalAccessException | InvocationTargetException e) {
// 如果在属性复制过程中出现非法访问异常IllegalAccessException或者调用目标方法时出现异常InvocationTargetException
// 会捕获该异常并打印异常堆栈信息,方便开发者定位问题
// "// TODO Auto-generated catch block" 是 IDE 自动生成的提示,提醒开发者可能需要在这里添加更具体的异常处理逻辑
e.printStackTrace();
}
}
}

@ -0,0 +1,46 @@
package com.entity.view;
import com.entity.FangwubaoxiuEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
/**
*
*
* 使
* @author
* @email
* @date 2025-04-04 18:46:21
*/
// 使用 @TableName 注解指定该类在数据库中对应的表名为 "fangwubaoxiu"
@TableName("fangwubaoxiu")
// 定义一个名为 FangwubaoxiuView 的类,它继承自 FangwubaoxiuEntity 类,
// 并实现了 Serializable 接口,实现该接口意味着该类的对象可以被序列化,以便在网络传输或存储到文件等场景使用
public class FangwubaoxiuView extends FangwubaoxiuEntity implements Serializable {
// 定义序列化版本号,用于在反序列化时验证版本的一致性,确保序列化和反序列化的对象版本匹配
private static final long serialVersionUID = 1L;
// 定义无参构造函数,当创建 FangwubaoxiuView 对象时不传入参数,会调用此构造函数
public FangwubaoxiuView(){
}
// 定义带参构造函数,接收一个 FangwubaoxiuEntity 类型的参数 fangwubaoxiuEntity
// 此构造函数的作用是将传入的 FangwubaoxiuEntity 对象的属性值复制到当前 FangwubaoxiuView 对象中
public FangwubaoxiuView(FangwubaoxiuEntity fangwubaoxiuEntity){
try {
// 使用 BeanUtils 类的 copyProperties 方法将 fangwubaoxiuEntity 对象的属性值复制到当前对象
// 该方法会自动匹配两个对象中相同名称和类型的属性并完成复制操作
BeanUtils.copyProperties(this, fangwubaoxiuEntity);
} catch (IllegalAccessException | InvocationTargetException e) {
// 如果在属性复制过程中出现非法访问异常IllegalAccessException或调用目标异常InvocationTargetException
// 捕获该异常并打印异常堆栈信息,方便开发者定位问题
// "// TODO Auto-generated catch block" 是 IDE 自动生成的提示,提醒开发者可能需要添加更具体的异常处理逻辑
e.printStackTrace();
}
}
}

@ -0,0 +1,47 @@
package com.entity.view;
import com.entity.FangwuleixingEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
/**
*
*
* 使
* @author
* @email
* @date 2025-04-04 18:46:21
*/
// 使用 @TableName 注解指定该类对应的数据库表名为 "fangwuleixing"
@TableName("fangwuleixing")
// 定义一个名为 FangwuleixingView 的类,它继承自 FangwuleixingEntity 类,
// 同时实现了 Serializable 接口,这意味着该类的对象可以被序列化,用于网络传输或存储到文件等场景
public class FangwuleixingView extends FangwuleixingEntity implements Serializable {
// 定义一个静态常量 serialVersionUID用于在序列化和反序列化过程中确保版本的一致性
// 当序列化对象时,该版本号会被记录,反序列化时会检查版本号是否匹配
private static final long serialVersionUID = 1L;
// 定义一个无参构造函数,当创建 FangwuleixingView 类的对象且不传入任何参数时,会调用此构造函数
public FangwuleixingView(){
}
// 定义一个带参构造函数,接收一个 FangwuleixingEntity 类型的参数 fangwuleixingEntity
// 该构造函数的作用是将传入的 FangwuleixingEntity 对象的属性值复制到当前 FangwuleixingView 对象中
public FangwuleixingView(FangwuleixingEntity fangwuleixingEntity){
try {
// 使用 BeanUtils 类的 copyProperties 方法将 fangwuleixingEntity 对象的属性值复制到当前对象
// 此方法会自动匹配两个对象中相同名称和类型的属性并进行复制
BeanUtils.copyProperties(this, fangwuleixingEntity);
} catch (IllegalAccessException | InvocationTargetException e) {
// 如果在属性复制过程中出现非法访问异常IllegalAccessException或调用目标异常InvocationTargetException
// 捕获该异常并打印异常堆栈信息,方便开发者定位问题
// "// TODO Auto-generated catch block" 是 IDE 自动生成的提示,提醒开发者可以在这里添加更具体的异常处理逻辑
e.printStackTrace();
}
}
}

@ -0,0 +1,49 @@
package com.entity.view;
import com.entity.FangwupingjiaEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
/**
*
*
* 使
* @author
* @email
* @date 2025-04-04 18:46:21
*/
// 使用 MyBatis-Plus 的 @TableName 注解,指定该实体类对应的数据库表名为 "fangwupingjia"
@TableName("fangwupingjia")
// 定义一个名为 FangwupingjiaView 的类,它继承自 FangwupingjiaEntity 类,
// 并实现了 Serializable 接口,表明该类的对象可以被序列化,以便在网络传输或存储时使用
public class FangwupingjiaView extends FangwupingjiaEntity implements Serializable {
// 定义一个序列化版本号,用于在反序列化时验证对象版本的一致性,
// 确保序列化和反序列化过程中类的结构兼容
private static final long serialVersionUID = 1L;
// 无参构造函数,当创建 FangwupingjiaView 类的对象时不传入任何参数,会调用此构造函数
public FangwupingjiaView(){
}
// 带参构造函数,接收一个 FangwupingjiaEntity 类型的参数 fangwupingjiaEntity
// 此构造函数的作用是将传入的 FangwupingjiaEntity 对象的属性值复制到当前 FangwupingjiaView 对象中
public FangwupingjiaView(FangwupingjiaEntity fangwupingjiaEntity){
try {
// 使用 BeanUtils 工具类的 copyProperties 方法,将 fangwupingjiaEntity 对象的属性值
// 复制到当前的 FangwupingjiaView 对象中。该方法会自动匹配两个对象中同名同类型的属性进行复制
BeanUtils.copyProperties(this, fangwupingjiaEntity);
} catch (IllegalAccessException | InvocationTargetException e) {
// 如果在属性复制过程中出现非法访问异常IllegalAccessException
// 或者调用目标方法时出现异常InvocationTargetException捕获该异常
// 并打印异常堆栈信息,方便开发人员定位问题
// 这里的 "// TODO Auto-generated catch block" 是 IDE 自动生成的提示,
// 提醒开发者可能需要在这里添加更具体的异常处理逻辑
e.printStackTrace();
}
}
}

@ -0,0 +1,47 @@
package com.entity.view;
import com.entity.FangwuxinxiEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
/**
*
*
* 使
* @author
* @email
* @date 2025-04-04 18:46:21
*/
// 使用 @TableName 注解指定该类在数据库中对应的表名为 "fangwuxinxi"
@TableName("fangwuxinxi")
// 定义一个名为 FangwuxinxiView 的类,它继承自 FangwuxinxiEntity 类,
// 同时实现了 Serializable 接口,意味着该类的对象可以被序列化,用于网络传输或存储到文件等场景
public class FangwuxinxiView extends FangwuxinxiEntity implements Serializable {
// 定义一个静态常量 serialVersionUID用于在序列化和反序列化时确保版本的一致性
// 序列化时该版本号会被记录,反序列化时会检查版本号是否匹配,防止版本不兼容问题
private static final long serialVersionUID = 1L;
// 定义一个无参构造函数,当创建 FangwuxinxiView 类的对象且不传入任何参数时,会调用此构造函数
public FangwuxinxiView(){
}
// 定义一个带参构造函数,接收一个 FangwuxinxiEntity 类型的参数 fangwuxinxiEntity
// 该构造函数的作用是将传入的 FangwuxinxiEntity 对象的属性值复制到当前 FangwuxinxiView 对象中
public FangwuxinxiView(FangwuxinxiEntity fangwuxinxiEntity){
try {
// 使用 BeanUtils 类的 copyProperties 方法将 fangwuxinxiEntity 对象的属性值复制到当前对象
// 该方法会自动匹配两个对象中相同名称和类型的属性并进行复制
BeanUtils.copyProperties(this, fangwuxinxiEntity);
} catch (IllegalAccessException | InvocationTargetException e) {
// 如果在属性复制过程中出现非法访问异常IllegalAccessException或调用目标异常InvocationTargetException
// 捕获该异常并打印异常堆栈信息,方便开发者定位问题
// "// TODO Auto-generated catch block" 是 IDE 自动生成的提示,提醒开发者可以在这里添加更具体的异常处理逻辑
e.printStackTrace();
}
}
}

@ -0,0 +1,47 @@
package com.entity.view;
import com.entity.FangzhuEntity;
import com.baomidou.mybatisplus.annotations.TableName;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import java.io.Serializable;
/**
*
*
* 使
* @author
* @email
* @date 2025-04-04 18:46:21
*/
// 利用 @TableName 注解来指定该类在数据库里对应的表名为 "fangzhu"
@TableName("fangzhu")
// 定义一个名为 FangzhuView 的类,它继承自 FangzhuEntity 类,
// 并且实现了 Serializable 接口,这表明该类的对象能够被序列化,适用于网络传输或文件存储等场景
public class FangzhuView extends FangzhuEntity implements Serializable {
// 定义一个静态常量 serialVersionUID用于在序列化和反序列化过程中保证版本的一致性
// 当进行反序列化操作时,会检查该版本号是否匹配,以此确保对象的兼容性
private static final long serialVersionUID = 1L;
// 定义一个无参构造函数,当创建 FangzhuView 类的对象且不传入任何参数时,会调用此构造函数
public FangzhuView(){
}
// 定义一个带参构造函数,接收一个 FangzhuEntity 类型的参数 fangzhuEntity
// 此构造函数的用途是把传入的 FangzhuEntity 对象的属性值复制到当前 FangzhuView 对象中
public FangzhuView(FangzhuEntity fangzhuEntity){
try {
// 借助 BeanUtils 类的 copyProperties 方法,将 fangzhuEntity 对象的属性值复制到当前对象
// 该方法会自动匹配两个对象中名称和类型相同的属性并完成复制操作
BeanUtils.copyProperties(this, fangzhuEntity);
} catch (IllegalAccessException | InvocationTargetException e) {
// 若在属性复制过程中出现非法访问异常IllegalAccessException或者调用目标异常InvocationTargetException
// 就捕获该异常并打印异常堆栈信息,方便开发者定位问题
// "// TODO Auto-generated catch block" 是 IDE 自动生成的提示,提醒开发者可以添加更具体的异常处理逻辑
e.printStackTrace();
}
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save