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

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
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.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.web.modules.category.service.IPlatformCategoryService;

/**
 * 商家端只读：平台商品分类（biz_goods_category，shop_id IS NULL）
 */
@RestController
@RequestMapping("/agri/seller/category")
public class SellerPlatformCategoryController extends BaseController
{
    @Autowired
    private IPlatformCategoryService platformCategoryService;

    /**
     * 发品「商品分类」下拉：平台二级分类（一级 &gt; 二级）
     */
    @PreAuthorize("@ss.hasPermi('agri:seller:goods:list') or @ss.hasPermi('agri:seller:goods:add') or @ss.hasPermi('agri:seller:goods:edit')")
    @GetMapping("/platformLevel2Options")
    public AjaxResult platformLevel2Options()
    {
        return success(platformCategoryService.selectPlatformLevel2Options());
    }
}
