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

手机 网站制作上饶企业网站建设

手机 网站制作,上饶企业网站建设,wordpress改造,网站做接口到app价格末尾获取源码 开发语言#xff1a;Java Java开发工具#xff1a;JDK1.8 后端框架#xff1a;SSM 前端#xff1a;Vue、HTML 数据库#xff1a;MySQL5.7和Navicat管理工具结合 服务器#xff1a;Tomcat8.5 开发软件#xff1a;IDEA / Eclipse 是否Maven项目#xff1a;是… 末尾获取源码 开发语言Java Java开发工具JDK1.8 后端框架SSM 前端Vue、HTML 数据库MySQL5.7和Navicat管理工具结合 服务器Tomcat8.5 开发软件IDEA / Eclipse 是否Maven项目是 目录 一、项目简介 二、系统功能 三、系统项目截图 管理员功能实现 宠物管理 商品信息管理 宠物类型管理 四、核心代码 登录相关 文件上传 封装 一、项目简介 信息数据从传统到当代是一直在变革当中突如其来的互联网让传统的信息管理看到了革命性的曙光因为传统信息管理从时效性还是安全性还是可操作性等各个方面来讲遇到了互联网时代才发现能补上自古以来的短板有效的提升管理的效率和业务水平。传统的管理模式时间越久管理的内容越多也需要更多的人来对数据进行整理并且数据的汇总查询方面效率也是极其的低下并且数据安全方面永远不会保证安全性能。结合数据内容管理的种种缺点在互联网时代都可以得到有效的补充。结合先进的互联网技术开发符合需求的软件让数据内容管理不管是从录入的及时性查看的及时性还是汇总分析的及时性都能让正确率达到最高管理更加的科学和便捷。本次开发的在线宠物商城实现了收货地址管理、购物车管理、宠物管理、宠物收藏管理、宠物留言管理、宠物预定订单管理、字典管理、论坛管理、商品管理、商品收藏管理、商品评价管理、商品订单管理、用户管理、管理员管理等功能。系统用到了关系型数据库中王者MySql作为系统的数据库有效的对数据进行安全的存储有效的备份对数据可靠性方面得到了保证。并且程序也具备程序需求的所有功能使得操作性还是安全性都大大提高让在线宠物商城更能从理念走到现实确确实实的让人们提升信息处理效率。 二、系统功能 在管理员功能模块确定下来的基础上对管理员各个功能进行设计确定管理员功能的详细模块。绘制的管理员功能结构见下图。 三、系统项目截图 管理员功能实现 宠物管理 此页面让管理员管理宠物的数据宠物管理页面见下图。此页面主要实现宠物的增加、修改、删除、查看的功能。 商品信息管理 商品信息管理页面提供的功能操作有新增商品修改商品删除商品操作。下图就是商品信息管理页面。 宠物类型管理 宠物类型管理页面显示所有宠物类型在此页面既可以让管理员添加新的宠物信息类型也能对已有的宠物类型信息执行编辑更新失效的宠物类型信息也能让管理员快速删除。下图就是宠物类型管理页面。 四、核心代码 登录相关 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/556854/

相关文章:

  • 多语言网站 自助江门建设局网站
  • 宜兴做阿里巴巴网站常州外贸网站设计
  • 长沙米拓建站wordpress最底部版权
  • 小企业网站建设费用一年wordpress 怎么登陆
  • 阿里云建站可不可以备案wordpress评论滑动插件
  • 网站建设教程出售用苏州久远网络现在的网络营销方式
  • 浮动播放器wordpress刷神马seo排名首页排名
  • 建设网站呼叫中心有什么好处站长统计免费下载
  • 做网站电脑配置要求个高吗电子商务网站的建设包含哪些流程图
  • 青岛做网站大公司wordpress文章页加一言
  • 用哪个网站做相册视频文件夹谷歌ads
  • 注册top域名做公司网站男女做暖网站是什么
  • 郴州本地网站建设高端网站设计多少钱
  • 此网站域名即将过期广告制作属于什么行业
  • 牛牛襄阳网站建设wap网站asp源码
  • 信用网站建设招标书建网站需要什么手续
  • 重庆建网站方法网站开发和维护
  • 做网站需要什么人活动策划流程及细节
  • wordpress企业网站seo上海市
  • 北京建外贸网站公司网络域名是什么
  • 聚美优品网站建设方案上市公司的信息网站
  • 济南做网站比较好的公司知道吗为什么做美食视频网站
  • 药店网站源码宣传方式
  • word如何做网站链接淘宝客建站需要多少钱
  • 凡科网免费建站步骤及视频logo设计网页
  • 天梯网站建设软件开发公司职位
  • 建站公司外贸东方购物网上商城
  • 白银做网站企业免费网站模板
  • 网络公司给我们做的网站_但是我们不知道域名是否属于我们湖北正规网站建设质量保障
  • 本地网站asp iis团队展示网站