mirror of
https://github.com/muety/wakapi.git
synced 2023-08-10 21:12:56 +03:00
fix: all time data model
This commit is contained in:
parent
7c8ea86d4e
commit
84e9559860
@ -3,6 +3,10 @@ package v1
|
|||||||
// https://wakatime.com/developers#all_time_since_today
|
// https://wakatime.com/developers#all_time_since_today
|
||||||
|
|
||||||
type AllTimeVieModel struct {
|
type AllTimeVieModel struct {
|
||||||
|
Data *AllTimeVieModelData `json:"data"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type AllTimeVieModelData struct {
|
||||||
Seconds float32 `json:"seconds"` // total number of seconds logged since account created
|
Seconds float32 `json:"seconds"` // total number of seconds logged since account created
|
||||||
Text string `json:"text"` // total time logged since account created as human readable string>
|
Text string `json:"text"` // total time logged since account created as human readable string>
|
||||||
IsUpToDate bool `json:"is_up_to_date"` // true if the stats are up to date; when false, a 202 response code is returned and stats will be refreshed soon>
|
IsUpToDate bool `json:"is_up_to_date"` // true if the stats are up to date; when false, a 202 response code is returned and stats will be refreshed soon>
|
||||||
|
@ -46,9 +46,11 @@ func (h *CompatV1AllHandler) ApiGet(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
total := summary.TotalTime()
|
total := summary.TotalTime()
|
||||||
vm := &v1.AllTimeVieModel{
|
vm := &v1.AllTimeVieModel{
|
||||||
|
Data: &v1.AllTimeVieModelData{
|
||||||
Seconds: float32(total),
|
Seconds: float32(total),
|
||||||
Text: utils.FmtWakatimeDuration(total * time.Second),
|
Text: utils.FmtWakatimeDuration(total * time.Second),
|
||||||
IsUpToDate: true,
|
IsUpToDate: true,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
utils.RespondJSON(w, http.StatusOK, vm)
|
utils.RespondJSON(w, http.StatusOK, vm)
|
||||||
|
@ -1 +1 @@
|
|||||||
1.9.0
|
1.9.1
|
Loading…
Reference in New Issue
Block a user