package com.ningdatech.carapi.irs.controller;

import com.ningdatech.carapi.irs.service.AccidentService;
import com.ningdatech.carapi.irs.service.RefreshKeyService;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
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 java.util.List;

/**
 * @Classname SmsService
 * @Description
 * @Date 2023/3/23 17:06
 * @Author PoffyZhang
 */
@Slf4j
@Validated
@RestController
@RequestMapping("/open/api/accident/")
@RequiredArgsConstructor
public class AccidentController {

    private final AccidentService accidentService;

    private final RefreshKeyService refreshKeyService;

    @ApiOperation(value = "刷新密钥 测试", notes = "刷新密钥 测试")
    @GetMapping("/refresh")
    public String refresh() {
        return refreshKeyService.refresh();
    }

    @ApiOperation(value = "事故责任认定书 测试", notes = "事故责任认定书 测试")
    @GetMapping("/test")
    public List<String> test() {
        return accidentService.getAccident();
    }

    @ApiOperation(value = "更新事故责任认定书数据", notes = "更新事故责任认定书数据")
    @GetMapping("/update")
    public String update() {
        return accidentService.updateAccident();
    }
}
