package sgc.portal.sample.sample0101.web;

import org.springframework.web.bind.annotation.*;
import sgc.portal.base.util.EasyHashMap;
import sgc.portal.sample.sample0101.dto.SAMPLE01010001USearch;
import sgc.portal.sample.sample0101.model.SAMPLE01010001U;
import sgc.portal.sample.sample0101.service.SAMPLE01010001UService;

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

@RestController
@RequestMapping("/sample/sample0101")
public class SAMPLE01010001UController {
    private final SAMPLE01010001UService service;

    public SAMPLE01010001UController(SAMPLE01010001UService service) {
        this.service = service;
    }
    
    /*
     * 조회 LIST
     */
    @PostMapping("/SAMPLE01010001U/list")
    public List<EasyHashMap<String, Object>> getList(@RequestBody SAMPLE01010001USearch search) {
        return service.getList(search);
    }
    
    /*
     * SAVE LIST
     */
    @PostMapping("/SAMPLE01010001U/save")
    public Map<String, String> save(@RequestBody List<SAMPLE01010001U> sAMPLE01010001U) {
    	return service.save(sAMPLE01010001U);
    }
    
    /*
     * draft
     */
    @PostMapping("/SAMPLE01010001U/draft")
    public Map<String, String> draft(@RequestBody SAMPLE01010001U sAMPLE01010001U) {
    	return service.draft(sAMPLE01010001U);
    }
    
}
