- 博客(6)
- 收藏
- 关注
原创 js Unicode 编码转中文
function reconvert(str){ str = str.replace(/(\\u)(\w{1,4})/gi,function($0){ return (String.fromCharCode(parseInt((escape($0).replace(/(%5Cu)(\w{1,4})/g,"$2")),16))); }); str = str.replace(/(&#x)(\w{1,4});/gi,function
2021-07-21 15:55:39 1120 1
原创 获取上周任意星期的日期、本周任意星期的日期
/** * 获取指定时间的上周几的日期 * * @param date 指定的时间 * @param week 要获取的周几 * @return */ public static LocalDate getLastWeek (LocalDate date,int week) { if (date == null) { return null; }
2021-03-05 11:05:50 118
原创 stream 流的一些简单用法
List<Map<String, Object>> jobList = generateList(); System.out.println(jobList); //去重 List<Object> tempList = jobList.stream().map(item -> item.get("type")).distinct().collect(Collectors.toList()); System.out.println(tempList);
2021-03-05 10:44:36 208 1
原创 java后端发送请求中附带文件
public Map<String, String> webUpload(Map<String, Object> param, MultipartFile file) throws Exception { String request_url = "xXXXXXXXXXXXXXXXXXXXXXXx"; //上传文件 // 换行符 final String newLine = "\r\n"; final String boundaryPrefix = "--";
2021-03-05 10:40:17 626 1
原创 未指定Content-Type时获取request中body内容
private Map<String,Object> getRequestBody (HttpServletRequest request) { Map<String,Object> param = null; InputStream is = null; try { is = request.getInputStream(); InputStreamReader br = new InputStreamReader(is,"utf-8"); Buff
2021-03-05 10:17:38 311 1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人