The design and implementation of springboot's Android-based mobile digital library graduation project - with source code 030911

Springboot Mobile Digital Library APP

Summary

This article conducts research and analysis on the mobile digital library, and then develops and designs the mobile digital library APP to solve the problem. The main functional modules of the mobile digital library APP include: overview of new books, popular books, book borrowing, etc., which are completed by selecting the APP developer tool for the design of the front-end view interface of this system. The system function design adopts MySQL as the main storage unit of background data. The Springboot framework is used to develop the system, and all the functions of the system are realized. This report first analyzes the background, function and significance of the research, laying the foundation for the rationality of the research work. Analyze the various requirements and technical problems of the mobile digital library APP, 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 mobile digital library APP Library app and deployment run using it.

Keywords: digitization; Springboot; MySQL database

Springboot mobile digital library app

Abstract

This paper studies and analyzes the mobile digital library, and then develops and designs the mobile digital library app to solve the problem. The main function modules of mobile digital library app include: overview of new books, popular books, book borrowing, etc. the front-end view interface of the system is designed by selecting app developer tools. The system function design adopts MySQL as the main storage unit of background data, and adopts springboot framework for system development to realize 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 mobile digital library app, 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 deployment and operation of the mobile digital library app.

 Key words:digitization; Springboot;Mysql database

Table of contents

Chapter 1 Introduction

1.1  Research background and significance

1.2 Research content 

Chapter 2 Introduction to Related Technologies 6

2.1  J2EE technology

2.2 MVVM pattern

2.3 B/S structure

2.4 Spring boot framework

2.5  Mysql database

2. 6 Android technology

2. 6 B/S system working principle

Chapter 3 System Analysis

3.1  Feasibility analysis

3.2  Analysis of Functional Requirements

3.2.1  Foreground user functions

3.2.2  Background administrator function

3.3  Analysis of non-functional requirements

3.4  Security Requirements Analysis

3.4.1  System Security

3.4.2  Data Security

3.5  Data flow analysis

Chapter 4 System Design

4.1  System architecture design

4.2  Overall system design

4.3  System function design

4.4  Database design

4.4.1  Data Requirements Analysis

4.4.2  Database conceptual design

4.4.3  Database table design

Chapter 5 System Implementation

5.1  Implementation of the database access layer

5.2  Implementation of registration module

5.3  Implementation of login module

5.4  Realization of User Profile Modification Module

5.5 Implementation of Popular Books Module

5.6 Realization of Book Borrowing Module

5.7 New book overview management module implementation 

Chapter 6 System Testing

6.1  Test purpose

6.2  Functional test

6.3  Performance Test

Chapter 7 Summary and Outlook

references

thank you

  1. introduction
    1. research background and meaning

Libraries are an important medium for culture and information dissemination. The development of mobile Internet technology provides new opportunities for libraries to expand service areas and improve service functions. More and more libraries and information technology service companies are implementing mobile library systems. develop. At present, the more common service methods of mobile libraries are resource disclosure and information notification services. These two types of services allow users to directly experience the exclusive services of mobile libraries, but these two types of services are still subject to certain time and geographical restrictions. , it is also necessary to build a service system that truly reflects the value of the mobile library according to the characteristics of the wireless mobile network. The general mobile network includes three elements: information system, mobile Internet, and mobile terminal, and the mobile library is also closely related to these three elements. The mobile terminal is the ultimate service carrier of the mobile library, and the mobile Internet can provide support for the picture, text and video transmission of the mobile library. The existing digital library is the basis for the development of the mobile library system, and the mobile library is extended according to the functions of the existing digital library. The above factors play a vital role in the development of mobile libraries. With the continuous strengthening of the functions of intelligent mobile terminals, the mobile library mainly develops towards the information service mode of intelligent judgment and situation awareness.

The development of mobile digital libraries is conducive to cultivating people's reading habits, forming a strong learning atmosphere, socializing learning modes such as lifelong learning, universal learning, open learning, and learning anytime and anywhere, promoting the development of social education in my country and promoting the economic development of our country. Cultural development, speed up the process of my country's informatization construction, and promote the development of my country's high-tech industry and software industry.

    1. research content

The development and implementation of mobile digital library APP, the required work content:

(1) First of all, determine the topic, determine the system to be built, and conduct a preliminary systematic confirmation of the background of the system and some problems currently facing it.

(2) After the system confirmation is completed, confirm the technology used in system development in combination with the needs of system development. The development of the mobile digital library APP uses the Springboot framework, and the database is used to build and develop the platform. The technology used is confirmed for technical analysis. Whether the technology used can complete the realization of the system.

(3) Determine the technology used by the system, confirm the user roles divided by the system online, and determine the functional modules to be designed according to the division of user roles. The design of the mobile digital library APP is mainly divided into administrator and user roles. And the functional modules used are also different, but the content of the system database is interactive, users can view book information at any time according to their own needs, and system staff can process and operate online information according to their own assigned content , the administrator obtains the detailed data information of all users, and processes and solves it as soon as possible according to the needs.

(4) Design the program and interface after the functional modules of the system are confirmed. The test method finds out the loopholes in the program, and solves the loopholes in the program online. If there is no problem in the test system, the system can be uploaded for formal operation.

  1. Related technology introduction
    1. J2EE technology

People can master many foreign languages, but what a computer scientist is proficient in is mostly programming languages, which are not human natural languages, such as C language, Java, Perl and so on. Since the "middleware" developed by different companies is not standardized enough, Sun launched J2EE and used this standard to solve the ills. It provides a good mechanism, allowing each layer to allow the corresponding server and components to run, making the system stable and usable, efficient in development, and easy to maintain.

    1. MVVM pattern

The MVVM model is a commonly used development model, which is mainly divided into M layer, V layer and C layer in terms of code implementation.

View (View) represents the user interaction interface. A web application may have many interfaces. In the MVVM mode, the view only deals with data collection, processing, and user requests, and does not include the processing of business processes and business processes. Handled by the Model.

Model (Model) is the processing of business processes/states and the formulation of business rules. The process of the model processing the business process cannot be seen by other layers. It is like a black box. After receiving the data requested by the view, it returns the final processing result. The main core of MVVM is the design of the business model. A typical application example is the popular EJB model. It further divides the model from the perspective of application technology implementation in order to make full use of existing components, but it cannot be used as a A framework for applying design models.

The controller (Controller) can be understood as receiving the user's request, and then the view and the model are matched together to complete the user's request together. It has a very obvious role in dividing the control layer, and can clearly tell you that it is a distributor, which model and view to choose, and what kind of request from the user can be completed. The control layer does not do all the data processing, for example: the user clicks a connection, after the control layer receives the request, it does not process the business information, it just transmits the user's information to the model, and tells the model what to do, and then chooses the one that meets the requirements The view is returned to the user.

    1. B/S structure

B/S (Browser/Server) is a more convenient architecture than its predecessor architecture. It uses the Web server to complete the data transfer and exchange. You only need to download the browser as the client, then the work will achieve a "slimming" effect, and there is no need to consider the problem of non-stop installation of software.

    1. Spring boot framework

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. 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. Aspect Oriented Programming(AOP) framework, the Spring AOP framework is based on the proxy mode, and can be configured at runtime; the AOP framework is mainly modularized for the 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. Spring integrates multiple transaction templates. The system can configure transactions through transaction templates, XML or Java annotations, and the transaction framework integrates functions such as messaging and caching. Spring's data access framework addresses common difficulties developers encounter when using databases in their applications. It not only provides support for all popular data access frameworks such as Java: JDBC, iBATS/MyBATIs, Hibernate, Java Data Objects (JDO), ApacheOJB and Apache Cayne, but also can be used with Spring's transaction management to provide data access Flexible abstraction. The Spring framework initially did not intend to build its own Web MVC framework . During the development process, its developers believed that the separation between the presentation layer and the request processing layer of the existing Struts Web framework and between the request processing layer and the model was not enough, so they created Spring MVC.

    1. Mysql database

Mysql has been updated many times, and the functional level has been very rich and perfect. From Mysql4 version to 5 version, a relatively large update has been made, and it has achieved good practical application results in actual commercial use. The latest version of Mysql supports the compression of information, and at the same time, it can also perform encryption to better meet the needs of information security. At the same time, after multiple updates of the system, the mirroring function of the database itself has also been greatly enhanced, the smoothness of operation and ease of use have been greatly improved, and the use and creation of drivers are also more efficient and faster. The biggest change is the optimization of the display of spatial information, which makes it easier to label and calculate coordinates on the application map. The powerful backup function also ensures that users will feel more at ease during the use process, and the supported Office features also support users' self-installation and use. The display form of information has also been greatly updated, and two very useful display areas have been added, one is the information area, which has classified tables and text, and the display of the interface is more refreshing and specific. The second is the information control of the instrument, which can display information in the instrument information area and compare multiple information at the same time, which brings great convenience to the actual use of users.

In the actual implementation process of the mobile digital library APP designed in this paper, the main reason for choosing the Mysql database is that there will be a large number of databases that are frequently operated during the application and development of the enterprise application system, and the data security The sexual requirements are also very high. Based on these factors, Mysql with a relatively high safety factor was finally selected to store the background data of the mobile digital library APP.

    1. android technology

Android is an operating system based on the Linux kernel, which was developed by Google in the early days and later by the Open Handset Alliance. It adopts the architecture of the software stack, which is mainly divided into three parts. The bottom layer is based on the work of the Linux kernel and only provides basic functions; other application software is developed by each company itself, using Java as a part of programming. In addition, in order to promote this technology, Google and dozens of other mobile phone companies established the Open Handset Alliance. Android is often rumored to be GPhone before it is made public.

It adopts a software stack (software stack, also known as software stack) architecture, which is mainly divided into three parts: the bottom layer is based on the Linux core, developed by C language, and only provides basic functions. The middle layer includes function library Library and virtual machine Virtual Machine, developed by C++. The top layer is a variety of application software, including call programs, SMS programs, etc., and the application software is developed by each company and written in Java.

    1. Working principle of B/S system

The B/S architecture adopts the working mode of browser request and server response.

Users can access information such as text, data, pictures, animation, video on demand and sound generated by the web server on the Internet through a browser;

And each web server can be connected with the database server in various ways, and a large amount of data is actually stored in the database server;

Download the program from the Web server to execute locally. If an instruction related to the database is encountered during the download process, the Web server will hand it over to the database server for interpretation and execution, and return it to the Web server, and the Web server will return it to the user. In this structure, many networks are connected together to form a huge network, that is, the global network. Each enterprise can build its own Internet on the basis of this structure.

In the B/S mode, the user requests access to many servers distributed on the network through the browser. The browser's request is processed by the server, and the processing result and corresponding information are returned to the browser. Other data Processing and requests are all completed by the Web Server. Through the frame structure and the browser embedded in the operating system, this structure has become the mainstream structure mode of today's software applications.

system analysis

  1. Feasibility Analysis

In terms of technology, the current mainstream Springboot framework is used to build the main body of the system. The front-end part is developed based on the MVVM model, and the B/S model is used to realize the design and aesthetic adjustment of the front page. It has been practiced in the course design, which can make the development more convenient and systematic. From a technical point of view, this system is completely achievable.

In terms of practicability, the main task of this design is to implement in the mobile digital library APP: book information management, new book overview management, popular book management, book borrowing management module, etc., in line with the current development trend. From the perspective of users, while also considering system operating costs and human resources, it adopts a convenient way on the Internet to realize online business, making the business process more systematic and more convenient for user experience, which is more practical.

In terms of economy, since the main purpose of the mobile digital library APP designed in this project is to provide more convenient and faster query and retrieval services for medical record information, that is, information software that can be directly put into use. The main cost of the system is mainly concentrated on the operation of continuous maintenance and management update of the used data in the later period. However, once the system is put into actual operation and use, it can improve the efficiency of information query and retrieval. At the same time, it is also necessary to effectively ensure the security of the information of the inquirer. At the same time, the practicality brought by this mobile digital library APP The value of the application far exceeds the cost of developing and maintaining the actual system. Therefore, it is economically feasible to develop this software.

    1. Functional Requirements Analysis

The functions of the Mobile Digital Library APP are mainly divided into front-end users registering and logging in according to their own needs, browsing book information and borrowing books, etc. The background system administrator mainly manages course information and attendance status, and the administrator mainly manages registered users, Book information, new book overview, popular books, book borrowing, etc. are managed.

The user use case diagram is shown below.

 

Figure 3-1 User use case diagram

The administrator use case diagram is shown below.

 

Figure 3-2 Administrator use case diagram

      1. front-end user function

The functions of the foreground user are as follows:

Account registration: The user fills in personal information and verifies the mobile phone number.

Login: Log in according to the account password.

Query book information: Users can browse book information in the online book list, and select a book to view details.

Maintain personal information: Users can modify their registration information at any time due to changes in personal information.

Popular books: The user performs an operation to learn about popular books online.

Book borrowing: Users can borrow books online.

Exchange Forum: Users can conduct forum exchanges.

      1. Background administrator function

The administrator functions are as follows:

Change password: Administrators can change their own login passwords to the system at any time to ensure system security.

User management: publish and maintain user information. .

Popular book management: maintain popular books, add, delete and modify information.

New book overview management: publish new book overview information.

Book borrowing management: review and manage the borrowing information of books.

Exchange forum management: manage forum information.

    1. Non-Functional Requirements Analysis

The first thing to consider is the system function software. In terms of specific design, whether it can better meet the basic functional requirements of various users. If it cannot better meet the needs of users, then the existence of this system is worthless. The non-functional analysis of the software system is carried out from 7 aspects, one is performance analysis, which is aimed at the system; one is security analysis, which is aimed at the system; the other is integrity analysis, which is aimed at the system; It is scalability analysis, for the system, and the other is performance analysis to adapt to the business. In the face of the performance, security, expansion, and integrity of the mobile digital library APP, it is found that the corresponding non-functional requirements analysis is required after a comprehensive comparison and analysis of the performance of the seven aspects of performance, security, expansion, and integrity.

    1. Security Requirements Analysis
      1. system security

Security is very important to every system. A system with good security can protect system information and user information from being stolen. Especially for the mobile digital library APP, there must be good security to protect the entire system.

The system has authority control for users, and limits the authority of users according to the role barriers, so as to ensure the security of the system.

      1. data security

The data in the database is input from the outside world. When the data is input, due to various reasons, the input data will be invalid or dirty. Therefore, how to ensure that the input data conforms to the regulations has become the primary concern of database systems, especially multi-user relational database systems.

Therefore, when writing to the database, data integrity, correctness, and consistency must be guaranteed.

    1. Data Flow Analysis

Analyze the data flow of the system, and the users of the system are divided into two categories, general users and administrators. The system mainly processes interface information transmission, login information verification, registration information reception, and user response to various operations.

The top-level data flow diagram of the system is shown in the figure below.

 

Figure 3-2 Top-level data flow diagram

To judge the identity of the user, it is judged according to the login data, and then jumps to the corresponding function interface. The internal users of the system can operate the data, and the database center can receive the effective data stream transmitted by the system to perform corresponding operations on the data SQL statements.

The underlying data flow diagram of the system is shown in the figure below.

                                             

 

 

 Figure 3-3 The underlying data flow diagram

 

The system can be divided into two parts, the foreground and the background. After each operation, the system returns the operation result. The data connection between the foreground and the background is mainly through the database, which means that different operations are performed on the database respectively.

  1. system design
    1. System architecture design

The architecture design of this mobile digital library APP is mainly divided into three layers, mainly including the Web layer, the business layer, and the Model layer. The web layer also includes the View layer and the Controller layer, and the Model layer includes the metadata extension layer and the data access layer.

The system architecture is shown in the figure below.

 

Figure 4-1 System architecture

    1. Overall System Design

The mobile digital library APP is generally divided into a front-end user module and a back-end administrator module.

The two modules appear to exist independently, but the accessed database is the same. The function of each module is made according to the previously completed demand analysis, and after consulting relevant materials.

To sum up, the functional structure diagram of the system is shown in the figure below.

                       

 

Figure 4-2 System function structure diagram

    1. System function design

User information management module: User management is divided into user addition and modification. User information is modified, added, and deleted by the administrator.

Popular book management module: popular book management is divided into popular book addition, modification and deletion. Popular book information is modified, added, and deleted by the administrator.

Book borrowing management module: book borrowing management is divided into: data set borrowing application submission. The administrator can query the book borrowing information, and the background administrator can review the book borrowing information.

    1. Database Design
      1. Data Requirements Analysis

From the previous analysis, the most important things in the database are user information, popular books, book borrowing, exchange forums, and an overview of new books. The analysis can get the following data description:

Platform users: used to record various information of users, including user name, password, name, gender, address, email address, contact information and other data items.

Administrator: Record the login information of the administrator. Including user name, password, permissions and other data items.

Book information: data items such as book name, book number, book type, book version, book author, book inventory, publication date, book price, content introduction, online preview, etc.

Book borrowing: store the user's borrowing information. Including data items such as book name, book number, type, price, borrowing quantity, borrowing fee, payment status, etc.

      1. Database conceptual design

According to the previous data flow chart, combined with the functional module design of the system, design each information entity that conforms to the system.

(1) Entity connection diagram, as shown in 4-3.

 

                                                                  Figure 4-3 Entity Connection Diagram

      1. database table design

The data tables owned by the Mobile Digital Library APP are as follows: Popular Books Table, Book Borrowing Table, New Book Overview Table, Exchange Forum Table, and User Table.

Due to the large number of data tables, only the main data tables of the system are displayed, as shown in the following table.

name

type

length

not null

primary key

note

ordinary_users_id

int

11

yes

yes

common user ID

user_name

varchar

64

no

no

username

user_gender

varchar

64

no

no

user gender

examine_state

varchar

16

yes

no

Approval Status

recommend

int

11

yes

no

Intelligent Recommendation

user_id

int

11

yes

no

User ID

create_time

datetime

0

yes

no

creation time

update_time

timestamp

0

yes

no

update time

name

type

length

not null

primary key

note

book-borrowing

int

11

yes

yes

Book Borrowing ID

book_name

varchar

64

no

no

book title

book_number

varchar

64

no

no

book number

book_type

varchar

64

no

no

book type

book_price

varchar

64

no

no

book price

borrowing_quantity

varchar

64

no

no

Borrowing quantity

borrowing_expenses

varchar

64

no

no

borrowing fee

borrowing_user

int

11

no

no

Borrower

pay_state

varchar

16

yes

no

Payment status

pay_type

varchar

16

no

no

Payment Types

recommend

int

11

yes

no

Intelligent Recommendation

create_time

datetime

0

yes

no

creation time

update_time

timestamp

0

yes

no

update time

name

type

length

not null

primary key

note

overview_of_the_new_book_id

int

11

yes

yes

New Book Overview ID

title_of_new_book

varchar

64

no

no

new book title

release_date

date

0

no

no

release date

new_book_type

varchar

64

no

no

new book type

new_book_author

varchar

64

no

no

new book author

new_book_cover

varchar

255

no

no

new book cover

book_number

varchar

64

yes

no

book number

hits

int

11

yes

no

hits

praise_len

int

11

yes

no

Likes

recommend

int

11

yes

no

Intelligent Recommendation

create_time

datetime

0

yes

no

creation time

update_time

timestamp

0

yes

no

update time

name

type

length

not null

primary key

note

popular_books_id

int

11

yes

yes

Popular Book ID

book_name

varchar

64

no

no

book title

book_number

varchar

64

yes

no

book number

book_cover_

varchar

255

no

no

book cover

book_type

varchar

64

no

no

book type

book_edition

varchar

64

no

no

book version

book_author

varchar

64

no

no

book author

publication_date

date

0

no

no

publication date

book_inventory

varchar

64

no

no

book inventory

book_price

varchar

64

no

no

book price

content_validity

text

0

no

no

brief introduction

online_preview

longtext

0

no

no

online preview

hits

int

11

yes

no

hits

praise_len

int

11

yes

no

Likes

recommend

int

11

yes

no

Intelligent Recommendation

create_time

datetime

0

yes

no

creation time

update_time

timestamp

0

yes

no

update time

name

type

length

not null

primary key

note

forum_id

mediumint

8

yes

yes

forum id

display

smallint

5

yes

no

to sort

user_id

mediumint

8

yes

no

User ID

nickname

varchar

16

no

no

Nick name

praise_len

int

10

no

no

Likes

hits

int

10

yes

no

number of visits

title

varchar

125

yes

no

title

keywords

varchar

125

no

no

Key words

description

varchar

255

no

no

describe

url

varchar

255

no

no

source address

tag

varchar

255

no

no

Label

img

text

0

no

no

cover picture

content

longtext

0

no

no

text

create_time

timestamp

0

yes

no

Creation time:

update_time

timestamp

0

yes

no

Update time:

avatar

varchar

255

no

no

Poster Avatar:

type

varchar

64

论坛分类

  1. 系统实现
    1. 数据库访问层的实现

该系统是通过jdbc和MySQL达成连接的,新建一个jdbc.properties文件来填写与数据库连接所需要的驱动和参数。

jdbc.driverClass=com.MySQL.jdbc.Driver

jdbc.url=jdbc:MySQL://localhost:3306/tsi

jdbc.username=root

jdbc.password=123

第一个参数代表MySQL数据库的驱动,第二个参数代表要连接的数据库,第三个和第四个参数代表数据库连接名和密码。

后台与数据库访问主要是通过HQL语句来进行查询的,查询语句中的表名是表格的实体类名,在这种查询语句中*是不允许使用的,除非适合聚合函数一起使用才可以。

    1. 注册模块的实现

用户在填写数据的时候必须与注册页面上的验证相匹配否则会注册失败,注册页面的表单验证是通过JavaScript进行验证的,用户名的长度必须在6到18之间,邮箱必须带有@符号,密码和密码确认必须相同,你输入的密码,系统会根据你输入密码的强度给出指定的值,电话号码和身份证号码必须要求输入格式与生活相符合,当你前台验证通过的时候你点击注册,表单会将你输入的值通过name值传递给后台并保存到数据库中。

用户注册流程图如下图所示。

 

图5-1用户注册流程图

用户注册界面如下图所示。

 

图5-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;

}

    1. 登录模块的实现

主要由两部分组成,登录前的登录界面以及登录后的用户功能界面。登录界面,要求用户输入用户名和密码,当用户名和密码其中一个输入为空时,给出提示“用户名,密码不能为空”。获取用户名和密码后到数据库中查找,如果用户名存在,以及对应的密码正确,则登录成功,否则登录失败。登录失败后给出提示,并把焦点停在文本框中。登录成功后将该次会话的全局变量username设置为用户名。登录成功后进入会员的功能模块,主要有会员基本信息修改,已经发布药品信息管理,发布信息,和退出功能。退出功能是清除全局变量username的值,并跳回到首页。

登录流程图如下图所示。

 

图5-3登录流程图

用户登录界面如下图所示。

 

图5-4用户登录界面

用户登录的逻辑代码如下所示。

/**

     * 登录

     * @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, "账号或密码不正确");

        }

}

    1. 用户资料修改模块的实现

用户登录/注册成功之后可以修改自己的基本信息。修改页面的表单中每一个input的name值都要与实体类中的参数相匹配,在用户点击修改页面的时候,如果改后用户名与数据库里面重复了,页面会提示该用户名已经存在了,否则通过Id来查询用户,并将用户的信息修改为表单提交的数据。

    1. 热门书籍模块的实现

如果书籍的信息需要修改,管理员可以通过查询书籍的基本信息来查询,查询热门书籍是通过ajax技术来进行查询的,需要传递书籍名称等参数然后在返回到该页面中,可以选中要修改或删除的那条信息,如果选中了超过一条数据,页面会挑一个窗口提醒只能选择一条数,如果没有选中数据会挑一个窗口题型必须选择一条数据。当选择确认修改的时候,后台会根据传过来的id到数据库查询,并将结果返回到修改页面中,可以在修改页面中修改刚刚选中的信息当点击确认的时候from表单会将修改的数据提交到后台并保存到数据库中,就是说如果提交的数据数据库中存在就修改,否则就保存。

热门书籍列表界面如下图所示。

 

图5-5热门书籍列表界面

热门书籍列表的逻辑代码如下:

@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();

    }

    1. 书籍借阅模块的实现

书籍借阅功能整体流程:用户进行书籍借阅时,同时会显示具体信息填写页面,在用户点击借阅按钮时,会先通过拦截器判断用户是否登录,若未登录,会跳转至登录页面,提示用户先登录,若为登录用户就会跳转至填写借阅信息的页面,填写好借阅信息之后,点击提交按钮,成功之后返回书籍借阅信息,告知用户借阅成功。

书籍借阅流程图如下图所示。

 

图5-7书籍借阅流程图

书籍借阅界面如下图所示。

 

图5-8书籍借阅界面

    1. 新书概述管理模块的实现

添加新书概述时,会给出数据填写的页面,该页面根据填写好的图书概述信息同样会事先发送Ajax请求查询是否已存在,数据填写好之后提交到后台,会调用相关服务在数据库中插入数据库。

新书概述管理流程图如下图所示。

 

图5-9新书概述管理流程图

新书概述管理页面设计效果如下图所示。

 

图5-10新书概述管理界面

新书概述管理界面逻辑代码如下:

 @RequestMapping(value = {"/avg_group", "/avg"})

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

        Query count = service.avg(service.readQuery(request), service.readConfig(request));

        return success(count.getResultList());

}

  1. 系统测试
    1. 测试目的

对任何系统而言,测试都是必不可少的环节,测试可以发现系统存在的很多问题,所有的软件上线之前,都应该进行充足的测试之后才能保证上线后不会Bug频发,或者是功能不满足需求等问题的发生。下面分别从单元测试,功能测试和用例测试来对系统进行测试以保证系统的稳定性和可靠性。

    1. 功能测试

下表是热门书籍管理功能的测试用例,检测了热门书籍管理中对热门书籍信息的增加,删除,修改,查询操作是否成功运行。观察系统的响应情况,得出该功能也达到了设计目标,系统运行正确。

前置条件;用户登录系统。

表6-1 热门书籍信息管理的测试用例

功能描述

用于热门书籍信息管理

测试目的

检测热门书籍信息管理时的各种操作的运行情况

测试数据以及操作

预期结果

实际结果

点击添加热门书籍信息,必填项合法输入,点击保存

提示添加成功

与预期结果一致

点击添加热门书籍信息,必填项输入不合法,点击保存

提示必填项不能为空

与预期结果一致

点击修改热门书籍信息,必填项修改为空,点击保存

提示必填项不能为空

与预期结果一致

点击修改热门书籍信息,必填项输入不合法,点击保存

提示必填项不能为空

与预期结果一致

点击删除热门书籍信息,选择热门书籍信息删除

提示删除成功

与预期结果一致

点击搜索热门书籍信息,输入存在的热门书籍信息名

查找出热门书籍信息

与预期结果一致

点击搜索热门书籍信息,输入不存在的热门书籍信息名

不显示热门书籍信息

与预期结果一致

下表是新书概述管理功能的测试用例,检测了新书概述管理中对新书概述信息的增加,删除,修改,查询操作是否成功运行。观察系统的响应情况,得出该功能也达到了设计目标,系统运行正确。

前置条件;用户登录系统。

表6-2 新书概述管理的测试用例

功能描述

用于新书概述管理

测试目的

检测新书概述管理时的各种操作的运行情况

测试数据以及操作

预期结果

实际结果

点击添加新书概述,必填项合法输入,点击保存

提示添加成功

与预期结果一致

点击添加新书概述,必填项输入不合法,点击保存

提示必填项不能为空

与预期结果一致

点击修改新书概述,必填项修改为空,点击保存

提示必填项不能为空

与预期结果一致

点击修改新书概述,必填项输入不合法,点击保存

提示必填项不能为空

与预期结果一致

点击删除新书概述,选择新书概述删除

提示删除成功

与预期结果一致

点击搜索新书概述,输入存在的新书概述名

查找出新书概述

与预期结果一致

点击搜索新书概述,输入不存在的新书概述名

不显示新书概述

与预期结果一致

下表是书籍借阅管理功能的测试用例,检测了书籍借阅管理中书籍借阅信息的操作是否成功运行。观察系统的响应情况,得出该功能也达到了设计目标,系统运行正确。

前置条件;用户登录系统。

表6-3 书籍借阅管理的测试用例

功能描述

用于书籍借阅管理

测试目的

检测书籍借阅管理时各种操作的情况

测试数据以及操作

预期结果

实际结果

未选择书籍借阅,点击提交

提示请选择书籍借阅

与预期结果一致

未输入时间,点击提交

提示请输入时间

与预期结果一致

    1. 性能测试

使用阿里云PTS(Performance Testing Service)性能测试服务对线上系统进行压力测试。线上服务器环境为:1核心CPU,1G内存,1Mbps公网带宽,Centos7.0操作系统。

压测过程中使用了2台并发机器,每台机器20个用户并发,对系统主页,登录,数据查询和数据维护等模块进行并发访问,测试结果是有40个用户并发时,数据管理相关页面的响应时间甚至达到了7s,通过查看服务器出网流量发现已经达到1381kb/s,可以看出服务器的带宽已经达到峰值,如果系统使用5Mbps的带宽,系统的响应时间和TPS将会大大增加。在整个测试的过程中,CPU的使用率占用仅8%,也提现出带宽瓶颈对系统的影响非常严重。

  1. 总结与展望

随着计算机互联网技术的迅猛发展,各行各业都已经实现采用计算机相关技术对日益放大的数据进行管理。该课题是研究移动数字图书馆为核心展开的,主要是为了实现图书馆移动数字化的需求。

移动数字图书馆APP的开发是以Springboot框架,系统整体为B/S架构,数据库系统使用MySQL。文中详细分析了移动数字图书馆APP的研究背景、研究目的和意义、开发工具和相关技术以及系统需求、系统详细设计和系统测试等等一系列内容。系统实现了移动数字图书馆APP所需的一些基本功能,并通过测试对这些实现的功能进行了完善,进而提高了系统整体的实用性。系统投入运行时,各功能均运行正常。系统的每个界面的操作符合常规逻辑,对使用者来说操作简单,界面友好。整个系统的各个功能设计合理,体现了人性化。但是由于自己在系统开发过程中对一些用到的相关知识和技术掌握不够牢固,再加上自身开发经验欠缺,因此系统在有些方面的功能还不够完善,考虑的不够全面,因此整个系统还有待日后逐步完善。

参考文献

[1]段学敏,高卫辉.图书管理与信息化结合途径初探[J].参花(下),2022(02):122-124.

[2]王小刚.互联网时代下的图书管理信息化建设[J].数字通信世界,2022(02):122-124.

[3]李鹏.新公共管理理念在图书管理中的创新应用[J].产业与科技论坛,2022,21(03):285-286.

[4]林辉.基于Java Web的渭南市大荔县图书管理系统的设计与实现[J].电子设计工程,2021,29(24):155-158+163.

[5]李东阳.利用信息技术优势,做好图书管理工作[J].新课程,2021(50):216.

[6]冯晓娟.信息技术在图书管理中的运用研究[J].文化产业,2021(33):40-42.

[7]王丹.大数据时代公共图书馆图书管理的创新路径[J].传媒论坛,2021,4(22):146-148.

[8]罗莉霞,高何裕.基于B/S的图书管理与个性化推荐系统的设计与实现[J].技术与市场,2021,28(11):184-185.

[9]杜秋英.基于网络环境下公共图书馆图书管理的措施[J].科技资讯,2021,19(30):146-148.

[10]黄波.基于PHP+MySQL图书管理系统设计与实现[J].信息与电脑(理论版),2021,33(19):124-126.

[11]何冰,刘瑞华.探索新媒体时代公共图书管理的有效途径[J].办公室业务,2021(19):172-173.

[12]岳晓玲.浅论信息化建设视角下的图书管理[J].文化产业,2021(25):85-87.

[13]曾莹珊.图书管理信息化建设的必要性与实现路径[J].新课程教学(电子版),2021(16):155-156.

[14]李燕.图书管理工作中存在的问题和解决措施[J].办公室业务,2021(15):161-162.

[15]张雪红.互联网时代图书管理信息化建设策略研究[J].中国高新科技,2021(14):39-40.

[16]霍福华,韩慧.基于SpringBoot微服务架构下前后端分离的MVVM模型[J].电子技术与软件工程,2022(01):73-76.

致谢

This design took 3 months. In this graduation project, it is inseparable from the guidance of the instructor to make things go smoothly. The instructor has given me a lot of help both in the graduation design experience and in the completion of the thesis. On the other hand, I have benefited a lot from the teacher's serious and responsible work attitude, prudent teaching spirit and strong theoretical level. His diligent and cautious attitude towards teaching and educating people also left me with a particularly deep feeling. I have learned a lot from my teachers. In theory and practice, my skills have been greatly improved. Here, I would like to express my heartfelt gratitude to the teachers.

After all the research and development of this graduation project, my system research and development has experienced a special progress from requirement analysis to realization of detailed functions, to final testing and maintenance. Let me have a deeper understanding of system development. Now my hands-on ability and ability to deal with doubts alone have also gained a particularly large increase in practice and learning. This is the best harvest of this graduation project.

Finally, during the whole system development process, the classmates and friends around me gave me a lot of opinions, so I quickly confirmed the business idea of ​​the system. Here, I sincerely express my gratitude to them.

Like+Favorite+Follow → private message to receive the source code and database
 

Guess you like

Origin blog.csdn.net/weixin_61498557/article/details/131370763