Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • May 23 03:36

    looly on v6-dev

    add ChannelUtil (compare)

  • May 23 03:32

    looly on v5-dev

    add ChannelUtil (compare)

  • May 23 02:43

    looly on v5-dev

    添加bigdecimal方法 修改版本号 ClassUtil增加判断是否是接口的方法 and 2 more (compare)

  • May 23 02:38

    looly on v6-dev

    add methods (compare)

  • May 20 09:56

    looly on v6-dev

    fix code (compare)

  • May 20 09:51

    looly on v5-dev

    fix size (compare)

  • May 20 04:07

    looly on v5-dev

    fix bugs (compare)

  • May 20 03:59

    looly on v6-dev

    fix bug (compare)

  • May 20 03:39

    looly on v6-dev

    add test (compare)

  • May 20 03:33

    looly on v6-dev

    add null check (compare)

  • May 18 02:38

    looly on v6-dev

    fix bug (compare)

  • May 18 02:35

    looly on v6-dev

    fix bug (compare)

  • May 18 02:33

    looly on v5-dev

    fix bug (compare)

  • May 18 02:23

    looly on v5-dev

    fix bug (compare)

  • May 16 13:22

    looly on 5.8.1

    (compare)

  • May 16 11:20

    looly on v5-dev

    prepare 5.8.2 (compare)

  • May 16 11:07

    looly on v5-master

    新增获取表是否存在于数据库状态标识 Merge remote-tracking branch 'o… prepare 5.8.1 and 22 more (compare)

  • May 16 11:04

    looly on v5-dev

    release 5.8.1 (compare)

  • May 16 10:59

    looly on v5-dev

    add hex support (compare)

  • May 16 10:57

    looly on v6-dev

    support hex (compare)

@dragonorant
使用 okhttp 执行请求就可以,如果不添加 header 头也可以请求,但是第三方要求的是必须要有这些头
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
Request request = new Request.Builder()
.url("https://report.api.vungle.com/ext/pub/reports/performance?start=2021-11-14&aggregates=revenue,clicks&end=2021-11-14&dimensions=application")
.method("GET", null)
.addHeader("Authorization", "Bearer vungleapiKey")
.addHeader("Accept", "application/json")
.addHeader("Vungle-Version", "1")
.build();
Response response = client.newCall(request).execute();
@dragonorant
String url = "https://report.api.vungle.com/ext/pub/reports/performance?start=2021-11-14&aggregates=revenue,clicks&end=2021-11-14&dimensions=application";
HttpRequest req = HttpRequest.get(url);
req.header("Authorization","Bearer vungleApiKey",true);
req.header("Accept","application/json; /",true);
req.header("Vungle-Version","1",true);
HttpResponse response = req.execute();
log.info("{}",response.body());
// 请求成功
if (200 == response.getStatus()){
log.info("{}",response.body());
}
即便是 req.header("Accept","application/json",true); 依旧如此
哪位大佬给指点下。其他的地方都没有问题,目前只有这个http 请求报这个问题;
Golden Looly
@looly
@zhanghuizong RandomUtil
@dragonorant 看样子是返回zip格式有问题吧,最新版本hutool么?
@hohaihy Csv没有sheet概念
cuim
@cuim
请问,hutool是支持向下兼容的么,我的工程里引用了hutool v5.4.4
littlelittle
@qianxifu
包已经导进了,为什么报这个错呢Caused by: java.lang.ClassNotFoundException: cn.hutool.extra.mail.MailUtil
kemingheng@qq.com
@aoheng
版本不对

包已经导进了,为什么报这个错呢Caused by: java.lang.ClassNotFoundException: cn.hutool.extra.mail.MailUtil

换个版本

duanzy
@duan199
DateUtil.weekCount这个方法计算出来的周次和实际周次不符吗?
kings1990
@kings1990
HttpRequest这个如何通过方法传入url Params?
@looly
占锐
@zhanruicc
网站首页图片挂了。。。
aren
@xiaoaren
文档页面打不开了
Golden Looly
@looly
@cuim 什么是向下兼容?
@duan199 可能非整周舍去了吧,如果有问题提issue吧
@zhanruicc 现在好了吧?
shijiaxun
@shijiaxun
使用ChineseDate闰月的时候,前一个五月初一和第二个五月初一都显示的闰五月初一
sashazhen
@sashazhen
ExcelWriter生成的文件怎么没跟我定义的标题走
有人在吗
@looly
Golden Looly
@looly
@shijiaxun 有这个bug,你升级到5.7.19试下。
@sashazhen 标题你在getWriter时候指定下sheet名称即可。
oh-jy
@oh-jy
文档页面挂了
@looly
Yokeuuu
@Yokeuuu
文档挂了
sunwe
@sunwe
参考文档无法访问,子页面404
Golden Looly
@looly
文档无法访问的,请访问备用页面:https://plus.hutool.cn/docs/#/
Kevin
@mrzhiyi
hutool能不能生成1-100序列形成的集合
Golden Looly
@looly
@mrzhiyi NumberUtil.range(1, 100)
Xujiu999
@Xujiu999
hutool 有关于地址的操作模块么 例如送货地址的增删改查
Golden Looly
@looly
@Xujiu999 没有
kaiyan521
@kaiyan521
@looly 请问存储过程怎么调用啊
up_wj
@best11589835
吴彦祖们 上传的MultipartFile 怎么用imgUtils压缩啊
Love you
@andongni
用得顺手
Jarod Kong
@userkdg

/**

 * 获取查询结果总数,生成类似于 SELECT count(1) from (sql) hutool_alias_count_<br>
 * 此方法会重新构建{@link SqlBuilder},并去除末尾的order by子句
 *
 * @param conn  数据库连接对象
 * @param sqlBuilder 查询语句
 * @return 复合条件的结果数
 * @throws SQLException SQL执行异常
 * @since 5.7.2
 */
public long count(Connection conn, SqlBuilder sqlBuilder) throws SQLException {}

注:为啥吧去除order by 作为必要截取? 比如:
(
select *,
row_number() over( partition by plat_name ,outer_product_id order by crawl_time desc) 子查询,窗口函数岂不是翻大车了?

这些藏得有点深了,上线后,出现该场景才暴露问题。
Jarod Kong
@userkdg
----------------------------------------------其他问题----------------

public long count(Connection conn, SqlBuilder sqlBuilder) throws SQLException {
checkConn(conn);

    String selectSql = sqlBuilder.build();
    // 去除order by 子句
    final int orderByIndex = StrUtil.indexOfIgnoreCase(selectSql, " order by");
    if (orderByIndex > 0) {
        selectSql = StrUtil.subPre(selectSql, orderByIndex);
    }
    return SqlExecutor.queryAndClosePs(dialect.psForCount(conn,
            SqlBuilder.of(selectSql).addParams(sqlBuilder.getParamValueArray())),
            new NumberHandler()).longValue();
}

这个直接new NumberHandler().longValue()过于绝对,要是jdbc返回的类型是:BigDecimal、BigInteger、Long、Integer,就直接报错了(CastxxxException)

unusPanda
@unusPanda
这个http工具好像不会抛出异常 这合理吗
chl1442802633
@chl1442802633
试试
11
TL
@OnlyTL
请问6.0计划什么时候发布
Golden Looly
@looly
@userkdg 麻烦提个issue。对于count操作是去掉末尾的order by的,没有考虑这类复杂SQL场景。
@unusPanda 可以抛出啊,你要在什么情况下抛出?
@OnlyTL 请关注v6-dev分支,在不断改造中
fanhua1550
@fanhua1550
BeanUtil.toBean方法转不了entity到实体类,这样要怎么弄