Java-based dessert mall system [with source code]

Java-based dessert shopping mall system

 Development language: Java
 Database: MySQL
 Technology: Spring+SpringMVC+MyBatis
 Tools: IDEA/Ecilpse, Navicat, Maven

 The system mainly has ordinary users and administrators, and its main functions include dessert information management, user information management, shopping cart, order, new product module, hot sales module, etc.

insert image description here
insert image description here

insert image description here

insert image description here
insert image description here


  The dessert mall management system is widely used in Jingdong, Taobao and other large e-commerce platforms. Therefore, the dessert mall management system has become an indispensable item in the development . When designing and implementing the dessert mall management system, factors such as economy, technology and operational practicability were considered, and the system was developed with IDEA as the development tool, MySQL as the database connection, and Java as the programming language. This system has the advantages of low development cost, smooth operation, simple operation and high safety performance. It mainly discusses from the aspects of system analysis and design, database design and system detailed design. The system analysis and design part mainly discusses the system function analysis and system design ideas. The database design mainly discusses the database design. The detailed design part of the system mainly discusses the detailed design process of several main modules.

System advantages
  and practicability: The shopping mall shopping system aims at the shopping needs of consumers, takes the convenience of users of the system as the principle, and adds some advanced design concepts at the same time. According to the different needs of consumers, a shopping platform with simple operation interface, complete module functions and easy management is made, which can fully meet the needs of consumers and facilitate the management of the website.

  Reliability: A good website must have high reliability. By combining advanced structural design and data security, the system can ensure that the system has high reliability and fault tolerance, so that the system will not appear unnecessary The error message hinders the management of the site.

  Intelligence: The design of this system requires that it is convenient for the website administrator to manage the website. Users can enter different book browsing pages through different module entrances according to their own needs. Through the editing and updating of the background book list, consumers can see The latest book information, and convenient to provide services for more users.

  Scalability and flexibility: The module design of the system is mainly aimed at facilitating website business expansion and user needs, requiring consumers to browse books conveniently and quickly search for the books they want to buy based on their own needs.

development background

  With the rapid development of society, the impact of computers is comprehensive and in-depth. With the continuous improvement of people's living standards, users' requirements for online cake malls in daily life are also constantly improving. Online cake malls are favored by the majority of users, making the development of online cake malls a necessary and urgent matter. The online cake mall mainly uses computers to manage the information required by the online cake mall, so that users can buy their favorite cakes without going out, which greatly saves time. Increase the choice of users, but also facilitate the timely query and modification of user information and the timely understanding of user information. The online cake mall brings more convenience to users, and the system meets the needs of users by cooperating with database management system software. The application of computer technology in modern management makes computer an important tool for people to apply modern technology. It can effectively solve the problem of convenient and comprehensive access to information and improve efficiency.

B/S architecture

  The B/S system can be used through a computer that can access the Internet. Its biggest advantage is that it does not need to install special software. First, the browser sends a request to the server, and then the server processes the request and returns the information to the browser. There is no need to access and calculate the data again, as long as it is responsible for displaying the data to reduce the requirements. If the client is like a "thin man", the server will become more and more "fat". Compared with the C/S architecture, the biggest difference between the B/S architecture and the C/S architecture is: the application software of the B/S system uses a web browser as a platform for interacting with users, while the C/S needs to develop a dedicated application program.

the code

 
/**
 * 登录相关
 */
@RequestMapping("users")
@RestController
public class UserController{
    
    
	
	@Autowired
	private UserService userService;
	
	@Autowired
	private TokenService tokenService;
 
	/**
	 * 登录
	 */
	@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("账号或密码不正确");
		}
		String token = tokenService.generateToken(user.getId(),username, "users", user.getRole());
		return R.ok().put("token", token);
	}
	
	/**
	 * 注册
	 */
	@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("用户已存在");
    	}
        userService.insert(user);
        return R.ok();
    }
	/**
	 * 退出
	 */
	@GetMapping(value = "logout")
	public R logout(HttpServletRequest request) {
    
    
		request.getSession().invalidate();
		return R.ok("退出成功");
	}

		/**
     * 密码重置
     */
    @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("账号不存在");
    	}
    	user.setPassword("123456");
        userService.update(user,null);
        return R.ok("密码已重置为:123456");
    }
		/**
     * 列表
     */
    @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);
    }
 
	    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") String id){
    
    
        UserEntity user = userService.selectById(id);
        return R.ok().put("data", user);
    }
    
    /**
     * 获取用户的session用户信息
     */
    @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);
    }
    /**
     * 保存
     */
    @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("用户已存在");
    	}
        userService.insert(user);
        return R.ok();
    }
 
    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody UserEntity user){
    
    
//        ValidatorUtils.validateEntity(user);
    	UserEntity u = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername()));
    	if(u!=null && u.getId()!=user.getId() && u.getUsername().equals(user.getUsername())) {
    
    
    		return R.error("用户名已存在。");
    	}
        userService.updateById(user);//全部更新
        return R.ok();
    }
 
    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
    
    
        userService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }
}

Summarize

  After more than four months of graduation project, Tangduoduo Cake Dessert Mall System was finally completed. The function of the website has barely reached the result of the original idea, and the simplest requirement has been fulfilled. Although the system interface looks a bit much, they are all simple function pages, and the user operations are easy to use and complete. I feel that designing a website alone for the first time is a process of learning from scratch, during which I also consolidated the book knowledge I have learned. On the interface, I used my own skilled software to design the picture of the homepage. The color adopts a uniform color tone to make the whole look more tidy. The background uses three lively bright colors, and the CSS is simple to unify the background and font color.

Guess you like

Origin blog.csdn.net/2301_78335941/article/details/130997262