Commit d5a496f1 by wangdayewjf

fixed 修改post请求

parent 13e1bff4
......@@ -3,6 +3,7 @@ package com.ydl.auth.apis;
import com.alibaba.dubbo.config.annotation.Reference;
import com.google.common.collect.Maps;
import com.ydl.auth.dto.AccessRequestDto;
import com.ydl.auth.dto.RequestDTO;
import com.ydl.auth.inf.AppAuthFacade;
import com.ydl.common.dto.BaseDtoResponse;
......@@ -10,10 +11,7 @@ import com.ydl.common.helper.ResponseFormatterHelper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.util.DigestUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.*;
import java.util.stream.Collectors;
......@@ -26,20 +24,17 @@ public class SignController {
@Reference(version = "1.0.0")
private AppAuthFacade appAuthFacade;
@RequestMapping(value = "/getAccessKey", method = RequestMethod.GET)
@ApiOperation(value = "消息频道页消息列表")
public BaseDtoResponse<String> getAccessKey(
@RequestParam(value = "appKey") String appKey,
@RequestParam(value = "path") String path
) throws Exception {
@RequestMapping(value = "/getAccessKey", method = RequestMethod.POST)
@ApiOperation(value = "消息频道页消息列表")
public BaseDtoResponse<String> getAccessKey(@RequestBody AccessRequestDto requestDto) throws Exception {
String appSecret = appAuthFacade.getSecretByAppKey(appKey);
String appSecret = appAuthFacade.getSecretByAppKey(requestDto.getAppKey());
Long timeStamp = System.currentTimeMillis();
String version = "1.0.0";
Map<String,String> paramMap = new HashMap<>();
paramMap.put("timestamp",timeStamp+"");
paramMap.put("path",path);
paramMap.put("path",requestDto.getPath());
paramMap.put("version",version);
String sign = generateSign(appSecret,paramMap);
return ResponseFormatterHelper.success(sign);
......
package com.ydl.auth.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.web.bind.annotation.RequestParam;
import java.io.Serializable;
@Data
public class AccessRequestDto implements Serializable {
@ApiModelProperty(value = "appKey",required = true)
private String appKey;
@ApiModelProperty(value = "path",required = true)
private String path;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment