package com.waimai.api;

import com.waimai.common.annotation.Anonymous;
import com.waimai.common.core.domain.R;
import com.waimai.web.admin.domain.FoodCategory;
import com.waimai.web.admin.service.IFoodCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/category")
@Anonymous
public class Category {
    @Autowired
    private IFoodCategoryService foodCategoryService;

    @RequestMapping
    public R<List<FoodCategory>> selectAll() {
        return R.ok(
                foodCategoryService.selectFoodCategoryList(new FoodCategory())
        );
    }
}
