package com.guwan.service;


import com.guwan.dal.dataobject.Order;
import com.guwan.dal.mysql.OrderMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderService {
    @Autowired
    private OrderMapper orderMapper;

    public void createOrder(Order order) {
        orderMapper.insertOrder(order);
    }

    public List<Order> getOrdersByUserId(Long userId) {
        return orderMapper.selectOrdersByUserId(userId);
    }
}
