lint: remove unused code from platform/label_studio, email, dashboard, sync
- Delete sync/text.go, sync/tile.go, platform/dashboard.go (entirely unused) - Remove unused vars/funcs from platform/label_studio.go (9 items) - Remove contentEmailInitial, contentEmailReportConfirmation, newContentEmailNotificationConfirmation, contentEmailBase from platform/email
This commit is contained in:
parent
10046f1edb
commit
e9127466f0
7 changed files with 1 additions and 299 deletions
17
sync/text.go
17
sync/text.go
|
|
@ -1,17 +0,0 @@
|
|||
package sync
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
||||
"github.com/Gleipnir-Technology/nidus-sync/html"
|
||||
nhttp "github.com/Gleipnir-Technology/nidus-sync/http"
|
||||
"github.com/Gleipnir-Technology/nidus-sync/platform"
|
||||
)
|
||||
|
||||
type contentTextMessages struct{}
|
||||
|
||||
func getTextMessages(ctx context.Context, r *http.Request, u platform.User) (*html.Response[contentTextMessages], *nhttp.ErrorWithStatus) {
|
||||
content := contentTextMessages{}
|
||||
return html.NewResponse("sync/text-messages.html", content), nil
|
||||
}
|
||||
54
sync/tile.go
54
sync/tile.go
|
|
@ -1,54 +0,0 @@
|
|||
package sync
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"github.com/Gleipnir-Technology/nidus-sync/platform"
|
||||
)
|
||||
|
||||
func getTileGPS(w http.ResponseWriter, r *http.Request, u platform.User) {
|
||||
ctx := r.Context()
|
||||
if err := r.ParseForm(); err != nil {
|
||||
respondError(w, "Could not parse form", err, http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
lat_s := r.FormValue("lat")
|
||||
lng_s := r.FormValue("lng")
|
||||
level_s := r.FormValue("level")
|
||||
if lat_s == "" || lng_s == "" || level_s == "" {
|
||||
respondError(w, "you must specify lat, lng, and level", nil, http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
level, err := strconv.Atoi(level_s)
|
||||
if err != nil {
|
||||
respondError(w, "couldn't parse level", err, http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
lat, err := strconv.ParseFloat(lat_s, 10)
|
||||
if err != nil {
|
||||
respondError(w, "couldn't parse lat", err, http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
lng, err := strconv.ParseFloat(lng_s, 10)
|
||||
if err != nil {
|
||||
respondError(w, "couldn't parse lng", err, http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
img, err := platform.ImageAtPoint(ctx, u.Organization, uint(level), lat, lng)
|
||||
if err != nil {
|
||||
respondError(w, "image at point", err, http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
w.Header().Set("Content-Type", "image/png")
|
||||
w.Header().Set("Content-Length", fmt.Sprintf("%d", len(img.Content)))
|
||||
_, err = io.Copy(w, bytes.NewBuffer(img.Content))
|
||||
if err != nil {
|
||||
respondError(w, "copy bytes", err, http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue