package com.icomsys.main_vm.biz.common.system.controller;

import com.google.gson.Gson;
import com.icomsys.main_vm.biz.common.system.service.SystemPolicyMenuService;
import com.icomsys.main_vm.biz.common.system.vo.*;
import com.icomsys.main_vm.common.code.MenuVo;
import com.querydsl.core.QueryResults;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Controller
@Slf4j
@RequiredArgsConstructor
@RequestMapping("/admin/common/system")
public class SystemPolicyMenuController {

    private final SystemPolicyMenuService systemPolicyMenuService;
    /**
     * 삭제한 메뉴입니다
     */

    @GetMapping("/policyMenu/manage.do")
    public String PolicyMenuView(){
        return "/adm/common/system/policyMenu";
    }

    @PostMapping("/policyMenu/list")
    @ResponseBody
    public DslDataTableRes<SystemPolicyMenuRes> PolicyMenuList(@RequestBody SystemPolicyMenuReq dto) {
        DslDataTableRes<SystemPolicyMenuRes> result = systemPolicyMenuService.PolicyMenuList(dto);
        log.info("PolicyMenuList result = {}", new Gson().toJson(result));
        return result;
    }


}
