当前位置: 首页 > 编程日记 > 正文

Java项目:网上商城系统(java+SSM+jsp+mysql+maven)

源码获取:博客首页 "资源" 里下载!

一、项目简述功能 
javaweb 网上商城系统,前台+后台管理,用户注册,登录,上哦展示,分组展示,搜索,收货地址管理,购物车管理,添加,购买,个人信息修改。订单查询等等,后台商品管理,分类管理,库存管理,订单管理,用户管理,信息修改等等.
二、项目运行 
环境配置: Jdk1.8 + Tomcats . 5 + mysql + Eclispe ( IntelliJ IDEA ,Eclispe , MyEclispe , sts 都支持)
项目技术: JSP + Spring + SpringMVC + MyBatis + html + cSS + Javascript + JQuery + Ajax + layui + maven 等等。

后台管理平台登录代码:

/*** 后台管理-主页*/
@Controller
public class AdminHomeController extends BaseController {@Resource(name = "adminService")private AdminService adminService;@Resource(name = "productOrderService")private ProductOrderService productOrderService;@Resource(name = "productService")private ProductService productService;@Resource(name = "userService")private UserService userService;/*** 转到后台管理-主页* @param session session对象* @param map 前台传入的Map* @return 响应数据* @throws ParseException 转换异常*/@RequestMapping(value = "admin", method = RequestMethod.GET)public String goToPage(HttpSession session, Map<String, Object> map) throws ParseException {logger.info("获取管理员信息");Object adminId = checkAdmin(session);if (adminId == null) {return "redirect:/admin/login";}Admin admin = adminService.get(null, Integer.parseInt(adminId.toString()));map.put("admin", admin);logger.info("获取统计信息");//产品总数Integer productTotal = productService.getTotal(null, new Byte[]{0, 2});//用户总数Integer userTotal = userService.getTotal(null);//订单总数Integer orderTotal = productOrderService.getTotal(null, new Byte[]{3});logger.info("获取图表信息");map.put("jsonObject", getChartData(null,null,7));map.put("productTotal", productTotal);map.put("userTotal", userTotal);map.put("orderTotal", orderTotal);logger.info("转到后台管理-主页");return "admin/homePage";}/*** 转到后台管理-主页(ajax方式)* @param session session对象* @param map 前台传入的Map* @return 响应数据* @throws ParseException 转换异常*/@RequestMapping(value = "admin/home", method = RequestMethod.GET)public String goToPageByAjax(HttpSession session, Map<String, Object> map) throws ParseException {logger.info("获取管理员信息");Object adminId = checkAdmin(session);if (adminId == null) {return "admin/include/loginMessage";}Admin admin = adminService.get(null, Integer.parseInt(adminId.toString()));map.put("admin", admin);logger.info("获取统计信息");Integer productTotal = productService.getTotal(null, new Byte[]{0, 2});Integer userTotal = userService.getTotal(null);Integer orderTotal = productOrderService.getTotal(null, new Byte[]{3});logger.info("获取图表信息");map.put("jsonObject", getChartData(null, null,7));logger.info("获取图表信息");map.put("jsonObject", getChartData(null,null,7));map.put("productTotal", productTotal);map.put("userTotal", userTotal);map.put("orderTotal", orderTotal);logger.info("转到后台管理-主页-ajax方式");return "admin/homeManagePage";}/*** 按日期查询图表数据(ajax方式)* @param beginDate 开始日期* @param endDate 结束日期* @return 响应数据* @throws ParseException 转换异常*/@ResponseBody@RequestMapping(value = "admin/home/charts", method = RequestMethod.GET, produces = "application/json;charset=utf-8")public String getChartDataByDate(@RequestParam(required = false) String beginDate, @RequestParam(required = false) String endDate) throws ParseException {if (beginDate != null && endDate != null) {//转换日期格式SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");return getChartData(simpleDateFormat.parse(beginDate), simpleDateFormat.parse(endDate),7).toJSONString();} else {return getChartData(null, null,7).toJSONString();}}/*** 按日期获取图表数据* @param beginDate 开始日期* @param endDate 结束日期* @param days 天数* @return 图表数据的JSON对象* @throws ParseException 转换异常*/private JSONObject getChartData(Date beginDate,Date endDate,int days) throws ParseException {JSONObject jsonObject = new JSONObject();SimpleDateFormat time = new SimpleDateFormat("yyyy-MM-dd", Locale.UK);SimpleDateFormat time2 = new SimpleDateFormat("MM/dd", Locale.UK);SimpleDateFormat timeSpecial = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.UK);//如果没有指定开始和结束日期if (beginDate == null || endDate == null) {//指定一周前的日期为开始日期Calendar cal = Calendar.getInstance();cal.add(Calendar.DATE, 1-days);beginDate = time.parse(time.format(cal.getTime()));//指定当前日期为结束日期cal = Calendar.getInstance();endDate = cal.getTime();} else {beginDate = time.parse(time.format(beginDate));endDate = timeSpecial.parse(time.format(endDate) + " 23:59:59");}logger.info("根据订单状态分类");//未付款订单数统计数组int[] orderUnpaidArray = new int[7];//未发货订单数统计叔祖int[] orderNotShippedArray = new int[7];//未确认订单数统计数组int[] orderUnconfirmedArray = new int[7];//交易成功订单数统计数组int[] orderSuccessArray = new int[7];//总交易订单数统计数组int[] orderTotalArray = new int[7];logger.info("从数据库中获取统计的订单集合数据");List<OrderGroup> orderGroupList = productOrderService.getTotalByDate(beginDate, endDate);//初始化日期数组JSONArray dateStr = new JSONArray(days);//按指定的天数进行循环for (int i = 0; i < days; i++) {//格式化日期串(MM/dd)并放入日期数组中Calendar cal = Calendar.getInstance();cal.setTime(beginDate);cal.add(Calendar.DATE, i);String formatDate = time2.format(cal.getTime());dateStr.add(formatDate);//该天的订单总数int orderCount = 0;//循环订单集合数据的结果集for(int j = 0; j < orderGroupList.size(); j++){OrderGroup orderGroup = orderGroupList.get(j);//如果该订单日期与当前日期一致if(orderGroup.getProductOrder_pay_date().equals(formatDate)){//从结果集中移除数据orderGroupList.remove(j);//根据订单状态将统计结果存入对应的订单状态数组中switch (orderGroup.getProductOrder_status()) {case 0://未付款订单orderUnpaidArray[i] = orderGroup.getProductOrder_count();break;case 1://未发货订单orderNotShippedArray[i] = orderGroup.getProductOrder_count();break;case 2://未确认订单orderUnconfirmedArray[i] = orderGroup.getProductOrder_count();break;case 3://交易成功订单orderSuccessArray[i] = orderGroup.getProductOrder_count();break;}//累加当前日期的订单总数orderCount += orderGroup.getProductOrder_count();}}//将统计的订单总数存入总交易订单数统计数组orderTotalArray[i] = orderCount;}logger.info("返回结果集map");jsonObject.put("orderTotalArray", orderTotalArray);jsonObject.put("orderUnpaidArray", orderUnpaidArray);jsonObject.put("orderNotShippedArray", orderNotShippedArray);jsonObject.put("orderUnconfirmedArray", orderUnconfirmedArray);jsonObject.put("orderSuccessArray", orderSuccessArray);jsonObject.put("dateStr",dateStr);return jsonObject;}
}

用户相关接口:

/*** 用户相关接口*/
@Controller
@RequestMapping("/index")
public class UserController{@Resourceprivate UserService userService;@Resourceprivate OrderService orderService;@Resourceprivate GoodService goodService;@Resourceprivate TypeService typeService;@Resourceprivate ShopcartService shopcartService;@Resourceprivate SkuService skuService;/*** 用户注册* @return*/@GetMapping("/register")public String reg(Model model) {model.addAttribute("flag", -1); // 注册页面return "/index/register.jsp";}/*** 用户注册* @return*/@PostMapping("/register")public String register(Users user, Model model){if (user.getUsername().isEmpty()) {model.addAttribute("msg", "用户名不能为空!");return "/index/register.jsp";}else if (userService.isExist(user.getUsername())) {model.addAttribute("msg", "用户名已存在!");return "/index/register.jsp";}else {String password = user.getPassword();userService.add(user);user.setPassword(password);return "/index/index"; // 注册成功后转去登录}}/*** 用户登录* @return*/@GetMapping("/login")public String log() {return "/index/index";}/*** 用户登录* @return*/@PostMapping("/login")public String login(@RequestParam(required=false, defaultValue="0")int flag, Users user, HttpSession session, Model model) {model.addAttribute("typeList", typeService.getList());if(flag==-1) {flag = 6; // 登录页面return "/index/index";}if(userService.checkUser(user.getUsername(), user.getPassword())){Users loginUser = userService.get(user.getUsername());session.setAttribute("user", loginUser);// 还原购物车数量session.setAttribute("total", shopcartService.getTotal(loginUser.getId()));return "redirect:index";} else {model.addAttribute("msg", "用户名或密码错误!");return "/index/index";}}/*** 注销登录* @return*/@RequestMapping("/logout")public String logout(HttpSession session) {session.removeAttribute("user");session.removeAttribute("order");return "/index/index";}/*** 查看购物车* @return*/@RequestMapping("/shopcart")public String shopcart(Model model, HttpSession session) {Users user = (Users) session.getAttribute("user");if (user == null) {model.addAttribute("msg", "请先登录!");return "/index/index";}model.addAttribute("typeList", typeService.getList());model.addAttribute("shopcartList", shopcartService.getList(user.getId()));model.addAttribute("totalPrice", shopcartService.getTotalPrice(user.getId()));return "/index/shopcart.jsp";}/*** 购买* @return*/@RequestMapping("/buy")public @ResponseBody int buy(Shopcart shopcart, HttpSession session, Model model){Users user = (Users) session.getAttribute("user");if (user == null) {return -111;}shopcart.setUserId(user.getId());shopcart.setGood(goodService.get(shopcart.getGoodId()));// 验证库存
//		int stock = skuService.getStock(shopcart.getGoodId(), shopcart.getColorId(), shopcart.getSizeId());
//		if(shopcart.getAmount() > stock) {
//			model.addAttribute("msg", "商品 [ " + shopcart.getGood().getName() + " ] 库存不足! 当前库存只有: " + stock);
//		}return orderService.save(Arrays.asList(shopcart), user);}/*** 购买* @return*/@RequestMapping("/cart")public @ResponseBody int cart(Shopcart shopcart, HttpSession session, Model model){Users user = (Users) session.getAttribute("user");if (user == null) {return -111;}shopcart.setUserId(user.getId());shopcartService.save(shopcart);int total = shopcartService.getTotal(user.getId());session.setAttribute("total", total);return total;}/*** 添加*/@RequestMapping("/add")public @ResponseBody boolean add(int skuid, HttpSession session){Users user = (Users) session.getAttribute("user");if (user == null) {return false;}return shopcartService.add(skuid);}/*** 减少*/@RequestMapping("/less")public @ResponseBody boolean less(int skuid, HttpSession session){Users user = (Users) session.getAttribute("user");if (user == null) {return false;}return shopcartService.less(skuid);}/*** 删除*/@RequestMapping("/delete")public @ResponseBody boolean delete(int skuid, HttpSession session){Users user = (Users) session.getAttribute("user");if (user == null) {return false;}shopcartService.delete(skuid);session.setAttribute("total", shopcartService.getTotal(user.getId()));return true;}/*** 总金额* @return*/@RequestMapping("/total")public @ResponseBody int total(HttpSession session){Users user = (Users) session.getAttribute("user");if (user == null) {return -111;}return shopcartService.getTotalPrice(user.getId());}/*** 提交订单* @return*/@RequestMapping("/save")public String save(ServletRequest request, HttpSession session, Model model){Users user = (Users) session.getAttribute("user");if (user == null) {model.addAttribute("msg", "请先登录!");return "/index/index";}List<Shopcart> shopcartList = shopcartService.getList(user.getId());if(Objects.isNull(shopcartList) || shopcartList.isEmpty()) {model.addAttribute("msg", "购物车没有商品");return shopcart(model, session);}// 验证库存for(Shopcart cart : shopcartList) {int stock = skuService.getStock(cart.getGoodId(), cart.getColorId(), cart.getSizeId());if(cart.getAmount() > stock) {model.addAttribute("msg", "商品 [ " + cart.getGood().getName() + " ] 库存不足! 当前库存只有: " + stock);return shopcart(model, session);}}int orderid = orderService.save(shopcartList, user);if(orderid > 0) {// 清空购物车session.setAttribute("total", shopcartService.getTotal(user.getId()));// 跳转支付return "redirect:topay?orderid="+orderid;} model.addAttribute("msg", "出了点问题");return shopcart(model, session);}/*** 支付页面* @return*/@RequestMapping("/topay")public String topay(int orderid, ServletRequest request, HttpSession session) {Users user = (Users) session.getAttribute("user");if (user == null) {request.setAttribute("msg", "请先登录!");return "/index/index";}request.setAttribute("typeList", typeService.getList());request.setAttribute("order", orderService.get(orderid));return "/index/pay.jsp";}/*** 支付(模拟)* @return*/@RequestMapping("/pay")public String pay(Orders order, ServletRequest request, HttpSession session) {Users user = (Users) session.getAttribute("user");if (user == null) {request.setAttribute("msg", "请先登录!");return "/index/index";}// 模拟支付orderService.pay(order);request.setAttribute("typeList", typeService.getList());request.setAttribute("order", orderService.get(order.getId()));request.setAttribute("msg", "支付成功! 即将跳转到订单列表");return "/index/pay.jsp";}/*** 查看订单* @return*/@RequestMapping("/order")public String order(HttpSession session, Model model){model.addAttribute("flag", 12);Users user = (Users) session.getAttribute("user");if (user == null) {model.addAttribute("msg", "请登录后查看订单!");return "/index/index";}model.addAttribute("typeList", typeService.getList());model.addAttribute("orderList", orderService.getListByUserid(user.getId()));return "/index/order.jsp";}/*** 个人信息* @return*/@RequestMapping("/my")public String my(HttpSession session, Model model){model.addAttribute("flag", 11);model.addAttribute("typeList", typeService.getList());Users user = (Users) session.getAttribute("user");if (user == null) {model.addAttribute("msg", "请先登录!");return "/index/index";}model.addAttribute("user", user);return "/index/my.jsp";}/*** 修改信息* @return*/@RequestMapping("/updateUser")public String updateUser(Users user, HttpSession session, Model model){model.addAttribute("flag", 11);model.addAttribute("typeList", typeService.getList());Users userLogin = (Users) session.getAttribute("user");if (userLogin == null) {model.addAttribute("msg", "请先登录!");return "/index/index";}// 修改资料Users u = userService.get(userLogin.getId());u.setName(user.getName());u.setPhone(user.getPhone());u.setAddress(user.getAddress());userService.update(u);  // 更新数据库session.setAttribute("user", u); // 更新sessionmodel.addAttribute("msg", "信息修改成功!");return "/index/my.jsp";}/*** 修改信息* @return*/@RequestMapping("/updatePassword")public String updatePassword(Users user, HttpSession session, Model model){model.addAttribute("flag", 11);model.addAttribute("typeList", typeService.getList());Users userLogin = (Users) session.getAttribute("user");if (userLogin == null) {model.addAttribute("msg", "请先登录!");return "/index/index";}// 修改密码Users u = userService.get(userLogin.getId());if(user.getPasswordNew()!=null && !user.getPasswordNew().trim().isEmpty()) {if (user.getPassword()!=null && !user.getPassword().trim().isEmpty() && SafeUtil.encode(user.getPassword()).equals(u.getPassword())) {if (user.getPasswordNew()!=null && !user.getPasswordNew().trim().isEmpty()) {u.setPassword(SafeUtil.encode(user.getPasswordNew()));}userService.update(u);  // 更新数据库session.setAttribute("user", u); // 更新sessionmodel.addAttribute("msg", "密码修改成功!");return "redirect:logout";}else {model.addAttribute("msg", "原密码错误!");}}return "/index/index";}}

前台相关接口:

/*** 前台相关接口*/
@Controller
@RequestMapping("/index")
public class IndexController{private static final int rows = 8; // 默认每页数量@Autowiredprivate TopService topService;@Autowiredprivate GoodService goodService;@Autowiredprivate TypeService typeService;@Autowiredprivate SkuService skuService;/*** 首页* @return*/@RequestMapping("/index")public String index(HttpServletRequest request){request.setAttribute("flag", -1);List<Types> typeList = typeService.getList();request.setAttribute("typeList", typeList);List<Map<String, Object>> dataList = new ArrayList<>();for(Types type : typeList) {Map<String, Object> map = new HashMap<>();map.put("type", type);map.put("goodList", goodService.getListByType(type.getId(), 1, 8)); // 取前8个dataList.add(map);}request.setAttribute("dataList", dataList);return "/index/index.jsp";}/*** 推荐列表* @return*/@RequestMapping("/top")public String tops(int typeid, @RequestParam(required=false, defaultValue="1")int page, HttpServletRequest request) {request.setAttribute("flag", typeid==2 ? 7 : 8);request.setAttribute("typeList", typeService.getList());request.setAttribute("goodList", goodService.getList(typeid, page, rows));request.setAttribute("pageHtml", PageUtil.getPageHtml(request, goodService.getTotal(typeid), page, rows));return "/index/goods.jsp";}/*** 商品列表* @return*/@RequestMapping("/goods")public String goods(int typeid, @RequestParam(required=false, defaultValue="1")int page, HttpServletRequest request){request.setAttribute("flag", typeid);request.setAttribute("typeList", typeService.getList());request.setAttribute("topList", topService.getList(Tops.TYPE_SUPPER, 1, 4));if (typeid > 0) {request.setAttribute("type", typeService.get(typeid));}request.setAttribute("goodList", goodService.getListByType(typeid, page, rows));request.setAttribute("pageHtml", PageUtil.getPageHtml(request, goodService.getTotalByType(typeid), page, rows));return "/index/goods.jsp";}/*** 商品详情* @return*/@RequestMapping("/detail")public String detail(int goodid, HttpServletRequest request){request.setAttribute("typeList", typeService.getList());request.setAttribute("topList", topService.getList(Tops.TYPE_SUPPER, 1, 4));Goods good = goodService.get(goodid);request.setAttribute("good", good);request.setAttribute("type", typeService.get(good.getTypeId()));request.setAttribute("colorList", skuService.getColorList(goodid));request.setAttribute("sizeList", skuService.getSizeList(goodid));return "/index/detail.jsp";}/*** 搜索* @return*/@RequestMapping("/search")public String search(String name, @RequestParam(required=false, defaultValue="1")int page, HttpServletRequest request) {if (Objects.nonNull(name) && !name.trim().isEmpty()) {request.setAttribute("goodList", goodService.getListByName(name, page, rows));request.setAttribute("pageHtml", PageUtil.getPageHtml(request, goodService.getTotalByName(name), page, rows));}request.setAttribute("typeList", typeService.getList());return "/index/goods.jsp";}/*** 查询库存* @param goodid* @param colorid* @param sizeid* @return*/@GetMapping("/stock")public @ResponseBody int stock(int goodid, int colorid, int sizeid) {return skuService.getStock(goodid, colorid, sizeid);}}

源码获取:博客首页 "资源" 里下载!

相关文章:

Linux 启动详解之init

1.init初探 init是Linux系统操作中不可缺少的程序之一。init进程&#xff0c;它是一个由内核启动的用户级进程&#xff0c;然后由它来启动后面的任务&#xff0c;包括多用户环境&#xff0c;网络等。 内核会在过去曾使用过init的几个地方查找它&#xff0c;它的正确位置&#x…

mysql 相关命令

mysqladmin versionmysqladmin statusmysqlshow -u帐号 -p密码 mysqlshow -u帐号 -p密码 库名mysql -u帐号 -p密码 -e SELECT Host,Db,User From db mysqlmysqldump --quick mysql | gzip > /root/mysql.gzmysqladmin create dbtestgunzip < /root/mysql.gz | mysql…

maven 添加数据库驱动

1.电脑上需要安装 apache maven2.下载oracle的jar包 例如我下载的是ojdbc7-12.jar3.cmd执行命令 mvn install:install-file -DgroupIdcom.oracle -DartifactIdojdbc7 -Dversion12 -Dpackagingjar -Dfiled:\jar\ojdbc7-12.jar-Dfile jar包所存放的位置4.pom文件添加&#xff1…

Rocksdb 的 BlobDB key-value 分离存储插件

前言 还是回到传统的 LSM-tree 中&#xff0c;我们key-value 写入时以append形态存放到一个data-block中&#xff0c;多个data-blockmetablock 之类的数据组织成一个sst。当我们读数据以及compaction的时候读到key 之后则很方便得读取到对应的value&#xff0c;一次I/O能够将k…

Java项目:(前端vue后台java微服务)在线考试系统(java+vue+springboot+mysql+maven)

源码获取&#xff1a;博客首页 "资源" 里下载&#xff01; 考试流程&#xff1a; 用户前台注册成为学生 管理员后台添加老师&#xff0c;系统将该用户角色上升为老师 老师登录&#xff0c;添加考试,添加题目&#xff0c;发布考试 考生登录前台参加考试&#xff0c…

C++实现stack【栈】

要求&#xff1a; //****file: stack.h/*对stack进行初始化检查stack为空&#xff0c;或已满将整数压入到stack中从stack里弹出整数 不移除任何袁术&#xff0c;讲过stack的内容输出到标准输出Stack类的私有成员如下&#xff1a;一个用于打印错误信息的私有哦成员函数三个私有数…

c#操作Excel整理总结

大家好&#xff0c;这是我在工作中总结的关于C#操作Excel的帮助类&#xff0c;欢迎大家批评指正&#xff01; using System; using System.Collections.Generic; using System.Data; using System.Data.OleDb; using System.IO; using Aspose.Cells;namespace MusicgrabTool {p…

C++ std::function<void(int)> 和 std::function<void()> 作为函数参数的注意事项

前言 std::function 作为标准库提供的函数指针&#xff0c;使用起来还是比较方便的&#xff0c;不过在使用过程中有一些需要注意的细节&#xff0c;这里做一个简单的记录。 基本使用 头文件: #include <functional>语法&#xff1a;std::function<return_type(args…

Java项目:网上电商系统(java+SSM+mysql+maven+tomcat)

源码获取&#xff1a;博客首页 "资源" 里下载&#xff01; 一、项目简述 功能&#xff1a;本系统分用户前台和管理员后台。 前台展示后台管理&#xff0c;前台界面可实现用户登录&#xff0c;用户注 册&#xff0c;商品展示&#xff0c;商品明细展示&#xff0c;用户…

C# SQLiteHelper

1 public class SQLiteHelpers2 {3 /// <summary> 4 /// ConnectionString样例&#xff1a;DatasourceTest.db3;Poolingtrue;FailIfMissingfalse 5 /// </summary> 6 public static string ConnectionStri…

[Git] 拉开发分支的代码报错

Git拉开发分支的代码报错&#xff1a; fatal: The remote end hung up unexpectedly fatal: early EOF fatal: index-pack failed 解决办法&#xff1a; git config --global core.compression -1 转载于:https://www.cnblogs.com/MasterMonkInTemple/p/10754596.html

C++ 通过模版工厂实现 简单反射机制

前言 我们知道Java/Python这种语言能够很好得 支持反射。反射机制 就是一种用户输入的字符串到对应实现方法的映射&#xff0c;比如http接口中 用户传入了url&#xff0c;我们需要调用该url对应的方法/函数对象 从而做出对应的操作。 而C 并没有友好得支持这样的操作&#xf…

计算机世界的“十六进制”为什么如此重要

在计算机世界中,十六进制扮演着不可或缺的角色。它以其紧凑的表示形式、与二进制的天然对应关系以及在各个领域的广泛应用,成为了计算机科学中的一把重要工具。总体而言,计算机需要十六进制并非偶然,它是一种为了更好地满足人类理解和处理数据的需求而产生的工具,为计算机科学的发展和应用提供了便利和支持。

面试官:如何实现10亿数据判重?

以 Java 中的 int 为例,来对比观察 BitMap 的优势,在 Java 中,int 类型通常需要 32 位(4 字节*8),而 BitMap 使用 1 位就可以来标识此元素是否存在,所以可以认为 BitMap 占用的空间大小,只有 int 类型的 1/32,所以有大数据量判重时,使用 BitMap 也可以实现。所以数据库去重显然是不行的。而使用集合也是不合适的,因为数据量太大,使用集合会导致内存不够用或内存溢出和 Full GC 频繁等问题,所以此时我们的解决方案通常是采用布隆过滤器来实现判重。

Java项目:校园二手市场系统(java+SSM+mysql+maven+tomcat)

源码获取&#xff1a;博客首页 "资源" 里下载&#xff01; 一、项目简述&#xff08; IW文档&#xff09; 功能&#xff1a;本系统分用户前台和管理员后台。 本系统用例模型有三种&#xff0c;分别是游客、注册用户和系统管 理员。下面分别对这三个角色的功能进行描…

php中$_REQUEST、$_POST、$_GET的区别和联系小结

php中$_REQUEST、$_POST、$_GET的区别和联系小结 作者&#xff1a; 字体&#xff1a;[增加 减小] 类型&#xff1a;转载php中有$_request与$_post、$_get用于接受表单数据&#xff0c;当时他们有何种区别&#xff0c;什么时候用那种最好。1. $_REQUEST php中$_REQUEST可以获取以…

uva 315 (poj 1144 求割点)

题意&#xff1a;给你一张无向图&#xff0c;求割点的个数。 思路&#xff1a;输入稍微处理一下接着直接套模版。 1 #include <iostream>2 #include <cstdio>3 #include <cstring>4 #include <cstdlib>5 #include <cmath>6 #include <algorit…

SQL学习之计算字段的用法与解析

一、计算字段 1、存储在数据库表中的数据一般不是应用程序所需要的格式。大多数情况下,数据表中的数据都需要进行二次处理。下面举几个例子。 (1)、我们需要一个字段同时显示公司名和公司地址&#xff0c;但这两个信息存储在不同表的列中。 (2)、省份、城市、邮政编码存储在不同…

手把手教你 用C++实现一个 可持久化 的http_server

前言 本文介绍一个有趣的 通过C实现的 持久化的http_server demo&#xff0c;这样我们通过http通信之后的数据可以持久化存储&#xff0c;即使server挂了&#xff0c;数据也不会丢失。我们的http_sever 也就能够真正得作为一个后端server了。 本身持久化这个能力是数据库提供…

【SVN多用户开发】代码冲突解决办法

SVN是一款集中式的代码存储工具&#xff0c;可以帮助多个用户协同开发同一应用程序。 但是SVN不能完全代替人工操作&#xff0c;有时也需要程序员自己进行沟通确认有效的代码。 下面就简单的看一下&#xff0c;常见的代码冲突以及解决方法。 总结起来&#xff0c;无非是&#x…

Java项目:在线宠物商店系统(java+SSM+mysql+maven+tomcat)

源码获取&#xff1a;博客首页 "资源" 里下载&#xff01; 一、项目简述 功能&#xff1a;本系统分用户前台和管理员后台。 系统包括用户的注册登录&#xff0c;狗狗的展示购物车添加以及下 单支付购买&#xff0c;后台有管理员用户&#xff0c;可以操作狗狗的品种&…

字符串中的数字排序

2019独角兽企业重金招聘Python工程师标准>>> public static String getBusiScope(String busiScope){ String regex "\\d{1,2}"; String busiStr""; Pattern pattern Pattern.compile(regex); Matcher matcher pattern.matcher(busiScope…

oo第二单元总结

第二单元总结 第一次作业 一、设计策略 本次作业采用FAFS算法&#xff0c;可直接用输入线程与电梯线程交互&#xff0c;调度器暂时不需要参与&#xff0c;故一共设计三个类三线程&#xff1a;Main类、elevator类及input类&#xff0c;main线程、elevator线程及input线程。main线…

Rocksdb iterator 的 Forward-scan 和 Reverse-scan 的性能差异

前言 最近在读 MyRocks 存储引擎2020年的论文&#xff0c;因为这个存储引擎是在Rocksdb之上进行封装的&#xff0c;并且作为Facebook 内部MySQL的底层引擎&#xff0c;用来解决Innodb的空间利用率低下 和 压缩效率低下的问题。而且MyRocks 在接入他们UDB 之后成功达成了他们的…

Java知多少(29)覆盖和重载

在类继承中&#xff0c;子类可以修改从父类继承来的方法&#xff0c;也就是说子类能创建一个与父类方法有不同功能的方法&#xff0c;但具有相同的名称、返回值类型、参数列表。如果在新类中定义一个方法&#xff0c;其名称、返回值类型和参数列表正好与父类中的相同&#xff0…

Java项目:清新论坛系统(java+SSM+mysql+maven+tomcat)

源码获取&#xff1a;博客首页 "资源" 里下载&#xff01; 一、项目简述 功能&#xff1a;本系统分用户前台和管理员后台。 用户前台主要功能有&#xff1a; 用户注册 用户登录 浏览帖子 回复帖子 修改个人资料 管理员后台的功能有&#xff1a; 管理论坛版块 用户管…

JUnit4.11 理论机制 @Theory 完整解读

最近在研究JUnit4&#xff0c;大部分基础技术都是通过百度和JUnit的官方wiki学习的&#xff0c;目前最新的发布版本是4.11&#xff0c;结合代码实践&#xff0c;发现官方wiki的内容或多或少没有更新&#xff0c;Theory理论机制章节情况尤为严重&#xff0c;不知道这章wiki对应的…

树链剖分——线段树区间合并bzoj染色

线段树区间合并就挺麻烦了&#xff0c;再套个树链就更加鬼畜&#xff0c;不过除了代码量大就没什么其他的了。。 一些细节&#xff1a;线段树每个结点用结构体保存&#xff0c;pushup等合并函数改成返回一个结构体&#xff0c;这样好写一些 struct Seg{int lc,rc,tot;Seg(){lcr…

MyRocks: 为facebool 的社交图谱服务的LSM-tree存储引擎

文章目录概览1. UDB 架构2. UDB 表格式3. Rocksdb&#xff1a;针对flash存储优化过的第三方库3.1 Rocksdb架构3.2 为什么选择Rocksdb4. MyRocks / Rocksdb 开发历程4.1 设计目标4.2 性能挑战4.2.1 降低CPU的消耗4.2.2 降低range-scan 的延时消耗4.2.3 磁盘空间和Compaction 的一…

Java项目:精品酒店管理系统(java+SSM+mysql+maven+tomcat)

源码获取&#xff1a;博客首页 "资源" 里下载&#xff01; 一、项目简述 功能&#xff1a;主要功能主要功能会员管理&#xff0c;住客管理&#xff0c;房间管 理&#xff0c;系统管理&#xff0c;以及一些重要数据的展示导出维护等等; 二、项目运行 环境配置&…