暂存提交
This commit is contained in:
+8
-3
@@ -5,6 +5,7 @@ import com.baiyue.common.core.api.ResultCode;
|
||||
import com.baiyue.common.core.exception.BizException;
|
||||
import com.baiyue.warehouse.entity.PartnerEntity;
|
||||
import com.baiyue.warehouse.service.PartnerQueryService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
@@ -13,10 +14,14 @@ import java.security.MessageDigest;
|
||||
@RestController
|
||||
@RequestMapping("/internal/warehouse-partners")
|
||||
public class InternalPartnerController {
|
||||
private final PartnerQueryService service; private final byte[] expected;
|
||||
public InternalPartnerController(PartnerQueryService service,
|
||||
@Resource
|
||||
private PartnerQueryService service;
|
||||
|
||||
private final byte[] expected;
|
||||
|
||||
public InternalPartnerController(
|
||||
@Value("${baiyue.security.internal-service-token}") String token) {
|
||||
this.service=service; this.expected=token.getBytes(StandardCharsets.UTF_8);
|
||||
this.expected=token.getBytes(StandardCharsets.UTF_8);
|
||||
}
|
||||
@GetMapping("/{tenantId}/{id}/active")
|
||||
public ApiResponse<PartnerEntity> active(@RequestHeader(value="X-Internal-Service-Token",required=false) String token,
|
||||
|
||||
+7
-3
@@ -5,6 +5,7 @@ import com.baiyue.common.core.api.ResultCode;
|
||||
import com.baiyue.common.core.exception.BizException;
|
||||
import com.baiyue.warehouse.dto.WarehouseDetailResponse;
|
||||
import com.baiyue.warehouse.service.WarehouseApplicationService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
@@ -13,11 +14,14 @@ import java.security.MessageDigest;
|
||||
@RestController
|
||||
@RequestMapping("/internal/warehouses")
|
||||
public class InternalWarehouseController {
|
||||
private final WarehouseApplicationService service;
|
||||
@Resource
|
||||
private WarehouseApplicationService service;
|
||||
|
||||
private final byte[] expected;
|
||||
public InternalWarehouseController(WarehouseApplicationService service,
|
||||
|
||||
public InternalWarehouseController(
|
||||
@Value("${baiyue.security.internal-service-token}") String token) {
|
||||
this.service = service; this.expected = token.getBytes(StandardCharsets.UTF_8);
|
||||
this.expected = token.getBytes(StandardCharsets.UTF_8);
|
||||
}
|
||||
@GetMapping("/{tenantId}/{id}/active")
|
||||
public ApiResponse<WarehouseDetailResponse> active(
|
||||
|
||||
+4
-2
@@ -4,6 +4,7 @@ import com.baiyue.common.core.api.ApiResponse;
|
||||
import com.baiyue.common.security.AuthenticatedUser;
|
||||
import com.baiyue.warehouse.entity.PartnerEntity;
|
||||
import com.baiyue.warehouse.service.PartnerQueryService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.security.core.annotation.AuthenticationPrincipal;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import java.util.List;
|
||||
@@ -11,8 +12,9 @@ import java.util.List;
|
||||
@RestController
|
||||
@RequestMapping("/api/merchant/v1/partners")
|
||||
public class MerchantPartnerController {
|
||||
private final PartnerQueryService service;
|
||||
public MerchantPartnerController(PartnerQueryService service) { this.service=service; }
|
||||
@Resource
|
||||
private PartnerQueryService service;
|
||||
|
||||
@GetMapping("/candidates")
|
||||
public ApiResponse<List<PartnerEntity>> candidates(@AuthenticationPrincipal AuthenticatedUser user,
|
||||
@RequestParam(required=false) String keyword,@RequestParam(required=false) String type) {
|
||||
|
||||
Reference in New Issue
Block a user