(Source code attached) springboot food recommendation system graduation project 29145

Summary

As a service of social networks, food has gradually integrated with online communities to form an Internet food economic industry chain. In the fast-paced life, compared with traditional food websites that solve the public's worries about what to eat, serve users and display food dishes and prices, a food recommendation system based on WeChat mini-programs with clear architecture and rich resources is built. It is very necessary.

This article takes practical application as the development background and uses software engineering principles and development methods. It mainly uses Java language technology, springboot framework and mysql database to complete the system design. The entire development process first conducts a demand analysis on the food recommendation system applet, and derives the main functions of the food recommendation system applet. Then carry out the overall design and detailed design of the food recommendation system applet. The overall design mainly includes the function design of the applet, the overall structure design of the applet, the data structure design of the applet and the security design of the applet. The detailed design mainly includes the food recommendation system applet. Implementation of database access, specific implementation of main functional modules, key code for module implementation, etc. Finally, the functional test of the food recommendation system applet was carried out, and the test results were analyzed and summarized. It was concluded that the food recommendation system applet has shortcomings and areas that need improvement, which will provide convenience for future food recommendation system applet maintenance. At the same time, it also provides reference and help for the future development of similar food recommendation system applets.

The development of food recommendation system applet makes the system more convenient and faster, and also makes the food recommendation system applet become more systematic and orderly. The system interface is friendly and easy to operate.

Keywords:Food recommendation system applet; WeChat applet; Mysql database; Java language 

Abstract

Food, as a service of social networks, has gradually combined with online communities to form an Internet food economy industry chain. In a fast-paced life, compared to traditional food websites that address the public's worries about what to eat, serve users and display the dishes and prices of food, it is necessary to build a food recommendation system based on WeChat applets with a clear architecture and rich resources.

This article is based on practical application as the development background, using software engineering principles and development methods. It mainly uses Java language technology, spring boot framework, and mysql database to complete the design of the system. The entire development process starts with a demand analysis of the food recommendation system applet, and obtains the main functions of the food recommendation system applet. Then, the overall design and detailed design of the food recommendation system applet are carried out. The overall design mainly includes the functional design of the applet, the overall structure design of the applet, the data structure design of the applet, and the security design of the applet; The detailed design mainly includes the implementation of the food recommendation system applet database access, the specific implementation of the main functional modules, and the key code for module implementation. Finally, a functional test of the food recommendation system applet was conducted, and the test results were analyzed and summarized. The shortcomings and areas for improvement of the food recommendation system applet were identified, which provided convenience for future food recommendation system applet maintenance, and also provided reference and assistance for future development of similar food recommendation system applets.

The development of food recommendation system applets makes the system more convenient and efficient, and also promotes the food recommendation system applets to become more systematic and orderly. The system interface is friendly and easy to operate.

Keywords: Food recommendation system applet; WeChat applet; MySQL database; Java Language

Table of contents

Summary

Abstract

1 Overview

1.1 Research background

1.2 Research significance

1.3 Main work of this topic

2 System development environment

2.1 java technology

2.2 Mysql database

2.3 Introduction to the mini program framework and directory structure

2.4 Introduction to spring boot framework

3 System analysis

3.1 Feasibility analysis

3.1.1 Technical feasibility

3.1.2 Operational feasibility

3.1.3 Economic feasibility

3.1.4 Legal feasibility

3.2 System process analysis

3.2.1 System development process

3.2.2 User login process

3.2.3 System operation process

3.2.4 Add information process

3.2.5 Modify information flow

3.2.6 Information deletion process

3.3 Use case analysis

3.4 System process analysis

3.4.1 Add information process

3.4.2 Operation process

3.4.3 Deletion of information process

4System Overview

4.1 System structure design

4.2 Database design

4.2.1 Database design principles

4.2.2 Database entities

4.3 Database design principles

4.3.1 Database table design

Table access_token (login access duration)

Table agriculture_products (agricultural products)

Table article (article: article for content management system)

Table article_type (article classification)

Table auth (user rights management)

Table classification_of_agricultural_products (Agricultural Products Classification)

table collect (collection)

Table comment (comment)

Table food_information (food information)

Table food_type (food type)

Table hits (user clicks)

Table merchant_users (merchant users)

Notice (announcement)

Table order_information (order information)

Table ordinary_users (ordinary users)

Express praise (like)

Table regulator (regulator)

Table slides (carousel)

Table upload (file upload)

Table user (user account: used to save user login information)

Table user_group (user group: used for user front-end identity and authentication)

5 system interface implementation

5.1 Administrator function module

System user information management

Resource management

Module management

5.2 User client function module

User registration

Basic Information

Front page

News information list

List of agricultural products

Food information page

Order information page

5.3 Merchant function module

5.4 Supervisor function module

6 system test

6.1 The significance of system testing

6.2 Test methods

6.3 Test analysis

in conclusion

Thanks

references

1 Overview

1.1ResearchBackground

Nowadays, with the wide coverage of the Internet and the continuous expansion of the development of new media forms, smartphones have penetrated into various life needs such as work, life, consumption and entertainment, changing people's traditional lifestyle. It has become an indispensable communication tool for everyone. . In today's busy society, whenever it's meal time, people generally worry about what to eat and which restaurant is better. According to the current development status of China's catering industry, the biggest feature is the rapid development of online ordering services. Online ordering has been welcomed and favored by many consumers. Traditional food websites display dishes, prices, etc., while food applications in APPs occupy mobile phone memory. In an era where technology is developing so rapidly, everyone is pursuing new era science and technology and integrating new era technology with food. , which gave rise to a food recommendation system based on WeChat mini programs, which provides more forms of higher-quality people-friendly services on the basis of satisfying people's daily online browsing of food and other functions. As a service of social networks, food has gradually integrated with online communities to form an Internet food economic industry chain. In the fast-paced life, compared with traditional food websites, a food recommendation system based on WeChat mini-programs with clear architecture and rich resources can solve the public's worries about what to eat, serve users and display food dishes and prices. Building is very necessary.

1.2 ResearchIntention

With the continuous improvement of people's living standards, there are more and more opportunities to eat out, such as dinners during holidays, dinners with colleagues, dinners with classmates, etc. When it comes to eating, the first thing to consider is where to eat and what to eat, so food websites have become the main source for people to obtain this information." Of course, traditional food websites all have the same dishes, prices, etc., which are displayed to all users. Users need to make the same choices from this menu to find what they like to eat from so many dishes. It is even more difficult and time consuming. Therefore, the application of personalized recommendation technology in the field of food has become particularly important.

The recommendation algorithm used in this article is mainly a collaborative filtering algorithm. Collaborative filtering recommendation is currently the most successful and widely used recommendation algorithm. As you can see from the title, collaborative filtering refers to finding groups with the same interests and hobbies as you, filtering out a few different opinions, and recommending some of the same information to interested users. The data source of this type of algorithm mainly comes from user behavioral data, including web browsing, purchases, clicks, ratings and comments. This data can truly and effectively reflect the user's interest in items, so it is used to make recommendations. The effect is better than other types of recommendation algorithms in terms of performance.

1.3 Main work of this topic

At the beginning, this article gives an overall description of the basic knowledge discussed in the system, and conducts a system analysis on this basis. In order to enable this system to be designed and implemented in a better and more complete manner, analysis and investigation must be conducted first. Based on the previous related foundations, a detailed analysis of the new system was carried out in terms of functionality. Then through detailed analysis, system design was carried out. Secondly, in terms of the feasibility of system implementation, I chose WeChat applet technology for development and design. For data storage, I used Mysql database for design. Since both WeChat applet and Mysql are very mature, they are very reliable, safe and practical in all aspects. Finally, the system is tested, perfected and released.

2 System development environment  

2.1 java technology

The Java language was released by Sun at the end of the 20th century, and the source code was open. This advantage attracted many outstanding programming enthusiasts from all over the world, and also enabled them to develop classic and fun games one after another at that time. The Java language is one of the pure object-oriented languages. From the early days of its release to the present, it can be said that it has a history of nearly 20 years and has developed into a profound influence in the history of the development of human computer programming languages.

The Java language has a variety of features: (1) Cross-platform independence; (2) Object-oriented; (3) Security is guaranteed; (4) Supports multiple tasks; (5) Multiple writing methods, code writing Simple. Compared with other low-level languages ​​and high-level languages, the Java language has obvious advantages and broad prospects in the future. It can be widely used in personal laptops, big data, large-scale games, etc.

First of all, the Java language has object-oriented characteristics and is easy to understand. Regarding objects, it can actually be understood that every thing is an object, including us humans. Utilize the basic characteristics of object-oriented languages ​​to solve practical problems in software development and provide technical support for effective software development.

Secondly, the Java language has good cross-platform independence. The application program written is written in Java language, so there is no need to use a compiler to modify the program code, and it can be run directly on any computer system, including Windows systems and Linux systems, that is, after one compilation , can run everywhere, so the Java language has excellent portability and can be implemented well across platforms.

2.2 Mysql number setting

The mysql database has many advantages, such as its easy-to-understand operation, powerful functions, and high information storage capacity. Therefore, it is widely used by people. For mysql database, it is generally mainly used for encoding and querying data, and it is applied to this database in many designs. In this process, we can query and combine conventional data, so When we use the mysql database, we only need to write a small piece of data to achieve the corresponding function. A database is a storage room for data storage, but the data is stored on a computer instead of a real storage room. The data is stored in a fixed format, not disordered. The definition is: a fixed format for a long time. Storage on computer memory that can be shared. Database management mainly includes the establishment of data tables, data storage, modification and addition of data. In order to ensure that the database system can operate normally, the management work carried out by relevant personnel. The establishment of the data table can adjust the data in the data table, recombine and reconstruct the data to ensure the security of the data.

2.3 Introduction to the applet framework and directory structure

The entire mini program framework system is divided into two parts:Logic layer andView layer. The goal of the mini program development framework is to allow developers to develop services with native mini program experience in WeChat in the simplest and most efficient way possible. The mini program provides data transmission and event systems between the view layer and the logic layer, and provides its own view layer and logic layer framework, allowing developers to focus on data and logic. At the core of the framework is a reactive data binding system that makes it very simple to keep data in sync with views. If data is modified in the logic layer, corresponding updates will be made in the view layer. The framework provides a set of basic components, which come with WeChat-style styles and special logic. Developers can create powerful WeChat mini programs by combining basic components.

2.4 Introduction to spring boot framework

Spring framework is an open source application framework onJava platform, providing a container with control inversion characteristics. 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 EJB (EnterpriseJavaBeans) model supplement, or even substitute. The Spring framework provides a series of solutions for development, such as utilizing the core features of inversion of control and implementing inversion of control through dependency injection to implement containerization of the managed object life cycle, using aspect-oriented programming for declarative transaction management, and integration 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 Inversion of Control (IOC) feature. IOC is designed to facilitate project maintenance and testing. It provides a method for unified configuration and management of Java objects through Java's reflection mechanism. The Spring framework uses containers 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 aimed at the intersection between modules. Focus on modularization. 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 basic needs through integration with AspectJ. Transaction management, remote access and other functions 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 a variety of 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 solves 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 ApacheCayne, but can also be used with Spring's transaction management to provide data access. Flexible abstraction. The Spring framework was not originally intended to build its own WebMVC framework. Its developers considered the existing StrutsWeb framework's presentation layer and requests during the development process. There was not enough separation between the processing layers and between the request processing layer and the model, so SpringMVC was created.

3 System analysis

The so-called system analysis is that the administrator obtains information through communication with the user client, and then displays this information to users and developers in the form of requirements specifications. In the long history of the development of software functions, for a long time, especially in the beginning, the importance of requirements analysis was not recognized by people. For example, at that time, the American company IBM developed an information management system for British Telecom. Development started without clarity, and the initial construction period was one year. Due to unclear requirements, the construction period was delayed by more than half a year, causing huge losses. This situation also exists in many of our software companies. They develop while developing, and even without clear communication with customers, directly copy the same type of projects and make changes. As a result, when the system is accepted, changes are made again, resulting in a loss of manpower and material resources. A huge waste. The reason for all these consequences is that the demand acquisition is not timely, unclear, and incomplete.

3.1 Feasibility analysis

The main goal of the food recommendation system applet is to provide food information recommendation and agricultural products and other related information management services. After determining the goals, we conduct a feasibility analysis on whether the goals of this system can be achieved from the following four aspects.

3.1.1 Technology availability

Food recommendation system Mainly uses WeChat applet technology, Java language, and Mysql database. The development of applications requires complete functions, simple use, and the establishment of a complete data Safe and stable database. The development technology of the food recommendation system applet is highly feasible, and the developers have mastered certain development technologies, so the development of the system is feasible.

3.1.2operability

The login interface of the food recommendation system applet is simple and easy to operate. It uses a common interface window to log in to the interface and access it through a computer. Users can access it as long as they have used a computer. The development of this system uses WeChat applet development, and the background is combined with Java language. These development environments make the system more complete. This system has the characteristics of easy operation, easy management, good interactivity, and is very simple in operation. Therefore this system can be developed.

3.1.3 Economic feasibility

The food recommendation system applet is based on B/S mode and Java technology on the server side. The client uses WeChat applet and Mysql database to store data. The required hardware and software environment are easy to purchase on the market. Program development is mainly about management. System development and maintenance. Therefore, the program does not require high development manpower and financial resources, and the system is not very complex, the development cycle is short, and it has high economic feasibility.

3.1.4 Legal feasibility

This food recommendation system applet is a self-designed management system and has great practical significance. Because both the software and the database use open source code, the development and design of this system does not have problems such as infringement and is completely legally feasible.

In summary, the food recommendation system applet has high technical, economic, operational and legal feasibility, and it is feasible to develop this program.

3.2 System process analysis

3.2.1 System development process

When developing a small program for a food recommendation system, first conduct a demand analysis, and then conduct an overall design plan for the system, design system functional modules, database selection, etc. The development process of this system is shown in Figure 3-1.

Figure 3-1 System development flow chart

3.2.2 UseRegistration process

In order to ensure the security of the system, if you want to use this system to manage system information, you must first log in to the system. As shown in Figure 3-3.

Figure 3-2 Login flow chart

3.2.3 System operation process

After the user opens the client and enters the system, the login interface will be displayed first, and the correct user name and password will be entered. The system will automatically detect the information. If the information is correct, the user will enter the system function interface and perform operations. Otherwise, an error will be displayed and the user cannot log in. The operation The process is shown in Figure 3-3.

Figure 3-3 System operation flow chart

3.2.4 Add information process

Administrators can add, delete, and modify user information, etc. Users can also add, delete, modify, etc. the information within their own authority. After entering the information, the system will verify the entered information and data on its own. If the information If it is correct, it will be added to the database. If the information is incorrect, you will be prompted to re-enter the information. The process of adding information is shown in Figure 3-4.

Figure 3-4 Add information flow chart

3.2.5 Modify information flow

Administrators can modify information on resource management, carousel management, announcement information management, food types, agricultural product classifications, etc. Users can also modify information within their own authority. First, enter the modification information interface and enter the modification information data. The system judges and verifies the data. If the modified information is legal, the modification is successful and the information is updated to the database. If the information is illegal, the modification fails and needs to be re-entered. The modified information flow chart is shown in Figure 3-5.

Figure 3-5 Modify information flow chart

3.2.6 Information deletion process

The administrator can delete information in the food recommendation system applet management, etc. After selecting the information to be deleted, click the delete button, and the system will ask if you are sure. If you click OK, the system will delete the selected information and The information is deleted in the database. The flow chart of deleting information is shown in Figure 3-6.

Figure 3-6 Deletion information flow chart

3.3Use case analysis

1. System users mainly use the system’s food recommendation system applet to view agricultural products, food information, news information, announcement information, basic information, etc. The following figure shows the use case diagram for ordinary users.

Figure 3-3.1 System user use case diagram

2. The administrator is mainly responsible for the homepage, carousel management, announcement information management, system user (administrator, ordinary user, merchant user, supervisor) resource management (news list, news category list) module management (food information, order information , agricultural products, food types, agricultural product categories) personal information, as shown in the figure below, a use case diagram describing the administrator.

Figure 3-3.2 Administrator use case diagram

3. The merchant is mainly responsible for the backend home page, module management (food information, order information) and personal information. The following figure describes the use case diagram of the merchant.

Figure 3-3.3 Merchant use case diagram

  1. The supervisor is mainly responsible for the backend home page and module management (food information, order information, agricultural products) and personal information. The following figure describes the use case diagram of the merchant.

Figure 3-3.4 Supervisor use case diagram

3.4System process analysis

3.4.1Additional information flow< /span>

Add information, the numbering system uses automatic numbering mode, nouserfill in,user. 4.1 Add information and enter the information. The system will automatically confirm the information and data. If the verification is successful, the valid information will be added to the database. If the information is invalid, re-enter the information. The process of adding information is shown in Figure 3-

图3-4.1 Additional information flow diagram

3.4.2Operating flow a>

User wants to enter the system, first enter the system login interface, and pass the correctuser name and password , select the login type to log in, the system will check the login information, the information is correct, and then enter the corresponding function interface, it will prompt that the information is incorrect and the login failed. The system operation process is shown in Figure 3-4.2.

图3-4.2Operation flow diagram

3.4.3Removal information flow

User selects the information to be deleted and clicks the Delete button. The system prompts whether to delete the information. Ifthe user wants to delete the information, the system will delete it. System database delete information. The deletion information flow chart is shown in Figure 3-4.3.

3-4.3 删删开应语程图

4System Overview

After the system analysis, we begin to memorize system design. System design includes overall design and detailed design. The overall design is just a general design. After the overall design, we can divide some things in the system, such as files, documents, data, etc. And through the overall design, we can roughly divide the modules and functions of the program. But it is only a preliminary classification and has no real implementation.

The overall design is just a preliminary design. Moreover, for a project, we can carry out multiple overall designs. Through comparison, including performance comparison, cost comparison, and benefit comparison, we can finally determine an optimal design plan and choose the best one. The overall design can reduce development costs and increase company benefits. From this point of view, the overall design is still very important.

The working principle diagram of the food recommendation system applet is shown in Figure 4-1:

Figure 4-1 System working principle diagram

4.1 统统结构设计

The system architecture diagram belongs to the system design stage. The system architecture diagram is only a product of this stage. The overall architecture of the system determines the model of the entire system and is the foundation of the system. The overall structural design of the food recommendation system applet is shown in Figure 4-2.

Figure 4-2 System structure diagram

4.2Number setting design

Database is the basis of computer information system. At present, the key and core part of the computer system is the database. The quality of database development has a direct impact on the quality and speed of the entire system.

4.2.1 Number setting 设计原则

The conceptual model is mainly based on the analysis of data requirements. It usually uses a conceptual data model to represent the relationship between various data, and processes and manages information for system users. At the same time, it establishes an E-R diagram to represent specific Entities, attributes, and relationships.

4.2.2 Numerical value system

4.3 Number of settings 设计原则

The applications of each database are separated from each other. When running into a certain program, it will communicate with the client through its own related protocols. Then this system will connect these data. When we choose which segment, we will briefly describe how the database is created. When you click the Finish button, the name of the data source will automatically pop up in the dialog box. Just click Next and directly enter the corresponding authentication and login password. 

The data flow of the food recommendation system applet:

图4-4  系统数据流程图

Gourmet Recommendation System Short ProcedureReal body E-R picture, as shown in 4.5.

图4.5实体E-R图

4.3.1 Quantity table design

The table information of the database is part of the design. The detailed information of each table in the database is introduced below.

Table access_token (login access duration)

serial number

name

type of data

length

Decimal places

Allow null values

primary key

default value

illustrate

1

token_id

int

10

0

N

AND

Temporary access badge ID

2

token

varchar

64

0

AND

N

temporary access badge

3

info

text

65535

0

AND

N

4

maxage

int

10

0

N

N

2

Maximum lifespan: Default 2 hours

5

create_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

Creation time:

6

update_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

Update time:

7

user_id

int

10

0

N

N

0

user ID:

Table agriculture_products (agricultural products)

serial number

name

type of data

length

Decimal places

Allow null values

primary key

default value

illustrate

1

agriculture_products_id

int

10

0

N

AND

Agricultural product ID

2

product_name

varchar

64

0

AND

N

product name

3

product_cover

varchar

255

0

AND

N

product cover

4

classification_of_agricultural_products

varchar

64

0

AND

N

Agricultural products classification

5

price_range

varchar

64

0

AND

N

price range

6

product_description

text

65535

0

AND

N

Product Description

7

ordinary_users

int

10

0

AND

N

0

general user

8

regulator

int

10

0

AND

N

0

Regulators

9

hits

int

10

0

N

N

0

Clicks

10

examine_state

varchar

16

0

N

N

Not reviewed

Approval Status

11

recommend

int

10

0

N

N

0

Intelligent Recommendation

12

create_time

datetime

19

0

N

N

CURRENT_TIMESTAMP

creation time

13

update_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

Update time

Table article (article: article for content management system)

serial number

name

type of data

length

Decimal places

Allow null values

primary key

default value

illustrate

1

article_id

mediumint

8

0

N

AND

Article id: [0,8388607]

2

title

varchar

125

0

N

AND

Title: [0,125] is used in the title tag of articles and html

3

type

varchar

64

0

N

N

0

Article classification: [0,1000] is used to search for articles of the specified type

4

hits

int

10

0

N

N

0

Number of clicks: [0,1000000000] Number of people who visited this article

5

praise_len

int

10

0

N

N

0

Number of likes

6

create_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

Creation time:

7

update_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

Update time:

8

source

varchar

255

0

AND

N

Source: [0,255] Source of article

9

url

varchar

255

0

AND

N

Source address: [0,255] used to jump to the website where the article was published

10

tag

varchar

255

0

AND

N

Tag: [0,255] is used to mark the relevant content of the article. Multiple tags are separated by spaces.

11

content

longtext

2147483647

0

AND

N

Text: the main content of the article

12

img

varchar

255

0

AND

N

cover picture

13

description

text

65535

0

AND

N

Article description

Table article_type (article classification)

serial number

name

type of data

length

Decimal places

Allow null values

primary key

default value

illustrate

1

type_id

smallint

5

0

N

AND

Category ID: [0,10000]

2

display

smallint

5

0

N

N

100

Display order: [0,1000] determines the order in which categories are displayed.

3

name

varchar

16

0

N

N

Category name: [2,16]

4

father_id

smallint

5

0

N

N

0

Parent category ID: [0,32767]

5

description

varchar

255

0

AND

N

Description: [0,255] describes the role of this classification

6

icon

text

65535

0

AND

N

Category icon:

7

url

varchar

255

0

AND

N

External link address: [0,255] If this category jumps to other websites, set it on the URL

8

create_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

Creation time:

9

update_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

Update time:

Table auth (user rights management)

serial number

name

type of data

length

Decimal places

Allow null values

primary key

default value

illustrate

1

auth_id

int

10

0

N

AND

Authorization ID:

2

user_group

varchar

64

0

AND

N

user group:

3

mod_name

varchar

64

0

AND

N

Module name:

4

table_name

varchar

64

0

AND

N

Table Name:

5

page_title

varchar

255

0

AND

N

page title:

6

path

varchar

255

0

AND

N

Routing path:

7

position

varchar

32

0

AND

N

Location:

8

mode

varchar

32

0

N

N

_blank

Jump method:

9

add

tinyint

3

0

N

N

1

Is it possible to add:

10

of the

tinyint

3

0

N

N

1

Can it be deleted:

11

set

tinyint

3

0

N

N

1

Whether it can be modified:

12

get

tinyint

3

0

N

N

1

Is it possible to view:

13

field_add

text

65535

0

AND

N

Add fields:

14

field_set

text

65535

0

AND

N

Modify fields:

15

field_get

text

65535

0

AND

N

Query fields:

16

table_nav_name

varchar

500

0

AND

N

Cross-table navigation name:

17

table_nav

varchar

500

0

AND

N

Cross-table navigation:

18

option

text

65535

0

AND

N

Configuration:

19

create_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

Creation time:

20

update_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

Update time:

Table classification_of_agricultural_products (Agricultural Products Classification)

serial number

name

type of data

length

Decimal places

Allow null values

primary key

default value

illustrate

1

classification_of_agricultural_products_id

int

10

0

N

AND

Agricultural product classification ID

2

classification_of_agricultural_products

varchar

64

0

AND

N

Agricultural products classification

3

recommend

int

10

0

N

N

0

Intelligent Recommendation

4

create_time

datetime

19

0

N

N

CURRENT_TIMESTAMP

creation time

5

update_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

Update time

table collect (collection)

serial number

name

type of data

length

Decimal places

Allow null values

primary key

default value

illustrate

1

collect_id

int

10

0

N

AND

Collection ID:

2

user_id

int

10

0

N

N

0

Collector ID:

3

source_table

varchar

255

0

AND

N

Source table:

4

source_field

varchar

255

0

AND

N

Source field:

5

source_id

int

10

0

N

N

0

Source ID:

6

title

varchar

255

0

AND

N

title:

7

img

varchar

255

0

AND

N

Cover:

8

create_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

Creation time:

9

update_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

Update time:

Table comment (comment)

serial number

name

type of data

length

Decimal places

Allow null values

primary key

default value

illustrate

1

comment_id

int

10

0

N

AND

Comment ID:

2

user_id

int

10

0

N

N

0

Commenter ID:

3

reply_to_id

int

10

0

N

N

0

Reply comment ID: empty is 0

4

content

longtext

2147483647

0

AND

N

content:

5

nickname

varchar

255

0

AND

N

Nick name:

6

avatar

varchar

255

0

AND

N

Avatar address: [0,255]

7

create_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

Creation time:

8

update_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

Update time:

9

source_table

varchar

255

0

AND

N

Source table:

10

source_field

varchar

255

0

AND

N

Source field:

11

source_id

int

10

0

N

N

0

Source ID:

Table food_information (food information)

serial number

name

type of data

length

Decimal places

Allow null values

primary key

default value

illustrate

1

food_information_id

int

10

0

N

AND

Food information ID

2

food_name

varchar

64

0

AND

N

Food name

3

food_type

varchar

64

0

AND

N

Type of cuisine

4

cover

varchar

255

0

AND

N

cover

5

food_unit_price

int

10

0

AND

N

0

Food unit price

6

food_specifications

varchar

64

0

AND

N

Gourmet specifications

7

regulator

int

10

0

AND

N

0

Regulators

8

merchant_users

int

10

0

AND

N

0

Business users

9

merchant_name

varchar

64

0

AND

N

the shop's name

10

merchant_mobile_phone

varchar

64

0

AND

N

Merchant mobile phone

11

merchant_address

varchar

64

0

AND

N

Business address

12

food_details

longtext

2147483647

0

AND

N

Food details

13

hits

int

10

0

N

N

0

Clicks

14

examine_state

varchar

16

0

N

N

Not reviewed

Approval Status

15

recommend

int

10

0

N

N

0

Intelligent Recommendation

16

create_time

datetime

19

0

N

N

CURRENT_TIMESTAMP

creation time

17

update_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

Update time

Table food_type (food type)

serial number

name

type of data

length

Decimal places

Allow null values

primary key

default value

illustrate

1

food_type_id

int

10

0

N

AND

Food type ID

2

food_type

varchar

64

0

AND

N

Type of cuisine

3

recommend

int

10

0

N

N

0

Intelligent Recommendation

4

create_time

datetime

19

0

N

N

CURRENT_TIMESTAMP

creation time

5

update_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

Update time

Table hits (user clicks)

serial number

name

type of data

length

Decimal places

Allow null values

primary key

default value

illustrate

1

hits_id

int

10

0

N

AND

Like ID:

2

user_id

int

10

0

N

N

0

Liked by:

3

create_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

Creation time:

4

update_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

Update time:

5

source_table

varchar

255

0

AND

N

Source table:

6

source_field

varchar

255

0

AND

N

Source field:

7

source_id

int

10

0

N

N

0

Source ID:

Table merchant_users (merchant users)

serial number

name

type of data

length

Decimal places

Allow null values

primary key

default value

illustrate

1

merchant_users_id

int

10

0

N

AND

Merchant User ID

2

merchant_name

varchar

64

0

AND

N

the shop's name

3

merchant_address

varchar

64

0

AND

N

Business address

4

merchant_mobile_phone

varchar

16

0

AND

N

Merchant mobile phone

5

examine_state

varchar

16

0

N

N

Not reviewed

Approval Status

6

recommend

int

10

0

N

N

0

Intelligent Recommendation

7

user_id

int

10

0

N

N

0

User ID

8

create_time

datetime

19

0

N

N

CURRENT_TIMESTAMP

creation time

9

update_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

Update time

Notice (announcement)

serial number

name

type of data

length

Decimal places

Allow null values

primary key

default value

illustrate

1

notice_id

mediumint

8

0

N

AND

Announcement id:

2

title

varchar

125

0

N

N

title:

3

content

longtext

2147483647

0

AND

N

text:

4

create_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

Creation time:

5

update_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

Update time:

Table order_information (order information)

serial number

name

type of data

length

Decimal places

Allow null values

primary key

default value

illustrate

1

order_information_id

int

10

0

N

AND

Order information ID

2

order_number

varchar

64

0

AND

N

order number

3

food_name

varchar

64

0

AND

N

Food name

4

food_type

varchar

64

0

AND

N

Type of cuisine

5

cover

varchar

255

0

AND

N

cover

6

food_unit_price

int

10

0

AND

N

0

Food unit price

7

food_specifications

varchar

64

0

AND

N

Gourmet specifications

8

regulator

int

10

0

AND

N

0

Regulators

9

merchant_users

int

10

0

AND

N

0

Business users

10

merchant_name

varchar

64

0

AND

N

the shop's name

11

merchant_mobile_phone

varchar

64

0

AND

N

Merchant mobile phone

12

order_date

date

10

0

AND

N

Order date

13

merchant_address

varchar

64

0

AND

N

Business address

14

ordinary_users

int

10

0

AND

N

0

general user

15

purchase_quantity

int

10

0

AND

N

0

Purchase quantity

16

payment_amount

varchar

64

0

AND

N

Payment amount

17

examine_state

varchar

16

0

N

N

Not reviewed

Approval Status

18

examine_reply

varchar

16

0

AND

N

moderation reply

19

pay_state

varchar

16

0

N

N

unpaid

Payment status

20

pay_type

varchar

16

0

AND

N

Payment type: WeChat, Alipay, online banking

21

recommend

int

10

0

N

N

0

Intelligent Recommendation

22

create_time

datetime

19

0

N

N

CURRENT_TIMESTAMP

creation time

23

update_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

Update time

Table ordinary_users (ordinary users)

serial number

name

type of data

length

Decimal places

Allow null values

primary key

default value

illustrate

1

ordinary_users_id

int

10

0

N

AND

Common user ID

2

user_name

varchar

64

0

AND

N

username

3

gender

varchar

64

0

AND

N

gender

4

examine_state

varchar

16

0

N

N

passed

Approval Status

5

recommend

int

10

0

N

N

0

Intelligent Recommendation

6

user_id

int

10

0

N

N

0

User ID

7

create_time

datetime

19

0

N

N

CURRENT_TIMESTAMP

creation time

8

update_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

Update time

Express praise (like)

serial number

name

type of data

length

Decimal places

Allow null values

primary key

default value

illustrate

1

praise_id

int

10

0

N

AND

Like ID:

2

user_id

int

10

0

N

N

0

Liked by:

3

create_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

Creation time:

4

update_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

Update time:

5

source_table

varchar

255

0

AND

N

Source table:

6

source_field

varchar

255

0

AND

N

Source field:

7

source_id

int

10

0

N

N

0

Source ID:

8

status

bit

1

0

N

N

1

Like status: 1 is like, 0 is canceled

Table regulator (regulator)

serial number

name

type of data

length

Decimal places

Allow null values

primary key

default value

illustrate

1

regulator_id

int

10

0

N

AND

Supervisor ID

2

name_of_supervisor

varchar

64

0

AND

N

Supervisor name

3

examine_state

varchar

16

0

N

N

passed

Approval Status

4

recommend

int

10

0

N

N

0

Intelligent Recommendation

5

user_id

int

10

0

N

N

0

User ID

6

create_time

datetime

19

0

N

N

CURRENT_TIMESTAMP

creation time

7

update_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

Update time

Table slides (carousel)

serial number

name

type of data

length

Decimal places

Allow null values

primary key

default value

illustrate

1

slides_id

int

10

0

N

AND

Carousel image ID:

2

title

varchar

64

0

AND

N

title:

3

content

varchar

255

0

AND

N

content:

4

url

varchar

255

0

AND

N

Link:

5

img

varchar

255

0

AND

N

Carousel image:

6

hits

int

10

0

N

N

0

Number of clicks:

7

create_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

Creation time:

8

update_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

Update time:

Table upload (file upload)

serial number

name

type of data

length

Decimal places

Allow null values

primary key

default value

illustrate

1

upload_id

int

10

0

N

AND

Upload ID

2

name

varchar

64

0

AND

N

file name

3

path

varchar

255

0

AND

N

access path

4

file

varchar

255

0

AND

N

file path

5

display

varchar

255

0

AND

N

display order

6

father_id

int

10

0

AND

N

0

Parent ID

7

you

varchar

255

0

AND

N

folder

8

type

varchar

32

0

AND

N

file type

Table user (user account: used to save user login information)

serial number

name

type of data

length

Decimal places

Allow null values

primary key

default value

illustrate

1

user_id

mediumint

8

0

N

AND

User ID: [0,8388607] User obtains other user-related data

2

state

smallint

5

0

N

N

1

Account status: [0,10](1 available | 2 abnormal | 3 frozen | 4 logged out)

3

user_group

varchar

32

0

AND

N

User group: [0,32767] determines user identity and permissions

4

login_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

Last Login Time:

5

phone

varchar

11

0

AND

N

Mobile phone number: [0,11] User’s mobile phone number, used to retrieve password or log in

6

phone_state

smallint

5

0

N

N

0

Mobile phone certification: [0,1] (0 not certified | 1 under review | 2 certified)

7

username

varchar

16

0

N

N

Username: [0,16] The account name used by the user to log in

8

nickname

varchar

16

0

AND

N

Nickname: [0,16]

9

password

varchar

64

0

N

N

Password: [0,32] The password required for user login, consisting of 6-16 digits or English

10

email

varchar

64

0

AND

N

Email: [0,64] User's email, used to retrieve password or log in

11

email_state

smallint

5

0

N

N

0

Email certification: [0,1] (0 not certified | 1 under review | 2 certified)

12

avatar

varchar

255

0

AND

N

Avatar address: [0,255]

13

create_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

Creation time:

Table user_group (user group: used for user front-end identity and authentication)

serial number

name

type of data

length

Decimal places

Allow null values

primary key

default value

illustrate

1

group_id

mediumint

8

0

N

AND

User group ID: [0,8388607]

2

display

smallint

5

0

N

N

100

Display order: [0,1000]

3

name

varchar

16

0

N

N

Name: [0,16]

4

description

varchar

255

0

AND

N

Description: [0,255] Describes the characteristics or scope of permissions of this user group

5

source_table

varchar

255

0

AND

N

Source table:

6

source_field

varchar

255

0

AND

N

Source field:

7

source_id

int

10

0

N

N

0

Source ID:

8

register

smallint

5

0

AND

N

0

Registration location:

9

create_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

Creation time:

10

update_time

timestamp

19

0

N

N

CURRENT_TIMESTAMP

Update time:

5 system interface implementation

5.1Management staffFunction model

The administrator enters a personal account and password to log in to the system. At this time, the system's database will search for relevant information. If the account and password we enter are incorrect, the database will prompt an error message and prompt the administrator. Re-enter your account number and password until the account and password are successfully entered, and a successful login message will be prompted. The administrator login rendering is shown in Figure 5.1:

Figure 5.1 Login interface

The login code is as follows:

/**

     * Log in

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

        }

}

管理员可以查看后台服务端后台首页、轮播图、公告信息管理、系统用户(管理员、普通用户、监管者、商家)资源管理(新闻列表、新闻分类列表)模块管理(美食信息、订单信息、农产品、美食类型、农产品分类)个人信息等操作。管理员服务端效果图如图5.2所示。

图5.2管理员服务端界面图

管理员功能页代码如下:

   @RequestMapping("/get_obj")

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

        Query select = service.select(service.readQuery(request), service.readConfig(request));

        List resultList = select.getResultList();

        if (resultList.size() > 0) {

            JSONObject jsonObject = new JSONObject();

            jsonObject.put("obj",resultList.get(0));

            return success(jsonObject);

        } else {

            return success(null);

        }

}

 public Query select(Map<String,String> query,Map<String,String> config){

        StringBuffer sql = new StringBuffer("select ");

        sql.append(config.get(FindConfig.FIELD) == null || "".equals(config.get(FindConfig.FIELD)) ? "*" : config.get(FindConfig.FIELD)).append(" ");

        sql.append("from ").append("`").append(table).append("`").append(toWhereSql(query, "0".equals(config.get(FindConfig.LIKE))));

        if (config.get(FindConfig.GROUP_BY) != null && !"".equals(config.get(FindConfig.GROUP_BY))){

            sql.append("group by ").append(config.get(FindConfig.GROUP_BY)).append(" ");

        }

        if (config.get(FindConfig.ORDER_BY) != null && !"".equals(config.get(FindConfig.ORDER_BY))){

            sql.append("order by ").append(config.get(FindConfig.ORDER_BY)).append(" ");

        }

        if (config.get(FindConfig.PAGE) != null && !"".equals(config.get(FindConfig.PAGE))){

            int page = config.get(FindConfig.PAGE) != null && !"".equals(config.get(FindConfig.PAGE)) ? Integer.parseInt(config.get(FindConfig.PAGE)) : 1;

            int limit = config.get(FindConfig.SIZE) != null && !"".equals(config.get(FindConfig.SIZE)) ? Integer.parseInt(config.get(FindConfig.SIZE)) : 10;

            sql.append(" limit ").append( (page-1)*limit ).append(" , ").append(limit);

        }

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

        return runEntitySql(sql.toString());

    }

系统用户信息管理

管理员对用户信息管理进行审核等操作,并可进行进行删除、修改、查看等操作。用户信息管理效果图如图5.3所示。

图5.3用户信息管理界面图

系统用户管理代码如下:

   @RequestMapping("/get_list")

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

        Map<String, Object> map = service.selectToPage(service.readQuery(request), service.readConfig(request));

        return success(map);

}

管理

管理员点击“资源管理”这一菜单的时候,会出现新闻列表+新闻分类列表这两个子菜单,能够对这两个模块进行增删改查等操作;资源管理界面如图5.4所示。

图5.4资源管理界面图

资源管理代码如下:

 @PostMapping("/upload")

    public Map<String, Object> upload(@RequestParam("file") MultipartFile file) {

        log.info("进入方法");

        if (file.isEmpty()) {

            return error(30000, "没有选择文件");

        }

        try {

            //判断有没路径,没有则创建

            String filePath = System.getProperty("user.dir") + "\\target\\classes\\static\\upload\\";

            File targetDir = new File(filePath);

            if (!targetDir.exists() && !targetDir.isDirectory()) {

                if (targetDir.mkdirs()) {

                    log.info("创建目录成功");

                } else {

                    log.error("创建目录失败");

                }

            }

            String fileName = file.getOriginalFilename();

            File dest = new File(filePath + fileName);

            log.info("文件路径:{}", dest.getPath());

            log.info("文件名:{}", dest.getName());

            file.transferTo(dest);

            JSONObject jsonObject = new JSONObject();

            jsonObject.put("url", "/api/upload/" + fileName);

            return success(jsonObject);

        } catch (IOException e) {

            log.info("上传失败:{}", e.getMessage());

        }

        return error(30000, "上传失败");

}

模块管

管理员点击“模块管理”这一菜单会显示美食信息+订单信息+农产品+美食类型+农品分类这五个子菜单,管理员可以对这五个模块进行管理操作,模块管理效果图如图5.5所示。

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

    }

5.2用户客户端功能模块

用户注册

用户注册在登陆页面填写账号、密码、邮箱、昵称、用户姓名等信息,进行注册如图5.7所示

图5.7用户注册界面图

注册代码如下:

/**

     * 注册

     * @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;

}

基本信息

在基本信息页面用户可以进行修改、查看、编辑基本信息、等操作如图5.8所示。

图5.8基本信息界面图

  前台首页

用户对查看首页详情页面,如图5.9所示。

图5.9前台首页功能界面图

  新闻资讯列表

新闻资讯详情页面可查看标题、点赞数、封面图、分类、标签、描述详细信息可对喜欢的文章进行点赞、收藏、发表评论等操作,如图5.10所示。

5.10新闻资讯界面图

农产品列表

农产品列表可通过搜索产品名称查看产品名称、产品封面图片、农产品分类、价格范围、产品描述、普通用户、监管者等详细信息,可进行收藏、发表评论或添加农产品等操作,如图5.11所示。

图5.11农产品列表界面图

图5.12添加农产品界面图

美食信息页面

美食信息列表可通过搜索美食名称、商家名称或美食类型查看美食单价、美食规格、监管者、商家用户、商家名称、商家手机、商家地址、美食详情、美食图片等详细信息,可进行收藏、下单购买评论等操作,如图5.13所示。

图5.13美食信息详情界面图

图5.14下单购买界面图

订单信息页面

订单信息页面可查看自己的订单详情等信息,可进行支付、查询等操作如图5.15所示。

图5.15订单信息界面图

5.3商家家功能模块

商家注册在登陆页面填写账号、密码、邮箱、昵称、用户姓名等信息,进行注册如图5.16所示

图5.16商家注册界面图

商家可以查看后台服务端后台首页、模块管理(美食信息、订单信息)等操作。商家服务端效果图如图5.17所示。

图5.17商家功能界面图

5.4监管者功能模块

监管者在登陆页面填写账号、密码、滑动图片验证等信息进行登录如图5.18所示

图5.18监管者登录界面图

监管者可以查看后台服务端后台首页、模块管理(美食信息、订单信息、农产品)等操作。监管者服务端效果图如图5.19所示。

图5.19监管者功能界面图

6系统测试

系统开发的最后一个步骤就是系统测试,系统测试也是整个系统十分重要的一个环节,测试的好坏关系到产品的发展。客户对软件的质量、性能和可靠性等需求就要通过测试来实现。测试过程要必须遵循严谨性、完善性、规范性的原则,测试的主要目的就是看看在系统运行中,是否会出现bug,然后对出现的bug进行调试,直到程序完美运行。但是软件的测试只能尽可能的减少bug,理论上来说是无法达到消除bug。但是bug越少,系统出错的几率就越低,用户使用起来也更方便、更安全。

近年来,软件包含测试从现在的检验当中来看,系统接近预期目标可能出现的问题,并对这些错误做出相应的修正,假如我们不进行早期的测试错误就会延续下去,最后所做出的成品就会有很大的困难。

我们要在这个测试的过程当中找出错误。测试成软件开发的主要一部分,自从有了程序的设计那天开始,它就成为了重要的组成部分。经过统计来看,软件测试可以占据这个系统45%的工作量,而在软件开发的成本当中,对于测试成本来说它包含了很多的测试工作。每个程序测试时都会出现和遇到错误。在整个程序的开发过程当中,人为去查找错误是非常复杂和困难的,所以我们一般都会找一些测试的工具来进行测试

6.1系统测试的意义

随着现代信息的快速发展,在社会各大领域中已经都开始应用网络信息技术,在应用网络技术的同时人们也开始把软件的质量问题作为了一个重要焦点来关注,因为一个软件的好与坏它决定着这个系统在市场上的生存,所以我们必须要把软件质量来做好,这样才有一定的生存能力。对于用户来说它们首先选用的都是保证这个系统软件的质量问题,因为一个系统的软件质量决定着用户在后期上成本经济的问题。图6-1就是纠错测试流程。

图6-1 测试与纠错信息流程

6.2 测试方法

具体测试方法包括:黑盒测试和白盒测试。

黑盒测试又被人们称作为功能测试,通常是在程序的接口来做一些测试的方法,它一般包括对程序的功能和使用的方法来做出一些数据的接受和输出,同时还可以做出正确的输出信息,并保证与外部信息的完整性。

白盒测试通常被人们称作为结构测试,在整个程序的结构和处理当中它是由程序当中的逻辑测试和检验程序来完成一些正确的工作。

具体的功能测试它是包括:系统的适用性、准确性、安全性等功能测试。

6.3测试分析

本美食推荐系统小程序满足相关信息的管理需求,在设计时借鉴了国内外优秀网站的优点,从界面到系统设计都保证了管理员以及用户能够方便操作。系统的主要特点和优点归纳如下:

(1)本系统用的移置性和针对性都比较高,因为针对性高可以提供更好的服务而移置性可以在多个系统上运行,更给用户带来了极大的方便。

(2)该美食推荐系统小程序内容全面,管理方便可以及时的全面的处理各种错误,异常,这样避免了很多因用户的马虎操作而出现的失误,其操作方便,用户界面友好,能够上网的人都可以很好的进行操作。

经过对上述的测试结果分析,所有基本功能齐全,操作简单,系统运行性能良好,系统安全可靠,能促进美食推荐系统小程序的发展,发展前景广阔。

结    论

本系统通过对微信小程序、java和Mysql数据库的简介,从硬件和软件两反面说明了美食推荐系统小程序的可行性,本文结论及研究成果如下:实现了微信小程序、java与Mysql相结合构建的美食推荐系统小程序,网站可以响应式展示。通过本次美食推荐系统小程序的研究与实现,我感到学海无涯,学习是没有终点的,而且实践出真知,只有多动手才能尽快掌握它,经验对系统的开发非常重要,经验不足,就难免会有许多考虑不周之处。比如要有美观的界面,更完善的功能,才能吸引更多的用户。

由于在此之前对于Java知识没有深入了解,所以从一开始就碰到许多困难,例如一开始的页面显示不规范、数据库连接有问题已经无法实现参数的传递等等,不过通过在网上寻找有关资料以及同学的帮助下最后都得到了解决,在此过程中,我不仅学到了很多知识,也提高了自己解决问题的能力,尤其是学会如何从大量的信息中筛选出所需有用的信息,同时我更加深刻的体会到了,虽然书本上的大部分知识都是有价值,正确的,但实际上每个人编程的思路和对数据处理的方法、思想都是不同的,这就要求我们一定要通过实践才能找到解决问题的方案。在此次毕业设计活动中,我不断的提高了自己,也得到了宝贵的经验,我相信这些对我以后的发展都会有很大帮助。

通过这次美食推荐系统小程序的开发,我参考了很多相关系统的例子,取长补短,吸取了其他系统的长处,逐步对该系统进行了完善,但是该系统还是有很多的不足之处,有待以后进一步学习。

实践证明,美食推荐系统小程序有着非常好的发展前景,经过测试运行,系统各项功能都十分完善,界面漂亮,使用方便,操作容易,在技术理论上已经成熟。

致    谢

大学的学习生活在这个季节将结束,但是在我的生命这仅仅只是一个逗号,我将面对另一个的开始。通过这次毕业设计的整个开发过程,从需求分析到具体功能实现,再到最终测试和维护的理解有了很大的进步,让我对系统开发有了更深刻的认识,对我个人的实践能力和解决问题的能力,都有了很大的帮助。这是这次毕业设计最大的收获。

首先要感谢我的指导老师,他在论文写作上,给予了我各种无私的帮助,治学严谨,严格要求,使我获得了很大的收获。老师深厚的理论知识和丰富的实践经验,都深深的影响到我,在这方面,我谨表示衷心的感谢。

Secondly, I would also like to express my gratitude to all the teachers and classmates. They actively provided a lot of help during my study process, whether it was professional knowledge or practical skills, which also enabled me to encounter difficulties in writing my thesis. Some of the problems encountered were easily solved.

Finally, I would like to express my heartfelt thanks to all the teachers who read and reviewed this paper!

references 

[1] Guan Hongqing, Xu Liang, Wang Wei, Zhang Yuanjie, Zhang Daqian, Yin Guangying, Sun Haoyun. Food personalized recommendation method and system based on autoencoders [P]. Shandong Province: CN115221402A, 2022-10-21.

[2] Li Le. Research on Java language application[J]. Smart China, 2022(09):80-81.

[3] Song Yang. Knowledge discussion on using Java language to develop Web application software [J]. China Equipment Engineering, 2022(14):121-123.

[4] He Bin. Research on the application of JAVA language in computer software development [J]. China Equipment Engineering, 2022(11):247-249.

[5] Yang Ying. Analysis of Java language exception handling mechanism [J]. Electronic Technology, 2022, 51(03): 42-43.

[6] Deng Hanxi, Chen Zhihua. Food recommendation system based on online reviews [J]. China Media Technology, 2022(03):39-41.DOI:10.19483/j.cnki.11-4653/n.2022.03.011 .

[7] Cao Songpeng, Wang Pengyu. A brief analysis of the application of Java language in software development [J]. Information Recording Materials, 2022, 23(03):114-116.DOI:10.16009/j.cnki.cn13-1295/tq. 2022.03.009.

[8] Fu Jinjing. Research on accurate recommendation strategies for personalized recommendation systems [D]. Nanjing University of Posts and Telecommunications, 2021. DOI: 10.27251/d.cnki.gnjdc.2021.000563.

[9] Yu Jia, Wu Danxin. Web rapid development framework based on SpringBoot [J]. Computer Programming Skills and Maintenance, 2021(09):31-33.DOI:10.16184/j.cnki.comprg.2021.09.013.

[10] Li Chao. Research on personalized food recommendation method based on knowledge graph [D]. South China University of Technology, 2021. DOI: 10.27151/d.cnki.ghnlu.2021.002653.

[11]Fuyuan Cheng. Talent Recruitment Management System for Small and Micro Enterprises Based on Springboot Framework[J]. Advances in Educational Technology and Psychology,2021,5(2).

[12]Kokoy Siti Komariah,Bong Kee Shin. Nutrition-Based Food Recommendation System for Prediabetic Person[J]. Korean Society of Information Scientists and Engineers Academic Presentation Papers, 2020.

[13] Li Jing. Food recommendation system based on WeChat applet [D]. Lanzhou University, 2020.DOI:10.27204/d.cnki.glzhu.2020.003430.

[14]Mansi Goel,Ayush Agarwal,Deepak Thukral,Tanmoy Chakraborty 0002. Fiducia: A Personalized Food Recommender System for Zomato.[J]. CoRR, 2019, abs/1903.10117.

[15] Song Dandan. Design and implementation of food ordering recommendation system based on WeChat applet [J]. Information and Communications, 2017(12):89-90.

[16] Fan Shunzhong. Research and application of personalized food recommendation algorithm based on user interest perception [D]. Hunan University, 2017.

[17] Li Chao. Research and implementation of information recommendation system based on user personality data [D]. Hunan Normal University, 2017.

[18] Xiong Congcong, Deng Ying, Shi Yancui, Tao Xin, Chen Yarui. Food recommendation algorithm based on collaborative filtering [J]. Computer Application Research, 2017, 34(07): 1985-1988.

[19] Wang Cong, Liu Qihua, Cao Yu. Research on mobile food recommendation system integrating context [J]. Computer Knowledge and Technology, 2015, 11(11): 255-260.DOI: 10.14004/j.cnki.ckt.2015.0691 .

[20] Sun Wenxin. Research and design of socialized food recommendation system [D]. Dalian Maritime University, 2013.

To receive the project source code for free, please follow and like + private message

Guess you like

Origin blog.csdn.net/VXbishe/article/details/134645940