Develop a system in three days, with a bonus of 3k [source code open source]

Recently, I helped my friends to develop a system. Because I need it in a hurry. Even at night.

After being driven out, the friend thought it was good, and gave some extra fees. It is still very high!

After obtaining the consent of the small partners, the source code is open sourced to everyone.

1. Operating environment:

Development system: Windows10

JDK version: Java JDK1.8

Development tools: idea

Database version: mysql5

Database visualization tool: navicat for mysql

Server: apache tomcat 7

Other tools: Google browser console to adjust web page layout
Postman interface tool for interface testing

Two, function introduction:

1. User module management: user login, user registration, user query, add, delete operations

2. Life sharing note management: display, add, modify, and delete operations of the shared note list

3. Life note details management: View, add, delete and other operations in the life note detail list

4. Administrator information management: view and modify administrator information

5. Bulletin information management: view, add, modify, and delete bulletin information

6. User module management: user list query, add, delete,

7. Favorite module management: user favorite list, cancel favorite, favorite

8. Follow user module management: follow user query, add follow, unfollow

9. User comment module management: user comment query, add, delete

10. Logout and logout management

The Spring framework is an open source application framework on the Java platform that provides a container with inversion of control features. Although the Spring framework itself has no restrictions on the programming model, its frequent use in Java applications made it so popular that it was later used as a supplement or even a substitute for the EJB (EnterpriseJavaBeans) model.

The Spring framework provides a series of solutions for development, such as using the core features of inversion of control, and implementing inversion of control through dependency injection to realize the containerization of the management object life cycle, using aspect-oriented programming for declarative transaction management, and integrating A variety of persistence technologies manage data access, provide a large number of excellent web frameworks to facilitate development, and so on. The Spring framework has the feature of inversion of control (IOC). IOC is designed to facilitate project maintenance and testing. It provides a method for unified configuration and management of Java objects through the Java reflection mechanism.

Three, system demonstration:

insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here

Fourth, the core code of the system:

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer adminId; // 管理员Id
@Column(length=200)
private String userName;  // 用户名
@Column(length=200)
private String password;  // 密码
@Column(length=200)
private String trueName;  // 真实姓名
@Column(length=200)
private String headPortrait;  // 头像
@Column(length=50)
private String sex;  // 性别
@Column(length=500)
private String signature;  // 备注
@Column(length=200)
private String phone;  // 电话 

@Id
 @GeneratedValue(strategy = GenerationType.IDENTITY)
 private Integer articleId; // 文章Id
 
 @Column(length = 200)
 private String title; // 文章标题
 
 @Lob
 @Column(columnDefinition = "TEXT")
 private String content; // 文章内容
 
 @Transient
 private String contentNoTag; // 博客内容 无网页标签 Lucene分词用到
 
 private Date publishDate; // 发布日期
 
 @Column(length = 200)
 private String author; // 作者
 
 @ManyToOne
 @JoinColumn(name = "classifyId")
 private Classify classify; // 文章类别
 
 private Integer click; // 点击数
 
 private Integer commentNum; // 评论数

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer bloggerId; // 博主Id
@Column(length=200)
private String nickName;  // 昵称
@Column(length=200)
private String headPortrait;  // 头像
@Column(length=500)
private String motto;  // 座右铭
@Column(length=500)
private String signature;  // 个性签名
@Column(length=200)
private String site;  // 地址 

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer commentId; // 评论Id
@ManyToOne
@JoinColumn(name="articleId")
private Article article; // 文章Id
@ManyToOne
@JoinColumn(name="userId")
private User user; // 用户Id
@Column(length=500)
private String content; // 评论内容
private Date commentDate; // 评论时间

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer noticeId;  // 公告Id
@Column(length=500)
private String content;  // 公告内容
private Date publishDate;  // 发布日期
@Column(length=200)
private Integer grade;  // 等级  0 重要  1 一般

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer replyId; // 回复Id
@ManyToOne
@JoinColumn(name="commentId")
private Comment comment; // 评论Id
@ManyToOne
@JoinColumn(name="userId")
private User user; // 用户Id
@Column(length=500)
private String content; // 回复内容
private Date replyDate; // 回复时间

**#数据源的地址
spring.datasource.url=jdbc:mysql://127.0.0.1:3307/db_fruit_vegetable_shop?serverTimezone=GMT%2b8&useUnicode=true&characterEncoding=utf8
spring.datasource.username=root
spring.datasource.password=crit@2019
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.continue-on-error=false
spring.datasource.test-while-idle=true
#获取连接时候验证,会影响性能
spring.datasource.test-on-borrow=false
#在连接归还到连接池时是否测试该连接
spring.datasource.test-on-return=false
spring.datasource.validation-query=SELECT 1 FROM DUAL
#空闲连接回收的时间间隔,与test-while-idle一起使用,设置5分钟
spring.datasource.time-between-eviction-runs-millis=300000
#连接池空闲连接的有效时间 ,设置30分钟
spring.datasource.min-evictable-idle-time-millis=1800000
spring.datasource.initial-size=5
#指定连接池中最大的活跃连接数.
spring.datasource.max-active=50
#指定连接池等待连接返回的最大等待时间,毫秒单位.
spring.datasource.max-wait=60000
#指定必须保持连接的最小值
spring.datasource.min-idle=5
#热部署生效
spring.devtools.restart.enabled=true
#mybatis驼峰匹配开启
mybatis.configuration.map-underscore-to-camel-case=true
# 控制台日志配置
mybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
#mapper文件扫描路径
mybatis.mapper-locations=classpath*:mappers/admin/*.xml,classpath*:mappers/home/*.xml,classpath*:mappers/common/*.xml
#mail配置
spring.mail.host=smtp.163.com
spring.mail.protocol=smtp
spring.mail.default-encoding=UTF-8
[email protected]
spring.mail.password=LBWCLXTCZNGUMVMZ
spring.mail.test-connection=true
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.starttls.enable=true
spring.mail.properties.mail.smtp.starttls.required=true
#redis配置
spring.redis.host=127.0.0.1
spring.redis.port=6379
spring.redis.database=0
#图片上传设置
yjq.upload.photo.sufix=.jpg,.png,.gif,.jpeg
#1024KB
yjq.upload.photo.maxsize=1024
#200MB = 204800KB
yjq.upload.attachment.maxsize=204800
yjq.upload.photo.path=D:/IDEA_project/FruitAndVegetableShop/src/main/resources/upload/photo/
yjq.upload.attachment.path=D:/IDEA_project/FruitAndVegetableShop/src/main/resources/upload/attachment/
**

Five, source code acquisition:

Click on the official account [springmeng] that pops up at the end of the article, and reply to [life sharing]

The Spring framework uses the container to manage the life cycle of objects. The container can configure objects by scanning XML files or specific Java annotations on classes. Developers can obtain objects through dependency lookup or dependency injection.

The Spring framework has an aspect-oriented programming (AOP) framework. The Spring AOP framework is based on the proxy mode and is configurable at runtime. The AOP framework is mainly modularized for cross concerns between modules.

The AOP framework of the Spring framework only provides basic AOP features. Although it cannot be compared with the AspectJ framework, it can also meet the basic needs through integration with AspectJ.

Functions such as transaction management and remote access under the Spring framework can be realized by using Spring AOP technology. Spring's transaction management framework brings an abstraction mechanism to the Java platform that enables local and global transactions, as well as nested transactions, to work with savepoints and in almost any environment on the Java platform.

The subsequent Java frameworks are all developed based on Spring, so Spring must be done well.

I am programmer Xiaomeng, welcome to like, forward, comment and follow.

おすすめ

転載: blog.csdn.net/mengchuan6666/article/details/127402140