package sgc.portal.cs.cs0501.web;

import org.springframework.web.bind.annotation.*;
import sgc.portal.base.util.EasyHashMap;
import sgc.portal.cs.cs0501.service.CS05010001UService;
import sgc.portal.cs.cs0501.dto.CS05010001USearch;
import sgc.portal.cs.cs0501.model.CS05010001U;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/cs/cs0501")
public class CS05010001UController {
	
	private final CS05010001UService service;

    public CS05010001UController(CS05010001UService service) {
        this.service = service;
    }

	//카테고리 트리 조회
    @PostMapping("/CS05010001U/selectTcsDocTree")
    public List<EasyHashMap<String, Object>> selectTcsDocTree(@RequestBody CS05010001USearch search) {
        return service.selectTcsDocTree(search);
    }
    
    //카테고리 내역 조회
    @PostMapping("/CS05010001U/selectTcsDocGrd")
    public List<EasyHashMap<String, Object>> selectTcsDocGrd(@RequestBody CS05010001USearch search) {
        return service.selectTcsDocGrd(search);
    }
    
	//카테고리 내역 수정
    @PostMapping("/CS05010001U/saveTcsDoc")
    public Map<String, String> saveTcsDoc(@RequestBody List<CS05010001U> cS05010001U) {
    	return service.saveTcsDoc(cS05010001U);
    }
}
