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.AuthUserPrg;
import sgc.portal.com.com.service.ComAuthUserPrgMngService;
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 : ComAuthUserMngController
 * 프로그램명   : 개인별권한그룹관리 Controller
 * @author      : Kim Gyu Yong(aaaa@aaa.co.kr)
 * @version   :  2020-09-05
 * @since JDK1.8
 * @see
 * 1. 최초 작성
**********************************************************/

@RestController
public class ComAuthUserPrgMngController {
    @Autowired
    private ComAuthUserPrgMngService comAuthUserPrgMngService;

    /**
     *

     * @param
     * @return
     * @throws Exception
     *
     */

    @PostMapping(value = "/com/com/selectComAuthPrgMngGrp")
    public List<EasyHashMap<String, Object>> selectComAuthPrgMngGrp(@RequestBody AuthUserPrg authUserPrg) {

        return comAuthUserPrgMngService.selectComAuthPrgMngGrp(authUserPrg);
    }

    @PostMapping(value = "/com/com/selectComAuthPrgMngMenu")
    public List<EasyHashMap<String, Object>> selectComAuthPrgMngMenu(@RequestBody AuthGrp authGrp) {

        return comAuthUserPrgMngService.selectComAuthPrgMngMenu(authGrp);
    }

    @PostMapping(value = "/com/com/selectComAuthPrgMngUser")
    public List<EasyHashMap<String, Object>> selectComAuthPrgMngUser(@RequestBody AuthUserPrg authUserPrg) {

        return comAuthUserPrgMngService.selectComAuthPrgMngUser(authUserPrg);
    }

    @PostMapping(value = "/com/com/selectComAuthPrgMngUserDtl")
    public List<EasyHashMap<String, Object>> selectComAuthPrgMngUserDtl(@RequestBody AuthUserPrg authUserPrg) {

        return comAuthUserPrgMngService.selectComAuthPrgMngUserDtl(authUserPrg);
    }
    /*

    @PostMapping(value = "/com/com/saveComAuthGrpMng")
    public void saveComAuthGrpMng(@RequestBody List<AuthGrp> authgrps) {
        comAuthUserMngService.saveComAuthGrpMng(authgrps);
    }



    //등록자 조회
    @PostMapping(value = "/com/com/selectComAuthUserMng")
    public List<EasyHashMap<String, Object>> selectComAuthUserMng(@RequestBody AuthUser authusers) {

        return comAuthUserMngService.selectComAuthUserMng(authusers);
    }

    //미등록자조회
    @PostMapping(value = "/com/com/selectComAuthUserNoMng")
    public List<EasyHashMap<String, Object>> selectComAuthUserNoMng(@RequestBody AuthUser authusers) {

        return comAuthUserMngService.selectComAuthUserNoMng(authusers);
    }
    */

    @PostMapping(value = "/com/com/saveComAuthPrgMngUser")
    public void saveComAuthPrgMngUser(@RequestBody List<AuthUserPrg> authUserPrg) {
        comAuthUserPrgMngService.saveComAuthPrgMngUser(authUserPrg);
    }

    @PostMapping(value = "/com/com/saveComAuthPrgMngUserDtl")
    public void saveComAuthPrgMngUserDtl(@RequestBody List<AuthUserPrg> authUserPrg) {
        comAuthUserPrgMngService.saveComAuthPrgMngUserDtl(authUserPrg);
    }

}
