package com.tongran.system.controller;

import com.tongran.common.core.web.controller.BaseController;
import com.tongran.common.core.web.domain.AjaxResult;
import com.tongran.common.log.annotation.Log;
import com.tongran.common.log.enums.BusinessType;
import com.tongran.system.domain.SysMenuClick;
import com.tongran.system.service.ISysMenuClickService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 菜单点击计数Controller
 * 
 * @author tongran
 * @date 2025-11-12
 */
@RestController
@RequestMapping("/sysMenuClick")
public class SysMenuClickController extends BaseController
{
    @Autowired
    private ISysMenuClickService sysMenuClickService;

    /**
     * 查询菜单点击计数列表
     */
    @GetMapping("/getMenuListTopEight")
    public AjaxResult list()
    {
        List<SysMenuClick> list = sysMenuClickService.selectSysMenuClickList();
        return success(list);
    }
    /**
     * 新增菜单点击计数
     */
    @Log(title = "菜单点击计数", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody SysMenuClick sysMenuClick)
    {
        return toAjax(sysMenuClickService.insertSysMenuClick(sysMenuClick));
    }
}
