package com.boyue.hasfj.controller;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
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 com.boyue.common.core.controller.BaseController;
import com.boyue.common.core.page.TableDataInfo;
import com.boyue.hasfj.domain.HtmlPages;
import com.boyue.hasfj.service.IHtmlPagesService;
import com.github.pagehelper.PageHelper;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;

/**
 * 司法局前端API接口
 *
 * @author boyue
 */
@RestController
@RequestMapping("/api/hasfj")
@Tag(name = "司法局前端API接口")
public class ApiController extends BaseController
{
    @Autowired
    private IHtmlPagesService htmlPagesService;

    /**
     * 获取二维码数据列表
     */
    @Operation(summary = "获取二维码数据列表")
    @GetMapping("/qrcodes")
    public TableDataInfo getQRCodes(
            @RequestParam(value = "type", required = false, defaultValue = "law") String type,
            @RequestParam(value = "pageNum", required = false, defaultValue = "1") Integer pageNum,
            @RequestParam(value = "pageSize", required = false, defaultValue = "6") Integer pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        HtmlPages htmlPages = new HtmlPages();
        htmlPages.setPageType(type);
        htmlPages.setStatus(1); // 只查询启用状态的
        List<HtmlPages> list = htmlPagesService.selectHtmlPagesList(htmlPages);
        return getDataTable(list);
    }
} 