Marshal CallDuration as ms
This commit is contained in:
parent
16a0606e4c
commit
59513572ba
1 changed files with 5 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
||||||
package calls
|
package calls
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
@ -29,6 +30,10 @@ func (d CallDuration) MsInt32Ptr() *int32 {
|
||||||
return &i
|
return &i
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (d CallDuration) MarshalJSON() ([]byte, error) {
|
||||||
|
return json.Marshal(d.Duration().Milliseconds())
|
||||||
|
}
|
||||||
|
|
||||||
func (d CallDuration) Seconds() int32 {
|
func (d CallDuration) Seconds() int32 {
|
||||||
return int32(time.Duration(d).Seconds())
|
return int32(time.Duration(d).Seconds())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue