|
@@ -28,6 +28,7 @@ func Config(c *gin.Context) {
|
|
|
Response: dto.NewOkResponse(),
|
|
|
Data: dto.ConfigResult{
|
|
|
FreeTrialDuration: totalFreeDuration - usedDuration,
|
|
|
+ Timestamp: time.Now().Unix(),
|
|
|
},
|
|
|
})
|
|
|
}
|
|
@@ -44,10 +45,16 @@ func UpdateUsedDuration(c *gin.Context) {
|
|
|
dto.Error(c, err)
|
|
|
return
|
|
|
}
|
|
|
+ usedDuration, err = storage.GetUsedDuration(deviceId)
|
|
|
+ if err != nil {
|
|
|
+ dto.Error(c, err)
|
|
|
+ return
|
|
|
+ }
|
|
|
c.JSON(http.StatusOK, dto.ConfigResponse{
|
|
|
Response: dto.NewOkResponse(),
|
|
|
Data: dto.ConfigResult{
|
|
|
FreeTrialDuration: totalFreeDuration - usedDuration,
|
|
|
+ Timestamp: time.Now().Unix(),
|
|
|
},
|
|
|
})
|
|
|
}
|