登录页面接口对接

This commit is contained in:
aoshiguchen
2022-08-02 22:39:58 +08:00
parent 93b3a605a0
commit 47d39878f7
7 changed files with 29 additions and 80 deletions
@@ -29,9 +29,7 @@ import fun.asgc.neutrino.core.web.annotation.RequestMapping;
import fun.asgc.neutrino.core.web.annotation.RestController;
import fun.asgc.neutrino.proxy.server.base.rest.Authorization;
import fun.asgc.neutrino.proxy.server.controller.req.LoginReq;
import fun.asgc.neutrino.proxy.server.controller.req.LogoutReq;
import fun.asgc.neutrino.proxy.server.controller.res.LoginRes;
import fun.asgc.neutrino.proxy.server.controller.res.LogoutRes;
import fun.asgc.neutrino.proxy.server.service.UserService;
import fun.asgc.neutrino.proxy.server.util.ParamCheckUtil;
@@ -1,51 +0,0 @@
/**
* Copyright (c) 2022 aoshiguchen
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
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 fun.asgc.neutrino.core.web.context.HttpContextHolder;
import fun.asgc.neutrino.proxy.server.service.Test1Service;
/**
*
* @author: aoshiguchen
* @date: 2022/7/17
*/
@RestController
@RequestMapping("/test1")
public class Test1Controller {
@Autowired
private Test1Service test1Service;
@GetMapping("hello")
public String hello() {
System.out.println("拿到参数 a = " + HttpContextHolder.getHttpRequestWrapper().getParameter("a"));
if ("aaa".equals(HttpContextHolder.getHttpRequestWrapper().getParameter("a"))) {
throw new RuntimeException("hhhh 异常了!");
}
return test1Service.hello();
}
}
@@ -48,6 +48,7 @@ public interface UserTokenMapper extends SqlMapper {
/**
* 根据token查询单条记录
* @param token
* @param time
* @return
*/
@Select("select * from user_token where token = ? and expiration_time > ?")
@@ -1,21 +0,0 @@
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());
}
}