All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.nbsaas.boot.article.rest.resource.ArticleResource Maven / Gradle / Ivy

package com.nbsaas.boot.article.rest.resource;

import com.nbsaas.boot.article.api.apis.ArticleApi;
import com.nbsaas.boot.article.data.entity.Article;
import com.nbsaas.boot.article.api.domain.request.ArticleRequest;
import com.nbsaas.boot.article.api.domain.response.ArticleResponse;
import com.nbsaas.boot.article.api.domain.simple.ArticleSimple;
import com.nbsaas.boot.article.rest.convert.ArticleSimpleConvert;
import com.nbsaas.boot.article.rest.convert.ArticleEntityConvert;
import com.nbsaas.boot.article.rest.convert.ArticleResponseConvert;
import com.nbsaas.boot.article.data.repository.ArticleRepository;

import java.io.Serializable;
import com.nbsaas.boot.jpa.data.core.BaseResource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation;

import java.util.function.Function;
/**
*   业务接口实现
*/
@Transactional
@Service
public class ArticleResource extends BaseResource  implements ArticleApi {

    @Resource
    private ArticleRepository articleRepository;

    @Override
    public JpaRepositoryImplementation getJpaRepository() {
        return articleRepository;
    }

    @Override
    public Function getConvertSimple() {
        return new ArticleSimpleConvert();
    }

    @Override
    public Function getConvertForm() {
        return new ArticleEntityConvert();
    }

    @Override
    public Function getConvertResponse() {
        return new ArticleResponseConvert();
    }




}






© 2015 - 2025 Weber Informatics LLC | Privacy Policy