package cn.iocoder.yudao.module.system.api.equipment;

import cn.iocoder.yudao.module.system.api.equipment.dto.AttendanceUpdateDTO;
import cn.iocoder.yudao.module.system.api.equipment.dto.DistributeRecordDTO;
import cn.iocoder.yudao.module.system.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(name = ApiConstants.NAME) // TODO 芋艿：fallbackFactory =
@Tag(name = "RPC 服务 - 考勤设备")
public interface AttendanceMachineApi {

    String PREFIX = ApiConstants.PREFIX + "/attendance-machine";

    @PostMapping(PREFIX + "/create-record")
    @Operation(summary = "新增设备请求记录")
    void createDistributeRecord(@RequestBody List<DistributeRecordDTO> recordDTO);

    @PutMapping(PREFIX + "/update-record")
    @Operation(summary = "新增设备请求记录")
    void updateDistributeRecord(@RequestBody List<DistributeRecordDTO> recordDTO);

    @PutMapping(PREFIX + "/update")
    @Operation(summary = "修改用户绑定的设备信息")
    void updateAttendance(@RequestBody AttendanceUpdateDTO updateDTO);

    @PostMapping(PREFIX + "/update-password")
    @Operation(summary = "修改设备密码")
    @Parameter(name = "deviceNo", description = "设备号", example = "1", required = true)
    @Parameter(name = "oldPassword", description = "旧密码", example = "1", required = true)
    @Parameter(name = "newPassword", description = "新密码", example = "1", required = true)
    void updateDevicePassword(@RequestParam("deviceNo") String deviceNo,
                              @RequestParam("oldPassword") String oldPassword,
                              @RequestParam("newPassword") String newPassword);
}
