mirror of
https://gitee.com/durcframework/SOP.git
synced 2025-08-11 12:56:28 +08:00
新增restful模式
This commit is contained in:
@@ -5,7 +5,6 @@ import com.gitee.sop.productweb.open.resp.ProductResponse;
|
||||
import com.gitee.sop.support.annotation.Open;
|
||||
import com.gitee.sop.support.context.OpenContext;
|
||||
import com.gitee.sop.support.dto.FileData;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
@@ -18,7 +17,6 @@ import java.util.List;
|
||||
* @author 六如
|
||||
* @dubbo
|
||||
*/
|
||||
@Api("产品服务")
|
||||
public interface OpenProduct {
|
||||
|
||||
/**
|
||||
|
@@ -16,9 +16,9 @@ public class ProductSaveRequest implements Serializable {
|
||||
private static final long serialVersionUID = -1214422742659231037L;
|
||||
|
||||
/**
|
||||
* 故事名称
|
||||
* 产品名称
|
||||
*/
|
||||
@NotBlank(message = "故事名称必填")
|
||||
@NotBlank(message = "产品名称必填")
|
||||
@Length(max = 64)
|
||||
private String productName;
|
||||
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user