http接口测试.
This commit is contained in:
@@ -37,8 +37,6 @@ import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.handler.codec.http.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author: aoshiguchen
|
||||
|
||||
+5
-5
@@ -21,12 +21,11 @@
|
||||
*/
|
||||
package fun.asgc.neutrino.proxy.server.controller;
|
||||
|
||||
import fun.asgc.neutrino.core.annotation.Autowired;
|
||||
import fun.asgc.neutrino.core.web.annotation.GetMapping;
|
||||
import fun.asgc.neutrino.core.web.annotation.RequestMapping;
|
||||
import fun.asgc.neutrino.core.web.annotation.RestController;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import fun.asgc.neutrino.proxy.server.service.Test1Service;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -36,11 +35,12 @@ import java.util.Date;
|
||||
@RestController
|
||||
@RequestMapping("/test1")
|
||||
public class Test1Controller {
|
||||
private static final SimpleDateFormat SDF = new SimpleDateFormat( "yyyy-MM-dd :HH:mm:ss");
|
||||
@Autowired
|
||||
private Test1Service test1Service;
|
||||
|
||||
@GetMapping("hello")
|
||||
public String hello() {
|
||||
return "hello 现在时间是:" + SDF.format(new Date());
|
||||
return test1Service.hello();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package fun.asgc.neutrino.proxy.server.service;
|
||||
|
||||
import fun.asgc.neutrino.core.annotation.Component;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author: aoshiguchen
|
||||
* @date: 2022/7/20
|
||||
*/
|
||||
@Component
|
||||
public class Test1Service {
|
||||
private static final SimpleDateFormat SDF = new SimpleDateFormat( "yyyy-MM-dd :HH:mm:ss");
|
||||
|
||||
public String hello() {
|
||||
return "hello 现在时间是:" + SDF.format(new Date());
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user