Create API for service requests list
This commit is contained in:
parent
4a440e3022
commit
b09725726c
5 changed files with 120 additions and 29 deletions
26
platform/fieldseeker/point_location.go
Normal file
26
platform/fieldseeker/point_location.go
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
package fieldseeker
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
//"github.com/Gleipnir-Technology/bob"
|
||||
"github.com/Gleipnir-Technology/bob/dialect/psql"
|
||||
"github.com/Gleipnir-Technology/bob/dialect/psql/sm"
|
||||
"github.com/Gleipnir-Technology/nidus-sync/db"
|
||||
"github.com/Gleipnir-Technology/nidus-sync/db/models"
|
||||
//"github.com/Gleipnir-Technology/nidus-sync/db/sql"
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
func PointLocationList(ctx context.Context, point_location_ids []uuid.UUID) (models.FieldseekerPointlocationSlice, error) {
|
||||
rows, err := models.FieldseekerPointlocations.Query(
|
||||
sm.Where(
|
||||
models.FieldseekerPointlocations.Columns.Globalid.EQ(psql.Any(point_location_ids)),
|
||||
),
|
||||
).All(ctx, db.PGInstance.BobDB)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("query point locations: %w", err)
|
||||
}
|
||||
return rows, nil
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue