Wallpaper website based on java+ssm+vue

Project Introduction

In the Internet age, with the continuous maturity and improvement of the development of the network system, people’s lives have also undergone great changes. While people are pursuing a higher material life, they are also thinking about how to make their own spiritual connotations To be promoted, and reading is a very important way for people to obtain spiritual enjoyment. In order to meet the requirement that people can read books anytime and anywhere as long as there is an internet connection, a wallpaper website was developed and researched.

This article mainly describes the specific development process of the wallpaper website. Based on the SSM framework, Vue technology and MYSQL database are used to make the wallpaper website have good stability and security. This design focuses on the wallpaper website from the aspects of system overview, system analysis, system design, database design, system test and summary. Users can query their favorite information through this wallpaper website.

The wallpaper website not only runs stably, is fast and convenient to operate, has a simple and clear interface, but also has complete functions and strong practicability.

Development environment

Programming language: Java
Database: Mysql
System architecture: B/S
Backend framework: SSM
Compilation tools: idea or eclipse, jdk1.8, maven
Support customization: java/php/python/android/applet/vue/crawler/c#/asp.net

System implementation

5.1 User Information Management
Figure 5.1 shows the user information management page. The functions provided to administrators on this page are: query management of user information, user information can be deleted, modified, and added.
Conditions for fuzzy queries on usernames are also made

Figure 5.1 User information management page

5.2 Wallpaper information management
As shown in Figure 5.2 is the wallpaper information management page. The functions provided to the administrator on this page are: view the published wallpaper information data, modify the wallpaper information, delete the wallpaper information if it is invalid, and blur the name of the wallpaper information Query the type of wallpaper information information and other conditions.

Figure 5.2 Wallpaper information management page

5.3 Wallpaper type management
As shown in Figure 5.3 is the wallpaper type management page. The functions provided to the administrator on this page include: conditional query according to the wallpaper type, and addition, modification, and query operations on the wallpaper type.

Figure 5.3 Wallpaper type management page

5.1 Announcement information management
Figure 5.4 shows the announcement information management page. The functions provided to administrators on this page include: adding, modifying, and querying operations based on announcement information.

Figure 5.4 Announcement information management page

Core code

package com.controller;

import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.service.TokenService;
import com.utils.*;
import java.lang.reflect.InvocationTargetException;

import com.service.DictionaryService;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.*;
import com.entity.view.*;
import com.service.*;
import com.utils.PageUtils;
import com.utils.R;
import com.alibaba.fastjson.*;

/**
 * Wallpaper information
 * Backend interface
 * @author
 * @email
*/
@RestController
@Controller
@RequestMapping("/bizhi")
public class BizhiController {<!-- -->
    private static final Logger logger = LoggerFactory. getLogger(BizhiController. class);

    @Autowired
    private BizhiService bizhiService;


    @Autowired
    private TokenService tokenService;
    @Autowired
    private DictionaryService dictionaryService;

    //cascade table service

    @Autowired
    private YonghuService yonghuService;


    /**
    * backend list
    */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){<!-- -->
        logger.debug("page method:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
        String role = String.valueOf(request.getSession().getAttribute("role"));
        if(false)
            return R.error(511,"Never enter");
        else if("user".equals(role))
            params.put("yonghuId",request.getSession().getAttribute("userId"));
        params.put("bizhiDeleteStart",1);params.put("bizhiDeleteEnd",1);
        if(params.get("orderBy")==null || params.get("orderBy")==""){<!-- -->
            params.put("orderBy","id");
        }
        PageUtils page = bizhiService.queryPage(params);

        //dictionary table data conversion
        List<BizhiView> list =(List<BizhiView>)page.getList();
        for(BizhiView c:list){<!-- -->
            //Modify the corresponding dictionary table fields
            dictionaryService. dictionaryConvert(c, request);
        }
        return R.ok().put("data", page);
    }

    /**
    * Backend details
    */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id, HttpServletRequest request){<!-- -->
        logger.debug("info method:,,Controller:{},,id:{}",this.getClass().getName(),id);
        BizhiEntity bizhi = bizhiService.selectById(id);
        if(bizhi !=null){<!-- -->
            //entity to view
            BizhiView view = new BizhiView();
            BeanUtils.copyProperties( bizhi , view );//Refactor entity data into view

            //Modify the corresponding dictionary table fields
            dictionaryService. dictionaryConvert(view, request);
            return R.ok().put("data", view);
        } else {<!-- -->
            return R.error(511,"No data found");
        }

    }

    /**
    * backend storage
    */
    @RequestMapping("/save")
    public R save(@RequestBody BizhiEntity bizhi, HttpServletRequest request){<!-- -->
        logger.debug("save method:,,Controller:{},,bizhi:{}",this.getClass().getName(),bizhi.toString());

        String role = String.valueOf(request.getSession().getAttribute("role"));
        if(false)
            return R.error(511,"will never enter");

        Wrapper<BizhiEntity> queryWrapper = new EntityWrapper<BizhiEntity>()
            .eq("bizhi_name", bizhi.getBizhiName())
            .eq("bizhi_types", bizhi.getBizhiTypes())
            .eq("bizhi_dnumber", bizhi.getBizhiDnumber())
            .eq("bizhi_delete", bizhi.getBizhiDelete())
            ;

        logger.info("sql statement:" + queryWrapper.getSqlSegment());
        BizhiEntity bizhiEntity = bizhiService.selectOne(queryWrapper);
        if(bizhiEntity==null){<!-- -->
            bizhi.setBizhiDelete(1);
            bizhi.setCreateTime(new Date());
            bizhiService.insert(bizhi);
            return R.ok();
        } else {<!-- -->
            return R.error(511,"There are the same data in the table");
        }
    }

    /**
    * Backend modification
    */
    @RequestMapping("/update")
    public R update(@RequestBody BizhiEntity bizhi, HttpServletRequest request){<!-- -->
        logger.debug("update method:,,Controller:{},,bizhi:{}",this.getClass().getName(),bizhi.toString());

        String role = String.valueOf(request.getSession().getAttribute("role"));
//if(false)
// return R.error(511,"will never enter");
        / / Query whether there is the same data according to the field
        Wrapper<BizhiEntity> queryWrapper = new EntityWrapper<BizhiEntity>()
            .notIn("id",bizhi.getId())
            .andNew()
            .eq("bizhi_name", bizhi.getBizhiName())
            .eq("bizhi_types", bizhi.getBizhiTypes())
            .eq("bizhi_dnumber", bizhi.getBizhiDnumber())
            .eq("bizhi_delete", bizhi.getBizhiDelete())
            ;

        logger.info("sql statement:" + queryWrapper.getSqlSegment());
        BizhiEntity bizhiEntity = bizhiService.selectOne(queryWrapper);
        if("".equals(bizhi.getBizhiPhoto()) || "null".equals(bizhi.getBizhiPhoto())){<!-- -->
                bizhi.setBizhiPhoto(null);
        }
        if(bizhiEntity==null){<!-- -->
            bizhiService.updateById(bizhi);//Update according to id
            return R.ok();
        } else {<!-- -->
            return R.error(511,"There are the same data in the table");
        }
    }

    /**
    * delete
    */
    @RequestMapping("/delete")
    public R delete(@RequestBody Integer[] ids){<!-- -->
        logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
        ArrayList<BizhiEntity> list = new ArrayList<>();
        for(Integer id:ids){<!-- -->
            BizhiEntity bizhiEntity = new BizhiEntity();
            bizhiEntity.setId(id);
            bizhiEntity.setBizhiDelete(2);
            list.add(bizhiEntity);
        }
        if(list != null & amp; & amp; list.size() >0){<!-- -->
            bizhiService.updateBatchById(list);
        }
        return R.ok();
    }


    /**
     * Bulk upload
     */
    @RequestMapping("/batchInsert")
    public R save(String fileName, HttpServletRequest request){<!-- -->
        logger.debug("batchInsert method:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);
        Integer yonghuId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")));
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        try {<!-- -->
            List<BizhiEntity> bizhiList = new ArrayList<>();//Uploaded things
            Map<String, List<String>> seaFields= new HashMap<>();//Fields to query
            Date date = new Date();
            int lastIndexOf = fileName. lastIndexOf(".");
            if(lastIndexOf == -1){<!-- -->
                return R.error(511,"The file has no suffix");
            }else{<!-- -->
                String suffix = fileName. substring(lastIndexOf);
                if(!".xls".equals(suffix)){<!-- -->
                    return R.error(511,"Only support excel files with suffix xls");
                }else{<!-- -->
                    URL resource = this.getClass().getClassLoader().getResource("../../upload/" + fileName);//Get file path
                    File file = new File(resource. getFile());
                    if(!file.exists()){<!-- -->
                        return R.error(511,"The uploaded file cannot be found, please contact the administrator");
                    }else{<!-- -->
                        List<List<String>> dataList = PoiUtil.poiImport(file.getPath());//Read xls file
                        dataList.remove(0);//Delete the first row, because the first row is a prompt
                        for(List<String> data:dataList){<!-- -->
                            //cycle
                            BizhiEntity bizhiEntity = new BizhiEntity();
// bizhiEntity.setBizhiName(data.get(0)); //Wallpaper name to be changed
// bizhiEntity.setBizhiTypes(Integer.valueOf(data.get(0))); //Wallpaper type to be changed
// bizhiEntity.setBizhiPhoto("");//Details and pictures
// bizhiEntity.setBizhiDnumber(Integer.valueOf(data.get(0))); //Download number to be changed
// bizhiEntity.setBizhiContent("");//Details and pictures
// bizhiEntity.setBizhiDelete(1);//Tombstone delete field
// bizhiEntity.setCreateTime(date);//time
                            bizhiList.add(bizhiEntity);


                            //Put the field to be queried for repetition into the map
                        }

                        // query for duplicates
                        bizhiService.insertBatch(bizhiList);
                        return R.ok();
                    }
                }
            }
        }catch (Exception e){<!-- -->
            e.printStackTrace();
            return R.error(511,"The batch insert data is abnormal, please contact the administrator");
        }
    }





    /**
    * Frontend list
    */
    @IgnoreAuth
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params, HttpServletRequest request){<!-- -->
        logger.debug("list method:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));

        // If no sorting field is specified, the id will be reversed by default
        if(StringUtil.isEmpty(String.valueOf(params.get("orderBy")))){<!-- -->
            params.put("orderBy","id");
        }
        PageUtils page = bizhiService.queryPage(params);

        //dictionary table data conversion
        List<BizhiView> list =(List<BizhiView>)page.getList();
        for(BizhiView c:list)
            dictionaryService.dictionaryConvert(c, request); //Modify the corresponding dictionary table fields
        return R.ok().put("data", page);
    }

    /**
    * Front-end details
    */
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id, HttpServletRequest request){<!-- -->
        logger.debug("detail method:,,Controller:{},,id:{}",this.getClass().getName(),id);
        BizhiEntity bizhi = bizhiService.selectById(id);
            if(bizhi !=null){<!-- -->


                //entity to view
                BizhiView view = new BizhiView();
                BeanUtils.copyProperties( bizhi , view );//Refactor entity data into view

                //Modify the corresponding dictionary table fields
                dictionaryService. dictionaryConvert(view, request);
                return R.ok().put("data", view);
            } else {<!-- -->
                return R.error(511,"No data found");
            }
    }


    /**
    * Front-end storage
    */
    @RequestMapping("/add")
    public R add(@RequestBody BizhiEntity bizhi, HttpServletRequest request){<!-- -->
        logger.debug("add method:,,Controller:{},,bizhi:{}",this.getClass().getName(),bizhi.toString());
        Wrapper<BizhiEntity> queryWrapper = new EntityWrapper<BizhiEntity>()
            .eq("bizhi_name", bizhi.getBizhiName())
            .eq("bizhi_types", bizhi.getBizhiTypes())
            .eq("bizhi_dnumber", bizhi.getBizhiDnumber())
            .eq("bizhi_delete", bizhi.getBizhiDelete())
            ;
        logger.info("sql statement:" + queryWrapper.getSqlSegment());
        BizhiEntity bizhiEntity = bizhiService.selectOne(queryWrapper);
        if(bizhiEntity==null){<!-- -->
            bizhi.setBizhiDelete(1);
            bizhi.setCreateTime(new Date());
        bizhiService.insert(bizhi);
            return R.ok();
        } else {<!-- -->
            return R.error(511,"There are the same data in the table");
        }
    }


}

Thesis reference

Table of contents
Catalog I
Summary III
ABSTRACT IV
1 Introduction 1
1.1 Subject background 1
1.2 Research status 1
1.3 Research content 2
2 System development environment 3
2.1 vue technology 3
2.2 JAVA technology 3
2.3 MYSQL database 3
2.4 B/S structure 4
2.5 SSM framework technology 4
3 System Analysis 5
3.1 Feasibility analysis 5
3.1.1 Technical feasibility 5
3.1.2 Operational Feasibility 5
3.1.3 Economic feasibility 5
3.1.4 Legal feasibility 5
3.2 System performance analysis 5
3.3 System function analysis 6
3.3.1 Role requirements 6
3.3.2 Functional requirements 6
3.4 System flow analysis 6
3.4.1 Registration process 6
3.4.2 Login process 7
4 System Design 8
4.1 System outline design 8
4.2 System structure design 8
4.3 Database Design 9
4.3.1 Database table design 9
5 Implementation of the system 13
5.1 Realization of function modules 13
5.1 User information management 13
5.2 Wallpaper information management 14
5.3 Wallpaper type management 16
5.1 Bulletin information management 18
6 System Test 21
6.1 Test Definition 21
6.2 Test purpose 21
6.3 Test method 21
6.4 Test analysis 21
7 Conclusion 23
Thanks 24
References 25