package com.cool.store.controller.webc;

import com.cool.store.response.ResponseResult;
import com.cool.store.service.menu.MiniMenuService;
import com.cool.store.vo.menu.MiniMenuConfigVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 小程序菜单配置 前端控制器
 * </p>
 *
 * @author wangff
 * @since 2025/10/31
 */
@RestController
@RequestMapping({"/mini/menu"})
@Api(tags = "Mini菜单配置")
@RequiredArgsConstructor
public class MiniMenuController {
    private final MiniMenuService miniMenuService;

    @ApiOperation("当前用户菜单配置")
    @GetMapping("/userConfig")
    public ResponseResult<List<MiniMenuConfigVO>> getCurrentUserConfig() {
        return ResponseResult.success(miniMenuService.getUserMiniMenu());
    }
}
