12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- package com.primeton.datatag;
- import com.alibaba.nacos.api.config.ConfigType;
- import com.alibaba.nacos.api.config.annotation.NacosValue;
- import com.alibaba.nacos.spring.context.annotation.config.NacosPropertySource;
- import org.springframework.beans.factory.annotation.Value;
- import org.springframework.boot.SpringApplication;
- import org.springframework.boot.autoconfigure.SpringBootApplication;
- import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RequestMethod;
- import org.springframework.web.bind.annotation.RequestParam;
- import org.springframework.web.bind.annotation.ResponseBody;
- import org.springframework.web.bind.annotation.RestController;
- import java.util.HashMap;
- import java.util.Map;
- @NacosPropertySource(dataId = "damp", type = ConfigType.YAML, autoRefreshed = true)
- @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
- @RestController
- public class DataTagApplication {
- @Value(value = "${hadoop.nameNodeUrl}")
- String hadoopUrl;
- @Value(value = "${hbase.url}")
- String hbaseUrl;
- @RequestMapping(value = "/hi", method = {RequestMethod.POST, RequestMethod.GET})
- @ResponseBody
- public Map<String, Object> sayHello(@RequestParam("name") String name) {
- final HashMap<String, Object> map = new HashMap<>();
- map.put("name", name);
- map.put("massage", "hello, " + name);
- map.put("hadoopUrl", hadoopUrl);
- map.put("hbaseUrl", hbaseUrl);
- return map;
- }
- public static void main(String[] args) {
- SpringApplication.run(DataTagApplication.class, args);
- System.out.println("/***************************************************/");
- System.out.println("/* */");
- System.out.println("/*(♥◠‿◠)ノ゙ cdhExecutor启动成功 ლ(´ڡ`ლ)゙ */");
- System.out.println("/* */");
- System.out.println("/***************************************************/");
- }
- }
|