Import file from owncloud
This commit is contained in:
parent
97bb149eb6
commit
69ad64715c
6 changed files with 104 additions and 28 deletions
|
@ -19,7 +19,7 @@ type uploadedExercice struct {
|
|||
|
||||
func createExercice(theme fic.Theme, args []string, body []byte) (interface{}, error) {
|
||||
if len(args) >= 1 {
|
||||
if eid, err := strconv.Atoi(string(args[0])); err != nil {
|
||||
if eid, err := strconv.Atoi(args[0]); err != nil {
|
||||
return nil, err
|
||||
} else if exercice, err := theme.GetExercice(eid); err != nil {
|
||||
return nil, err
|
||||
|
@ -55,25 +55,6 @@ func createExercice(theme fic.Theme, args []string, body []byte) (interface{}, e
|
|||
}
|
||||
}
|
||||
|
||||
type uploadedFile struct {
|
||||
URI string
|
||||
}
|
||||
|
||||
func createExerciceFile(theme fic.Theme, exercice fic.Exercice, args []string, body []byte) (interface{}, error) {
|
||||
var uf uploadedFile
|
||||
if err := json.Unmarshal(body, &uf); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if len(uf.URI) == 0 {
|
||||
return nil, errors.New("URI not filled")
|
||||
}
|
||||
|
||||
// TODO: se connecter à OwnCloud
|
||||
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
type uploadedKey struct {
|
||||
Name string
|
||||
Key string
|
||||
|
|
Reference in a new issue