Class: ScanController

controllers~ScanController()

Class representing a scan controller.

Constructor

new ScanController()

Create a scan controller.
Source:

Methods

(async) byId(id) → {Promise:.<object:>}

Get an scan by id.
Parameters:
Name Type Description
id number
Source:
Returns:
Type
Promise:.<object:>

(async) byUser(userId) → {Promise:.<Array:.<object:>>}

Get scans by user.
Parameters:
Name Type Description
userId number
Source:
Returns:
Type
Promise:.<Array:.<object:>>

(async) changeBooksIdentified(scanId, amount) → {Promise:.<void:>}

Change the amount of books identified by a certain amount.
Parameters:
Name Type Description
scanId number
amount number
Source:
Returns:
Type
Promise:.<void:>

(async) changeImagePath(scanId, imagePath) → {Promise:.<void:>}

Change the image path of a scan.
Parameters:
Name Type Description
scanId number
imagePath string
Source:
Returns:
Type
Promise:.<void:>

(async) changeSpinesSegmentedBy(scanId, amount) → {Promise:.<void:>}

Change the amount of spines segmented by a certain amount.
Parameters:
Name Type Description
scanId number
amount number
Source:
Returns:
Type
Promise:.<void:>

(async) delete(scanId) → {Promise:.<void:>}

Delete a scan.
Parameters:
Name Type Description
scanId number
Source:
Returns:
Type
Promise:.<void:>

(async) getResultsAndData(scanId) → {Promise:.<Array:.<object:>>}

Get the results of a scan including books and authors.
Parameters:
Name Type Description
scanId number
Source:
Returns:
Type
Promise:.<Array:.<object:>>

(async) insert(userId) → {Promise:.<object:>}

Insert a new scan.
Parameters:
Name Type Description
userId number
Source:
Returns:
Type
Promise:.<object:>

(async) insertResult(scanId, bookId, segmentJson) → {Promise:.<void:>}

Insert scan result.
Parameters:
Name Type Description
scanId number
bookId number
segmentJson object
Source:
Returns:
Type
Promise:.<void:>

(async) insertWithLocation(userId, latitude, longitude) → {Promise:.<void:>}

Insert a new scan with a location.
Parameters:
Name Type Description
userId number
latitude number
longitude number
Source:
Returns:
Type
Promise:.<void:>

(async) updateStatus(scanId, status) → {Promise:.<void:>}

Update the status of a scan.
Parameters:
Name Type Description
scanId number
status string
Source:
Returns:
Type
Promise:.<void:>