package com.dk.mdm.controller.mst;

import com.dk.common.response.ResponseResultVO;
import com.dk.mdm.model.pojo.mst.ComMenu;
import com.dk.common.service.BaseService;
import com.dk.mdm.model.query.mst.ComMenuQuery;
import com.dk.mdm.model.vo.mst.MenuFrequencyVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
import com.dk.mdm.service.mst.ComMenuService;

import java.util.List;

@Api(tags = "常用功能API接口")
@RestController
@RequestMapping("/mst/comMenu")
public class ComMenuController{

    public BaseService<ComMenu> getService() {
        return comMenuService;
    }

    @Autowired
    private ComMenuService comMenuService;

    /**
     * @desc : 条件查询
     * @author : 周兴
     * @date : 2024/3/29 10:36
     */
    @ApiOperation(value = "条件查询", notes = "条件查询")
    @PostMapping({"list_by"})
    public ResponseResultVO<?> selectByCond(@RequestBody ComMenuQuery comMenuQuery) {
        return comMenuService.selectByCond(comMenuQuery);
    }

    /**
     * @desc : 查询常用菜单以及功能频率高的菜单
     * @author : 周兴
     * @date : 2024/3/29 10:36
     */
    @ApiOperation(value = "查询常用菜单以及功能频率高的菜单", notes = "查询常用菜单以及功能频率高的菜单")
    @PostMapping({"select_menu"})
    public ResponseResultVO<?> selectMenu(@RequestBody ComMenuQuery comMenuQuery) {
        return comMenuService.selectMenu(comMenuQuery);
    }

    /**
     * @desc   : 保存常用功能
     * @author : 周兴
     * @date   : 2024/3/28 9:13
     */
    @ApiOperation( value = "保存常用功能", notes = "保存常用功能" )
    @PostMapping({"save"})
    public ResponseResultVO<?> save(@RequestBody List<ComMenu> comMenuList) {
        return comMenuService.save(comMenuList);
    }
}
