package com.ruoyi.novel.service.impl;

import com.ruoyi.novel.domain.Novel;
import com.ruoyi.novel.mapper.NovelMapper;
import com.ruoyi.novel.service.NovelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;
import java.util.List;

// NovelServiceImpl.java
@Service
public class NovelServiceImpl implements NovelService {

    @Autowired
    private NovelMapper novelMapper;

    @Override
    public List<Novel> selectNovelList(Novel novel) {
        return novelMapper.selectNovelList(novel);
    }

    @Override
    @Transactional
    public int insertNovel(Novel novel) {
        novel.setCreateTime(new Date());
        return novelMapper.insertNovel(novel);
    }

    // 其他CRUD方法...
}
