This commit is contained in:
tanghc
2020-09-25 13:35:37 +08:00
parent 3ca80dd6a6
commit faa9310759
8 changed files with 246 additions and 20 deletions

View File

@@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.gitee.sop.servercommon.annotation.BizCode;
import com.gitee.sop.servercommon.annotation.Open;
import com.gitee.sop.servercommon.bean.OpenContext;
import com.gitee.sop.servercommon.bean.ServiceContext;
import com.gitee.sop.servercommon.exception.ServiceException;
import com.gitee.sop.storyweb.controller.param.CategoryParam;
import com.gitee.sop.storyweb.controller.param.LargeTextParam;
@@ -16,6 +18,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -81,6 +84,18 @@ public class Example1001_BaseController {
return story;
}
@Open(value = "story.system.param.get")
@GetMapping("/get/system/param/v1")
public StoryResult systemParam(StoryParam param) {
StoryResult result = new StoryResult();
OpenContext openContext = ServiceContext.getCurrentContext().getOpenContext();
System.out.println(param == openContext.getBizObject());
System.out.println("app_id:" + openContext.getAppId());
System.out.println("token:" + openContext.getAppAuthToken());
result.setName("系统参数:" + openContext);
return result;
}
// 参数绑定
@Open(value = "story.param.bind", mergeResult = false)
@RequestMapping("/get/param/v1")