package com.fs.company.controller.store;

import com.fs.common.annotation.Log;
import com.fs.common.core.controller.BaseController;
import com.fs.common.core.domain.AjaxResult;
import com.fs.common.core.page.TableDataInfo;
import com.fs.common.core.redis.RedisCache;
import com.fs.common.enums.BusinessType;
import com.fs.common.utils.poi.ExcelUtil;
import com.fs.his.domain.FsPackageCate;
import com.fs.his.param.FsPackageCateUParam;
import com.fs.his.service.IFsPackageCateService;
import com.fs.his.vo.OptionsVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
 * 套餐包分类Controller
 *
 * @author fs
 * @date 2024-05-08
 */
@RestController
@RequestMapping("/store/packageCate")
public class FsPackageCateController extends BaseController
{
    @Autowired
    private IFsPackageCateService fsPackageCateService;
    @Autowired
    RedisCache redisCache;
    /**
     * 查询套餐包分类列表
     */
    @GetMapping("/list")
    public TableDataInfo list(FsPackageCateUParam fsPackageCate)
    {
        startPage();
        List<FsPackageCate> list = fsPackageCateService.selectFsPackageCateList(fsPackageCate);
        return getDataTable(list);
    }


    /**
     * 获取套餐包分类详细信息
     */
    @GetMapping(value = "/{cateId}")
    public AjaxResult getInfo(@PathVariable("cateId") Long cateId)
    {
        return AjaxResult.success(fsPackageCateService.selectFsPackageCateByCateId(cateId));
    }



    @GetMapping("/allList")
    public AjaxResult allList()
    {
        Map map = fsPackageCateService.selectFsArticleCateAllList();
        return AjaxResult.success(map);
    }
    @GetMapping("/cateList")
    public TableDataInfo cateList()
    {
        List<OptionsVO> list = fsPackageCateService.selectCateList();
        return getDataTable(list);
    }
}
