doum
2025-12-12 dce1e83ec27a066ebc6c17a4ac6d03c9ad6ff703
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package com.doumee.api.web;
 
import com.doumee.config.annotation.LoginRequired;
import com.doumee.core.model.ApiResponse;
import com.doumee.dao.business.model.Article;
import com.doumee.dao.web.dto.ArticleDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
 
import java.util.List;
 
/**
 * Created by IntelliJ IDEA.
 *
 * @Author : Rk
 * @create 2023/3/23 17:33
 */
@Api(tags = "咖啡百科")
@RestController
@RequestMapping("/web/article")
@Slf4j
public class ArticleApi extends ApiController{
 
 
    /**
     * 条件查询单条记录
     *
     * @param article 实体对象
     * @return Article
     */
    /**
     * 咖啡百科详情
     * @param id
     * @return
     */
    @LoginRequired
    @ApiOperation(value = "咖啡百科详情", notes = "小程序端")
    @GetMapping("/findOneById")
    public ApiResponse<Article> findOneById(@RequestParam Integer id){
 
        return ApiResponse.success(articleService.findById(id));
    }
 
    /**
     * 条件查询
     *
     * @param labelId 实体对象
     * @return List<Article>
     */
    @LoginRequired
    @ApiOperation(value = "咖啡百科列表", notes = "小程序端")
    @GetMapping("/findList")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true)
    })
    public ApiResponse<List<ArticleDTO>> findList(@RequestParam Integer labelId){
        Article article = new Article();
        article.setLabelId(labelId);
        return ApiResponse.success(articleService.findList(article));
    }
}