package sgc.portal.com.com.web;

import sgc.portal.base.util.EasyHashMap;
import sgc.portal.com.com.model.AuthGrp;
import sgc.portal.com.com.model.GrpPrg;
import sgc.portal.com.com.model.Menu;
import sgc.portal.com.com.model.Program;
import sgc.portal.com.com.service.ComAuthPrgMngService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**********************************************************
 * 시스템명  : 시스템관리(COM)
 * 프로그램ID : ComAuthPrgMngController
 * 프로그램명   : 권한그룹관리 Controller
 * @author       : mir(aaaa@aaa.co.kr)
 * @version   :  2020-09-07
 * @since JDK1.8
 * @see
 * 1. 최초 작성
**********************************************************/
@RestController
public class ComAuthPrgMngController {

    @Autowired
    private ComAuthPrgMngService comAuthPrgMngService;

    /**
     *

     * @param
     * @return
     * @throws Exception
     *
     */
    @PostMapping(value = "/com/com/selectComAuthPrgGrpMng")
    public List<EasyHashMap<String, Object>> selectComAuthPrgGrpMng(@RequestBody AuthGrp authgrps) {

        return comAuthPrgMngService.selectComAuthPrgGrpMng(authgrps);
    }

    @PostMapping(value = "/com/com/saveComAuthPrgMenuMng")
    public void saveComAuthPrgMenuMng(@RequestBody List<Menu> menus) {
        comAuthPrgMngService.saveComAuthPrgMenuMng(menus);
    }

    @PostMapping(value = "/com/com/saveComAuthPrgMng")

    public void saveComAuthGrpMng(@RequestBody List<GrpPrg> grpprgs) {

        comAuthPrgMngService.saveComAuthPrgMng(grpprgs);
    }

    @PostMapping(value = "/com/com/deleteComAuthPrgMng")
    public void deleteComAuthPrgMenuMng(@RequestBody List<GrpPrg> grpprgs) {
        comAuthPrgMngService.deleteComAuthPrgMenuMng(grpprgs);
    }

    @PostMapping(value = "/com/com/selectComAuthPrgMng")
    public List<EasyHashMap<String, Object>> selectComAuthPrgMng(@RequestBody GrpPrg grpprgs) {

        return comAuthPrgMngService.selectComAuthPrgMng(grpprgs);
    }

    @PostMapping(value = "/com/com/selectComAuthPrgMenuMng")
    public List<EasyHashMap<String, Object>> selectComAuthPrgMenuMng(@RequestBody Menu menus) {

        return comAuthPrgMngService.selectComAuthPrgMenuMng(menus);
    }

    @PostMapping(value = "/com/com/selectComAuthPrgPrgMng")
    public List<EasyHashMap<String, Object>> selectComAuthPrgPrgMng(@RequestBody Program prgs) {

        return comAuthPrgMngService.selectComAuthPrgPrgMng(prgs);
    }
/*
    @PostMapping(value = "/com/com/updateComAuthPrgMng")
    public void updateComAuthPrgMng(@RequestBody List<AuthUser> authusers) {
        comAuthPrgMngService.updateComAuthPrgMng(authusers);
    }
    */
}
