feat: implement entity and wiki management services, repositories, and routes with associated controllers
Build and Release / release (push) Successful in 1m34s

This commit is contained in:
2026-05-27 18:32:35 +07:00
parent e35f67e26b
commit d02006390b
15 changed files with 442 additions and 2 deletions
+31
View File
@@ -242,6 +242,37 @@ func (q *Queries) GetEntityBySlug(ctx context.Context, slug pgtype.Text) (Entity
return i, err
}
const getEntityIDsByGeometryIDs = `-- name: GetEntityIDsByGeometryIDs :many
SELECT geometry_id, entity_id
FROM entity_geometries
WHERE geometry_id = ANY($1::uuid[])
`
type GetEntityIDsByGeometryIDsRow struct {
GeometryID pgtype.UUID `json:"geometry_id"`
EntityID pgtype.UUID `json:"entity_id"`
}
func (q *Queries) GetEntityIDsByGeometryIDs(ctx context.Context, dollar_1 []pgtype.UUID) ([]GetEntityIDsByGeometryIDsRow, error) {
rows, err := q.db.Query(ctx, getEntityIDsByGeometryIDs, dollar_1)
if err != nil {
return nil, err
}
defer rows.Close()
items := []GetEntityIDsByGeometryIDsRow{}
for rows.Next() {
var i GetEntityIDsByGeometryIDsRow
if err := rows.Scan(&i.GeometryID, &i.EntityID); err != nil {
return nil, err
}
items = append(items, i)
}
if err := rows.Err(); err != nil {
return nil, err
}
return items, nil
}
const searchEntities = `-- name: SearchEntities :many
SELECT id, project_id, name, slug, description, status, time_start, time_end, is_deleted, created_at, updated_at
FROM entities