package sgc.portal.com.auth.web;

import sgc.portal.com.auth.model.SmComHdlgAuth;
import sgc.portal.com.auth.service.ComBusiHandleAuthMngService;
import sgc.portal.base.util.EasyHashMap;
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;
import java.util.Map;

/**********************************************************
 * 시스템명   : 운영관리
 * 프로그램ID : ComBusiHandleAuthMngController
 * 프로그램명 :  업무취급권한 Controller
 * @author  : 박상우
 * @version  :  2020-08-21
 * @see   1.최초 작성
 */
@RestController
public class ComBusiHandleAuthMngController {

    @Autowired
    private ComBusiHandleAuthMngService comBusiHandleAuthMngService;

    /**
     * 업무취급권한 정보 조회
     * Select gbb rule code mng list.
     *
     * @param smComHdlgAuth the sm com hdlg auth
     * @return the list
     */
    @PostMapping(value = "/com/auth/selectComBusiHandleAuthMng")
    public List<EasyHashMap<String, Object>> selectGbbRuleCodeMng(@RequestBody SmComHdlgAuth smComHdlgAuth) {

        return comBusiHandleAuthMngService.selectComBusiHandleAuthMng(smComHdlgAuth);
    }

    /**
     * 업무취급권한 정보 조회(combo)
     * Select com busi handle auth mng combo list.
     *
     * @param smComHdlgAuth the sm com hdlg auth
     * @return the list
     */
    @PostMapping(value = "/com/auth/selectComBusiHandleAuthMngCombo")
    public List<EasyHashMap<String, Object>> selectComBusiHandleAuthMngCombo(@RequestBody SmComHdlgAuth smComHdlgAuth) {

        return comBusiHandleAuthMngService.selectComBusiHandleAuthMngCombo(smComHdlgAuth);
    }

    /**
     * 업무취급권한 정보 저장
     * Save com busi handle auth mng map.
     *
     * @param smComHdlgAuthes the sm com hdlg authes
     * @return the map
     */
    @PostMapping(value = "/com/auth/saveComBusiHandleAuthMng")
    public Map<String,String> saveComBusiHandleAuthMng(@RequestBody List<SmComHdlgAuth> smComHdlgAuthes) {

        return comBusiHandleAuthMngService.saveComBusiHandleAuthMng(smComHdlgAuthes);
    }
}
