package com.guwan.controller;


import com.guwan.dal.dataobject.Order;
import com.guwan.dal.mysql.OrderMapper;
import com.guwan.service.IOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/orders")
public class OrderController {
    @Autowired
    private IOrderService orderService;

    @Autowired
    private OrderMapper orderMapper;

    @GetMapping
    public void createOrder() {
        System.out.println("orderService = ");

        for (int i = 1; i < 100; i++) {
            Order order = new Order(i, i, i);
            orderMapper.insert(order);
            //orderService.save(order);
        }
    }

}
