package com.matrix.system.shopXcx.action; 
 | 
  
 | 
import com.matrix.core.pojo.AjaxResult; 
 | 
import com.matrix.system.shopXcx.bean.ShopArticle; 
 | 
import com.matrix.system.shopXcx.dao.ShopArticleDao; 
 | 
import org.springframework.beans.factory.annotation.Autowired; 
 | 
import org.springframework.stereotype.Controller; 
 | 
import org.springframework.web.bind.annotation.*; 
 | 
  
 | 
import java.util.List; 
 | 
  
 | 
/** 
 | 
 * @description 文章 
 | 
 * @author jiangyouyao 
 | 
 * @date 2019-06-10 14:41 
 | 
 */ 
 | 
@Controller 
 | 
@RequestMapping(value = "shopArticleApi") 
 | 
public class ShopArticleApiAction { 
 | 
  
 | 
    @Autowired 
 | 
    private ShopArticleDao shopArticleDao; 
 | 
  
 | 
    /** 
 | 
     * 根据类型code查询类型文章 
 | 
     * @param 
 | 
     * @return 
 | 
     */ 
 | 
    @PostMapping("/findArticleByArtypeCode/{artypeCode}") 
 | 
    @ResponseBody 
 | 
    public AjaxResult getArticleByArtypeCode(@PathVariable("artypeCode") String artypeCode) { 
 | 
        List<ShopArticle> shopArticles = shopArticleDao.selectArticleByArtypeCode(artypeCode); 
 | 
        AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, shopArticles); 
 | 
        return result; 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 根据标题和类型查询文章接口 
 | 
     * @param 
 | 
     * @return 
 | 
     */ 
 | 
    @PostMapping("/findArticleByTitleAndType") 
 | 
    @ResponseBody 
 | 
    public AjaxResult findArticleByTitleAndType(@RequestBody ShopArticle shopArticle) { 
 | 
        List<ShopArticle> shopArticles = shopArticleDao.findArticleByTitleAndType(shopArticle); 
 | 
        AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, shopArticles); 
 | 
        return result; 
 | 
    } 
 | 
  
 | 
   
 | 
} 
 |