package sgc.portal.base.web;

import sgc.portal.base.util.EasyHashMap;
import sgc.portal.base.model.SmComHelp;
import sgc.portal.base.service.ComHelpDeskService;
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;

/**********************************************************
 * 시스템명  : 시스템관리(COM)
 * 프로그램ID : ComHelpDeskController
 * 프로그램명   : 도움말
 * @author  : mir(aaaa@aaa.co.kr)
 * @version  :  2020-10-26
 * @since JDK1.8
 * @see   1.최초 작성
 */
@RestController
public class ComHelpDeskController {

    @Autowired
    private ComHelpDeskService comHelpDeskService;

    /**
     * Select comm pop list.
     *
     * @param smComHelp the sm com help
     * @return list
     * @throws Exception `
     */
//공통내역 코드정보 조회
    @PostMapping(value = "/com/pop/selectHelpDesk")
    public List<EasyHashMap<String, Object>>  selectCommPop(@RequestBody SmComHelp smComHelp) {
        return comHelpDeskService.selectHelpdesk(smComHelp);
    }

    /**
     * Save help desk map.
     *
     * @param smComHelp the sm com help
     * @return the map
     */
    @PostMapping(value = "/com/pop/saveHelpDesk")
    public Map<String,String> saveHelpDesk(@RequestBody SmComHelp smComHelp) {
        return comHelpDeskService.saveHelpDesk(smComHelp);
    }

}
