|
@@ -48,10 +48,14 @@ func AddUsedDuration(c *gin.Context) {
|
|
|
dto.Error(c, err)
|
|
|
return
|
|
|
} else {
|
|
|
+ freeTrialDuration := totalFreeDuration - existed
|
|
|
+ if freeTrialDuration < 0 {
|
|
|
+ freeTrialDuration = 0
|
|
|
+ }
|
|
|
c.JSON(http.StatusOK, dto.ConfigResponse{
|
|
|
Response: dto.NewOkResponse(),
|
|
|
Data: dto.ConfigResult{
|
|
|
- FreeTrialDuration: totalFreeDuration - existed,
|
|
|
+ FreeTrialDuration: freeTrialDuration,
|
|
|
Timestamp: time.Now().Unix(),
|
|
|
Node: convert2DtoNode(healthNodes()[0]),
|
|
|
},
|