package org.dromara.app;

import com.wzj.soopin.content.domain.bo.ArticleBO;
import com.wzj.soopin.content.domain.vo.ArticleVO;
import com.wzj.soopin.content.service.IArticleService;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.dromara.common.core.domain.R;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/app/article")
@Tag(name = "内容管理")
@RequiredArgsConstructor
public class AppArticleController {

    private final IArticleService service;
    @Tag(name = "轮播列表")
    @PostMapping("/carousel")
    public R<List<ArticleVO>> carousel(@RequestBody ArticleBO bo) {
        bo.setType(1);//轮播图
        bo.setCategoryId(1l);
        List<ArticleVO> articleList = service.selectVoList( bo.toWrapper());
        return R.ok(articleList);
    }
}
