Graduation project based on springboot news management system - with source code 211113

Topic springboot news management system

Table of contents

Summary 1

1 Introduction 1

1.1 Research Significance 1

1.2 Research status at home and abroad1

1.3 Features of system development technology 1

1.4 Paper Structure and Chapter Arrangement 1

2 News management system analysis 3

2.1 Feasibility analysis 3

2.2 System flow analysis 3

2.2.1 Data addition process 3

2.3.2 Data modification process 4

2.3.3 Data deletion process 4

2.3 System function analysis 4

2.3.1 Functional Analysis 4

2.3.2 Non-functional analysis 5

2.4 System use case analysis 6

2.5 Summary of this chapter 7

3 Overall Design of News Management System 8

3.1 System architecture design 8

3.2 System function module design 8

3.2.1 Overall functional module design 9

3.2.2 User module design 9

3.2.3 Review Management Module Design 10

3.3 Database Design 10

3.3.1 Database conceptual structure design 10

3.3.2 Database logical structure design 14

3.4 Chapter Summary 17

4 Detailed Design and Implementation of News Management System 18

4.1 User Function Module 18

4.1.1 Front page interface 18

4.1.2 User login interface 18

4.1.3 User registration interface 19

4.1.4 My account interface 20

4.1.5 Exchange forum interface 21

4.1.6 News interface 21

4.2 Administrator function module 23

4.2.1 User management interface 23

4.2.2 Message management interface 24

4.2.3 Site management interface 24

4.2.4 More management interface 25

5 System Test 26

5.1 Purpose of system testing 26

5.2 System test cases 26

5.3 System test results 27

Conclusion 28

Reference 29

Thanks 30

Summary

In the information society, there is a need for targeted information acquisition channels, but the expansion of channels is basically the direction that people are striving for. Due to the deviation in their perspective, people can often obtain different types of information, which is also the most difficult technology to overcome. topic. Aiming at the news management system and other issues, research and analyze the news management system, and then develop and design the news management system to solve the problem.

The main functional modules of the news management system include system user management, message exchange, exchange classification, news list, news classification, feedback, video sharing, adopting an object-oriented development model for software development and hardware erection, which can be very good Meet the needs of actual use, improve the corresponding software installation and program coding work, use Mysql as the main storage unit of background data, use Java technology and Ajax technology for business system coding and development, and realize all the functions of this system . This report first analyzes the background, function and significance of the research, laying the foundation for the rationality of the research work. Analyze the requirements and technical problems of the news management system, prove the necessity and technical feasibility of the system, then give a basic introduction to the technical software and design ideas that need to be used in the design system, and finally realize the news management system and Deployment runs use it.

Keywords : springboot technology; MYSQL; news management system

Abstract

In the information society, there is a need for targeted information access, but the expansion of access is basically the direction of people's efforts. Due to the deviation of the perspective, people can often obtain different types of information, which is also the most difficult subject for technology to overcome. Aiming at the problems of news management system, this paper studies and analyzes the news management system, and then develops and designs the news management system to solve the problems.

The main functional modules of the news management system include system user management, message exchange, communication classification, news list, news classification, opinion feedback and video sharing. The object-oriented development mode is adopted for software development and hardware erection, which can well meet the actual needs, improve the corresponding software erection and program coding, take MySQL as the main storage unit of background data, and adopt Java technology Ajax technology encodes and develops the business system, and realizes all the functions of the system. This report first analyzes the background, function and significance of the research, which lays a foundation for the rationality of the research work. This paper analyzes the various requirements and technical problems of the news management system, proves the necessity and technical feasibility of the system, then makes a basic introduction to the technical software and design ideas needed to design the system, and finally realizes the news management system and deploys it.

Keywords: Springboot technology; MYSQL; News management system

1 Introduction

1.1 Research Significance

The development of information technology has made the whole world smaller and smaller, which also means that the competitive environment of enterprises is developing from regionalization to globalization, especially as the date of China's accession to the WTO is approaching, economic globalization is a major trend, and the school is located In fact, the macro environment of China is not just a narrow network connected by information technicians, but the technical environment and economic environment should be considered together to form a concept of a large network. The degree to which a school has mastered information, whether information is obtained in a timely manner, whether information can be fully utilized, and whether the response to information is sensitive and accurate has increasingly become an important factor to measure an enterprise's market competitiveness. Therefore, it is of great significance to establish a dynamic news release system to meet the requirements of enterprise development. The news system is a relatively typical document system. Mastering the development of the news system will be of great help to the development of other document systems.

With the rapid development of the information age, traditional newspapers and magazines are far from meeting people's needs. People hope to learn more news and information online, so it is necessary for us to create a news on the Internet. Released the management information system. Most websites publish and manage information in a static way, but the amount of information that needs to be updated on the website is also increasing, so this is not conducive to the work of website managers. In order to manage the website more conveniently, we urgently need to use dynamic technology to create a news release management information system.

1.2 Research status at home and abroad

The rapid development of the Internet and the rapid popularization of intelligent processing terminals have greatly changed people's lives, ways and production methods. In 1997, the Internet as a new form of media began to disseminate news. Just a few years ago today, it went through a series of technical updates and changes. The impact of network news on human society is enormous. The news information management system is convenient for managers to update and maintain website information and improve user experience.

The development of news information system is accompanied by the development of computer software and network technology. According to the technical division of labor, the news information management system can be roughly divided into three categories: static network news information release platform, dynamic news management system platform and personalized news management platform.

In the early stage of news management system development, due to many factors such as network bandwidth and computer interaction technology, the information released by the system is presented to users in the form of simple static web pages. Compared with the traditional ways of distributing information such as newspapers and television, static web pages allow users to browse anytime and anywhere, which is a huge advancement brought about by information technology. However, there are some deficiencies in simple static network news publishing and management. For example, with the continuous increase and change of news data volume, webmasters usually need to re-edit web pages. On the other hand, static web pages can only be browsed by users, and the transmission of information is one-way, which cannot allow effective communication and communication between users and systems, and users and users.

With the advancement of information technology and the development of Web2.0 semantic network, dynamic news information management system came into being. Dynamic has two meanings: one is to move the surface content of web pages through Flash and Java animation; the other is dynamic news content. Currently, the main approach to database-based news release and management is to store all the data of a website in a selected database. When the user sends a browsing request to the website server, the server invokes programs such as ASP and Java to dynamically invoke the contents of the database to generate online news. At the same time, users can express their views on viewing content according to their own wishes, and communicate with other users.

When computers and other intelligent terminal devices became very cheap and popular, we also changed from a computer-centric model to a human-centered service model, and personalized intelligent news information management platforms began to emerge. At present, news websites such as Google and Baidu can recommend news content that users may be interested in according to the user's personalized customization.

Although after more than ten years of development, the news information management system has made great progress, but there are still some deficiencies and problems.

1. The current news information management system has unclear division of labor among management users and chaotic management. The main reason for this problem is that the current news management system does not carefully divide the management level.

2. The current news information management system has problems such as insufficient unity and diversity of content presentation.

3. The focus of the display is not clear.

4. The query ability of the existing news information management system is not strong enough.

5. In terms of personalized news customization and recommendation, the current system needs to be further strengthened and perfected.

1.3 Features of system development technology

(1) The backend of the web background management in the news management system no longer uses the ancient jsp+javabean+servlet technology, but uses the current mainstream springboot framework, which reduces java configuration codes and simplifies programming codes. The current springboot framework is also One of the frameworks chosen by many businesses.

(2) The front end of the web background management in the news management system uses a JavaScript framework, which can beautify the page design with ajax[8] and jquery[9].

(3) The mysql5.7 used for the database in the news management system has high execution efficiency.

1.4 Paper Structure and Chapter Arrangement

The thesis will be arranged in layers, except for the abstract acknowledgments and references, the main text will also analyze the requirements of the website, explain the general design and implemented functions, and finally list some commissioning records. The main structure of the thesis is as follows:

Chapter 1: Introduction. The first chapter mainly introduces the background of the subject research, the status quo of system development and the research status and main work of this paper at home and abroad.

Chapter Two: System Requirements Analysis. The second chapter mainly conducts demand analysis from the aspects of system users and functions.

Chapter Three: System Design. The third chapter mainly carries on the function design to the system frame, the system function module, the database.

Chapter Four: System Realization. The fourth chapter mainly introduces the construction of the system framework and the realization of the system interface.

Chapter Five: System Testing. Chapter 5 mainly tests some interfaces of the system and tests the main functions

Chapter Six: Summary.

2 System Analysis of News Management System

System analysis is a prerequisite for developing a project. Through system analysis, the basic needs of the main users of the system can be well understood, and this is also the reason for the development of the project. Further, feasibility analysis is carried out on system development, usually including technical feasibility, economic feasibility, etc. Feasibility analysis is also an analysis from the overall perspective of the project. Then it is to analyze the specific needs of the project, and the means of analysis are generally realized through the user's use case diagram. The following is a detailed introduction.

2.1 Feasibility analysis

(1) Economic feasibility:

Most of the tools used in the project are currently popular open source and free, so in the early stage of development, the funds used for the project will be greatly reduced, and the development of the software will not be affected by the funds during the project start-up period, so It is still economically feasible. Try to use the least cost to meet the needs of users. Save funds for labor costs and equipment costs. It will go further and further on the road of paperless and high efficiency.

So there is no question of economic viability.

(2) Operation feasibility:

The design of this project refers to several development cases of websites under this mode, analyzes their operation interface, combines many cases together, and highlights the people-oriented and simplified operation, so people with basic computer knowledge can operate this project.

Therefore, there is no problem with operability.

(3) Technical feasibility:

Technical feasibility refers to the feasibility of building a framework, and the acceptability of system technology upgrades when better technologies emerge, and the ratio of development time to cost.

The existing springboot technology can cater to the construction of all e-commerce systems. When developing this news management system, I used springboot+MYSQL to run the overall program.

In summary, there is no problem with the technical feasibility.

(4) Legal feasibility:

From the perspective of developers, springboot and MYSQL are open source and free online, and there will be no legal disputes in terms of intellectual property rights.

From the perspective of user use, as long as no contraband is sold on the system, a treaty agreement is made on the system, and illegal payments are eliminated.

In summary, there is no question of legal feasibility.

2.2 System flow analysis

The business process is to use some specific symbols and lines to demonstrate the user's process of using the system. When performing system analysis, the business process can help developers better understand the business, find errors, and improve the system.

2.2.1 Data addition process

After the user successfully logs in to the system, the operation of adding data can be realized. The number of adding data is specific and generated by the system, and the user cannot fill it in at will. Except for the number, the user can fill in other additional information by himself, and the filled information is verified by the system and verified to be legal. Passing shows that the data addition is successful. On the contrary, the addition is not successful. Figure 2-1 shows the process of adding data.

Figure 2-1 Flowchart of adding data

2.2.2 Data modification process

The process of data modification is similar to the process of data addition described above, as shown in Figure 2-2.

Figure 2-2 Data modification flow chart

2.2.3 Data deletion process

If there are some useless data in the system, the relevant management personnel can also delete these data. Figure 2-3 is the flow chart of data deletion.

Figure 2-3 Data deletion flow chart

2.3 System function analysis

2.3.1 Functional Analysis

According to the role of the news management system, I divided it into two parts: the registered user management module and the administrator management module.

Common user management module:

(1)用户注册登录:用户注册为用户并登录新闻管理系统;用户对个人信息的增删改查,比如个人资料,密码修改。

(2)查看新闻管理系统的首页信息:新闻管理系统的首页信息包含了首页、公告消息、交流论坛、新闻资讯、意见反馈、视频分享等。

(3)公告:用户在公告这一菜单下对用户提交的查看、同时也可以发布、评论。

(4)新闻资讯:用户进行新闻资讯的阅览,查看管理者发布的新闻资讯信息。

(5)我的收藏:在“我的”下可以查看管理“我的收藏”信息,可以查看收藏,也可以对不喜欢的信息进行删除收藏;

(6)我的账户:当用户点击右上角“我的”这个按钮,会出现子菜单,点击“我的账户”可以对个人的资料以及登录系统的密码进行设置;

(7)个人中心:当用户点击右上角“我的”这个按钮,就会进入到对应的后台进行信息的管理了;

管理员管理模块:

(1)用户管理:管理员可以对前台上注册过的用户信息进行管控,也可以对管理员信息进行管控。

(2)新闻列表管理:管理员在后台可以对新闻管理系统中显示的新闻进行增删改查。

(3)内容管理:管理员可以对新闻管理系统前台展示的交流论坛、交流分类、新闻列表及新闻分类的分类进行管控。

(4)更多管理:在“更多管理”这一菜单下,可以对管理人员用户操作的意见反馈、视频分享以及在前台用户提交的交流论坛等进行管控。

(5)站点管理:管理员可以对新闻管理系统中首页显示的轮播图以及系统中的一些公告发布到系统当中,让用户及时的查看到系统信息,进行合理安排。

2.3.2 非功能性分析

新闻管理系统的非功能性需求比如新闻管理系统的安全性怎么样,可靠性怎么样,性能怎么样,可拓展性怎么样等。具体可以表示在如下3-1表格中:

表3-1新闻管理系统非功能需求表

安全性

主要指新闻管理系统数据库的安装,数据库的使用和密码的设定必须合乎规范。

可靠性

可靠性是指新闻管理系统能够安装用户的指示进行操作,经过测试,可靠性90%以上。

性能

性能是影响新闻管理系统占据市场的必要条件,所以性能最好要佳才好。

可扩展性

比如数据库预留多个属性,比如接口的使用等确保了系统的非功能性需求。

易用性

用户只要跟着新闻管理系统 的页面展示内容进行操作,就可以了。

可维护性

新闻管理系统 开发的可维护性是非常重要的,经过测试,可维护性没有问题

2.4 系统用例分析

通过2.3功能的分析,得出了本新闻管理系统的用例图:

用户角色用例如图2-3所示。

图2-3 新闻管理系统用户角色用例图

web后台管理上的管理员是维护整个新闻管理系统中所有数据信息的。管理员角色用例如图2-4所示。

图2-4 新闻管理系统管理员角色用例图

2.5本章小结

本章主要通过对新闻管理系统的可行性分析、流程分析、功能需求分析、系统用例分析,确定整个新闻管理系统 要实现的功能。同时也为新闻管理系统的代码实现和测试提供了标准。

3 新闻管理系统 总体设计

本章主要讨论的内容包括新闻管理系统的功能模块设计、数据库系统设计。

3.1 系统架构设计

本新闻管理系统 从架构上分为三层:表现层(UI)、业务逻辑层(BLL)以及数据层(DL)。

图3-1新闻管理系统架构设计图

表现层(UI):又称UI层,主要完成本新闻管理系统的UI交互功能,一个良好的UI可以打打提高用户的用户体验,增强用户使用本新闻管理系统 时的舒适度。UI的界面设计也要适应不同版本的新闻管理系统 以及不同尺寸的分辨率,以做到良好的兼容性。UI交互功能要求合理,用户进行交互操作时必须要得到与之相符的交互结果,这就要求表现层要与业务逻辑层进行良好的对接。

业务逻辑层(BLL):主要完成本新闻管理系统 的数据处理功能。用户从表现层传输过来的数据经过业务逻辑层进行处理交付给数据层,系统从数据层读取的数据经过业务逻辑层进行处理交付给表现层。

数据层(DL):由于本新闻管理系统 的数据是放在服务端的mysql数据库中,因此本属于服务层的部分可以直接整合在业务逻辑层中,所以数据层中只有数据库,其主要完成本新闻管理系统 的数据存储和管理功能。

3.2 系统功能模块设计

3.2.1整体功能模块设计

在上一章节中主要对系统的功能性需求和非功能性需求进行分析,并且根据需求分析了本新闻管理系统中的用例。那么接下来就要开始对本新闻管理系统的架构、主要功能和数据库开始进行设计。新闻管理系统根据前面章节的需求分析得出,其总体设计模块图如图3-2所示。

图3-2 新闻管理系统功能模块图

3.2.2用户模块设计

后台管理者能够实现对前台注册的用户增删改查操作,用户模块结构图如下图:

图3-3用户用户模块结构图

3.2.3评论管理模块设计

新闻管理系统是一个交流性质的公开平台,用户用户和管理人员用户可以对平台上信息进行评论,增加用户之间的互动性。但是同时也为了更好的规范评论的内容,给予管理员删除不合适的言论的功能,所以需要专门设计一个评论管理模块,具体的结构图如下:

图3-4评论模块结构图

3.3 数据库设计

数据库设计一般包括需求分析、概念模型设计、数据库表建立三大过程,其中需求分析前面章节已经阐述,概念模型设计有概念模型和逻辑结构设计两部分。

3.3.1 数据库概念结构设计

下面是整个新闻管理系统 中主要的数据库表总E-R实体关系图。

图3-6 新闻管理系统总E-R关系图

下面根据新闻管理系统的数据库总E-R关系图可以得出新闻管理系统需要很多E-R图,在此罗列出来一些主要的数据库E-R模型图。

图3-7注册用户E-R关系图

图3-8 评论E-R关系图

图3-9视频分享E-R关系图

图3-10意见反馈E-R关系图

3.3.2 数据库逻辑结构设计

通过上一小节中新闻管理系统 中总E-R关系图上得出一共需要创建很多个数据表。在此我主要罗列几个主要的数据库表结构设计。

video_sharing表:

名称

类型

长度

不是null

主键

注释

video_sharing_id

int

11

视频分享ID

title

varchar

64

标题

cover

varchar

255

封面

video

varchar

255

视频

release_date

date

0

发布日期

user_name

int

11

用户名

brief_introduction

text

0

简介

details

longtext

0

详情

hits

int

11

点击数

praise_len

int

11

点赞数

examine_state

varchar

16

审核状态

examine_reply

varchar

16

审核回复

recommend

int

11

智能推荐

create_time

datetime

0

创建时间

update_time

timestamp

0

更新时间

registered_user表:

名称

类型

长度

不是null

主键

注释

registered_user_id

int

11

注册用户ID

user_name

varchar

64

用户名

examine_state

varchar

16

审核状态

recommend

int

11

智能推荐

user_id

int

11

用户ID

create_time

datetime

0

创建时间

update_time

timestamp

0

更新时间

feedback表:

名称

类型

长度

不是null

主键

注释

feedback_id

int

11

意见反馈ID

theme

varchar

64

主题

relevant_vouchers

varchar

255

相关凭证

user_name

int

11

用户名

contact_number

varchar

64

联系电话

content

text

0

内容

examine_state

varchar

16

审核状态

examine_reply

varchar

16

审核回复

recommend

int

11

智能推荐

create_time

datetime

0

创建时间

update_time

timestamp

0

更新时间

forum表:

名称

类型

长度

不是null

主键

注释

forum_id

mediumint

8

论坛id

display

smallint

5

排序

user_id

mediumint

8

用户ID

nickname

varchar

16

昵称

praise_len

int

10

点赞数

hits

int

10

访问数

title

varchar

125

标题

keywords

varchar

125

关键词

description

varchar

255

描述

url

varchar

255

来源地址

tag

varchar

255

标签

img

text

0

封面图

content

longtext

0

正文

create_time

timestamp

0

创建时间

update_time

timestamp

0

更新时间

avatar

varchar

255

发帖人头像

type

varchar

64

论坛分类

comment表:

名称

类型

长度

不是null

主键

注释

comment_id

int

11

评论ID

user_id

int

11

评论人ID

reply_to_id

int

11

回复评论ID

content

longtext

0

内容

nickname

varchar

255

昵称

avatar

varchar

255

头像地址

create_time

timestamp

0

创建时间

update_time

timestamp

0

更新时间

source_table

varchar

255

来源表

source_field

varchar

255

来源字段

source_id

int

10

来源ID

3.4本章小结

整个新闻管理系统的需求分析主要对系统总体架构以及功能模块的设计,通过建立E-R模型和数据库逻辑系统设计完成了数据库系统设计。

4 新闻管理系统详细设计与实现

新闻管理系统的详细设计与实现主要是根据前面的新闻管理系统 的需求分析和新闻管理系统 的总体设计来设计页面并实现业务逻辑。主要从新闻管理系统 界面实现、业务逻辑实现这两部分进行介绍。

4.1用户功能模块

4.1.1 前台首页界面

当进入新闻管理系统的时候,首先映入眼帘的是系统的导航栏,下面是轮播图以及系统内容,其主界面展示如下图4-1所示。

图4-1 前台首页界面图

4.1.2用户登录界面

新闻管理系统中的前台上注册后的用户是可以通过自己的账户名和密码进行登录的,当用户输入完整的自己的账户名和密码信息并点击“登录”按钮后,将会首先验证输入的有没有空数据,再次验证输入的账户名+密码和数据库中当前保存的用户信息是否一致,只有在一致后将会登录成功并自动跳转到新闻管理系统的首页中;否则将会提示相应错误信息,用户登录界面如下图4-2所示。

=

图4-2用户登录界面图

登录关键代码如下所示。

/**

* 登录

* @param data

* @param httpServletRequest

* @return

*/

@PostMapping("login")

public Map<String, Object> login(@RequestBody Map<String, String> data, HttpServletRequest httpServletRequest) {

log.info("[执行登录接口]");

String username = data.get("username");

String email = data.get("email");

String phone = data.get("phone");

String password = data.get("password");

List resultList = null;

Map<String, String> map = new HashMap<>();

if(username != null && "".equals(username) == false){

map.put("username", username);

resultList = service.select(map, new HashMap<>()).getResultList();

}

else if(email != null && "".equals(email) == false){

map.put("email", email);

resultList = service.select(map, new HashMap<>()).getResultList();

}

else if(phone != null && "".equals(phone) == false){

map.put("phone", phone);

resultList = service.select(map, new HashMap<>()).getResultList();

}else{

return error(30000, "账号或密码不能为空");

}

if (resultList == null || password == null) {

return error(30000, "账号或密码不能为空");

}

//判断是否有这个用户

if (resultList.size()<=0){

return error(30000,"用户不存在");

}

User byUsername = (User) resultList.get(0);

Map<String, String> groupMap = new HashMap<>();

groupMap.put("name",byUsername.getUserGroup());

List groupList = userGroupService.select(groupMap, new HashMap<>()).getResultList();

if (groupList.size()<1){

return error(30000,"用户组不存在");

}

UserGroup userGroup = (UserGroup) groupList.get(0);

//查询用户审核状态

if (!StringUtils.isEmpty(userGroup.getSourceTable())){

String sql = "select examine_state from "+ userGroup.getSourceTable() +" WHERE user_id = " + byUsername.getUserId();

String res = String.valueOf(service.runCountSql(sql).getSingleResult());

if (res==null){

return error(30000,"用户不存在");

}

if (!res.equals("已通过")){

return error(30000,"该用户审核未通过");

}

}

//查询用户状态

if (byUsername.getState()!=1){

return error(30000,"用户非可用状态,不能登录");

}

String md5password = service.encryption(password);

if (byUsername.getPassword().equals(md5password)) {

// 存储Token到数据库

AccessToken accessToken = new AccessToken();

accessToken.setToken(UUID.randomUUID().toString().replaceAll("-", ""));

accessToken.setUser_id(byUsername.getUserId());

tokenService.save(accessToken);

// 返回用户信息

JSONObject user = JSONObject.parseObject(JSONObject.toJSONString(byUsername));

user.put("token", accessToken.getToken());

JSONObject ret = new JSONObject();

ret.put("obj",user);

return success(ret);

} else {

return error(30000, "账号或密码不正确");

}

}

4.1.3用户注册界面

不是新闻管理系统中正式用户的是可以在线进行注册的,如果你没有本新闻管理系统的账号的话,添加“注册”,当填写上自己的账号+密码+确认密码+昵称+邮箱+手机号等后再点击“注册”按钮后将会先验证输入的有没有空数据,再次验证密码和确认密码是否是一样的,最后验证输入的账户名和数据库表中已经注册的账户名是否重复,只有都验证没问题后即可用户注册成功。其用用户注册界面展示如下图4-3所示。

图4-2用户注册界面图

注册关键代码如下所示。

/**

* 注册

* @param user

* @return

*/

@PostMapping("register")

public Map<String, Object> signUp(@RequestBody User user) {

// 查询用户

Map<String, String> query = new HashMap<>();

query.put("username",user.getUsername());

List list = service.select(query, new HashMap<>()).getResultList();

if (list.size()>0){

return error(30000, "用户已存在");

}

user.setUserId(null);

user.setPassword(service.encryption(user.getPassword()));

service.save(user);

return success(1);

}

/**

* 用户ID:[0,8388607]用户获取其他与用户相关的数据

*/

@Id

@GeneratedValue(strategy = GenerationType.IDENTITY)

@Column(name = "user_id")

private Integer userId;

/**

* 账户状态:[0,10](1可用|2异常|3已冻结|4已注销)

*/

@Basic

@Column(name = "state")

private Integer state;

/**

* 所在用户组:[0,32767]决定用户身份和权限

*/

@Basic

@Column(name = "user_group")

private String userGroup;

/**

* 上次登录时间:

*/

@Basic

@Column(name = "login_time")

private Timestamp loginTime;

/**

* 手机号码:[0,11]用户的手机号码,用于找回密码时或登录时

*/

@Basic

@Column(name = "phone")

private String phone;

/**

* 手机认证:[0,1](0未认证|1审核中|2已认证)

*/

@Basic

@Column(name = "phone_state")

private Integer phoneState;

/**

* 用户名:[0,16]用户登录时所用的账户名称

*/

@Basic

@Column(name = "username")

private String username;

/**

* 昵称:[0,16]

*/

@Basic

@Column(name = "nickname")

private String nickname;

/**

* 密码:[0,32]用户登录所需的密码,由6-16位数字或英文组成

*/

@Basic

@Column(name = "password")

private String password;

/**

* 邮箱:[0,64]用户的邮箱,用于找回密码时或登录时

*/

@Basic

@Column(name = "email")

private String email;

/**

* 邮箱认证:[0,1](0未认证|1审核中|2已认证)

*/

@Basic

@Column(name = "email_state")

private Integer emailState;

/**

* 头像地址:[0,255]

*/

@Basic

@Column(name = "avatar")

private String avatar;

/**

* 创建时间:

*/

@Basic

@Column(name = "create_time")

@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")

private Timestamp createTime;

@Basic

@Transient

private String code;

}

4.1.4我的账户界面

当用户点击右上角“我的”这个按钮,会出现子菜单,点击“我的账户”可以对个人的资料以及登录系统的密码进行设置,我的账户界面如下图4-4所示。

图4-4我的账户界面图

4.1.5交流论坛界面

当用户登录到系统中以后,点击“交流论坛”这一菜单,会显示所有的交流标题,可以查看交流详情进行评论,也可以发布交流内容,同时支持输入关键词对交流论坛信息进行搜索。界面如下图4-5所示。

图4-5交流论坛界面图

4.1.6新闻资讯界面

当访客点击新闻管理系统中导航栏上的“新闻资讯”后将会进入到该“新闻资讯”列表的界面,然后选择想要看的新闻资讯,点击进入到详细界面,新闻资讯界面如下图4-6 所示。

图4-6新闻资讯界面图

4.2管理员功能模块

4.2.1 用户管理界面

新闻管理系统中的管理人员是可以对前台注册的用户进行管理的,也可以对管理员进行管控。界面如下图4-7所示。

图4-7用户管理界面图

用户管理关键代码如下所示。

public String encryption(String plainText) {

String re_md5 = new String();

try {

MessageDigest md = MessageDigest.getInstance("MD5");

md.update(plainText.getBytes());

byte b[] = md.digest();

int i;

StringBuffer buf = new StringBuffer("");

for (int offset = 0; offset < b.length; offset++) {

i = b[offset];

if (i < 0)

i += 256;

if (i < 16)

buf.append("0");

buf.append(Integer.toHexString(i));

}

re_md5 = buf.toString();

} catch (Exception e) {

e.printStackTrace();

}

return re_md5;

}

4.2.2留言管理界面

新闻管理系统中的管理人员是可以对前台用户发布的留言进行管控的,界面如下图4-8所示。

图4-8留言管理界面图

4.2.3站点管理界面

新闻管理系统中的管理人员在“站点管理”这一菜单中是可以对前台显示的轮播图以及公告栏进行管控。界面如下图4-9所示。

图4-9站点管理界面图

站点管理关键代码如下所示。

@PostMapping("/add")

@Transactional

public Map<String, Object> add(HttpServletRequest request) throws IOException {

service.insert(service.readBody(request.getReader()));

return success(1);

}

@Transactional

public Map<String, Object> addMap(Map<String,Object> map){

service.insert(map);

return success(1);

}

public Map<String,Object> readBody(BufferedReader reader){

BufferedReader br = null;

StringBuilder sb = new StringBuilder("");

try{

br = reader;

String str;

while ((str = br.readLine()) != null){

sb.append(str);

}

br.close();

String json = sb.toString();

return JSONObject.parseObject(json, Map.class);

}catch (IOException e){

e.printStackTrace();

}finally{

if (null != br){

try{

br.close();

}catch (IOException e){

e.printStackTrace();

}

}

}

return null;

}

public void insert(Map<String,Object> body){

StringBuffer sql = new StringBuffer("INSERT INTO ");

sql.append("`").append(table).append("`").append(" (");

for (Map.Entry<String,Object> entry:body.entrySet()){

sql.append("`"+humpToLine(entry.getKey())+"`").append(",");

}

sql.deleteCharAt(sql.length()-1);

sql.append(") VALUES (");

for (Map.Entry<String,Object> entry:body.entrySet()){

Object value = entry.getValue();

if (value instanceof String){

sql.append("'").append(entry.getValue()).append("'").append(",");

}else {

sql.append(entry.getValue()).append(",");

}

}

sql.deleteCharAt(sql.length() - 1);

sql.append(")");

log.info("[{}] - 插入操作:{}",table,sql);

Query query = runCountSql(sql.toString());

query.executeUpdate();

}

4.2.4更多管理界面

新闻管理系统中的管理人员在“更多管理”这一菜单下是可以对新闻管理系统内的意见反馈、视频分享进行管控的,其管理界面如下图4-10所示。

图4-10更多管理界面图

更多管理关键代码如下所示。

@RequestMapping(value = "/del")

@Transactional

public Map<String, Object> del(HttpServletRequest request) {

service.delete(service.readQuery(request), service.readConfig(request));

return success(1);

}

@Transactional

public void delete(Map<String,String> query,Map<String,String> config){

StringBuffer sql = new StringBuffer("DELETE FROM ").append("`").append(table).append("`").append(" ");

sql.append(toWhereSql(query, "0".equals(config.get(FindConfig.GROUP_BY))));

log.info("[{}] - 删除操作:{}",table,sql);

Query query1 = runCountSql(sql.toString());

query1.executeUpdate();

}

5系统测试

5.1系统测试的目的

系统开发到了最后一个阶段那就是系统测试,系统测试对软件的开发其实是非常有必要的。因为没什么系统一经开发出来就可能会尽善尽美,再厉害的系统开发工程师也会在系统开发的时候出现纰漏,系统测试能够较好的改正一些bug,为后期系统的维护性提供很好的支持。通过系统测试,开发人员也可以建立自己对系统的信心,为后期的系统版本的跟新提供支持。

5.2 系统测试用例

系统测试包括:用户登录功能测试、新闻展示功能测试、新闻添加、新闻搜索、密码修改功能测试,如表5-1、5-2、5-3、5-4、5-5所示:

用户登录功能测试:

表5-1 用户登录功能测试表

用例名称

用户登录系统

目的

测试用户通过正确的用户名和密码可否登录功能

前提

未登录的情况下

测试流程

1) 进入登录页面

2) 输入正确的用户名和密码

预期结果

用户名和密码正确的时候,跳转到登录成功界面,反之则显示错误信息,提示重新输入

实际结果

实际结果与预期结果一致

新闻查看功能测试:

表5-2 新闻查看功能测试表

用例名称

新闻查看

目的

测试新闻查看功能

前提

用户登录

测试流程

点击新闻列表

预期结果

可以查看到所有新闻信息

实际结果

实际结果与预期结果一致

管理员添加新闻界面测试:

表5-3 管理员添加新闻界面测试表

用例名称

新闻发布测试用例

目的

测试新闻发布功能

前提

用户正常登录情况下

测试流程

1)点击新闻信息管理就,然后点击添加后并填写信息。

2)点击进行提交。

预期结果

提交以后,页面首页会显示新的新闻信息

实际结果

实际结果与预期结果一致

新闻搜索功能测试:

表5-4新闻搜索功能测试表

用例名称

新闻搜索测试

目的

测试新闻搜索功能

前提

测试流程

1)在搜索框填入搜索关键字。

2)点击搜索按钮。

预期结果

页面显示包含有搜索关键字的新闻

实际结果

实际结果与预期结果一致

密码修改功能测试:

表5-5 密码修改功能测试表

用例名称

密码修改测试用例

目的

测试管理员密码修改功能

前提

管理员用户正常登录情况下

测试流程

1)管理员密码修改并完成填写。

2)点击进行提交。

预期结果

使用新的密码可以登录

实际结果

实际结果与预期结果一致

5.3 系统测试结果

通过编写新闻管理系统的测试用例,已经检测完毕用户登录模块、新闻查看模块、新闻添加模块、新闻搜索模块、密码修改功能测试,通过这5大模块为新闻管理系统的后期推广运营提供了强力的技术支撑。

结论

至此,新闻管理系统已经结束,在开发前做了许多的准备,在本系统的设计和开发过程中阅览和学习了许多文献资料,从中我也收获了很多宝贵的方法和设计思路,对系统的开发也起到了很重要的作用,系统的开发技术选用的都是自己比较熟悉的,比如Web、springboot技术、MYSQL,这些技术都是在以前的学习中学到了,其中许多的设计思路和方法都是在以前不断地学习中摸索出来的经验,其实对于我们来说工作量还是比较大的,但是正是由于之前的积累与准备,才能顺利的完成这个项目,由此看来,积累经验跟做好准备是十分重要的事情。

当然在该系统的设计与实现的过程中也离不开老师以及同学们的帮助,正是因为他们的指导与帮助,我才能够成功的在预期内完成了这个系统。同时在这个过程当中我也收获了很多东西,此系统也有需要改进的地方,但是由于专业知识的浅薄,并不能做到十分完美,希望以后有机会可以让其真正的投入到使用之中。

参考文献

[1]张兰,刘国亮. 一种基于人工智能的新闻媒体数据推荐管理系统[P]. 江西省:CN113961051A,2022-01-21.

[2]曲良,朱玉春,胡卫星. 一种分布式新闻与事件上报管理系统装置[P]. 北京市:CN214803166U,2021-11-23.

[3]Westlund Oscar,Krumsvik Arne H.,Lewis Seth C.. Competition, Change, and Coordination and Collaboration: Tracing News Executives’ Perceptions About Participation in Media Innovation[J]. Journalism Studies,2021,22(1):

[4]Blankenship Justin C.,Riffe Daniel. Follow the Leader?: Optimism and Efficacy on Solo Journalism of Local Television Journalists and News Directors[J]. Journalism Practice,2021,15(1):

[5], 华翔采购管理系统V1.0. 湖南省,华翔翔能科技股份有限公司,2020-08-01.

[6]任超. 面向互联网的新闻管理系统设计与实现[D].山东大学,2020.

[7]韩旭.基于WEB的新闻管理系统的设计与实现[J].电子世界,2020(03):204-205.

[8]牛帆,黄婷婷,史铭. 新闻采编业务管理系统的设计与实践[C]//中国新闻技术工作者联合会2019年学术年会论文集.,2019:19-25.

[9]于黎冰,关辉,王晓晨,徐妹妍,刘维雪,孙佳. 融媒体视域下体育新闻视频媒体管理系统的分析与设计[C]//第十一届全国体育科学大会论文摘要汇编.,2019:1428-1430.

[10]仉允苇. 石油新闻管理系统的设计与实现[D].西安电子科技大学,2019.

[11]叶飞,张勇,马慧.基于家园互动的校园新闻管理系统的设计与构建[J].电子测试,2019(12):79-81.

[12]钟勇, 十八、上海市新闻出版局 上海新闻出版职业技术学校教学信息化管理系统升级改造. 张晓莺 主编,上海信息化年鉴,上海人民出版社,2017,159,年鉴.

[13]王和诚.新闻管理系统的设计与实现[J].电子测试,2018(12):76-77.

[14]王帅. 鞍资网IT新闻素材管理系统的设计与实现[D].大连理工大学,2018.

[15]于建委.网站新闻管理系统的设计与应用研究[J].网络安全技术与应用,2017(09):68+85.

致 谢

逝者如斯夫,不舍昼夜。转眼间,大用户用户活便已经接近尾声,人面对着离别与结束,总是充满着不舍与茫然,我亦如此,仍记得那年秋天,我迫不及待的提前一天到了学校,面对学校巍峨的大门,我心里充满了期待:这里,就是我新生活的起点吗?那天,阳光明媚,学校的欢迎仪式很热烈,我面对着一个个对着我微笑的同学,仿佛一缕缕阳光透过胸口照进了我心里,同时,在那天我认识可爱的室友,我们携手共同度过了这难忘的两年。如今,我望着这篇论文的致谢,不禁又要问自己:现在,我们就要说再见了吗?

感慨莫名,不知所言。遥想当初刚来学校的时候,心里总是想着工科学校会过于板正,会缺乏一些柔情,当时心里甚至有一点点排斥,但是随着我对学校的慢慢认识与了解,我才认识到了她的美丽,她的柔情,并且慢慢的喜欢上了这个校园,但是时间太快了,快到我还没有好好体会她的美丽便要离开了,但是她带给我的回忆,永远不会离开我,也许真正离开那天我的眼里会满含泪水,我不是因为难过,我只是想将她的样子映在我的泪水里,刻在我的心里。最后,感谢我的老师们,是你们教授了我们知识与做人的道理;感谢我的室友们,是你们陪伴了我如此之久;感谢每位关心与支持我的人。

少年,追风赶月莫停留,平荒尽处是春山。

点赞+收藏+关注 → 私信领取本源代码、数据库

Guess you like

Origin blog.csdn.net/DZBS2000/article/details/128947827