Skip to content
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

#4 Impl ImportCourses for BrightspaceService #479

Merged
merged 6 commits into from
Nov 6, 2024

Conversation

carddev81
Copy link
Contributor

@PThorpe92 Initial implementation of ImportCourses for BrightspaceService. Retrieves CSV from Brightspace REST API, parses the CSV into UnlockEd type course, if the Brightspace course does not exist within UnlockEd, makes REST API call to retrieve course images and if one does not exist a default one is used. Example of implemented courses:

image

return urlRes.Data.Url, nil
}

func getDefaultImg() ([]byte, error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the case that the download fails, can we have this just set the ThumbnailURL to /brightspace.png which we can keep in the /frontend/public directory, so we don't have to read and upload this default image each time?

Copy link
Contributor Author

@carddev81 carddev81 Nov 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, much more efficient. I'll make the change in the upcoming PR. Ah, I just seen that you made the change already. Thanks!

@PThorpe92 PThorpe92 force-pushed the init_brightspace_courses branch from a56519c to ae62b1a Compare November 6, 2024 23:26
@PThorpe92 PThorpe92 force-pushed the init_brightspace_courses branch from ae62b1a to 735df2b Compare November 6, 2024 23:28
Copy link
Member

@PThorpe92 PThorpe92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

made the changes so keighan could put his PR in that depended on ReadCSV, etc. will discuss with you tomorrow. looks good 👍

@PThorpe92 PThorpe92 merged commit b4bb56c into UnlockedLabs:main Nov 6, 2024
4 checks passed
PThorpe92 added a commit that referenced this pull request Nov 12, 2024
* feat: add initial csvs local directory and default brightspace image for integration of courses

* fix: modify gorm criteria for ProviderPlatform state to be enabled

* feat: add Brightspace ProviderPlatformType for integration of courses

* feat: add gocarina/gocvs library used for reading csv files for integration of courses

* feat: add logic for the integration of brightspace courses

* fix: use brightspace default img path

---------

Co-authored-by: PThorpe92 <preston@unlockedlabs.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants