Case 089: Design and implementation of campus comprehensive service platform based on WeChat applet

Get the source code at the end of the article

Development language: Java

Framework: SSM

JDK version: JDK1.8

Database: mysql 5.7

Development software: eclipse/myeclipse/idea

Maven package: Maven3.5.4

Mini program framework: uniapp

Mini program development software: HBuilder X

Mini program running software: WeChat developer

Table of contents

Preface

System display

Seller’s WeChat function implementation

Implementation of user WeChat functions

Administrator server function implementation

Code

Login function implementation code

Registration function implementation code

Password reset function implementation code

Modify the information function implementation code

Delete information function implementation code

Save information function implementation code


Preface

With the rapid development of our country's economy, people's demand for mobile phones is increasing, and various mobile phone software are also widely used. However, for data information management on mobile phones, various software for mobile phones are also very popular among users. Campus Comprehensive services are widely used by users. In order to facilitate users to manage the data information of the campus comprehensive service applet at any time, a management system based on the campus comprehensive service applet has been developed.

The design of the campus comprehensive service applet is mainly to consider in detail the functions to be implemented by the system, and then design the interface after determining the functions to be implemented. During this process, we also need to consider how to better combine the functions and pages. , it is convenient for users to easily and clearly find the information they need, and it also provides the later operability of the system platform, and technology development is carried out through a detailed understanding of the information content.

The development of the campus comprehensive service applet uses the existing mature technology reference, uses the source code as a template, analyzes the functional adjustments and combines the actual needs of the campus comprehensive service applet, and discusses the use of the campus comprehensive service applet. 


System display

Seller’s WeChat function implementation

The seller registers and logs in. The seller enters the registration page and fills in the seller's account number, password, seller's name, gender, age, ID number, contact number, and seller's address to register. If the information is correct, enter the login page and fill in the seller's account number and password to log in.

My, sellers can view seller information, release information, order information, my collection management and other information by entering my page. 

 

Seller information, the seller enters the personal information to view the seller account, password, seller name, gender, age, ID number, contact number, photo, seller address, and can edit and save. 

 

To publish information, sellers can enter the publishing information page to edit information number, information name, type, introduction, information picture, seller account, seller name, contact number, seller address and other information 

 

Implementation of user WeChat functions

User registration and login. The user enters the registration page and fills in the personal account number, password, name, gender, age, ID number, mobile phone number, and address to register. If the information is correct, the user enters the login page and fills in the account number and password to log in. 

Home page. Users can enter the home page to view the home page, published information, mine and other information, and perform viewing operations. 

 

To publish information, the user enters the information release page to view the information number, information name, type, introduction, information picture, seller account, seller name, contact number, seller address, and can apply for purchase and other information. They can also enter the product name for search operations as needed. 

 

 

My, users can view user information, publishing information, order information, my collection management and other information by entering my page. 

 

Order information, users can view order number, information number, information name, type, introduction, information picture, seller account, seller name, contact number, seller address, purchase date, personal account, name, mobile phone number and other information by entering the order information. Sellers and administrators review and users view 

 

Personal information, the user enters the personal information page to view personal account, password, name, gender, age, ID number, mobile phone number, photo, address and other information, and submit and save the information. 

 

Administrator server function implementation

The administrator confirms through the campus comprehensive service applet. The administrator enters the main interface of the campus comprehensive service applet. The administrator enters the operation interface and fills in his user name and password online through the login window to log in. After successful login, he enters the system. Obtain corresponding information through the operation interface 

 

The administrator enters the interface and enters the system through the task hall of the interface. After successful login, he can view the homepage, personal center, user management, seller management, release information management, order information management, type management, system management and other functional modules, and carry out Corresponding operation 

 

 User management, the administrator can add, modify, delete, and query information on the user information page by viewing personal account, name, gender, age, ID number, mobile phone number, photo, address, etc. 

 

Seller management, the administrator can add, modify, delete, and query information on the seller management page by viewing the seller account, seller name, gender, age, ID number, contact number, photo, seller address, etc. 

 


Code

Login function implementation code

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

Registration function implementation code

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

Password reset function implementation code

@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");
    }

Modify the information function implementation code

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

Delete information function implementation code

@RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        userService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }

Save information function implementation code

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

Guess you like

Origin blog.csdn.net/2301_79727522/article/details/135375160