package com.gyee.wisdom.alarm.sharding.controller;

import com.gyee.wisdom.alarm.sharding.config.AjaxResult;
import com.gyee.wisdom.alarm.sharding.entity.StopType;
import com.gyee.wisdom.alarm.sharding.service.StopTypeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;


@Slf4j
@RestController
@RequestMapping("/Stoptype")
@CrossOrigin
public class StopTypeController {



    @Autowired
    private StopTypeService stopTypeService;



    @CrossOrigin(origins = "*",maxAge = 3600)
    @GetMapping(value = "/treeType")
    public AjaxResult  getRecentFault()throws Exception {
        try {
            List<StopType> types= stopTypeService.queryStopTypeList();
            return AjaxResult.successData(200,types);
        } catch (Exception e) {
            return AjaxResult.error();
        }

    }
}
