新增restful模式

This commit is contained in:
六如
2025-02-02 16:37:12 +08:00
parent ddc709ede4
commit 10b060255c
7 changed files with 50 additions and 2 deletions

View File

@@ -1,9 +1,12 @@
package com.sop.example.rest.examplerest.rest.impl;
import com.gitee.sop.support.context.OpenContext;
import com.sop.example.rest.examplerest.rest.GoodsController;
import com.sop.example.rest.examplerest.rest.vo.GoodsVO;
import org.apache.dubbo.config.annotation.DubboService;
import java.util.Map;
/**
* @author 六如
@@ -15,6 +18,10 @@ public class GoodsControllerImpl implements GoodsController {
GoodsVO goodsVO = new GoodsVO();
goodsVO.setId(id);
goodsVO.setName("冰箱");
Map<String, String> headers = OpenContext.current().getHeaders();
String token = headers.get("token");
System.out.println(token);
return goodsVO;
}
}