package sgc.portal.cs.cs0101.web;

import org.springframework.web.bind.annotation.*;
import sgc.portal.base.util.EasyHashMap;
import sgc.portal.cs.cs0101.service.CS01010001UService;
import sgc.portal.cs.cs0101.dto.CS01010001USearch;
import sgc.portal.cs.cs0101.model.CS01010001U;

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

@RestController
@RequestMapping("/cs/cs0101")
public class CS01010001UController {
	
	private final CS01010001UService service;

    public CS01010001UController(CS01010001UService service) {
        this.service = service;
    }

	//공지사항 조회
    @PostMapping("/CS01010001U/selectTcsNotiList")
    public List<EasyHashMap<String, Object>> selectTcsNotiList(@RequestBody CS01010001USearch search) {
        return service.selectTcsNotiList(search);
    }
    
    //공지사항 조회 팝업
    @PostMapping("/CS01010001U/selectTcsNotiPopList")
    public EasyHashMap<String, Object> selectTcsNotiPopList(@RequestBody CS01010001USearch search) {
        return service.selectTcsNotiPopList(search);
    }
    
    //첨부파일 조회
    @PostMapping("/CS01010001U/selectFileList")
    public List<EasyHashMap<String, Object>> selectFileList(@RequestBody CS01010001USearch search) {
        return service.selectFileList(search);
    }

	//공지사항 등록 수정
    @PostMapping("/CS01010001U/saveTcsNotiList")
    public Map<String, String> saveTcsNotiList(@RequestBody CS01010001U cS01010001U) {
    	return service.saveTcsNotiList(cS01010001U);
    }
    
    //첨부파일
    @PostMapping("/CS01010001U/updateAflId")
    public Map<String, String> updateAflId(@RequestBody CS01010001U cS01010001U) {
    	return service.updateAflId(cS01010001U);
    }
    
    //공지사항 삭제
    @PostMapping("/CS01010001U/deleteTcsNotiList")
    public void deleteTcsNotiList(@RequestBody CS01010001U cS01010001U) {
    	service.deleteTcsNotiList(cS01010001U);
    }
}
