ruoyi-api/ruoyi-api-study/src/main/java/com/ruoyi/study/api/model/TGameRecord.java
@@ -45,6 +45,9 @@ */ @ApiModelProperty(value = "用时时间 秒") private Integer useTime; @ApiModelProperty(value = "用时时间 秒") @TableField(exist = false) private String useTime1; @ApiModelProperty(value = "游戏时间") @TableField(exist = false) private String time; ruoyi-service/ruoyi-management/src/main/java/com/ruoyi/management/controller/TUserController.java
@@ -94,9 +94,20 @@ 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; return String.format("%d小时%d分钟", hours, minutes); } public static String convertToChineseOrdinal(int number) { if (number <= 0 || number > 50) { return "未知"; ruoyi-service/ruoyi-study/pom.xml
@@ -15,18 +15,7 @@ </description> <dependencies> <dependency> <groupId>com.huawei.apigateway</groupId> <artifactId>java-sdk-core</artifactId> <version>3.2.5</version> <scope>system</scope> <systemPath>${project.basedir}/lib/java-sdk-core-3.2.5.jar</systemPath> </dependency> <!-- <dependency>--> <!-- <groupId>com.huaweicloud.sdk</groupId>--> <!-- <artifactId>huaweicloud-sdk-bundle</artifactId>--> <!-- <version>3.1.87</version>--> <!-- </dependency>--> <dependency> <groupId>redis.clients</groupId> <artifactId>jedis</artifactId> ruoyi-service/ruoyi-study/src/main/java/com/ruoyi/study/domain/TGameRecord.java
@@ -48,6 +48,9 @@ */ @ApiModelProperty(value = "用时时间 秒") private Integer useTime; @ApiModelProperty(value = "用时时间 秒") @TableField(exist = false) private String useTime1; /** * 游戏Id