package com.ruoyi.web.controller.api; import com.ruoyi.common.core.domain.R; import com.ruoyi.system.model.TBanner; import com.ruoyi.system.service.TBannerService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.context.annotation.Lazy; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.List; @Slf4j @RestController @RequestMapping("/index") @Api(tags = "首页模块") @RequiredArgsConstructor(onConstructor_ = {@Lazy}) public class IndexController { private final TBannerService tBannerService; @ApiOperation(value = "首页模块--轮播图",response = TBanner.class) @GetMapping(value = "/getBannerList") public R> getBannerList() { List tBannerList = tBannerService.list(); return R.ok(tBannerList); } @ApiOperation(value = "首页模块--轮播图详情",response = TBanner.class) @GetMapping(value = "/getBannerDetail/{id}") public R getBannerDetail(@PathVariable String id) { TBanner tBanner = tBannerService.getById(id); return R.ok(tBanner); } }