新增restful模式

This commit is contained in:
六如
2025-02-04 11:58:25 +08:00
parent 1cecae512c
commit a2a438562b
20 changed files with 212 additions and 50 deletions

View File

@@ -1,6 +1,7 @@
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;
import org.apache.dubbo.config.annotation.DubboService;
@@ -19,7 +20,7 @@ public class GoodsControllerImpl implements GoodsController {
goodsVO.setId(id);
goodsVO.setName("冰箱");
Map<String, String> headers = OpenContext.current().getHeaders();
Map<String, String> headers = WebContext.current().getHeaders();
String token = headers.get("token");
System.out.println(token);
return goodsVO;