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.AuthUser;
import sgc.portal.com.com.service.ComAuthUserMngService;
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 ComAuthUserMngController {
    @Autowired
    private ComAuthUserMngService comAuthUserMngService;

    /**
     *

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

        return comAuthUserMngService.selectComAuthGrpMng(authgrps);
    }

    @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/saveComAuthUserMng")
    public void saveComAuthUserMng(@RequestBody List<AuthUser> authusers) {
        comAuthUserMngService.saveComAuthUserMng(authusers);
    }
}
