mirror of
https://gitea.gofwd.group/Forward_Group/ballistic-builder-spring.git
synced 2026-01-20 16:51:03 -05:00
cleanup and fixes
This commit is contained in:
@@ -1,4 +1,10 @@
|
||||
|
||||
/**
|
||||
* Query projections for the catalog domain.
|
||||
* Query projections for the catalog domain.
|
||||
* <p>
|
||||
*
|
||||
* @author Forward Group, LLC
|
||||
* @version 1.0
|
||||
* @since 2025-12-10
|
||||
*/
|
||||
package group.goforward.battlbuilder.catalog.query;
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package group.goforward.battlbuilder.common;
|
||||
|
||||
public class Constants {
|
||||
public static final String ROLE_ADMIN = "'ADMIN'";
|
||||
/**
|
||||
* The public base URL used when generating short links (differs in dev vs prod).
|
||||
* Examples:
|
||||
* - http://localhost:8080
|
||||
* - https://bb.ooo
|
||||
*/
|
||||
public static final String PUBLIC_BASE_URL = "http://localhost:8080";
|
||||
/**
|
||||
* The frontend base URL used when redirecting BUILD short links.
|
||||
* Examples:
|
||||
* - http://localhost:3000
|
||||
* - https://battlbuilder.com
|
||||
*/
|
||||
public static final String FRONT_END_BASE_URL = "http://localhost:3000";
|
||||
}
|
||||
@@ -5,6 +5,9 @@ import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* see application.properties for values
|
||||
*/
|
||||
@Configuration
|
||||
public class MinioConfig {
|
||||
|
||||
|
||||
@@ -1,33 +1,20 @@
|
||||
package group.goforward.battlbuilder.config;
|
||||
|
||||
import group.goforward.battlbuilder.common.Constants;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
@ConfigurationProperties(prefix = "shortlinks")
|
||||
public class ShortLinksProperties {
|
||||
/**
|
||||
* The public base URL used when generating short links (differs in dev vs prod).
|
||||
* Examples:
|
||||
* - http://localhost:8080
|
||||
* - https://bb.ooo
|
||||
*/
|
||||
public static final String PUBLIC_BASE_URL = "http://localhost:8080";
|
||||
/**
|
||||
* The frontend base URL used when redirecting BUILD short links.
|
||||
* Examples:
|
||||
* - http://localhost:3000
|
||||
* - https://battlbuilder.com
|
||||
*/
|
||||
public static final String FRONT_END_BASE_URL = "http://localhost:3000";
|
||||
/**
|
||||
* Master switch to enable short links.
|
||||
*/
|
||||
private boolean enabled = true;
|
||||
|
||||
|
||||
private String publicBaseUrl = PUBLIC_BASE_URL;
|
||||
private String publicBaseUrl = Constants.PUBLIC_BASE_URL;
|
||||
|
||||
|
||||
private String frontendBaseUrl = FRONT_END_BASE_URL;
|
||||
private String frontendBaseUrl = Constants.FRONT_END_BASE_URL;
|
||||
|
||||
public boolean isEnabled() {
|
||||
return enabled;
|
||||
|
||||
@@ -8,7 +8,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/admin/categories")
|
||||
@RequestMapping({"/api/admin/categories","/api/v1/admin/categories"})
|
||||
@CrossOrigin
|
||||
public class AdminCategoryController {
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/admin/dashboard")
|
||||
@RequestMapping({"/api/admin/dashboard", "/api/v1/admin/dashboard"})
|
||||
public class AdminDashboardController {
|
||||
|
||||
private final AdminDashboardService adminDashboardService;
|
||||
|
||||
@@ -7,7 +7,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/admin/part-categories")
|
||||
@RequestMapping({"/api/admin/part-categories", "/api/v1/admin/part-categories"})
|
||||
@CrossOrigin // keep it loose for now, you can tighten origins later
|
||||
public class AdminPartCategoryController {
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import org.springframework.web.server.ResponseStatusException;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/admin/part-role-mappings")
|
||||
@RequestMapping({"/api/admin/part-role-mappings", "/api/v1/admin/part-role-mappings"})
|
||||
@CrossOrigin
|
||||
public class AdminPartRoleMappingController {
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.util.List;
|
||||
import org.springframework.web.server.ResponseStatusException;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/platforms")
|
||||
@RequestMapping({"/api/platforms", "/api/v1/platforms"})
|
||||
@CrossOrigin
|
||||
public class AdminPlatformController {
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import group.goforward.battlbuilder.web.dto.MerchantAdminDto;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/admin/merchants")
|
||||
@RequestMapping({"/api/admin/merchants", "/api/v1/admin/merchants"})
|
||||
@CrossOrigin(origins = "http://localhost:3000") // TEMP for Cross-Origin Bug
|
||||
public class MerchantAdminController {
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/platforms")
|
||||
@RequestMapping({"/platforms", "api/v1/platforms"})
|
||||
public class PlatformViewController {
|
||||
|
||||
@GetMapping("/manage")
|
||||
|
||||
@@ -10,7 +10,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/admin/import-status")
|
||||
@RequestMapping({"/api/admin/import-status", "/api/v1/admin/import-status"})
|
||||
public class AdminImportStatusController {
|
||||
|
||||
private final ProductRepository productRepository;
|
||||
|
||||
@@ -11,7 +11,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/admin/mapping")
|
||||
@RequestMapping({"/api/admin/mapping", "/api/v1/admin/mapping"})
|
||||
public class AdminMappingController {
|
||||
|
||||
private final MappingAdminService mappingAdminService;
|
||||
|
||||
@@ -7,7 +7,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/admin/merchants")
|
||||
@RequestMapping({"/api/admin/merchants", "/api/v1/admin/merchants"})
|
||||
public class AdminMerchantController {
|
||||
|
||||
private final MerchantFeedImportService merchantFeedImportService;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package group.goforward.battlbuilder.web.admin;
|
||||
|
||||
import group.goforward.battlbuilder.common.Constants;
|
||||
import group.goforward.battlbuilder.services.admin.AdminUserService;
|
||||
import group.goforward.battlbuilder.web.dto.admin.AdminUserDto;
|
||||
import group.goforward.battlbuilder.web.dto.admin.UpdateUserRoleRequest;
|
||||
@@ -11,8 +12,8 @@ import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/admin/users")
|
||||
@PreAuthorize("hasRole('ADMIN')")
|
||||
@RequestMapping({"/admin/users", "/api/v1/admin/users"})
|
||||
@PreAuthorize("hasRole(" + Constants.ROLE_ADMIN + ")")
|
||||
public class AdminUserController {
|
||||
|
||||
private final AdminUserService adminUserService;
|
||||
|
||||
@@ -8,7 +8,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/admin/mappings")
|
||||
@RequestMapping({"/api/admin/mappings", "/api/v1/admin/mappings"})
|
||||
public class CategoryMappingAdminController {
|
||||
|
||||
private final MappingAdminService mappingAdminService;
|
||||
|
||||
Reference in New Issue
Block a user