Helius
2021-01-12 c9b157e19d101fd2d9a79c3db673f0c2cacd481c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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;
    }
 
  
}