mirror of
https://gitea.gofwd.group/Forward_Group/ballistic-builder-spring.git
synced 2026-01-21 01:01:05 -05:00
adding version to the endpoints
This commit is contained in:
@@ -19,7 +19,7 @@ import java.util.Map;
|
|||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/api/auth")
|
@RequestMapping({"/api/auth", "/api/v1/auth"})
|
||||||
@CrossOrigin
|
@CrossOrigin
|
||||||
public class AuthController {
|
public class AuthController {
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/api/builder")
|
@RequestMapping({"/api/builder", "/api/v1/builder"})
|
||||||
@CrossOrigin
|
@CrossOrigin
|
||||||
public class BuilderBootstrapController {
|
public class BuilderBootstrapController {
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/api/categories")
|
@RequestMapping({"/api/categories", "/api/v1/categories"})
|
||||||
@CrossOrigin // you can tighten origins later
|
@CrossOrigin // you can tighten origins later
|
||||||
public class CategoryController {
|
public class CategoryController {
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ import org.springframework.http.ResponseEntity;
|
|||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/api/admin/imports")
|
@RequestMapping({"/api/admin/imports", "/api/v1/admin/imports"})
|
||||||
|
|
||||||
@CrossOrigin(origins = "http://localhost:3000")
|
@CrossOrigin(origins = "http://localhost:3000")
|
||||||
public class ImportController {
|
public class ImportController {
|
||||||
|
|
||||||
|
|||||||
@@ -3,11 +3,13 @@ package group.goforward.battlbuilder.controllers;
|
|||||||
import group.goforward.battlbuilder.model.Merchant;
|
import group.goforward.battlbuilder.model.Merchant;
|
||||||
import group.goforward.battlbuilder.repos.MerchantRepository;
|
import group.goforward.battlbuilder.repos.MerchantRepository;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
|
@RequestMapping({"/api/admin", "/api/v1/admin"})
|
||||||
public class MerchantDebugController {
|
public class MerchantDebugController {
|
||||||
|
|
||||||
private final MerchantRepository merchantRepository;
|
private final MerchantRepository merchantRepository;
|
||||||
@@ -16,7 +18,7 @@ public class MerchantDebugController {
|
|||||||
this.merchantRepository = merchantRepository;
|
this.merchantRepository = merchantRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/api/admin/debug/merchants")
|
@GetMapping("/debug/merchants")
|
||||||
public List<Merchant> listMerchants() {
|
public List<Merchant> listMerchants() {
|
||||||
return merchantRepository.findAll();
|
return merchantRepository.findAll();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/api/part-role-mappings")
|
@RequestMapping({"/api/part-role-mappings", "/api/v1/part-role-mappings"})
|
||||||
public class PartRoleMappingController {
|
public class PartRoleMappingController {
|
||||||
|
|
||||||
private final PartRoleMappingService service;
|
private final PartRoleMappingService service;
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/api/products")
|
@RequestMapping({"/api/products", "/api/v1/products"})
|
||||||
@CrossOrigin
|
@CrossOrigin
|
||||||
@ConditionalOnProperty(name = "app.api.legacy.enabled", havingValue = "true", matchIfMissing = false)
|
@ConditionalOnProperty(name = "app.api.legacy.enabled", havingValue = "true", matchIfMissing = false)
|
||||||
public class ProductController {
|
public class ProductController {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import java.util.List;
|
|||||||
|
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/api/brands")
|
@RequestMapping({"/api/v1/brands", "/api/brands"})
|
||||||
public class BrandController {
|
public class BrandController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private BrandRepository repo;
|
private BrandRepository repo;
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package group.goforward.battlbuilder.controllers.api;
|
||||||
|
|
||||||
|
import group.goforward.battlbuilder.model.Build;
|
||||||
|
import group.goforward.battlbuilder.repos.BuildRepository;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/v1/api/builds")
|
||||||
|
public class BuildController {
|
||||||
|
@Autowired
|
||||||
|
private BuildRepository repo;
|
||||||
|
@Autowired
|
||||||
|
// private BuildsService service;
|
||||||
|
//@Cacheable(value="getAllStates")
|
||||||
|
@GetMapping("/all")
|
||||||
|
public ResponseEntity<List<Build>> getAll() {
|
||||||
|
List<Build> builds = repo.findAll();
|
||||||
|
return ResponseEntity.ok(builds);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ResponseEntity<Build> getAllBuildsById(@PathVariable Integer id) {
|
||||||
|
return repo.findById(id)
|
||||||
|
.map(ResponseEntity::ok)
|
||||||
|
.orElse(ResponseEntity.notFound().build());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -15,11 +15,11 @@ import java.time.Duration;
|
|||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/api/images")
|
@RequestMapping("/api/images")
|
||||||
public class ImagesController {
|
public class ImageController {
|
||||||
|
|
||||||
private final ImageService imageService;
|
private final ImageService imageService;
|
||||||
|
|
||||||
public ImagesController(ImageService imageService) {
|
public ImageController(ImageService imageService) {
|
||||||
this.imageService = imageService;
|
this.imageService = imageService;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@ import java.util.UUID;
|
|||||||
import static org.springframework.http.HttpStatus.*;
|
import static org.springframework.http.HttpStatus.*;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/api/users/me")
|
@RequestMapping({"/api/v1/users/me", "/api/users/me"})
|
||||||
@CrossOrigin
|
@CrossOrigin
|
||||||
public class MeController {
|
public class MeController {
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import java.util.List;
|
|||||||
|
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/api/states")
|
@RequestMapping({"/api/states", "/api/v1/states"})
|
||||||
public class StateController {
|
public class StateController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private StateRepository repo;
|
private StateRepository repo;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import java.util.List;
|
|||||||
|
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/api/user")
|
@RequestMapping({"/api/user", "/api/v1/user"})
|
||||||
public class UserController {
|
public class UserController {
|
||||||
private final UserRepository repo;
|
private final UserRepository repo;
|
||||||
private final UsersService usersService;
|
private final UsersService usersService;
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package group.goforward.battlbuilder.services;
|
||||||
|
|
||||||
|
import aj.org.objectweb.asm.commons.Remapper;
|
||||||
|
import group.goforward.battlbuilder.model.Brand;
|
||||||
|
|
||||||
|
public interface BuildsService {
|
||||||
|
Brand save(Brand item);
|
||||||
|
|
||||||
|
Remapper findById(Integer id);
|
||||||
|
|
||||||
|
void deleteById(Integer id);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user