package com.yami.shop.api.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yami.shop.bean.model.AdvertInfo;
import com.yami.shop.service.IAdvertInfoService;
import io.swagger.annotations.ApiOperation;
import org.springframework.http.ResponseEntity;
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 javax.annotation.Resource;


/**
 * 广告信息管理实现
 *
 * @author wy
 * @version 1.0.0
 * @since 2025-01-01
 */
@RestController
@RequestMapping("/advert")
public class AdvertInfoController {

    @Resource
    private IAdvertInfoService advertInfoService;

    @ApiOperation("搜索")
    @GetMapping("/search")
    public ResponseEntity<IPage<AdvertInfo>> search(@RequestParam(value = "advertName", required = false) String advertName,
                                                    @RequestParam(value = "status",required = false) Integer status,
                                                    @RequestParam(value = "current", required = false, defaultValue = "1") Integer current,
                                                    @RequestParam(value = "size",required = false, defaultValue = "10") Integer size) {
        return advertInfoService.search(advertName, status, current, size);
    }


}
