package com.hc.gpweb.controller.front;

import com.hc.gpbusiness.service.WebQrCodeService;
import com.hc.gpcore.utils.result.Result;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;


/**
 * 官网二维码表(WebQrCode)表控制层
 *
 * @author makejava
 * @since 2024-11-21 14:30:55
 */

@RestController
@RequestMapping("/api/front/QrCode")
public class FrontQrCodeController {

    /**
     * 服务对象
     */
    private final WebQrCodeService webQrCodeService;

    public FrontQrCodeController(WebQrCodeService webQrCodeService) {
        this.webQrCodeService = webQrCodeService;
    }


    @GetMapping("/list")
    @ApiOperation(value = "获取QR列表(分页)", response = Result.class)
    public Result listZccmQrAccessory(@RequestParam(defaultValue = "0") Integer page,
                                      @RequestParam(defaultValue = "0") Integer size,
                                      @ApiParam(value = "qrName1") @RequestParam(required = false) String qrName1,
                                      @ApiParam(value = "qrName2") @RequestParam(required = false) String qrName2,
                                      @ApiParam(value = "12表示文件 视频") @RequestParam(required = false) Integer qrType,
                                      @ApiParam(value = "章节ID") @RequestParam(required = false) Integer qrId1,
                                      @ApiParam(value = "章节ID") @RequestParam(required = false) Integer qrId2,
                                      @ApiParam(value = "文件名") @RequestParam(required = false) String fileName) {
        return Result.success(webQrCodeService.queryByAll(page, size,qrName1,qrName2,qrType,qrId1,qrId2,fileName));
    }

}
