package com.yaoyuan.jiscuss.service.impl;

import com.yaoyuan.jiscuss.entity.DiscussionTag;
import com.yaoyuan.jiscuss.repository.DiscussionsTagsRepository;
import com.yaoyuan.jiscuss.service.IDiscussionsTagsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import org.springframework.transaction.annotation.Transactional;
import java.util.List;

@Service
public class DiscussionsTagsServiceImpl implements IDiscussionsTagsService {

    @Autowired
    private DiscussionsTagsRepository discussionsTagsRepository;

    @Transactional(readOnly = true)
    @Override
    public List<DiscussionTag> getAllList() {
        return discussionsTagsRepository.findAll();
    }

    @Transactional
    @Override
    public DiscussionTag insert(DiscussionTag discussionTag) {
        return discussionsTagsRepository.save(discussionTag);
    }
}
