diff --git a/platform/ios.go b/platform/ios.go new file mode 100644 index 00000000..2fe2fac5 --- /dev/null +++ b/platform/ios.go @@ -0,0 +1,25 @@ +package platform + +import ( + "context" + "time" + + "github.com/Gleipnir-Technology/nidus-sync/db" + "github.com/Gleipnir-Technology/nidus-sync/db/models" +) + +func fieldseeker(ctx context.Context, u *models.User, since *time.Time) (fsync FieldseekerRecordsSync, err error) { + pl, err := u.R.Organization.Pointlocations().All(ctx, db.PGInstance.BobDB) + if err != nil { + return + } + fsync.MosquitoSources = pl + return fsync, err +} + +func ContentClientIos(ctx context.Context, u *models.User, since *time.Time) (csync ClientSync, err error) { + fsync, err := fieldseeker(ctx, u, since) + return ClientSync{ + Fieldseeker: fsync, + }, err +} diff --git a/platform/type.go b/platform/type.go new file mode 100644 index 00000000..acfaa47b --- /dev/null +++ b/platform/type.go @@ -0,0 +1,15 @@ +package platform +import ( + "time" + + "github.com/Gleipnir-Technology/nidus-sync/db/models" +) + +type ClientSync struct { + Fieldseeker FieldseekerRecordsSync + Since time.Time +} + +type FieldseekerRecordsSync struct { + MosquitoSources models.FieldseekerPointlocationSlice +}