diff --git a/sop-example/example-rest/src/main/java/com/sop/example/rest/examplerest/rest/impl/GoodsControllerImpl.java b/sop-example/example-rest/src/main/java/com/sop/example/rest/examplerest/rest/impl/GoodsControllerImpl.java index b5072c57..9c5094e5 100644 --- a/sop-example/example-rest/src/main/java/com/sop/example/rest/examplerest/rest/impl/GoodsControllerImpl.java +++ b/sop-example/example-rest/src/main/java/com/sop/example/rest/examplerest/rest/impl/GoodsControllerImpl.java @@ -1,6 +1,5 @@ package com.sop.example.rest.examplerest.rest.impl; -import com.gitee.sop.support.context.OpenContext; import com.gitee.sop.support.context.WebContext; import com.sop.example.rest.examplerest.rest.GoodsController; import com.sop.example.rest.examplerest.rest.vo.GoodsVO; @@ -24,20 +23,18 @@ public class GoodsControllerImpl implements GoodsController { goodsVO.setName("冰箱"); List list = new ArrayList<>(); - + // 获取真实地址 list.add("realIp:" + webContext.getRealIp()); - + // 获取请求头 Map headers = webContext.getHeaders(); String token = headers.get("token"); list.add("token:" + token); - - String remoteAddr = webContext.getRemoteAddr(); - list.add("remoteAddr:" + remoteAddr); - + // 获取请求参数 String idValue = webContext.getParameter("id"); list.add("id:" + idValue); - goodsVO.setRemark(list.toString()); + + System.out.println(list); return goodsVO; } }