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

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.GetallSchoolDisableRequest;
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 com.sikey.wa04.common.interceptor.CurrentRequestUser;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 上课禁用
 *
 * @author luoyangwei
 * @date 2024 年 10 月 18 日 11:27:34
 */
@RestController
@RequestMapping(ProjectContextConstant.USER_CONTEXT_URL + "/user/child/school-disable/wristwatch")
public class SchoolDisableWristwatchController extends BaseController {

    @Resource
    private SchoolDisableService schoolDisableService;

    /**
     * 手表获取上课禁用
     *
     * @return ResponseEntity<GetallSchoolDisableResponse>
     * @see com.sikey.wa04.api.user.client.rest.SchoolDisableController#getall(GetallSchoolDisableRequest)
     */
    @Authenticated
    @GetMapping("/getall")
    public GetallSchoolDisableResponse getall() {
        GenericManufacturerHeader genericManufacturerHeader = genericManufacturerHeader();
        return schoolDisableService.getall(new GetallSchoolDisableRequest(CurrentRequestUser.get().getId()),genericManufacturerHeader,true);
    }
}
