-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add BulkImport APIs and cron #148
Conversation
src/main/java/io/supertokens/pluginInterface/bulkimport/sqlStorage/BulkImportSQLStorage.java
Outdated
Show resolved
Hide resolved
src/main/java/io/supertokens/pluginInterface/bulkimport/BulkImportStorage.java
Outdated
Show resolved
Hide resolved
src/main/java/io/supertokens/pluginInterface/bulkimport/BulkImportStorage.java
Show resolved
Hide resolved
// This method returns a JSON object string representation, excluding 'status', 'createdAt', and 'updatedAt'. | ||
// It is used for inserting the user into the database or during testing. | ||
public String toRawDataForDbStorage() { | ||
JsonObject jsonObject = new Gson().fromJson(new Gson().toJson(this), JsonObject.class); | ||
jsonObject.remove("status"); | ||
jsonObject.remove("createdAt"); | ||
jsonObject.remove("updatedAt"); | ||
return jsonObject.toString(); | ||
} | ||
|
||
public static BulkImportUser fromRawDataFromDbStorage(String id, String rawData, BULK_IMPORT_USER_STATUS status, String primaryUserId, String errorMessage, long createdAt, long updatedAt) { | ||
BulkImportUser user = new Gson().fromJson(rawData, BulkImportUser.class); | ||
user.id = id; | ||
user.status = status; | ||
user.primaryUserId = primaryUserId; | ||
user.errorMessage = errorMessage; | ||
user.createdAt = createdAt; | ||
user.updatedAt = updatedAt; | ||
return user; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these two fucntions are very unclear. As a reader of this code, it makes no sense why they are there. Please add more detailed comment with examples.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added comment to explain the purpose of these functions. That should help explain it.
Summary of change
(A few sentences about this PR)
Related issues
Checklist for important updates
build.gradle
git tag
) in the formatvX.Y.Z
, and then find the latest branch (git branch --all
) whoseX.Y
is greater than the latest released tag.