finish
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"nCovTrack-Backend/models"
|
||||
)
|
||||
|
||||
//InsertLocation Insert locations
|
||||
func InsertLocation(claims models.TokenClaims, locationJMap map[string]interface{}) bool {
|
||||
locationCMap := models.MapJ2c[models.BackLocation](locationJMap, true)
|
||||
models.BeforeSave(locationCMap, claims.ID)
|
||||
@@ -11,11 +12,13 @@ func InsertLocation(claims models.TokenClaims, locationJMap map[string]interface
|
||||
return (ok && rowsAffected != 0)
|
||||
}
|
||||
|
||||
//ListLocation List locations
|
||||
func ListLocation(queryJMap map[string]any) *[]map[string]any {
|
||||
queryCMap := models.MapJ2c[models.BackLocation](queryJMap, true)
|
||||
return models.ListField[models.BackLocation]([]map[string]any{queryCMap}, true, "is_delete")
|
||||
}
|
||||
|
||||
//DeleteLocation Delete locations
|
||||
func DeleteLocation(id int) bool {
|
||||
ok, rowsAffected := models.DeleteById[models.BackLocation](id)
|
||||
return (ok && rowsAffected != 0)
|
||||
|
||||
Reference in New Issue
Block a user