Electronic product recommendation system based on springboot+vue

Collect and follow to avoid getting lost, end of source code article

Article directory

  • 1. Project introduction
  • 2. Development environment
  • 3. Function introduction
  • 4. Core code
  • 5. Effect drawing
  • 6. Article Table of Contents

1. Project introduction

The electronic product recommendation system based on Vue is developed based on the actual situation and combined with the current preferences of young people and the e-commerce environment. The electronic product recommendation system based on vue is developed using Java language and Vue in terms of language. MySQL database is used in database storage, and the development tool is IDEA.
The electronic product recommendation system based on Vue is divided into two parts: the front desk and the back desk. The front desk part is mainly used for users to purchase and view products, and the back desk part is mainly used for administrators to publish product-related information and manage orders. The front-end part includes user registration and login, viewing product-related information, viewing announcement information, viewing hot-selling products, viewing premium products, adding products to the shopping cart, settling orders, viewing and managing their own order information; the back-end functions mainly include the system Home page, personal center, user management, hot-selling product management, premium product management, latest shelf management, product type management, system management, order management and other functions. These functions can basically meet the needs of users to view and purchase goods online.

Keywords: electronic products; recommendation; shopping; Spring Boot framework; MySQL

2. Development environment

Development language: Java
Framework: springboot
JDK version: JDK1.8
Server: tomcat7
Database: mysql
Database tool: Navicat11
Development software: eclipse/myeclipse/idea
Maven package: Maven
—————-

3. Function introduction

The electronic product recommendation system based on Vue is divided into two parts: the front desk and the back desk. The front desk part is mainly used for users to purchase and view products, and the back desk part is mainly used for administrators to publish product-related information and manage orders. The front-end part includes user registration and login, viewing product-related information, viewing announcement information, viewing hot-selling products, viewing premium products, adding products to the shopping cart, settling orders, viewing and managing their own order information; the back-end functions mainly include the system Home page, personal center, user management, hot-selling product management, premium product management, latest shelf management, product type management, system management, order management and other functions. These functions can basically meet the needs of users to view and purchase goods online. The specific functions are shown in the figure below

Figure 4-2 System functional structure diagram

4. Core code

Part of the code:

package com.example.controller;

import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.SecureUtil;
import com.example.common.Result;
import com.example.common.ResultCode;
import com.example.entity.Caiwu;
import com.example.exception.CustomException;
import com.example.service.CaiwuService;
import com.example.utils.MapWrapperUtils;
import com.example.utils.jwt.JwtUtil;
import com.example.vo.CaiwuVo;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping(value = "/caiwu")
public class CaiwuController {<!-- -->

    @Resource
    private CaiwuService caiwuService;

    @PostMapping
    public Result<Caiwu> add(@RequestBody CaiwuVo caiwu) {<!-- -->
        caiwuService.add(caiwu);
           return Result.success(caiwu);
    }
\t
\t

    @PostMapping("/deleteList")
    public Result<Caiwu> deleteList(@RequestBody CaiwuVo caiwu) {<!-- -->
        caiwuService.deleteList(caiwu.getList());
        return Result.success();
    }

    @DeleteMapping("/{id}")
    public Result delete(@PathVariable Long id) {<!-- -->
        caiwuService.delete(id);
        return Result.success();
    }

    @PutMapping
    public Result update(@RequestBody CaiwuVo caiwu) {<!-- -->
        caiwuService.update(caiwu);
        return Result.success();
    }

    @GetMapping("/{id}")
    public Result<Caiwu> detail(@PathVariable Integer id) {<!-- -->
        Caiwu caiwu = caiwuService.findById(id);
        return Result.success(caiwu);
    }

    @GetMapping
    public Result<List<Caiwu>> all() {<!-- -->
        return Result.success(caiwuService.list());
    }

    @PostMapping("/page")
    public Result<CaiwuVo> page(@RequestBody CaiwuVo caiwuVo) {<!-- -->
        return Result.success(caiwuService.findPage(caiwuVo));
    }
@PostMapping("/login")
    public Result login(@RequestBody Caiwu caiwu, HttpServletRequest request) {<!-- -->
        if (StrUtil.isBlank(caiwu.getZhanghao()) || StrUtil.isBlank(caiwu.getMima())) {<!-- -->
            throw new CustomException(ResultCode.PARAM_LOST_ERROR);
        }
        Caiwu login = caiwuService.login(caiwu);
// if(!login.getStatus()){<!-- -->
// return Result.error("1001","Status restriction, unable to log in to the system");
// }
        if(login != null) {<!-- -->
            HashMap hashMap = new HashMap();
            hashMap.put("user", login);
            Map<String, Object> map = MapWrapperUtils.builder(MapWrapperUtils.KEY_USER_ID,caiwu.getId());
            String token = JwtUtil.creatToken(map);
            hashMap.put("token", token);
            return Result.success(hashMap);
        }else {<!-- -->
            return Result.error();
        }
    }
    @PutMapping("/updatePassword")
    public Result updatePassword(@RequestBody Caiwu info, HttpServletRequest request) {<!-- -->
        Caiwu caiwu = caiwuService.findById(info.getId());
        String oldPassword = SecureUtil.md5(info.getMima());
        if (!oldPassword.equals(caiwu.getMima())) {<!-- -->
            return Result.error(ResultCode.PARAM_PASSWORD_ERROR.code, ResultCode.PARAM_PASSWORD_ERROR.msg);
        }
        info.setMima(SecureUtil.md5(info.getNewPassword()));
        Caiwu caiwu1 = new Caiwu();
        BeanUtils.copyProperties(info, caiwu1);
        caiwuService.update(caiwu1);
        return Result.success();
    }
}

5. Renderings

Please add a picture description

Please add a picture description
Please add image description
Please add an image description
Please add a picture description
Please add a picture description

6. Article directory

Table of contents
Chapter 1 Introduction 1
1.1 Background and significance 1
1.2 Overview of research at home and abroad 2
1.3 Contents of the study 2
Chapter 2 Research on Key Technologies 3
2.1 Related technologies 3
2.2 Java technology 3
2.3 ECLIPSE development environment 4
2.4 Introduction to Tomcat 4
2.5 Spring Boot Framework 5
Chapter 3 System Analysis 5
3.1 System design goals 6
3.2 System feasibility analysis 6
3.3 System function analysis and description 7
3.4 System UML use case analysis 8
3.4.1 Administrator use case 9
3.4.2 User use cases 9
3.5 System process analysis 10
3.5.1 Add information process 11
3.5.2 Operation process 12
3.5.3 Deletion of information process 13
Chapter 4 System Design 14
4.1 System Architecture 15
4.2 Database design principles 16
4.3 Data sheet 17
Chapter 5 System Implementation 18
5.1 User function module 18
5.2 Administrator function module 19
5.3 User function module 19
5.4 Front page function module 19
Chapter 6 System Test 20
6.1 Test definition and purpose 21
6.2 Performance Test 22
6.3 Test module 23
6.4 Test results 24
Summary 25
Acknowledgments 27