Introduction:
With the continuous development of information technology, we have now entered the information age, and the representative of the information age is the increasingly mature network technology, and now the network has been closely linked with our life, we can not imagine our life without the network like how, Maybe it’s like food without seasoning. Life would be boring without the Internet. We can through the network housebound do many things, such as books, work, entertainment, study, shopping, making friends, shopping and so on many of our number of things, and it is because the network of our life become colorful, maybe sometimes help us save a lot of time and give us more opportunities. That’s what the Bookmart website does for us. The book website mall is mainly some enterprises in order not to lose for some reason did not go to the store to buy goods in the book goods guests and design a convenient shopping system through the Internet, the birth of the book mall website for businesses to provide a lot of opportunities. Another reason is that online shopping is very useful to people’s life and work pressure, so now the demand for online shopping is constantly improving, but a large part of people still do not have time to buy their favorite books and goods, so the book mall website arises at the right moment. After the birth of the book mall website, users can view a large number of varieties of furniture information through the Internet in their spare time, so as to easily buy their favorite books and so on, on the other hand, is to improve the sales of the book business. In general, the book mall website not only meets the needs of many people, but also does not affect the work or waste the rest of the time. It is a very meaningful system
Full Address:2022Java graduation project: Books shopping mall system (Java + Springboot + VUE implementation)- winter vacation quickly roll up
Function screenshots:
User login: can be divided into administrators and ordinary users for login, also can be registered here.
Input relevant user information for user registration.
Front end user homepage: after logging in, users can view the newly listed books and news books, click into the details to view the purchase of books, add to the shopping cart, and collect books interested in their own operations and view and modify personal information.
Administrator home: book mall system administrator login after the main function modules: user personal information management, modify the password, book classification management, book commodity details management, home page round broadcast map management, news information management, book list management, order information management and delivery information management.
Book Classification management:
News information Management:
Add and modify:
Book list management: Administrators can add, modify, delete and query book list information
Book Details:
Order management: Administrators can view order information, modify order status, and delivery status.
Delivery information management:
Front end Book Details page:
Book details page: view book details, add to shopping cart and favorites, and view user comments
Fill in shopping cart information, etc.
My Personal focus:
Tool language:
Development tools: IDEA 2021.3, Navicat for mysql, Postman.
Development language: Java, JDk1.8, mysql5, Node.js 14.
Hardware environment: Windows 10 operating system, Google Browser, etc.
Main technologies: Springboot, Mybatis – Plus, Vue, Element UI, mysql, etc
Key code:
package com.controller;
/** * Login related */
@RequestMapping("users")
@RestController
public class UserController{
@Autowired
private UserService userService;
@Autowired
private TokenService tokenService;
/** * login */
@IgnoreAuth
@PostMapping(value = "/login")
public R login(String username, String password, String captcha, HttpServletRequest request) {
UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
if(user==null| |! user.getPassword().equals(password)) {return R.error("Incorrect account number or password");
}
String token = tokenService.generateToken(user.getId(),username, "users", user.getRole());
return R.ok().put("token", token);
}
/** * Register */
@IgnoreAuth
@PostMapping(value = "/register")
public R register(@RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);
if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) ! =null) {
return R.error("User already exists");
}
userService.insert(user);
return R.ok();
}
/** * exit */
@GetMapping(value = "logout")
public R logout(HttpServletRequest request) {
request.getSession().invalidate();
return R.ok("Exit successful");
}
/**
* 密码重置
*/
@IgnoreAuth
@RequestMapping(value = "/resetPass")
public R resetPass(String username, HttpServletRequest request){
UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
if(user==null) {
return R.error("Account does not exist");
}
user.setPassword("123456");
userService.update(user,null);
return R.ok("Password reset to 123456");
}
/** * list */
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,UserEntity user){
EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();
PageUtils page = userService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));
return R.ok().put("data", page);
}
/** * list */
@RequestMapping("/list")
public R list( UserEntity user){
EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();
ew.allEq(MPUtil.allEQMapPre( user, "user"));
return R.ok().put("data", userService.selectListView(ew));
}
/** * info */
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") String id){
UserEntity user = userService.selectById(id);
return R.ok().put("data", user);
}
/** * Get user session user information */
@RequestMapping("/session")
public R getCurrUser(HttpServletRequest request){
Long id = (Long)request.getSession().getAttribute("userId");
UserEntity user = userService.selectById(id);
return R.ok().put("data", user);
}
/** * save */
@PostMapping("/save")
public R save(@RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);
if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) ! =null) {
return R.error("User already exists");
}
userService.insert(user);
return R.ok();
}
/** * modify */
@RequestMapping("/update")
public R update(@RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);
userService.updateById(user);// All updates
return R.ok();
}
/** * delete */
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
userService.deleteBatchIds(Arrays.asList(ids));
returnR.ok(); }}Copy the code
Interception configuration:
package com.config;
@Configuration
public class InterceptorConfig extends WebMvcConfigurationSupport{
@Bean
public AuthorizationInterceptor getAuthorizationInterceptor(a) {
return new AuthorizationInterceptor();
}
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(getAuthorizationInterceptor()).addPathPatterns("/ * *").excludePathPatterns("/static/**");
registry.addInterceptor(getAuthorizationInterceptor()).addPathPatterns("/ * *").excludePathPatterns("/upload/**");
// registry.addInterceptor(getAuthorizationInterceptor()).addPathPatterns("/**").excludePathPatterns("/virtuel/**");
super.addInterceptors(registry);
}
/ * * * 2.0 configuration springboot WebMvcConfigurationSupport, leads to the default configuration is covered, static resource needs to be rewritten to allow access to * / addResourceHandlers method
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/ * *")
.addResourceLocations("classpath:/resources/")
.addResourceLocations("classpath:/static/")
.addResourceLocations("classpath:/upload/")
.addResourceLocations("classpath:/admin/")
.addResourceLocations("classpath:/front/")
.addResourceLocations("classpath:/public/");
registry.addResourceHandler("/upload/**").addResourceLocations("file:D:/work/");
super.addResourceHandlers(registry); }}Copy the code
Global YML configuration
# Tomcat server: tomcat: uri-encoding: UTF-8 port: 8080 servlet: context-path: /springbootUCW7v spring: datasource: . DriverClassName: com. Mysql. JDBC Driver url: JDBC: mysql: / / 127.0.0.1:3306 / springbootUCW7v? useUnicode=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UT C username: root password: 123456 servlet: multipart: max-file-size: 10MB max-request-size: 10MB resources: static-locations: classpath:/testStatic/,classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/ #mybatis mybatis: mapper-locations: classpath*: *.xml #mybatis mybatis: mapper-locations: classpath*: *.xml Com. entity global-config: # primary key type 0:" database ID increment ", 1:" user input ID",2:" global unique ID (number type unique ID)", 3:" global unique ID UUID"; Id-type: 1 # field strategy 0:" ignore judgment ",1:" non-null judgment "),2:" non-null judgment "field-strategy: 2 # column-underline transform db-column-underline: True # refresh mapper refresh mapper: true # refresh mapper refresh logic-delete-value: -1 logic-not-delete-value: 0 # custom SQL injector SQL - injector: com. Baomidou. Mybatisplus. Mapper. LogicSqlInjector configuration: map-underscore-to-camel-case: true cache-enabled: false call-setters-on-nulls: True #springboot mybatis plus set jdbcTypeForNull jdbctype.null jdbc-type-for-null: The virtual path 'null' # files virtuel: filePath: C: / Users/Administrator/Desktop/lyy /Copy the code
Database design:
** database name: **springboot-book
** Issue: **V1.0.0
** Book mall system database table design description
Table config (Configuration file)
Serial number | The name of the | The data type | The length of the | Decimal places | Allows null values | A primary key | instructions |
---|---|---|---|---|---|---|---|
1 | id | bigint | 20 | 0 | N | Y | |
2 | name | varchar | 100 | 0 | N | N | Configuration Parameter Name |
3 | value | varchar | 100 | 0 | Y | N | Setting Parameter Values |
Table DINGdanxinxi (Order information)
Serial number | The name of the | The data type | The length of the | Decimal places | Allows null values | A primary key | instructions |
---|---|---|---|---|---|---|---|
1 | id | bigint | 20 | 0 | N | Y | |
2 | addtime | timestamp | 19 | 0 | N | N | |
3 | dingdanbianhao | varchar | 200 | 0 | Y | N | The order no. |
4 | shujimingcheng | varchar | 200 | 0 | Y | N | The name of the books |
5 | fenlei | varchar | 200 | 0 | Y | N | classification |
6 | fengmian | varchar | 200 | 0 | Y | N | The cover |
7 | jiage | varchar | 200 | 0 | Y | N | The price |
8 | shuliang | int | 10 | 0 | Y | N | The number of |
9 | zongjiage | varchar | 200 | 0 | Y | N | The total price |
10 | xiadanriqi | date | 10 | 0 | Y | N | Date of order |
11 | beizhu | varchar | 200 | 0 | Y | N | note |
12 | yonghuming | varchar | 200 | 0 | Y | N | The user name |
13 | shouji | varchar | 200 | 0 | Y | N | Mobile phone |
14 | dizhi | varchar | 200 | 0 | Y | N | address |
15 | ispay | varchar | 200 | 0 | Y | N | Whether or not to pay |
Table Discussshuji (Book Comment Table)
Serial number | The name of the | The data type | The length of the | Decimal places | Allows null values | A primary key | instructions |
---|---|---|---|---|---|---|---|
1 | id | bigint | 20 | 0 | N | Y | |
2 | addtime | timestamp | 19 | 0 | N | N | |
3 | refid | bigint | 20 | 0 | N | N | Associative table id |
4 | content | varchar | 200 | 0 | N | N | Comment on the content |
5 | userid | bigint | 20 | 0 | N | N | The user id |
Table FAHUOXinXI (Shipping information)
Serial number | The name of the | The data type | The length of the | Decimal places | Allows null values | A primary key | instructions |
---|---|---|---|---|---|---|---|
1 | id | bigint | 20 | 0 | N | Y | |
2 | addtime | timestamp | 19 | 0 | N | N | |
3 | dingdanbianhao | varchar | 200 | 0 | Y | N | The order no. |
4 | shujimingcheng | varchar | 200 | 0 | Y | N | The name of the books |
5 | fengmian | varchar | 200 | 0 | Y | N | The cover |
6 | shuliang | varchar | 200 | 0 | Y | N | The number of |
7 | fahuoriqi | date | 10 | 0 | Y | N | The delivery date |
8 | yonghuming | varchar | 200 | 0 | Y | N | The user name |
9 | shouji | varchar | 200 | 0 | Y | N | Mobile phone |
10 | dizhi | varchar | 200 | 0 | Y | N | address |
11 | dingdanzhuangtai | varchar | 200 | 0 | N | N | The order status |
Table news
Serial number | The name of the | The data type | The length of the | Decimal places | Allows null values | A primary key | The default value | instructions |
---|---|---|---|---|---|---|---|---|
1 | id | bigint | 20 | 0 | N | Y | ||
2 | addtime | timestamp | 19 | 0 | N | N | CURRENT_TIMESTAMP | |
3 | title | varchar | 200 | 0 | N | N | The title | |
4 | picture | varchar | 200 | 0 | N | N | The picture | |
5 | content | longtext | 2147483647 | 0 | N | N | content |
Table Shuji (Book)
Serial number | The name of the | The data type | The length of the | Decimal places | Allows null values | A primary key |
---|---|---|---|---|---|---|
1 | id | bigint | 20 | 0 | N | Y |
2 | addtime | timestamp | 19 | 0 | N | N |
3 | shujibianhao | varchar | 200 | 0 | Y | N |
4 | shujimingcheng | varchar | 200 | 0 | N | N |
5 | fenlei | varchar | 200 | 0 | N | N |
6 | fengmian | varchar | 200 | 0 | Y | N |
7 | zuozhe | varchar | 200 | 0 | Y | N |
8 | chubanshe | varchar | 200 | 0 | Y | N |
9 | jiage | int | 10 | 0 | Y | N |
10 | shuliang | int | 10 | 0 | Y | N |
11 | shujijieshao | longtext | 2147483647 | 0 | Y | N |
12 | clicktime | datetime | 19 | 0 | Y | N |
13 | clicknum | int | 10 | 0 | Y | N |
Table Shujifenlei (Book Classification)
Serial number | The name of the | The data type | The length of the | Decimal places | Allows null values | A primary key | instructions |
---|---|---|---|---|---|---|---|
1 | id | bigint | 20 | 0 | N | Y | |
2 | addtime | timestamp | 19 | 0 | N | N | |
3 | fenlei | varchar | 200 | 0 | N | N | classification |
Table storeup
Serial number | The name of the | The data type | The length of the | Decimal places | Allows null values | A primary key | instructions |
---|---|---|---|---|---|---|---|
1 | id | bigint | 20 | 0 | N | Y | |
2 | addtime | timestamp | 19 | 0 | N | N | |
3 | userid | bigint | 20 | 0 | N | N | The user id |
4 | refid | bigint | 20 | 0 | Y | N | The collection id |
5 | tablename | varchar | 200 | 0 | Y | N | The name of the table |
6 | name | varchar | 200 | 0 | N | N | The name of the collection |
7 | picture | varchar | 200 | 0 | N | N | Collect pictures |
Table Token (Token table)
Serial number | The name of the | The data type | The length of the | Decimal places | Allows null values | A primary key | instructions |
---|---|---|---|---|---|---|---|
1 | id | bigint | 20 | 0 | N | Y | |
2 | userid | bigint | 20 | 0 | N | N | The user id |
3 | username | varchar | 100 | 0 | N | N | The user name |
4 | tablename | varchar | 100 | 0 | Y | N | The name of the table |
5 | role | varchar | 100 | 0 | Y | N | role |
6 | token | varchar | 200 | 0 | N | N | password |
7 | addtime | timestamp | 19 | 0 | N | N | The new time |
8 | expiratedtime | timestamp | 19 | 0 | N | N | Expiration time |
Table users
Serial number | The name of the | The data type | The length of the | Decimal places | Allows null values | A primary key | instructions |
---|---|---|---|---|---|---|---|
1 | id | bigint | 20 | 0 | N | Y | |
2 | username | varchar | 100 | 0 | N | N | The user name |
3 | password | varchar | 100 | 0 | N | N | password |
4 | role | varchar | 100 | 0 | Y | N | role |
5 | addtime | timestamp | 19 | 0 | N | N | The new time |
Table YONGhu (user)
Serial number | The name of the | The data type | The length of the | Decimal places | Allows null values | A primary key | instructions |
---|---|---|---|---|---|---|---|
1 | id | bigint | 20 | 0 | N | Y | |
2 | addtime | timestamp | 19 | 0 | N | N | |
3 | yonghuming | varchar | 200 | 0 | N | N | The user name |
4 | mima | varchar | 200 | 0 | N | N | password |
5 | xingming | varchar | 200 | 0 | N | N | The name |
6 | xingbie | varchar | 200 | 0 | Y | N | gender |
7 | touxiang | varchar | 200 | 0 | Y | N | Head portrait |
8 | shouji | varchar | 200 | 0 | Y | N | Mobile phone |
9 | dizhi | varchar | 200 | 0 | Y | N | address |
Project Summary:
Through the recent Java object-oriented programming, front-end knowledge and Java framework grasp and learning, as well as this period of time the book product website system development, let me more understand the importance of Java learning. During the development of this system, I have completed many experiments and functional tests of the education system. During the system development study at this stage, I have realized that I am familiar with Java, and then I can use related technologies independently. Through the understanding and learning of Java related technologies, I found that it does have many advantages. For example, Java integrates abstractness and encapsulation as well as inheritance and polymorphism, realizing the functions of code reuse and code expansion and improving the speed and efficiency of overall software development. It is very important for our computer major to learn Java language well, so IN the process of developing this teaching management system project, I tried my best to understand Java programming ideas, master basic skills, common methods and the ability to solve mistakes, and learn as much knowledge as possible. The main purpose of my study of programming is to improve my key skills and techniques in programming solutions to practical problems. Java object-oriented programming is a practical relatively very strong language, springMVC framework MVC three-tier architecture pattern, and the framework encountered in the design pattern of data access and logic operations are concentrated in the components to enhance the system’s reuse and expansibility. The expansibility of the system is greatly enhanced. As well as front-end jQuery, JS, JSP, CSS style master let me to the layout of the web page, style adjustment, font and so on to achieve more accurate web effect.
Source code:
Everyone likes, favorites, attention, comments, interested and I exchange
Clocked articles updated 136/365 days