package sgc.portal.cs.cs0502.web;

import org.springframework.web.bind.annotation.*;
import sgc.portal.base.util.EasyHashMap;
import sgc.portal.cs.cs0502.service.CS05020001UService;
import sgc.portal.cs.cs0502.dto.CS05020001USearch;
import sgc.portal.cs.cs0502.model.CS05020001U;

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

@RestController
@RequestMapping("/cs/cs0502")
public class CS05020001UController {
	
	private final CS05020001UService service;

    public CS05020001UController(CS05020001UService service) {
        this.service = service;
    }

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