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

import com.sikey.wa04.business.application.service.user.AlarmClockService;
import com.sikey.wa04.business.infrastructure.configuration.ProjectContextConstant;
import com.sikey.wa04.business.infrastructure.dto.request.alarmclock.GetallAlarmClockRequest;
import com.sikey.wa04.business.infrastructure.dto.response.alarmclock.GetallAlarmClockResponse;
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:23:10
 */
@RestController
@RequestMapping(ProjectContextConstant.USER_CONTEXT_URL + "/user/alarm-clock/wristwatch")
public class AlarmClockWristwatchController extends BaseController {

    @Resource
    private AlarmClockService alarmClockService;

    /**
     * 手表设备查询闹钟
     *
     * @return 响应内容一致
     * @see com.sikey.wa04.api.user.client.rest.AlarmClockController
     */
    @Authenticated
    @GetMapping("/getall")
    public GetallAlarmClockResponse getall() {
        GenericManufacturerHeader genericManufacturerHeader = genericManufacturerHeader();
        return alarmClockService.getall(new GetallAlarmClockRequest(CurrentRequestUser.get().getId()),genericManufacturerHeader, true);
    }

}
