1
0
mirror of synced 2026-04-24 10:38:51 +08:00

♻️ 移除 UrlBuilder

This commit is contained in:
Yangkai.Shen
2019-07-18 20:37:41 +08:00
parent 72792c3c83
commit 0d4e52d615
49 changed files with 1086 additions and 1743 deletions

View File

@@ -1,6 +1,7 @@
package me.zhyd.oauth.utils;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.StrUtil;
import lombok.Data;
@@ -12,7 +13,7 @@ import java.util.Map;
* 构造URL
* </p>
*
* @author yangkai.shen
* @author yangkai.shen (https://xkcoding.com)
* @date Created in 2019-07-18 15:47
*/
@Data
@@ -63,6 +64,9 @@ public class UrlBuilder {
* @return url
*/
public String build(boolean encode) {
if (MapUtil.isEmpty(this.params)) {
return this.baseUrl;
}
String baseUrl = StrUtil.addSuffixIfNot(this.baseUrl, "?");
String paramString = GlobalAuthUtil.parseMapToString(this.params, encode);
return baseUrl + paramString;