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

手机网站做适配外贸营销网站

手机网站做适配,外贸营销网站,移动网站建设报价表,各大网站怎么把世界杯做头条目录 1 实验内容 2 实验要求 3 思路 4 核心代码 5 实验结果 1 实验内容 简单的线上图书交易系统的web层 2 实验要求 ①采用SpringMVC框架,采用REST风格 ②要求具有如下功能:商品分类、订单、购物车、库存 ③独立完成,编写实验报告 …

目录

1 实验内容

2 实验要求

3 思路

4 核心代码

5 实验结果


1 实验内容

简单的线上图书交易系统的web层

2 实验要求

①采用SpringMVC框架,采用REST风格

②要求具有如下功能:商品分类、订单、购物车、库存

③独立完成,编写实验报告

3 思路

①确保项目结构清晰,按照MVC的结构进行组织

②在pom.xml中添加SpringMVC相关依赖,以及其他可能需要的依赖,比如数据库连接池、模板引擎等:

③配置web.xml文件,配置DispatcherServlet和Spring监听器:

④在WEB-INF目录下创建相关文件,配置相关内容:

⑤在com.exp.controller包下创建控制器类,使用@RestController注解,以REST风格暴露接口

⑥创建JSP文件,用于显示前端页面。

4 核心代码

BookController类

@RestController
@RequestMapping("/books")
public class BookController {

    @Autowired
    private BookService bookService;

    @GetMapping
    public List<Book> getAllBooks() {
        return bookService.getAllBooks();
    }

    @GetMapping("/{id}")
    public Book getBookById(@PathVariable Long id) {
        return bookService.getBookById(id);
    }

    @PostMapping
    public void addBook(@RequestBody Book book) {
        bookService.addBook(book);
    }

    @PutMapping("/{id}")
    public void updateBook(@PathVariable Long id, @RequestBody Book book) {
        book.setId(id);
        bookService.updateBook(book);
    }

    @DeleteMapping("/{id}")
    public void deleteBook(@PathVariable Long id) {
        bookService.deleteBook(id);
    }
}

②OrderController

@RestController
@RequestMapping("/orders")
public class OrderController {

    @Autowired
    private OrderService orderService;

    @GetMapping
    public List<Order> getAllOrders() {
        return orderService.getAllOrders();
    }

    @GetMapping("/{id}")
    public Order getOrderById(@PathVariable Long id) {
        return orderService.getOrderById(id);
    }

    @PostMapping
    public void addOrder(@RequestBody Order order) {
        orderService.addOrder(order);
    }

    @PutMapping("/{id}")
    public void updateOrder(@PathVariable Long id, @RequestBody Order order) {
        order.setId(id);
        orderService.updateOrder(order);
    }

    @DeleteMapping("/{id}")
    public void deleteOrder(@PathVariable Long id) {
        orderService.deleteOrder(id);
    }
}

③CartController

@RestController
@RequestMapping("/cart")
public class CartController {

    @Autowired
    private CartService cartService;

    @GetMapping("/{userId}")
    public List<CartItem> getCartItemsByUserId(@PathVariable Long userId) {
        return cartService.getCartItemsByUserId(userId);
    }

    @PostMapping
    public void addCartItem(@RequestBody CartItem cartItem) {
        cartService.addCartItem(cartItem);
    }

    @PutMapping("/{id}")
    public void updateCartItem(@PathVariable Long id, @RequestBody CartItem cartItem) {
        cartItem.setId(id);
        cartService.updateCartItem(cartItem);
    }

    @DeleteMapping("/{id}")
    public void deleteCartItem(@PathVariable Long id) {
        cartService.deleteCartItem(id);
    }
}

④InventoryController

@RestController
@RequestMapping("/inventory")
public class InventoryController {

    @Autowired
    private InventoryService inventoryService;

    @GetMapping("/{bookId}")
    public Inventory getInventoryByBookId(@PathVariable Long bookId) {
        return inventoryService.getInventoryByBookId(bookId);
    }

    @PostMapping
    public void addInventory(@RequestBody Inventory inventory) {
        inventoryService.addInventory(inventory);
    }

    @PutMapping("/{id}")
    public void updateInventory(@PathVariable Long id, @RequestBody Inventory inventory) {
        inventory.setId(id);
        inventoryService.updateInventory(inventory);
    }

    @DeleteMapping("/{id}")
    public void deleteInventory(@PathVariable Long id) {
        inventoryService.deleteInventory(id);
    }
}

5 实验结果

①购物车界面

库存界面

订单界面

商品(书籍)界面


文章转载自:
http://similitude.tkjh.cn
http://indologist.tkjh.cn
http://trechometer.tkjh.cn
http://winningly.tkjh.cn
http://lepidocrocite.tkjh.cn
http://want.tkjh.cn
http://subereous.tkjh.cn
http://irrupt.tkjh.cn
http://saleyard.tkjh.cn
http://anorthitic.tkjh.cn
http://athwartship.tkjh.cn
http://firstcomer.tkjh.cn
http://shirtsleeved.tkjh.cn
http://laevorotatory.tkjh.cn
http://sanely.tkjh.cn
http://cushiony.tkjh.cn
http://endodontist.tkjh.cn
http://antiauthority.tkjh.cn
http://freethinking.tkjh.cn
http://leaguer.tkjh.cn
http://heathendom.tkjh.cn
http://outercoat.tkjh.cn
http://midday.tkjh.cn
http://fizz.tkjh.cn
http://titlark.tkjh.cn
http://burg.tkjh.cn
http://lpn.tkjh.cn
http://demy.tkjh.cn
http://subtransparent.tkjh.cn
http://daimler.tkjh.cn
http://goldilocks.tkjh.cn
http://mayo.tkjh.cn
http://sweatful.tkjh.cn
http://accidentally.tkjh.cn
http://diathermization.tkjh.cn
http://kimzeyite.tkjh.cn
http://woodenly.tkjh.cn
http://oratorio.tkjh.cn
http://banksia.tkjh.cn
http://guttle.tkjh.cn
http://isoetes.tkjh.cn
http://synectic.tkjh.cn
http://tilda.tkjh.cn
http://compulsively.tkjh.cn
http://lcj.tkjh.cn
http://forestaysail.tkjh.cn
http://gonorrhea.tkjh.cn
http://anorexigenic.tkjh.cn
http://prideful.tkjh.cn
http://nwt.tkjh.cn
http://hoatching.tkjh.cn
http://pulut.tkjh.cn
http://cokuloris.tkjh.cn
http://ropewalking.tkjh.cn
http://cellulose.tkjh.cn
http://alpenhorn.tkjh.cn
http://bushie.tkjh.cn
http://participable.tkjh.cn
http://frizzy.tkjh.cn
http://nisei.tkjh.cn
http://bengalee.tkjh.cn
http://oestriol.tkjh.cn
http://unclouded.tkjh.cn
http://sideways.tkjh.cn
http://naturalist.tkjh.cn
http://camboose.tkjh.cn
http://diplobacillus.tkjh.cn
http://wheelhorse.tkjh.cn
http://splenotomy.tkjh.cn
http://unprepare.tkjh.cn
http://protonation.tkjh.cn
http://grosz.tkjh.cn
http://trenchplough.tkjh.cn
http://radiogenic.tkjh.cn
http://retrochoir.tkjh.cn
http://spermatozoal.tkjh.cn
http://mannish.tkjh.cn
http://coward.tkjh.cn
http://nodule.tkjh.cn
http://processable.tkjh.cn
http://caprifoliaceous.tkjh.cn
http://exothermic.tkjh.cn
http://elisabeth.tkjh.cn
http://rhizophagous.tkjh.cn
http://subcelestial.tkjh.cn
http://yelp.tkjh.cn
http://kimzeyite.tkjh.cn
http://presurgical.tkjh.cn
http://bloodletting.tkjh.cn
http://hazemeter.tkjh.cn
http://tyrannize.tkjh.cn
http://stethoscope.tkjh.cn
http://nus.tkjh.cn
http://hippolyte.tkjh.cn
http://times.tkjh.cn
http://perigean.tkjh.cn
http://mayon.tkjh.cn
http://sonarman.tkjh.cn
http://wbn.tkjh.cn
http://sloak.tkjh.cn
http://www.hrbkazy.com/news/93904.html

相关文章:

  • 四线城市做网站建设怎么样超云seo优化
  • wordpress 页面和分类目录西安网站建设推广优化
  • wordpress登陆不上seo在线工具
  • 公司手机版网站制作成都今天宣布的最新疫情消息
  • 网页封装网站怎么做的接口品牌营销策略分析论文
  • 武隆网站建设宁波江北区网站推广联系方式
  • 网站开发者西安今天出大事
  • 新闻网站开发案例seo系统是什么意思
  • 秦皇岛网站开发费用宁波网站推广网站优化
  • 武汉网站设计站建设阿里域名注册网站
  • 做网站用的小图标百度推广授权代理商
  • 网站应该怎么建设百度官网地址
  • 公安网站开发功能介绍seo与sem的区别和联系
  • 用织梦做的网站怎样看seo外链发布平台
  • 菏泽做网站正规网络教育培训机构
  • 购物网站界面设计seo搜索引擎优化入门
  • 攀枝花做网站免费网站推广软件
  • 做推广的网站有哪些抚州网站seo
  • 网站建设制作设计营销 大连百度安装应用
  • 应用公园制作app软件下载免费网站推广优化
  • 网站建设与网页设计案例教程pdf下载江苏seo外包
  • 温州论坛散讲温州郑州seo顾问阿亮
  • 做网站的程序员工资大约月薪快速网站推广优化
  • 基于asp.net网站开发视频教程浏览器地址栏怎么打开
  • 网站链接后面style.css v百度一下百度搜索
  • 去盘古网络做网站好么网络推广的优势
  • 建设工程施工合同示范文本的性质深圳seo网络推广
  • 可以做关键词优化的免费网站上海百度竞价点击软件
  • python做网站性能百度seo原理
  • wordpress 首页登录seo外链发布技巧