package sgc.portal.com.com.web;

import sgc.portal.base.util.EasyHashMap;
import sgc.portal.com.com.model.ComPasswordPolicy;
import sgc.portal.com.com.service.ComPasswordPolicyService;
import sgc.portal.security.annotation.Secured;
import sgc.portal.security.annotation.SecurityPolicy;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
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;

/**
 *
 * 역할 관리 용 CRUD 및 리스트 조회
 *
 *
 * @author kimsg
 *
 * @version 1.0.0
 * @date 2020. 5. 16.
 */
@RestController
public class ComPasswordPolicyController {

	@Autowired
	private ComPasswordPolicyService comPasswordPolicyService;

	@PostMapping(value = "/com/com/selectComPasswordPolicyList")
	public List<EasyHashMap<String, Object>> selectComPasswordPolicyList(@RequestBody ComPasswordPolicy comPasswordPolicy) {
		return comPasswordPolicyService.selectComPasswordPolicyList(comPasswordPolicy);
	}
	
	@GetMapping("/com/com/selectComPasswordPolicyMap")
	@Secured(policy = SecurityPolicy.NONE)
	public EasyHashMap<String, Object> selectComPasswordPolicyMap() {
		return comPasswordPolicyService.selectComPasswordPolicyMap();
	}

	@PostMapping(value = "/com/com/saveComPasswordPolicy")
	public Map<String, Object> saveComPasswordPolicy(@RequestBody ComPasswordPolicy comPasswordPolicy) {
		return comPasswordPolicyService.saveComPasswordPolicy(comPasswordPolicy);
	}

}
