末尾获取源码
开发语言:Java
Java开发工具:JDK1.8
后端框架:SSM
前端:采用JSP技术开发
数据库:MySQL5.7和Navicat管理工具结合
服务器:Tomcat8.5
开发软件:IDEA / Eclipse
是否Maven项目:是
目录
随着科学技术的飞速发展,各行各业都在努力与现代先进技术接轨,通过科技手段提高自身的优势,商品交易当然也不能排除在外,随着商品交易管理的不断成熟,它彻底改变了过去传统的经营管理方式,不仅使商品交易管理难度变低了,还提升了商品交易管理的灵活性。这种个性化的网上商品交易特别注重交互协调经营与管理的相互配合,激发了管理人员的创造性与主动性,对商品交易的管理而言非常有利。
星空游戏购买下载平台的设计主要是对系统所要实现的功能进行详细考虑,确定所要实现的功能后进行界面的设计,在这中间还要考虑如何可以更好的将功能及页面进行很好的结合,方便用户可以很容易明了的找到自己所需要的信息,还有系统平台后期的可操作性,通过对信息内容的详细了解进行技术的开发。
本设计的基本思想就是采用SSM框架开发星空游戏购买下载平台,以Java为开发语言,MySQL为数据库,后端使用了Spring、Spring MVC和MyBatis三个框架(简称SSM),其中用Spring MVC实现。测试结果表明,该星空游戏购买下载平台能以一种简便、轻量级的方式实现了管理的基本功能,降低了开发的复杂性,提高了系统的可维护性,具有一定的应用价值。
1、关于星空游戏购买下载平台的基本要求
(1)功能要求:个人中心、用户管理、游戏分类管理、游戏信息管理、订单信息管理、游戏下载管理、管理员管理、留言板管理、系统管理等功能模块。
(2)性能:在不同操作系统上均能无差错实现在不同类型的用户登入相应界面后能不出差错、方便地进行预期操作。
(3)安全与保密要求:用户都必须通过身份验证才能进入系统,并且用户的权限也需要根据用户的类型进行限定。
(4)环境要求:支持多种平台,可在Windows系列、Vista系统等多种操作系统下使用。
2、设计原则
系统架构设计应反映用户与整个系统接口模块之间的有效交互,以确保系统中实时数据的可扩展性和安全性。只有系统设计才能实现这一目标。可以扩展功能模块以适应系统的未来发展。
在系统的所有功能模块中,必须要保证系统的数据安全性、易用性、柔软性和扩展性,下面分别对四个性能进行详细分析。
(1)数据的安全性
对于用户进行网上购物管理所牵扯到的数据信息,必须保证系统数据的安全性,因此在系统设计过程中必须要有多方面的考虑到系统的安全问题并进行解决处理。
(2)易用性
对于易用性主要是对于系统实现完成交付给用户,用户是否可以不用培训就能够进行系统管理操作,也就是常说的傻瓜操作,一定简单明了,任何人都可以上手对数据信息进行操作管理。
(3)柔软性
对于任何一个系统的实现都会涉及的服务种类繁多,所以在设计时一定确保系统可以随时更改并且可以随时处理。
(4)扩展性
互联网的不断发展,对于系统实现的所有的功能随着用户需求的不断提高,功能模块也将要不断扩展。
由于这是一个星空游戏购买下载平台,系统的设计是为了更好地节省人员成本和各种成本,因此需要考虑系统开发成本和效益。
用户进入星空游戏购买下载平台平台可以查看首页、游戏信息、留言反馈、我的、后台等操作

用户通过登录界面,进行在线填写用户名和密码,信息输入完成后选择提交,用户登录完成,如果用户没有自己的账号,需要在线注册成为网站会员,用户进入到注册界面,进行填写用户的基本信息内容,信息编辑完成后选择提交
用户通过游戏信息列表可以查看网站已有的游戏信息类别,用户根据需求可以进行在线选择分类进行查看游戏信息,通过游戏信息列表查看界面展示的游戏信息,用户根据自己的需求可以点击商品图片进入到游戏详情界面,通过详情界面获取到游戏名称、开发商、价格、游戏简介、上市日期等信息,根据需求在线评价操作,也可结合需求进行在线购买等操作
用户通过购买页面可以进行查看订单编号、游戏分类、开发商、价格、购买日期、用户名、用户姓名、联系方式等信息,进行提交订单操作
留言反馈:通过列表可以进行在线输入留言内容进行在线提交留言反馈信息。
个人中心:通过页面可以进行获取个人中心、我的收藏等功能模块,进行相对应操作。个人中心:通过页面可以进行在线更新个人信息,进行在线更新操作
用户通过后台进行查看个人中心、订单信息管理、游戏下载管理、我的收藏管理、留言板管理等功能模块,进行相对应操作。
订单信息管理,用户根据自己的订单信息,可以进行查看订单编号、游戏分类、游戏名称、开发商、价格、购买日期、用户名、用户姓名、联系方式、是否支付等,进行在线查看订单或在线支付操作,并通过输入订单编号进行查询
游戏下载管理,通过列表可以获取订单编号、游戏分类、游戏名称、开发商、游戏软件、用户名、用户姓名等信息,进行在线查看并在线下载操作,并通过输入订单编号进行查询
留言板管理,通过列表可以获取留言人ID、用户名、留言内容、回复内容等信息,进行在线查看或删除操作,并通过输入用户名进行查询操作
管理员通过登录窗口进行输入自己的账号信息进行在线登录,登录完成后可以对系统的个人中心、用户管理、游戏分类管理、游戏信息管理、订单信息管理、游戏下载管理、管理员管理、留言板管理、系统管理等功能模块进行在线编辑或者删除等操作。
订单信息管理,管理员根据需求可以在线查看系统查看订单编号、游戏分类、游戏名称、开发商、价格、购买日期、用户名、用户姓名、联系方式、是否支付等信息,并结合需求可以对订单信息进行在线发送、查看订单、修改或删除等操作

游戏下载管理,管理员通过列表可以进行在线查看订单编号、游戏分类、游戏名称、开发商、游戏软件、用户名、用户姓名等信息,进行在线查看、在线下载、修改、删除操作
用户管理:通过列表可以获取用户名、用户姓名、头像、性别、联系方式、邮箱等信息,进行在线查看、添加、修改或删除操作,并通过输入用户名、用户姓名进行查询、批量删除操作
游戏分类管理:通过列表可以获取游戏分类等信息,进行在线查看、添加、修改或删除操作,并通过输入游戏分类进行查询、批量删除操作
游戏信息管理:通过列表可以获取游戏名称、游戏分类、图片、开发商、价格、游戏简介、上市日期等信息,进行在线查看、修改添加或删除操作,并通过输入游戏名称进行查询
管理员管理:通过列表可以获取用户名、密码、角色等信息,进行在线查看、添加、修改或删除操作,并通过输入用户名进行查询
留言板管理,通过列表可以获取留言人、用户名、留言内容、回复内容等信息,进行在线查看、回复、修改或删除操作
-
- package com.controller;
-
-
- import java.util.Arrays;
- import java.util.Calendar;
- import java.util.Date;
- import java.util.Map;
-
- import javax.servlet.http.HttpServletRequest;
-
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Controller;
- import org.springframework.web.bind.annotation.GetMapping;
- import org.springframework.web.bind.annotation.PathVariable;
- import org.springframework.web.bind.annotation.PostMapping;
- import org.springframework.web.bind.annotation.RequestBody;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RequestParam;
- import org.springframework.web.bind.annotation.ResponseBody;
- import org.springframework.web.bind.annotation.RestController;
-
- import com.annotation.IgnoreAuth;
- import com.baomidou.mybatisplus.mapper.EntityWrapper;
- import com.entity.TokenEntity;
- import com.entity.UserEntity;
- import com.service.TokenService;
- import com.service.UserService;
- import com.utils.CommonUtil;
- import com.utils.MD5Util;
- import com.utils.MPUtil;
- import com.utils.PageUtils;
- import com.utils.R;
- import com.utils.ValidatorUtils;
-
- /**
- * 登录相关
- */
- @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
().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
().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
().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
params,UserEntity user) { - EntityWrapper
ew = new EntityWrapper(); - PageUtils page = userService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));
- return R.ok().put("data", page);
- }
-
- /**
- * 列表
- */
- @RequestMapping("/list")
- public R list( UserEntity user){
- EntityWrapper
ew = new EntityWrapper(); - ew.allEq(MPUtil.allEQMapPre( user, "user"));
- return R.ok().put("data", userService.selectListView(ew));
- }
-
- /**
- * 信息
- */
- @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
().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);
- userService.updateById(user);//全部更新
- return R.ok();
- }
-
- /**
- * 删除
- */
- @RequestMapping("/delete")
- public R delete(@RequestBody Long[] ids){
- userService.deleteBatchIds(Arrays.asList(ids));
- return R.ok();
- }
- }
- package com.controller;
-
- import java.io.File;
- import java.io.FileNotFoundException;
- import java.io.IOException;
- import java.util.Arrays;
- import java.util.Date;
- import java.util.HashMap;
- import java.util.List;
- import java.util.Map;
- import java.util.Random;
- import java.util.UUID;
-
- import org.apache.commons.io.FileUtils;
- import org.apache.commons.lang3.StringUtils;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.http.HttpHeaders;
- import org.springframework.http.HttpStatus;
- import org.springframework.http.MediaType;
- import org.springframework.http.ResponseEntity;
- import org.springframework.util.ResourceUtils;
- import org.springframework.web.bind.annotation.PathVariable;
- import org.springframework.web.bind.annotation.RequestBody;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RequestParam;
- import org.springframework.web.bind.annotation.RestController;
- import org.springframework.web.multipart.MultipartFile;
-
- import com.annotation.IgnoreAuth;
- import com.baomidou.mybatisplus.mapper.EntityWrapper;
- import com.entity.ConfigEntity;
- import com.entity.EIException;
- import com.service.ConfigService;
- import com.utils.R;
-
- /**
- * 上传文件映射表
- */
- @RestController
- @RequestMapping("file")
- @SuppressWarnings({"unchecked","rawtypes"})
- public class FileController{
- @Autowired
- private ConfigService configService;
- /**
- * 上传文件
- */
- @RequestMapping("/upload")
- public R upload(@RequestParam("file") MultipartFile file,String type) throws Exception {
- if (file.isEmpty()) {
- throw new EIException("上传文件不能为空");
- }
- String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1);
- File path = new File(ResourceUtils.getURL("classpath:static").getPath());
- if(!path.exists()) {
- path = new File("");
- }
- File upload = new File(path.getAbsolutePath(),"/upload/");
- if(!upload.exists()) {
- upload.mkdirs();
- }
- String fileName = new Date().getTime()+"."+fileExt;
- File dest = new File(upload.getAbsolutePath()+"/"+fileName);
- file.transferTo(dest);
- FileUtils.copyFile(dest, new File("C:\\Users\\Desktop\\jiadian\\springbootl7own\\src\\main\\resources\\static\\upload"+"/"+fileName));
- if(StringUtils.isNotBlank(type) && type.equals("1")) {
- ConfigEntity configEntity = configService.selectOne(new EntityWrapper
().eq("name", "faceFile")); - if(configEntity==null) {
- configEntity = new ConfigEntity();
- configEntity.setName("faceFile");
- configEntity.setValue(fileName);
- } else {
- configEntity.setValue(fileName);
- }
- configService.insertOrUpdate(configEntity);
- }
- return R.ok().put("file", fileName);
- }
-
- /**
- * 下载文件
- */
- @IgnoreAuth
- @RequestMapping("/download")
- public ResponseEntity<byte[]> download(@RequestParam String fileName) {
- try {
- File path = new File(ResourceUtils.getURL("classpath:static").getPath());
- if(!path.exists()) {
- path = new File("");
- }
- File upload = new File(path.getAbsolutePath(),"/upload/");
- if(!upload.exists()) {
- upload.mkdirs();
- }
- File file = new File(upload.getAbsolutePath()+"/"+fileName);
- if(file.exists()){
- /*if(!fileService.canRead(file, SessionManager.getSessionUser())){
- getResponse().sendError(403);
- }*/
- HttpHeaders headers = new HttpHeaders();
- headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
- headers.setContentDispositionFormData("attachment", fileName);
- return new ResponseEntity<byte[]>(FileUtils.readFileToByteArray(file),headers, HttpStatus.CREATED);
- }
- } catch (IOException e) {
- e.printStackTrace();
- }
- return new ResponseEntity<byte[]>(HttpStatus.INTERNAL_SERVER_ERROR);
- }
-
- }
- package com.utils;
-
- import java.util.HashMap;
- import java.util.Map;
-
- /**
- * 返回数据
- */
- public class R extends HashMap
{ - private static final long serialVersionUID = 1L;
-
- public R() {
- put("code", 0);
- }
-
- public static R error() {
- return error(500, "未知异常,请联系管理员");
- }
-
- public static R error(String msg) {
- return error(500, msg);
- }
-
- public static R error(int code, String msg) {
- R r = new R();
- r.put("code", code);
- r.put("msg", msg);
- return r;
- }
-
- public static R ok(String msg) {
- R r = new R();
- r.put("msg", msg);
- return r;
- }
-
- public static R ok(Map
map) { - R r = new R();
- r.putAll(map);
- return r;
- }
-
- public static R ok() {
- return new R();
- }
-
- public R put(String key, Object value) {
- super.put(key, value);
- return this;
- }
- }