simplify call to peer
This commit is contained in:
parent
e8acf8a127
commit
9f72f4b2f8
@ -3,8 +3,6 @@ package oclib
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
|
||||||
"time"
|
|
||||||
|
|
||||||
"cloud.o-forge.io/core/oc-lib/models/peer"
|
"cloud.o-forge.io/core/oc-lib/models/peer"
|
||||||
"cloud.o-forge.io/core/oc-lib/models/resources"
|
"cloud.o-forge.io/core/oc-lib/models/resources"
|
||||||
@ -63,30 +61,6 @@ func (wfa *Workflow) CheckBooking(caller *tools.HTTPCaller) (bool, error) {
|
|||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (wfa *Workflow) getFormat(date *time.Time) string {
|
|
||||||
month := fmt.Sprintf("%v", int(date.Month()))
|
|
||||||
day := fmt.Sprintf("%v", date.Day())
|
|
||||||
hour := fmt.Sprintf("%v", date.Hour())
|
|
||||||
minute := fmt.Sprintf("%v", date.Minute())
|
|
||||||
second := fmt.Sprintf("%v", date.Second())
|
|
||||||
if len(month) == 1 {
|
|
||||||
month = "0" + month
|
|
||||||
}
|
|
||||||
if len(day) == 1 {
|
|
||||||
day = "0" + day
|
|
||||||
}
|
|
||||||
if len(hour) == 1 {
|
|
||||||
hour = "0" + hour
|
|
||||||
}
|
|
||||||
if len(minute) == 1 {
|
|
||||||
minute = "0" + minute
|
|
||||||
}
|
|
||||||
if len(second) == 1 {
|
|
||||||
second = "0" + second
|
|
||||||
}
|
|
||||||
return fmt.Sprintf("%v", date.Year()) + "-" + month + "-" + day + "T" + hour + ":" + minute + ":" + second
|
|
||||||
}
|
|
||||||
|
|
||||||
func (d *Workflow) GetName() string {
|
func (d *Workflow) GetName() string {
|
||||||
return d.Name
|
return d.Name
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user