Commit 15c1b0f2 by zhouhb

[+]代码修改

1 parent cb43574b
...@@ -167,7 +167,7 @@ public class MerchantSaveRequest extends DefaultRequest implements Serializable ...@@ -167,7 +167,7 @@ public class MerchantSaveRequest extends DefaultRequest implements Serializable
* 文件数据 * 文件数据
*/ */
@ApiModelProperty(notes = "文件数据", required = true) @ApiModelProperty(notes = "文件数据", required = true)
private List<FileSaveRequest> merchantFiles; private String merchantFiles;
} }
\ No newline at end of file \ No newline at end of file
...@@ -21,6 +21,21 @@ public class MerchantRopResponse { ...@@ -21,6 +21,21 @@ public class MerchantRopResponse {
@ApiModelProperty(name = "id", notes = "商户名称", dataType = "String", required = true, example = "1", value = "商户id") @ApiModelProperty(name = "id", notes = "商户名称", dataType = "String", required = true, example = "1", value = "商户id")
private String merchantName; private String merchantName;
/**
* 营业范围
*/
@ApiModelProperty(name = "businessScope", notes = "营业范围", dataType = "String", required = true, example = "1", value = "商户id")
private String businessScope;
/**
* 品牌
*/
@ApiModelProperty(name = "merchantBrand", notes = "品牌", dataType = "String", required = true, example = "1", value = "商户id")
private String merchantBrand;
/** /**
* 商户简称 * 商户简称
*/ */
......
package cn.com.glsx.merchants.response; package cn.com.glsx.merchants.response;
import cn.com.glsx.merchants.model.response.MerchantFileResponse;
import cn.com.glsx.merchants.model.response.MerchantUserResponse;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -114,10 +116,10 @@ public class StaffResponse implements Serializable { ...@@ -114,10 +116,10 @@ public class StaffResponse implements Serializable {
/** /**
* 文件 * 文件
*/ */
private FileResponse merchantFileResponse; private MerchantFileResponse merchantFileResponse;
/** /**
* 账号 * 账号
*/ */
private MerchantUserRopResponse merchantUserResponse; private MerchantUserResponse merchantUserResponse;
} }
\ No newline at end of file \ No newline at end of file
...@@ -14,6 +14,7 @@ import cn.com.glsx.merchants.request.file.FileSaveRequest; ...@@ -14,6 +14,7 @@ import cn.com.glsx.merchants.request.file.FileSaveRequest;
import cn.com.glsx.merchants.request.merchant.*; import cn.com.glsx.merchants.request.merchant.*;
import cn.com.glsx.merchants.response.*; import cn.com.glsx.merchants.response.*;
import cn.com.glsx.merchants.util.Pagination; import cn.com.glsx.merchants.util.Pagination;
import com.alibaba.fastjson.JSONObject;
import com.glsx.plat.common.annotation.SysLog; import com.glsx.plat.common.annotation.SysLog;
import com.glsx.plat.common.enums.OperateType; import com.glsx.plat.common.enums.OperateType;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -51,8 +52,8 @@ public class MerchantService { ...@@ -51,8 +52,8 @@ public class MerchantService {
private MerchantRequest converMerchant(MerchantSaveRequest merchantSaveRequest) { private MerchantRequest converMerchant(MerchantSaveRequest merchantSaveRequest) {
MerchantRequest merchantRequest = ConvertRequest.convertRequest(merchantSaveRequest, new MerchantRequest()); MerchantRequest merchantRequest = ConvertRequest.convertRequest(merchantSaveRequest, new MerchantRequest());
List<FileSaveRequest> merchantFiles = merchantSaveRequest.getMerchantFiles(); String merchantFiles = merchantSaveRequest.getMerchantFiles();
merchantRequest.setMerchantFiles(ConvertRequest.convertListRequest(merchantFiles, MerchantFileRequest.class)); merchantRequest.setMerchantFiles(JSONObject.parseArray(merchantFiles, MerchantFileRequest.class));
return merchantRequest; return merchantRequest;
} }
......
...@@ -84,14 +84,13 @@ public class BaseControllerTest { ...@@ -84,14 +84,13 @@ public class BaseControllerTest {
} }
} }
String sign = RopUtils.sign(params.toSingleValueMap(), secret); String sign = RopUtils.sign(params.toSingleValueMap(), secret);
params.add("sign", sign);
RestTemplate rest = new RestTemplate(); RestTemplate rest = new RestTemplate();
RopUriTemplateHandler uriTemplateHandler = new RopUriTemplateHandler(url); RopUriTemplateHandler uriTemplateHandler = new RopUriTemplateHandler(url);
uriTemplateHandler.setDefaultUriVariables(params.toSingleValueMap()); uriTemplateHandler.setDefaultUriVariables(params.toSingleValueMap());
rest.setUriTemplateHandler(uriTemplateHandler); rest.setUriTemplateHandler(uriTemplateHandler);
url=url+"?"+getUrlParamsByMap(params); url=url+"?"+getUrlParamsByMap(params);
HttpHeaders headers = new HttpHeaders(); HttpHeaders headers = new HttpHeaders();
headers.add("TGT", "67d3ef25-2da5-4e2d-bbd8-79cb9d10150f"); headers.add("TGT", "1aaf2f5b-bbdf-42b3-83bb-fd3992f0e7e7");
String s = rest.postForObject(url, new HttpEntity<String>(headers), String.class); String s = rest.postForObject(url, new HttpEntity<String>(headers), String.class);
return s; return s;
} }
...@@ -151,7 +150,6 @@ public class BaseControllerTest { ...@@ -151,7 +150,6 @@ public class BaseControllerTest {
MultiValueMap<String, String> params = new LinkedMultiValueMap<String, String>(16); MultiValueMap<String, String> params = new LinkedMultiValueMap<String, String>(16);
params.add("appKey", appKey); params.add("appKey", appKey);
params.add("format", "json"); params.add("format", "json");
params.add("locale", "zh_CN");
return params; return params;
} }
......
...@@ -3,33 +3,38 @@ package cn.com.glsx.merchants.controller;/** ...@@ -3,33 +3,38 @@ package cn.com.glsx.merchants.controller;/**
* @date 2021/7/28 * @date 2021/7/28
*/ */
import com.alibaba.fastjson.JSONObject;
import org.junit.Test; import org.junit.Test;
import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap; import org.springframework.util.MultiValueMap;
import javax.xml.crypto.Data;
/** /**
* @author zhouhaibao * @author zhouhaibao
* @version 1.0 * @version 1.0
* @description: TODO * @description: TODO
* @date 2021/7/28 15:59 * @date 2021/7/28 15:59
*/ */
public class StaffControllerTest extends BaseControllerTest{ public class StaffControllerTest extends BaseControllerTest {
@Test @Test
public void testGetExample() throws Exception { public void testGetExample() throws Exception {
MultiValueMap<String, String> params = new LinkedMultiValueMap<String, String>(4); MultiValueMap<String, String> params = new LinkedMultiValueMap<String, String>(4);
params.add("v", "1.0.0"); params.add("v", "1.0.0");
params.add("method", "cn.com.glsx.merchants.staff.saveStaff"); params.add("method", "cn.com.glsx.merchants.staff.saveStaff");
params.add("name", "alvin"); params.add("name", "alvin");
params.add("staffName","贤心"); params.add("staffName", "贤心");
params.add("staffJob","jkl"); params.add("staffJob", "jkl");
params.add("password","3"); params.add("password", "3");
params.add("visibleInferiorMer","1"); params.add("visibleInferiorMer", "1");
params.add("staffPhone","18873336682"); params.add("staffPhone", "18873336682");
params.add("merchantId","31"); params.add("merchantId", "31");
params.add("staffEmail","952643348@qq.com"); params.add("staffEmail", "952643348@qq.com");
params.add("roleIds[0]","342"); params.add("roleIds[0]", "342");
params.add("merchantFileRequest.fileUrl","http://jhjhjhhj"); MultiValueMap<String, String> newa = new LinkedMultiValueMap<String, String>(4);
params.add("merchantFileRequest.fileName","dfdfddssd"); newa.add("fileUrl", "http://jhjhjhhj");
System.out.println(getByHeader(params)); newa.add("fileName", "dfdfddssd");
params.add("merchantFileRequest", JSONObject.toJSONString(newa));
System.out.println(post(params));
} }
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!