V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  RedBeanIce  ›  全部回复第 8 页 / 共 55 页
回复总数  1089
1 ... 4  5  6  7  8  9  10  11  12  13 ... 55  
闪电贷
招行,3.6 ,仅供参考
@Strive0630
注意 base64 加密,请百度
185 天前
回复了 cMoon 创建的主题 Java mybatisplus @TableName 注解中 excludeProperty 赋值问题
我不理解,,请问你可以再描述一下你的根本问题呢,请不要问 AB 问题。
因为 A 问题,问了 B 问题。

@tableName 描述的就是数据库的一个单表,为什么会存在父类的情况呢。
除非是公共字段,,,但是公共字段就是每张表都存在的。
185 天前
回复了 jgh004 创建的主题 广州 广州性文化节怎么报名看展?
@jgh004 60 元一张票。
@Strive0630

个人微信:MTgwMDA4NTU5MDM=
有过此种体验,非常清晰,
如果对 Amazon 后台操作有问题,可以联系我。
我是负责这一块的对接 Amazon 的开发人员。

但是能不能做这个问题,请自己想清楚,
190 天前
回复了 28painters 创建的主题 Linux RocketMQ 在线上使用需要多大的内存和 cpu?
@RedBeanIce 用的是 jar 包启动。
190 天前
回复了 28painters 创建的主题 Linux RocketMQ 在线上使用需要多大的内存和 cpu?
@oneisall8955 请问是用的 docker 么,,,我们 16 个 Java 的 springboot ,占了 20G 内存
@xiaokongwu

hhhh ,是我让你产生误解了。很抱歉。

最开始的时候,result 的处理在下面,,现在挪到上面去就好了,
@RedBeanIce

apache http ,,,伪代码
```
// 执行请求
CloseableHttpResponse response = httpClient.execute(post, new BasicHttpContext());
// 返回的状态 200 404 等等
int statusCode = response.getStatusLine().getStatusCode();

HttpEntity entity = response.getEntity();
if (entity != null) {
InputStream instream = entity.getContent();
result = IOUtils.toString(instream, StandardCharsets.UTF_8);
}
if (statusCode != 200) {
logger.info("request url failed, http code={}, url={}, result={}", response.getStatusLine().getStatusCode(), url, result);
return null;
}


result 里面就是,成功信息,或者是异常信息

```
@RedBeanIce

apache http ,,,伪代码
```
// 执行请求
CloseableHttpResponse response = httpClient.execute(post, new BasicHttpContext());
// 返回的状态 200 404 等等
int statusCode = response.getStatusLine().getStatusCode();
int statusCode = response.getStatusLine().getStatusCode();
HttpEntity entity = response.getEntity();
if (entity != null) {
InputStream instream = entity.getContent();
result = IOUtils.toString(instream, StandardCharsets.UTF_8);
}
if (statusCode != CONNCET_SUCCESS) {
logger.info("request url failed, http code={}, url={}, result={}", response.getStatusLine().getStatusCode(), url, result);
return null;
}
if (statusCode != 200) {
logger.info("request url failed, http code={}, url={}", response.getStatusLine().getStatusCode(), url);
return null;
}



```
@xiaokongwu

apache http ,,,伪代码
```
// 执行请求
CloseableHttpResponse response = httpClient.execute(post, new BasicHttpContext());
// 返回的状态 200 404 等等
int statusCode = response.getStatusLine().getStatusCode();
if (statusCode != 200) {
logger.info("request url failed, http code={}, url={}", response.getStatusLine().getStatusCode(), url);
return null;
}
```
如果像是上述代码获取,,则只能获取到 bad request


报错都在日志打印里面,org.apache.http.wire ,carrier 字段有问题
@hmmm000

```
请求方式

HttpEntity<String> request = new HttpEntity<>(parse.toJSONString(), headersV2);
String personResultAsJsonStr = null;
try {
personResultAsJsonStr = restTemplate.postForObject(url, request, String.class);
} catch (RestClientException e) {
e.printStackTrace();
}
System.out.println(personResultAsJsonStr);

```

```
打印

19:05:22.927 [main] DEBUG org.springframework.web.client.RestTemplate - Created POST request for "https://marketplace.walmartapis.com/v3/orders/108829823812146/shipping"
19:05:22.928 [main] DEBUG org.springframework.web.client.RestTemplate - Setting request Accept header to [text/plain, application/json, application/cbor, application/*+json, */*]
19:05:22.929 [main] DEBUG org.springframework.web.client.RestTemplate - Writing [{"orderShipment":{"orderLines":{"orderLine":[{"lineNumber":"1","orderLineStatuses":{"orderLineStatus":[{"status":"Shipped","statusQuantity":{"amount":"1","unitOfMeasurement":"EACH"},"trackingInfo":{"carrierName":{"carrier":"Fedex"},"methodCode":"Standard","shipDateTime":1698132951000,"trackingNumber":"785444130107"}}]},"sellerOrderId":"FO231024144001001"}]}}}] using [org.springframework.http.converter.StringHttpMessageConverter@7a362b6b]
19:05:23.423 [main] DEBUG org.springframework.web.client.RestTemplate - POST request for "https://marketplace.walmartapis.com/v3/orders/108829823812146/shipping" resulted in 400 (Bad Request); invoking error handler
null
org.springframework.web.client.HttpClientErrorException: 400 Bad Request
at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:118)
at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:103)
at org.springframework.web.client.ResponseErrorHandler.handleError(ResponseErrorHandler.java:63)
at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:730)

```

但是我想要的是,,

"{"errors":{"error":[{"code":"INVALID_REQUEST_CONTENT.GMP_ORDER_API","field":"carrier","description":"Unsupported carrier 'Fedex' was specified in line number 1. Only pre-defined names are allowed for 'carrier.' For a list of acceptable carriers, see https://developer.walmart.com/api/us/mp/orders#operation/shippingUpdates . If you select 'otherCarrier' you must also provide the tracking URL.","info":"Request content is invalid.","severity":"ERROR","category":"DATA","errorIdentifiers":{"entry":[]}}]}}

它提示我,,,carrier 字段有问题。。(相关描述,请看开头)
@lsk569937453

请再看一下我的问题。我们问题不是 400 。

而是具体的详细的报错,仅仅体现在日志中,无法让 ta 体现在返参中。
@dyllen 确实,你是对的。请找到适合自己的代码编写方式。

业务开发,开源开发,是两种玩法。
198 天前
回复了 justdoit123 创建的主题 JavaScript JS 大数溢出问题
@mxT52CRuqR6o5

可以,但是最好不要这样子。

一个后端+略微入门前端的人认为,一个语言不支持大数,是不太合理的。
208 天前
回复了 RedBeanIce 创建的主题 武汉 [武汉-后端] 请问有公司招人么
1 ... 4  5  6  7  8  9  10  11  12  13 ... 55  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2341 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 32ms · UTC 12:22 · PVG 20:22 · LAX 05:22 · JFK 08:22
Developed with CodeLauncher
♥ Do have faith in what you're doing.