package com.ruoyi.web.modules.home.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.web.modules.home.service.IHomeAppService;

/**
 * C 端商城首页（Banner、类目导航、热销商品）
 */
@RestController
@RequestMapping("/api/home")
public class HomeAppController extends BaseController
{
    @Autowired
    private IHomeAppService homeAppService;

    @Anonymous
    @GetMapping("/banners")
    public AjaxResult banners()
    {
        return success(homeAppService.listBanners());
    }

    @Anonymous
    @GetMapping("/categories")
    public AjaxResult categories()
    {
        return success(homeAppService.listPlatformLevel1Nav());
    }

    @Anonymous
    @GetMapping("/hot-goods")
    public AjaxResult hotGoods()
    {
        return success(homeAppService.listHotGoods());
    }
}
