package com.lovecoding.mvc.service;

import com.lovecoding.mvc.dao.BookDao;
import com.lovecoding.mvc.model.Book;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class BookServiceImpl implements BookService {

    @Autowired
    Book book;

    @Override
    public int add(BookDao book) {
        int add = this.book.add(book);
        return add;
    }

    @Override
    public int del(Long bookId) {
        int add = this.book.del(bookId);
        return add;
    }


    public int update(BookDao book) {
        int update = this.book.update(book);
        return update;
    }


    public BookDao get(Long bookId) {
        return this.book.get(bookId);
    }

    @Override
    public List<Map<String, Object>> get() {
        return this.book.get();
    }
}
