public Map<String, String> getParams(Course c) { Map<String, String> d = new HashMap<>(); d.put("courseId", c.getCourseId()); d.put("itemId", c.getItemId()); d.put("time1", CommonUtil.formatStr(String.valueOf(System.currentTimeMillis()), 20)); d.put("time2", CommonUtil.formatStr(String.valueOf(c.getStartTime()), 20)); d.put("time3", CommonUtil.formatStr(String.valueOf(CommonUtil.timeToSeconds(c.getVideoTotalTime())), 20)); d.put("time4", CommonUtil.formatStr(String.valueOf(c.getEndTime()), 20)); d.put("videoIndex", String.valueOf(c.getVideoIndex())); d.put("time5", CommonUtil.formatStr(String.valueOf(c.getStudyTimeLong()), 20)); d.put("terminalType", c.getTerminalType()); d.put("residenceTime", c.getResidenceTime()); d.put("assessment", c.getAssessment()); return d; }

public static String formatStr(String c, int a) { String l = ""; int k = c.length(); if (k > 0) { if (k + 2 > a) { return c; } else { int g = a - k - 2; int h = 1; for (int e = 0; e < g; e++) { h = h * 10; } int b = (int) (Math.random() * h); int f = String.valueOf(b).length(); if (f < g) { for (int d = f; d < g; d++) { b = b * 10; } } if (k >= 10) { l += k; } else { l += "0" + k; } l += c + b; } } else { return c; } return l; }

getParams functionc var d = courseId ccourseId itemId citemId time1 CommonUtilformatStrnew DategetTime 20 time2 CommonUtilforma

原文地址: https://www.cveoy.top/t/topic/bARI 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录