package sgc.portal.com.com.web;

import sgc.portal.base.util.EasyHashMap;
import sgc.portal.com.com.model.Program;
import sgc.portal.com.com.service.ComPrgService;
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	: ComPrgController
 * 프로그램명	: 프로그램 관리 Controller
 * @author	: SBK
 * @version	: 2023-07-25
 * @since JDK1.8
 * @see
 * 1. 최초 작성
**********************************************************/

@RestController
public class ComPrgController {

	@Autowired
	private ComPrgService comPrgService;

    /**
     * Select com prg reg search list list.
     *
     * @param prg the prg
     * @return the list
     */
    @PostMapping(value = "/com/com/selectComPrgRegSearchList")
    public List<EasyHashMap<String, Object>> selectComPrgRegSearchList(@RequestBody Program prg){
        return comPrgService.selectComPrgRegList(prg);
    }

    /**
     * Select com prg reg search list list.
     *
     * @param prg the prg
     * @return the list
     */
    @PostMapping(value = "/pwa/com/selectComPrgRegSearchList")
    public List<EasyHashMap<String, Object>> selectComPrgRegSearchList2(@RequestBody Program prg){
        return comPrgService.selectComPrgRegList(prg);
    }
   
    /**
     * Save com prg reg list.
     *
     * @param prg the prg
     */
    @PostMapping(value = "/com/com/saveComPrgRegList")
    public void saveComPrgRegList(@RequestBody List<Program> prg){
        comPrgService.saveComPrgRegInsert(prg);
    }

    /**
     * Select prg id.
     *
     * @param prg the prg
     * @return the map
     */
    @PostMapping(value = "/com/com/selectPrgId")
    public EasyHashMap<String, Object> selectPrgId(@RequestBody Program prg){
        return comPrgService.selectPrgId(prg);
    }

}
