package com.pwt.web.controller.monitor;

import com.pwt.common.annotation.Log;
import com.pwt.common.core.domain.AjaxResult;
import com.pwt.web.service.IPwtChangeBatteryRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.NotBlank;

/**
 * @author hanshuangxi
 * @date 2023/8/4 10:59
 */
@RestController
@RequestMapping("changeBatteryRecord")
@Validated
public class ChangeBatteryRecordController {

    @Autowired
    private IPwtChangeBatteryRecordService changeBatteryRecordService;

    @GetMapping("getChangeCount")
    public AjaxResult getChangeCount(@NotBlank(message = "电池组序号不能为空") String batterySn) {
        return AjaxResult.success().put("changeCount", changeBatteryRecordService.getChangeCount(batterySn));
    }
}
