Categories as map
This commit is contained in:
@@ -6,14 +6,15 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/vars")
|
||||
public class VariablesController {
|
||||
|
||||
@GetMapping("/categories")
|
||||
public List<Enums.Category> getAllVariables() {
|
||||
return List.of(Enums.Category.values());
|
||||
public Map<Enums.Category, String> getAllVariables() {
|
||||
return Enums.categoryPL;
|
||||
}
|
||||
|
||||
@GetMapping("/statuses")
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package _11.asktpk.artisanconnectbackend.utils;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class Enums {
|
||||
public enum Role {
|
||||
ADMIN, USER
|
||||
@@ -13,6 +15,31 @@ public class Enums {
|
||||
Knitting, Carpentry, Other
|
||||
}
|
||||
|
||||
public static final Map<Category, String> categoryPL = Map.ofEntries(
|
||||
Map.entry(Category.Handmade, "Rękodzieło"),
|
||||
Map.entry(Category.Woodworking, "Stolarstwo"),
|
||||
Map.entry(Category.Metalworking, "Obróbka metalu"),
|
||||
Map.entry(Category.Ceramics, "Ceramika"),
|
||||
Map.entry(Category.Textiles, "Tekstylia"),
|
||||
Map.entry(Category.Jewelry, "Biżuteria"),
|
||||
Map.entry(Category.Leatherwork, "Wyroby skórzane"),
|
||||
Map.entry(Category.Painting, "Malarstwo"),
|
||||
Map.entry(Category.Sculpture, "Rzeźbiarstwo"),
|
||||
Map.entry(Category.Glasswork, "Szklarstwo"),
|
||||
Map.entry(Category.Furniture, "Meble"),
|
||||
Map.entry(Category.Restoration, "Renowacja"),
|
||||
Map.entry(Category.Tailoring, "Krawiectwo"),
|
||||
Map.entry(Category.Weaving, "Tkactwo"),
|
||||
Map.entry(Category.Calligraphy, "Kaligrafia"),
|
||||
Map.entry(Category.Pottery, "Garncarstwo"),
|
||||
Map.entry(Category.Blacksmithing, "Kowalstwo"),
|
||||
Map.entry(Category.Basketry, "Koszykarstwo"),
|
||||
Map.entry(Category.Embroidery, "Hafciarstwo"),
|
||||
Map.entry(Category.Knitting, "Dzierganie"),
|
||||
Map.entry(Category.Carpentry, "Ciesielstwo"),
|
||||
Map.entry(Category.Other, "Inne")
|
||||
);
|
||||
|
||||
public enum Status {
|
||||
ACTIVE, INACTIVE
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user