| | |
| | | userInfoVO.setTodayHours(data1.getTodayHours()); |
| | | userInfoVO.setWeekHours(data1.getWeekHours()); |
| | | userInfoVO.setMonthHours(data1.getMonthHours()); |
| | | PageInfo<TGameRecord> gameRecords = data1.getGameRecords(); |
| | | List<TGameRecord> records = gameRecords.getRecords(); |
| | | for (TGameRecord record : records) { |
| | | String s = convertSecondsToHoursMinutes(record.getUseTime()); |
| | | record.setUseTime1(s); |
| | | } |
| | | userInfoVO.setGameRecords(data1.getGameRecords()); |
| | | return AjaxResult.success(userInfoVO); |
| | | } |
| | | public static String convertSecondsToHoursMinutes(int seconds) { |
| | | int hours = seconds / 3600; |
| | | int minutes = (seconds % 3600) / 60; |
| | | if (hours == 0){ |
| | | if (minutes == 0){ |
| | | return String.format("%d秒", seconds); |
| | | }else{ |
| | | return String.format("%d分钟", minutes); |
| | | } |
| | | }else{ |
| | | return String.format("%d小时%d分钟", hours, minutes); |
| | | } |
| | | } |
| | | public static String convertToChineseOrdinal(int number) { |
| | | if (number <= 0 || number > 50) { |
| | |
| | | return AjaxResult.error("新密码不能与旧密码相同"); |
| | | } |
| | | one.setPassword(SecurityUtils.encryptPassword(password)); |
| | | sysUserService.updateById(one); |
| | | return AjaxResult.success(); |
| | | } |
| | | @GetMapping("/sendPhoneCode") |