HEAVY: migrate accounts and logs to service/repo architecture
This commit is contained in:
parent
5c255fb34b
commit
49e14b5bc5
37 changed files with 1019 additions and 687 deletions
|
|
@ -1,18 +1,18 @@
|
|||
package api
|
||||
|
||||
import (
|
||||
"arimelody-web/log"
|
||||
"arimelody-web/model"
|
||||
"bufio"
|
||||
"encoding/base64"
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"arimelody-web/model"
|
||||
"arimelody-web/model/app"
|
||||
"bufio"
|
||||
"encoding/base64"
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func HandleImageUpload(app *model.AppState, data *string, directory string, filename string) (string, error) {
|
||||
func HandleImageUpload(app *app.AppState, data *string, directory string, filename string) (string, error) {
|
||||
split := strings.Split(*data, ";base64,")
|
||||
header := split[0]
|
||||
imageData, err := base64.StdEncoding.DecodeString(split[1])
|
||||
|
|
@ -50,7 +50,7 @@ func HandleImageUpload(app *model.AppState, data *string, directory string, file
|
|||
return "", nil
|
||||
}
|
||||
|
||||
app.Log.Info(log.TYPE_FILES, "\"%s\" created.", imagePath)
|
||||
app.Log.Info(model.LOG_FILES, "\"%s\" created.", imagePath)
|
||||
|
||||
return filename, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue