yangys
2024-03-28 13ada1093cb8de6e31a718d2222429ded70133c8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package com.qianwen.smartman.modules.report.utils;
 
import cn.hutool.json.JSONObject;
 
/* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/report/utils/ResultUtil.class */
public class ResultUtil {
    private static final String TOTAL = "total";
    private static final String COUNT = "count";
 
    public static <T> JSONObject dataToJsonObject(T t, Long count, Integer size) {
        int total = Math.toIntExact(count.longValue() / size.intValue());
        int total2 = count.longValue() % ((long) size.intValue()) == 0 ? total : total + 1;
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("data", t);
        jsonObject.put(TOTAL, Integer.valueOf(total2));
        jsonObject.put(COUNT, count);
        return jsonObject;
    }
}