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

网站建设信 信科网络如何实现网站的快速排名

网站建设信 信科网络,如何实现网站的快速排名,番禺人才网招聘网官网,佛山模板建站末尾获取源码 开发语言#xff1a;Java Java开发工具#xff1a;JDK1.8 后端框架#xff1a;SSM 前端#xff1a;采用Vue技术开发 数据库#xff1a;MySQL5.7和Navicat管理工具结合 服务器#xff1a;Tomcat8.5 开发软件#xff1a;IDEA / Eclipse 是否Maven项目#x… 末尾获取源码 开发语言Java Java开发工具JDK1.8 后端框架SSM 前端采用Vue技术开发 数据库MySQL5.7和Navicat管理工具结合 服务器Tomcat8.5 开发软件IDEA / Eclipse 是否Maven项目是 目录 一、项目简介 二、系统功能 三、系统项目截图 系统主界面 留言反馈界面 用户注册界面 用户登录界面 校园论坛界面 用户管理界面 留言板管理界面 系统公告管理界面 校园论坛管理界面 四、核心代码 登录相关 文件上传 封装 一、项目简介 网络的覆盖电脑手机的普及使得人们的交流上升到网络信息化的层面上来论坛系统就是在这样的环境下就诞生了而且深受用户喜爱。 本学院学生论坛系统应用Java技术MYSQL数据库存储数据基于SSMVue框架开发。在网站的整个开发过程中首先对系统进行了需求分析设计出系统的主要功能模块其次对网站进行总体规划和详细设计最后对学院学生论坛系统进行了系统测试包括测试定义测试方法测试方案等并对测试结果进行了分析和总结进而得出系统的不足及需要改进的地方为以后的系统维护和扩展提供了方便。 本系统布局合理、色彩搭配和谐、框架结构设计清晰具有操作简单界面清晰管理方便功能完善等优势有很高的使用价值。 二、系统功能 用户在系统前台可查看系统信息包括首页、校园论坛、系统公告以及留言反馈等用户要想实现发帖等操作必须登录系统没有账号的用户可进行注册操作注册登录后主要功能模块包括个人中心、我的发布。 管理员可登录系统后台对系统进行全面管理操作管理员主要功能模块包括个人中心、用户管理、留言板管理、校园论坛以及系统管理。 三、系统项目截图 系统主界面 用户进入本系统可查看系统信息主要包括首页校园论坛以及系统公告等 留言反馈界面 用户登录后可进行留言反馈操作 用户注册界面 未有账号的用户可进入注册界面进行注册操作 用户登录界面 用户在登录界面可输入正确的登录信息点击提交按钮进行登录操作 校园论坛界面 用户在校园论坛界面可查看已有帖子信息并可查看详情登录后可进行发帖、评论等 用户管理界面 管理员可查看、添加、修改和删除用户信息 留言板管理界面 管理员可查看留言板信息并可进行回复、修改和删除操作 系统公告管理界面 管理员可添加、修改和删除系统公告信息 校园论坛管理界面 管理员可管理校园论坛信息 四、核心代码 登录相关 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.dnsts.com.cn/news/76320.html

相关文章:

  • 网站建设相关业务外贸工作上班一般都干嘛
  • 中国建设业管理协会网站网站的头尾和导航的公用文件
  • 公司运营策划营销新网站seo方法
  • 免费招聘网站平台义乌做网站多少钱
  • 专业建设网站企业推动高质量发展发言材料
  • 找方案的网站ICP备案和实际网站不是一个名字
  • 前端是做网站吗济南区网站开发
  • 做网站商城公司做的网站怎么维护
  • 小网站文案响应式 购物网站模板
  • 河源网站建设公司网站建设技术标准
  • 网站的色彩wordpress制作网页教程
  • 营销网站建设资料上海人才市场档案存放中心
  • 8上的信息课做网站作业网页制作素材免费网站
  • 个体工商户做的网站能推广吗互联网行业最新资讯
  • 自己做网站网页归档淮安网站建设找谁好
  • 制作网站需要钱吗网站开发文章怎么分类
  • 建站网站排行榜商丘至开网络科技有限公司
  • 公司业绩怎么发到建设厅网站上莱芜seo推广
  • 栾城seo整站排名网站开发投资成本
  • 网站设计案例欣赏呈贡网站建设
  • html5素材网站福州模板建站代理
  • 南昌网站搭建建设定制怎么模仿一个网站
  • 专业的培训行业网站开发wordpress网址访问慢
  • 个人网站备案资料网站全屏广告
  • 网站建设费属于宣传费企业网站搜索引擎推广方法包括
  • 网站正在建设 mp4潜江市网站
  • 青岛网站制作设计建设一个蛋糕网站的背景与目的
  • 剑三做月饼活动网站定制一款软件需要多少钱
  • 建设网络道德教育网站的有效措施网站开发工程师要求
  • 南宁专业网站营销怎么建网站 手机版