http接口测试.

This commit is contained in:
aoshiguchen
2022-07-20 23:43:35 +08:00
parent 317a390b79
commit 48187dfc42
3 changed files with 26 additions and 7 deletions
@@ -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
@@ -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();
}
}
@@ -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());
}
}