-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from k-avy/kavya/api/task2
feat: added create and update endpoints. Reviewed by : [email protected] Tested by : [email protected]
- Loading branch information
Showing
5 changed files
with
241 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
// SPDX-FileCopyrightText: 2023 Kavya Shukla <[email protected]> | ||
// SPDX-License-Identifier: GPL-2.0-only | ||
|
||
// Package models is made to connect the database and to store the structs of | ||
// different data. | ||
// Package models is made to store the structs of different data. | ||
package models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// SPDX-FileCopyrightText: 2023 Kavya Shukla <[email protected]> | ||
// SPDX-License-Identifier: GPL-2.0-only | ||
|
||
package utils | ||
|
||
import "github.com/fossology/LicenseDb/pkg/models" | ||
|
||
func Converter(input models.LicenseJson) models.LicenseDB { | ||
if input.SpdxCompatible == "t" { | ||
input.SpdxCompatible = input.Shortname | ||
} else { | ||
input.SpdxCompatible = "LicenseRef-fossology-" + input.Shortname | ||
} | ||
result := models.LicenseDB{ | ||
Shortname: input.Shortname, | ||
Fullname: input.Fullname, | ||
Text: input.Text, | ||
Url: input.Fullname, | ||
Copyleft: input.Copyleft, | ||
AddDate: input.AddDate, | ||
FSFfree: input.FSFfree, | ||
OSIapproved: input.OSIapproved, | ||
GPLv2compatible: input.GPLv2compatible, | ||
GPLv3compatible: input.GPLv3compatible, | ||
Notes: input.Notes, | ||
Fedora: input.Fedora, | ||
TextUpdatable: input.TextUpdatable, | ||
DetectorType: input.DetectorType, | ||
Active: input.Active, | ||
Source: input.Source, | ||
SpdxId: input.SpdxCompatible, | ||
Risk: input.Risk, | ||
Flag: input.Flag, | ||
Marydone: input.Marydone, | ||
} | ||
return result | ||
} |