Design and implementation of online game trading system based on Java (source code + lw + deployment documents + explanation, etc.)

Blogger Introduction: ?300,000+ fans across the entire network, csdn guest author, blog expert, CSDN Rising Star Program mentor, high-quality creator in the Java field, Blog Star, Nuggets / Huawei Cloud / Alibaba Cloud / InfoQ and other platforms are high-quality authors, focusing on the field of Java technology and practical graduation projects?

Contact for source code at the end of the article

Recommended subscription for wonderful columns Otherwise, you won’t find it next time

The most comprehensive collection of computer software graduation project topics for 2022-2024: 1,000 popular topic recommendations?

Java project quality practical cases “100 sets”

Java WeChat Mini Program Project Practical “100 Sets”

If you are interested, you can save it first. If you have questions about graduation topics, projects, thesis writing and other related questions, you can leave me a message for consultation. I hope to help more people

?

System introduction:

Most of the traditional information management relies on manual registration and management by managers. However, with the rapid development of information technology in recent years, many old-fashioned information management models have been updated and iterated. Product management information because of its management content The complexity and large number of management means that manual processing cannot meet the needs of the majority of users, so a corresponding online game trading system has emerged.

This online game trading system has two permissions: administrator and user. The administrator can manage the user’s basic information content, manage car information and car rental information, and can communicate with users and other operations. Users can view product management. Information, you can view news and view administrator reply messages and other operations.

This online game trading system adopts the most popular B/S three-tier structure model in WEB application development. It uses a MySQL database that takes up little space but has complete functions for data storage operations. The system development technology uses JSP technology. This online game trading system can solve many problems of traditional manual operations, such as long delays in data query and cumbersome data management steps. In general, the online game trading system has stable performance, comprehensive functions, and is very cost-effective when put into operation.

When dividing the functional modules in the system, the online game trading system uses a hierarchical diagram to represent it. The hierarchical diagram has a tree structure and can use rectangular boxes to depict data information. The data structure represented by the top layer is very complete. The data represented by the rectangular box below the top layer is the subset data. Of course, the rectangular box at the bottom is the data element that cannot be subdivided. Using a hierarchical box diagram to describe the system functions allows users to understand at a glance. You can understand the functions of the system and the sub-functions under the corresponding function sections. The online game trading system is divided into two operating roles: administrator and user. Their functions will be explained below.

Administrators can manage users’ basic information and manage other functions. The administrator function structure diagram is as follows:

When the program is handed over to the user for use, the operation flow chart of the program needs to be provided, so that the user can easily understand the specific working steps of the program. Nowadays, the operation process of the program has a general standard, that is, first submit the login data through the login page, After the program is verified correctly, the user can operate the corresponding function on the program function operation area page.

?

Program operation flow chart

Function screenshot:

5.1 Implementation of administrator function module

5.1.1 Product management list

Figure 5.1 shows the product management list page. The functions provided to administrators on this page are: view product management, add product management, modify product management, delete product management, etc.

Figure 5.1 Product management list page

5.1.2 News information management

The administrator can manage the basic information of registered users at the front desk, and can set the accounts of registered users to be frozen or in use. The administrator can also select the information of many expired registered users for batch deletion. The registered user management interface is shown in Figure 5.2.

Figure 5.2 News information management page

5.1.3 News type management

The news type management page displays all news types. On this page, administrators can add new news information types and edit and update existing news type information. Invalid news type information can also be quickly deleted by administrators. The picture below is the news type management page. The news type management interface is shown in Figure 5.3.

Figure 5.3 News type management interface

Code implementation:

/**
 * Login related
 */
@RequestMapping("users")
@RestController
public class UserController{
    
    @Autowired
    private UserService userService;
    
    @Autowired
    private TokenService tokenService;

    /**
     * Log in
     */
    @IgnoreAuth
    @PostMapping(value = "/login")
    public R login(String username, String password, String role, HttpServletRequest request) {
        UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
        if(user != null){
            if(!user.getRole().equals(role)){
                return R.error("Permissions are abnormal");
            }
            if(user==null || !user.getPassword().equals(password)) {
                return R.error("The account or password is incorrect");
            }
            String token = tokenService.generateToken(user.getId(),username, "users", user.getRole());
            return R.ok().put("token", token);
        }else{
            return R.error("The account number or password or permissions are incorrect");
        }

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

    /**
     * quit
     */
    @GetMapping(value = "logout")
    public R logout(HttpServletRequest request) {
        request.getSession().invalidate();
        return R.ok("Exit successfully");
    }
    
    /**
     * reset Password
     */
    @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 has been 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);
    }

    /**
     * information
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") String id){
        UserEntity user = userService.selectById(id);
        return R.ok().put("data", user);
    }
    
    /**
     * Get the user's session user information
     */
    @RequestMapping("/session")
    public R getCurrUser(HttpServletRequest request){
        Integer id = (Integer)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();
    }

    /**
     * Revise
     */
    @RequestMapping("/update")
    public R update(@RequestBody UserEntity user){
// ValidatorUtils.validateEntity(user);
        userService.updateById(user);//Update all
        return R.ok();
    }

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

Paper reference:

Source code acquisition:

Everyone like, collect, follow, comment, viewget contact information

Recommended subscription for wonderful columns: In the column below

The most comprehensive collection of computer software graduation project topics for 2022-2024: 1,000 popular topic recommendations?

Java project quality practical cases “100 sets”

Java WeChat Mini Program Project Practice “100 Sets”

The knowledge points of the article match the official knowledge files, and you can further learn related knowledge. Java Skill TreeHomepageOverview 137860 people are learning the system