当前位置: 首页 > news >正文

做网站需要什么文件中国工程建设信息平台

做网站需要什么文件,中国工程建设信息平台,杭州动漫设计公司最新招聘,用手机做网站的软件末尾获取源码 开发语言#xff1a;Java Java开发工具#xff1a;JDK1.8 后端框架#xff1a;SSM 前端#xff1a;采用JSP技术开发 数据库#xff1a;MySQL5.7和Navicat管理工具结合 服务器#xff1a;Tomcat8.5 开发软件#xff1a;IDEA / Eclipse 是否Maven项目#x… 末尾获取源码 开发语言Java Java开发工具JDK1.8 后端框架SSM 前端采用JSP技术开发 数据库MySQL5.7和Navicat管理工具结合 服务器Tomcat8.5 开发软件IDEA / Eclipse 是否Maven项目是 目录 一、项目简介 二、系统功能 三、系统项目截图 1管理员功能实现 商品管理 留言管理 商品类型管理 四、核心代码 登录相关 文件上传 封装 一、项目简介 信息数据从传统到当代是一直在变革当中突如其来的互联网让传统的信息管理看到了革命性的曙光因为传统信息管理从时效性还是安全性还是可操作性等各个方面来讲遇到了互联网时代才发现能补上自古以来的短板有效的提升管理的效率和业务水平。传统的管理模式时间越久管理的内容越多也需要更多的人来对数据进行整理并且数据的汇总查询方面效率也是极其的低下并且数据安全方面永远不会保证安全性能。结合数据内容管理的种种缺点在互联网时代都可以得到有效的补充。结合先进的互联网技术开发符合需求的软件让数据内容管理不管是从录入的及时性查看的及时性还是汇总分析的及时性都能让正确率达到最高管理更加的科学和便捷。本次开发的网上购物平台实现了收货地址管理、购物车管理、字典管理、留言版管理、商品管理、商品收藏管理、商品评价管理、商品订单管理、用户管理、管理员管理等功能。系统用到了关系型数据库中王者MySql作为系统的数据库有效的对数据进行安全的存储有效的备份对数据可靠性方面得到了保证。并且程序也具备程序需求的所有功能使得操作性还是安全性都大大提高让网上购物平台更能从理念走到现实确确实实的让人们提升信息处理效率。 二、系统功能 在管理员功能模块确定下来的基础上对管理员各个功能进行设计确定管理员功能的详细模块。绘制的管理员功能结构见下图。 三、系统项目截图 1管理员功能实现 商品管理 此页面让管理员管理商品的数据商品管理页面见下图。此页面主要实现商品的增加、修改、删除、查看的功能。 留言管理 留言管理页面提供的功能操作有回复留言修改留言删除留言操作。下图就是留言信息管理页面。 商品类型管理 商品类型管理页面显示所有商品类型在此页面既可以让管理员添加新的商品信息类型也能对已有的商品类型信息执行编辑更新失效的商品类型信息也能让管理员快速删除。下图就是商品类型管理页面。 四、核心代码 登录相关 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{Autowiredprivate UserService userService;Autowiredprivate TokenService tokenService;/*** 登录*/IgnoreAuthPostMapping(value /login)public R login(String username, String password, String captcha, HttpServletRequest request) {UserEntity user userService.selectOne(new EntityWrapperUserEntity().eq(username, username));if(usernull || !user.getPassword().equals(password)) {return R.error(账号或密码不正确);}String token tokenService.generateToken(user.getId(),username, users, user.getRole());return R.ok().put(token, token);}/*** 注册*/IgnoreAuthPostMapping(value /register)public R register(RequestBody UserEntity user){ // ValidatorUtils.validateEntity(user);if(userService.selectOne(new EntityWrapperUserEntity().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(退出成功);}/*** 密码重置*/IgnoreAuthRequestMapping(value /resetPass)public R resetPass(String username, HttpServletRequest request){UserEntity user userService.selectOne(new EntityWrapperUserEntity().eq(username, username));if(usernull) {return R.error(账号不存在);}user.setPassword(123456);userService.update(user,null);return R.ok(密码已重置为123456);}/*** 列表*/RequestMapping(/page)public R page(RequestParam MapString, Object params,UserEntity user){EntityWrapperUserEntity ew new EntityWrapperUserEntity();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){EntityWrapperUserEntity ew new EntityWrapperUserEntity();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 EntityWrapperUserEntity().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{Autowiredprivate 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 EntityWrapperConfigEntity().eq(name, faceFile));if(configEntitynull) {configEntity new ConfigEntity();configEntity.setName(faceFile);configEntity.setValue(fileName);} else {configEntity.setValue(fileName);}configService.insertOrUpdate(configEntity);}return R.ok().put(file, fileName);}/*** 下载文件*/IgnoreAuthRequestMapping(/download)public ResponseEntitybyte[] 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 ResponseEntitybyte[](FileUtils.readFileToByteArray(file),headers, HttpStatus.CREATED);}} catch (IOException e) {e.printStackTrace();}return new ResponseEntitybyte[](HttpStatus.INTERNAL_SERVER_ERROR);}}封装 package com.utils;import java.util.HashMap; import java.util.Map;/*** 返回数据*/ public class R extends HashMapString, Object {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(MapString, Object 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;} }
http://www.zqtcl.cn/news/643714/

相关文章:

  • 墨星写作网站阿里云购买网站登录
  • 做微网站公司知名网站设计
  • 宁波中科网站建设有限公司天津市建设 银行网站
  • 长沙建个网站一般需要多少钱化妆品网站建设方案项目书
  • 宁波外贸网站推广做网站如何选域名
  • 如何在百度上搜索到自己的网站提升关键词
  • asp net做网站建设英文网站的公司
  • 旅游英文网站 建设需求WordPress首页id
  • 南宁网站如何制作网站seo查询站长之家
  • 网站备案太麻烦门户网站模板
  • 九江建网站多少钱打开云南省住房和城乡建设厅网站
  • 合肥市门户网站wordpress登陆不上
  • 摄影网站在线建设办公室设计装修
  • 深圳市移动端网站建设游戏网站建设与策划方案
  • wap版网站 加app提示厦门网站seo优化
  • 旅游网站 功能建设银行网站会员
  • 公园网站建设wordpress 分类目录使用英文
  • 苏州高端网站设计制作wordpress改固定连接
  • 门户网站开源sae安装wordpress
  • 建设彩票网站需要哪些要求城乡与住房建设厅网站首页
  • 公司做网站费用计入什么科目网络建设规划
  • 外贸网站建设案例深圳设计网站培训
  • 龙岗地区做网站公司北京装饰公司排行 2019
  • 大企业网站建设方案wordpress博客模板查询
  • 手机网站建设动态公司做网站效果怎么样
  • 网站推广和优化教程上海网络科技有限公司招聘
  • 即墨建网站价格商城二次开发
  • 网站排名易下拉教程怎么做网店运营
  • 聊城做网站公司聊城博达海外服务器租用多少钱一年
  • 手机上网站做国外销售都上什么网站