package com.gyee.gaia.state.wind.controller;

import com.gyee.gaia.state.wind.config.AppConfig;
import com.gyee.gaia.state.wind.entity.TestTb;
import com.gyee.gaia.state.wind.service.TestTbService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
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;

@RestController
@RequestMapping("/config")
public class ConfigController {

    @Autowired
    AppConfig appConfig;

    @Autowired
    TestTbService testTbService;


    @GetMapping("/all")
    public String getConfigString() {
        return appConfig.toString();
    }

    @GetMapping("")
    public AppConfig getConfig() {
        return appConfig;
    }

    @GetMapping("/test")
    public List<TestTb> testDb() {
        return testTbService.getAllTestTb();
    }

}


