package com.cyl.h5.controller;

import com.cyl.manager.oth.domain.entity.BlackImgInfo;
import com.cyl.manager.oth.domain.query.BlackImgInfoQuery;
import com.cyl.manager.oth.service.BlackImgInfoService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.enums.BusinessType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 背景图管理信息Controller
 *
 * @author zcc
 * @date 2024-08-01
 */
@Api(description ="小程序-背景图管理信息接口列表")
@RestController
@RequestMapping("/h5/blackImgInfo")
public class H5BlackImgInfoController extends BaseController {
    @Autowired
    private BlackImgInfoService service;


    @ApiOperation("小程序-查询背景图管理信息列表")
    @PostMapping("/list")
    public ResponseEntity<Page<BlackImgInfo>> list(@RequestBody BlackImgInfoQuery query, Pageable page) {
        List<BlackImgInfo> list = service.selectList(query, page);
        return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal()));
    }
}
