package com.gyee.wisdom.xfai.net3.controller;

import com.gyee.wisdom.xfai.net3.entity.WindPowerStation;
import com.gyee.wisdom.xfai.net3.mapper.WindPowerStationMapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @descrition: 页面基本信息
 * @author:Wanghs
 * @date:2019-12-06
 */
@Slf4j
@RestController
@RequestMapping("/info")
@CrossOrigin
public class InfoController {

    @Autowired
    private WindPowerStationMapper windPowerStationMapper;

    @RequestMapping(value = "/station")
    @ResponseBody
    public List<WindPowerStation> getAllStation(@RequestParam(value = "id", required = false) String id) {

        String md5Str = DigestUtils.md5Hex("12345678" + "gdnxfd");

        if (StringUtils.isBlank(id)) {
            id = "_FDC";
        }
        List<WindPowerStation> lst = windPowerStationMapper.getStationAll(id);
        return lst;
    }

}
