package com.sikey.wa04.api.user.client.rest;

import com.sikey.wa04.business.application.service.user.SchoolDisableService;
import com.sikey.wa04.business.infrastructure.configuration.ProjectContextConstant;
import com.sikey.wa04.business.infrastructure.dto.request.schooldisable.CreateSchoolDisableRequest;
import com.sikey.wa04.business.infrastructure.dto.request.schooldisable.DeleteSchoolDisableRequest;
import com.sikey.wa04.business.infrastructure.dto.request.schooldisable.GetallSchoolDisableRequest;
import com.sikey.wa04.business.infrastructure.dto.request.schooldisable.UpdateSchoolDisableRequest;
import com.sikey.wa04.business.infrastructure.dto.response.schooldisable.GetallSchoolDisableResponse;
import com.sikey.wa04.common.BaseController;
import com.sikey.wa04.common.dto.header.GenericManufacturerHeader;
import com.sikey.wa04.common.interceptor.Authenticated;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.web.bind.annotation.*;

/**
 * 上课禁用
 */
@RestController
@RequestMapping(ProjectContextConstant.USER_CONTEXT_URL + "/user/child/school-disable")
public class SchoolDisableController extends BaseController {

    @Resource
    private SchoolDisableService schoolDisableService;

    @Authenticated
    @PostMapping("/create")
    public void create(@Valid @RequestBody CreateSchoolDisableRequest request) {
        GenericManufacturerHeader genericManufacturerHeader = genericManufacturerHeader();
        schoolDisableService.create(request,genericManufacturerHeader);
    }

    @Authenticated
    @PostMapping("/update")
    public void update(@Valid @RequestBody UpdateSchoolDisableRequest request) {
        GenericManufacturerHeader genericManufacturerHeader = genericManufacturerHeader();
        schoolDisableService.update(request,genericManufacturerHeader);
    }

    @Authenticated
    @GetMapping("/delete")
    public void delete(@Valid DeleteSchoolDisableRequest request) {
        GenericManufacturerHeader genericManufacturerHeader = genericManufacturerHeader();
        schoolDisableService.delete(request,genericManufacturerHeader);
    }

    @Authenticated
    @GetMapping("/getall")
    public GetallSchoolDisableResponse getall(@Valid GetallSchoolDisableRequest request) {
        GenericManufacturerHeader genericManufacturerHeader = genericManufacturerHeader();
        return schoolDisableService.getall(request,genericManufacturerHeader,false);
    }

}
