从第三方获取用户优惠券
This commit is contained in:
@@ -227,6 +227,27 @@ public final class LbThirdIntegrationConfigUtil {
|
||||
return limit;
|
||||
}
|
||||
|
||||
public static String resolveMoneyCouponApiBaseUrl(LbThirdIntegrationConfig config) {
|
||||
String base = trimTrailingSlash(requireText(config.getAdminBaseUrl(), "adminBaseUrl"));
|
||||
String path = config.getMoneyCouponListPath();
|
||||
if (!StringUtils.hasText(path)) {
|
||||
path = "";
|
||||
}
|
||||
path = path.trim();
|
||||
if (!path.startsWith("/")) {
|
||||
path = "/" + path;
|
||||
}
|
||||
return base + path;
|
||||
}
|
||||
|
||||
public static int resolveMoneyCouponListLimit(LbThirdIntegrationConfig config) {
|
||||
Integer limit = config.getMoneyCouponListLimit();
|
||||
if (limit == null || limit < 1) {
|
||||
return 90;
|
||||
}
|
||||
return limit;
|
||||
}
|
||||
|
||||
private static Map<String, String> parseQueryString(String query) {
|
||||
Map<String, String> params = new HashMap<>();
|
||||
if (query == null || query.isBlank()) {
|
||||
|
||||
Reference in New Issue
Block a user