“mitao”
2025-12-10 19f88869bf518a66511d077b50ec422226e8da9f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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<List<TBanner>> getBannerList() {
        List<TBanner> tBannerList = tBannerService.list();
        return R.ok(tBannerList);
    }
 
    @ApiOperation(value = "首页模块--轮播图详情",response = TBanner.class)
    @GetMapping(value = "/getBannerDetail/{id}")
    public R<TBanner> getBannerDetail(@PathVariable String id) {
        TBanner tBanner = tBannerService.getById(id);
        return R.ok(tBanner);
    }
 
}