Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
A
Afrishop refactored project
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Whispa
Afrishop refactored project
Commits
67591291
提交
67591291
authored
4月 26, 2021
作者:
wudepeng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
商品导入
上级
deb656b2
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
18 个修改的文件
包含
1001 行增加
和
482 行删除
+1001
-482
PaypalConfig.java
...ain/java/com/example/afrishop_v3/config/PaypalConfig.java
+57
-57
PaypalContoller.java
.../com/example/afrishop_v3/controllers/PaypalContoller.java
+408
-408
CategoryEnum.java
...main/java/com/example/afrishop_v3/enums/CategoryEnum.java
+25
-0
TbCfDescripiton.java
.../java/com/example/afrishop_v3/models/TbCfDescripiton.java
+2
-0
TbCfExpressTemplate.java
...a/com/example/afrishop_v3/models/TbCfExpressTemplate.java
+10
-0
TbCfGoodstwotype.java
...java/com/example/afrishop_v3/models/TbCfGoodstwotype.java
+2
-0
TbCfGoodstype.java
...in/java/com/example/afrishop_v3/models/TbCfGoodstype.java
+6
-0
TbCfStationItem.java
.../java/com/example/afrishop_v3/models/TbCfStationItem.java
+11
-13
ItemTask.java
src/main/java/com/example/afrishop_v3/quartz/ItemTask.java
+321
-0
TbCfDescripitonRepository.java
...ple/afrishop_v3/repository/TbCfDescripitonRepository.java
+7
-0
TbCfGoodstwotypeRepository.java
...le/afrishop_v3/repository/TbCfGoodstwotypeRepository.java
+9
-0
TbCfGoodstypeRepository.java
...ample/afrishop_v3/repository/TbCfGoodstypeRepository.java
+8
-0
TbCfStationItemRepository.java
...ple/afrishop_v3/repository/TbCfStationItemRepository.java
+3
-0
PayPalUtil.java
src/main/java/com/example/afrishop_v3/util/PayPalUtil.java
+1
-0
application-test.yml
src/main/resources/application-test.yml
+1
-1
application.properties
src/main/resources/application.properties
+3
-3
AfrishopV3ApplicationTests.java
...a/com/example/afrishop_v3/AfrishopV3ApplicationTests.java
+6
-0
MainTest.java
src/test/java/com/example/afrishop_v3/MainTest.java
+121
-0
没有找到文件。
src/main/java/com/example/afrishop_v3/config/PaypalConfig.java
浏览文件 @
67591291
package
com
.
example
.
afrishop_v3
.
config
;
//
package com.example.afrishop_v3.config;
//
import
com.example.afrishop_v3.models.Token
;
//
import com.example.afrishop_v3.models.Token;
import
com.example.afrishop_v3.repository.TokenRepository
;
//
import com.example.afrishop_v3.repository.TokenRepository;
import
com.example.afrishop_v3.util.PayPalUtil
;
//
import com.example.afrishop_v3.util.PayPalUtil;
import
com.paypal.base.codec.binary.Base64
;
//
import com.paypal.base.codec.binary.Base64;
import
com.paypal.base.rest.APIContext
;
//
import com.paypal.base.rest.APIContext;
import
com.paypal.base.rest.OAuthTokenCredential
;
//
import com.paypal.base.rest.OAuthTokenCredential;
import
com.paypal.base.rest.PayPalRESTException
;
//
import com.paypal.base.rest.PayPalRESTException;
//
import
net.sf.json.JSONObject
;
//
import net.sf.json.JSONObject;
import
org.apache.commons.lang3.builder.ToStringExclude
;
//
import org.apache.commons.lang3.builder.ToStringExclude;
import
org.springframework.beans.factory.annotation.Value
;
//
import org.springframework.beans.factory.annotation.Value;
import
org.springframework.context.annotation.*
;
//
import org.springframework.context.annotation.*;
//
//
import
java.io.IOException
;
//
import java.io.IOException;
import
java.io.UnsupportedEncodingException
;
//
import java.io.UnsupportedEncodingException;
import
java.util.*
;
//
import java.util.*;
import
java.util.concurrent.*
;
//
import java.util.concurrent.*;
//
//
@Configuration
//
@Configuration
public
class
PaypalConfig
{
//
public class PaypalConfig {
//
@Value
(
"${paypal.client_app}"
)
//
@Value("${paypal.client_app}")
private
String
clientId
;
//
private String clientId;
//
@Value
(
"${paypal.client_secret}"
)
//
@Value("${paypal.client_secret}")
private
String
clientSecret
;
//
private String clientSecret;
//
@Value
(
"${paypal.mode}"
)
//
@Value("${paypal.mode}")
private
String
mode
;
//
private String mode;
//
//
@Bean
//
@Bean
public
Map
<
String
,
String
>
paypalSdkConfig
()
{
//
public Map<String, String> paypalSdkConfig() {
Map
<
String
,
String
>
sdkConfig
=
new
HashMap
<>();
//
Map<String, String> sdkConfig = new HashMap<>();
sdkConfig
.
put
(
"mode"
,
mode
);
//
sdkConfig.put("mode", mode);
return
sdkConfig
;
//
return sdkConfig;
}
//
}
//
//
@Bean
//
@Bean
public
OAuthTokenCredential
authTokenCredential
()
{
//
public OAuthTokenCredential authTokenCredential() {
return
new
OAuthTokenCredential
(
clientId
,
clientSecret
,
paypalSdkConfig
());
//
return new OAuthTokenCredential(clientId, clientSecret, paypalSdkConfig());
}
//
}
//
@Bean
//
@Bean
public
APIContext
apiContext
()
throws
PayPalRESTException
{
//
public APIContext apiContext() throws PayPalRESTException {
APIContext
apiContext
=
new
APIContext
(
authTokenCredential
().
getAccessToken
());
//
APIContext apiContext = new APIContext(authTokenCredential().getAccessToken());
apiContext
.
setConfigurationMap
(
paypalSdkConfig
());
//
apiContext.setConfigurationMap(paypalSdkConfig());
return
apiContext
;
//
return apiContext;
}
//
}
//
//
}
//
}
src/main/java/com/example/afrishop_v3/controllers/PaypalContoller.java
浏览文件 @
67591291
差异被折叠。
点击展开。
src/main/java/com/example/afrishop_v3/enums/CategoryEnum.java
0 → 100644
浏览文件 @
67591291
package
com
.
example
.
afrishop_v3
.
enums
;
public
enum
CategoryEnum
{
WOMEN
(
1
,
"Women"
),
CURVE
(
3
,
"Curve+Plus"
),
MEN
(
5
,
"Men"
),
KIDS
(
4
,
"Kids"
);
private
Integer
categoryId
;
private
String
categoryName
;
CategoryEnum
(
Integer
categoryId
,
String
categoryName
){
this
.
categoryId
=
categoryId
;
this
.
categoryName
=
categoryName
;
}
public
Integer
getCategoryId
()
{
return
categoryId
;
}
public
String
getCategoryName
()
{
return
categoryName
;
}
}
src/main/java/com/example/afrishop_v3/models/TbCfDescripiton.java
浏览文件 @
67591291
...
@@ -63,6 +63,8 @@ public class TbCfDescripiton{
...
@@ -63,6 +63,8 @@ public class TbCfDescripiton{
*/
*/
private
String
twoType
;
private
String
twoType
;
private
String
tempId
;
private
Integer
sort
;
private
Integer
sort
;
public
Integer
getSort
()
{
public
Integer
getSort
()
{
...
...
src/main/java/com/example/afrishop_v3/models/TbCfExpressTemplate.java
浏览文件 @
67591291
...
@@ -19,6 +19,9 @@ import java.util.Date;
...
@@ -19,6 +19,9 @@ import java.util.Date;
@Data
@Data
public
class
TbCfExpressTemplate
{
public
class
TbCfExpressTemplate
{
/**
/**
* 模板id
* 模板id
*/
*/
...
@@ -89,6 +92,13 @@ public class TbCfExpressTemplate{
...
@@ -89,6 +92,13 @@ public class TbCfExpressTemplate{
*/
*/
private
Date
updateTime
;
private
Date
updateTime
;
public
TbCfExpressTemplate
()
{
}
public
TbCfExpressTemplate
(
String
templateId
)
{
this
.
templateId
=
templateId
;
}
/**
/**
* 设置:模板id
* 设置:模板id
*/
*/
...
...
src/main/java/com/example/afrishop_v3/models/TbCfGoodstwotype.java
浏览文件 @
67591291
...
@@ -41,6 +41,8 @@ public class TbCfGoodstwotype{
...
@@ -41,6 +41,8 @@ public class TbCfGoodstwotype{
*/
*/
private
String
goodstwotypeUrl
;
private
String
goodstwotypeUrl
;
private
String
tempId
;
@Transient
@Transient
private
boolean
autoLoad
=
false
;
private
boolean
autoLoad
=
false
;
...
...
src/main/java/com/example/afrishop_v3/models/TbCfGoodstype.java
浏览文件 @
67591291
...
@@ -2,6 +2,7 @@ package com.example.afrishop_v3.models;
...
@@ -2,6 +2,7 @@ package com.example.afrishop_v3.models;
import
lombok.Getter
;
import
lombok.Getter
;
import
lombok.Setter
;
import
lombok.Setter
;
import
org.springframework.data.relational.core.sql.In
;
import
javax.persistence.Entity
;
import
javax.persistence.Entity
;
import
javax.persistence.Id
;
import
javax.persistence.Id
;
...
@@ -41,6 +42,11 @@ public class TbCfGoodstype{
...
@@ -41,6 +42,11 @@ public class TbCfGoodstype{
*/
*/
private
String
goodstypeImage
;
private
String
goodstypeImage
;
/**
* 临时ID
*/
private
Integer
tempId
;
/**
/**
* 设置:商品分类Id
* 设置:商品分类Id
*/
*/
...
...
src/main/java/com/example/afrishop_v3/models/TbCfStationItem.java
浏览文件 @
67591291
...
@@ -93,7 +93,7 @@ public class TbCfStationItem {
...
@@ -93,7 +93,7 @@ public class TbCfStationItem {
/**
/**
* 是否置顶 Y:是 N:否
* 是否置顶 Y:是 N:否
*/
*/
private
String
itemTop
;
private
Integer
itemTop
;
/**
/**
* 供应商
* 供应商
*/
*/
...
@@ -127,6 +127,16 @@ public class TbCfStationItem {
...
@@ -127,6 +127,16 @@ public class TbCfStationItem {
private
String
handled
;
private
String
handled
;
private
String
tempId
;
public
String
getTempId
()
{
return
tempId
;
}
public
void
setTempId
(
String
tempId
)
{
this
.
tempId
=
tempId
;
}
@JsonIgnore
@JsonIgnore
@ManyToOne
@ManyToOne
@JoinColumn
(
columnDefinition
=
"template"
,
name
=
"template"
)
@JoinColumn
(
columnDefinition
=
"template"
,
name
=
"template"
)
...
@@ -394,19 +404,7 @@ public class TbCfStationItem {
...
@@ -394,19 +404,7 @@ public class TbCfStationItem {
return
itemSku
;
return
itemSku
;
}
}
/**
* 设置:是否置顶 Y:是 N:否
*/
public
void
setItemTop
(
String
itemTop
)
{
this
.
itemTop
=
itemTop
;
}
/**
* 获取:是否置顶 Y:是 N:否
*/
public
String
getItemTop
()
{
return
itemTop
;
}
/**
/**
* 设置:供应商
* 设置:供应商
...
...
src/main/java/com/example/afrishop_v3/quartz/ItemTask.java
0 → 100644
浏览文件 @
67591291
差异被折叠。
点击展开。
src/main/java/com/example/afrishop_v3/repository/TbCfDescripitonRepository.java
浏览文件 @
67591291
package
com
.
example
.
afrishop_v3
.
repository
;
package
com
.
example
.
afrishop_v3
.
repository
;
import
com.example.afrishop_v3.models.TbCfDescripiton
;
import
com.example.afrishop_v3.models.TbCfDescripiton
;
import
com.example.afrishop_v3.models.TbCfGoodstwotype
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.jpa.repository.Query
;
import
org.springframework.data.repository.PagingAndSortingRepository
;
import
org.springframework.data.repository.PagingAndSortingRepository
;
import
java.util.List
;
import
java.util.List
;
...
@@ -10,4 +12,9 @@ public interface TbCfDescripitonRepository extends PagingAndSortingRepository<Tb
...
@@ -10,4 +12,9 @@ public interface TbCfDescripitonRepository extends PagingAndSortingRepository<Tb
List
<
TbCfDescripiton
>
findAllByGoodstwotypeIdOrderBySort
(
String
categoryTwo
);
List
<
TbCfDescripiton
>
findAllByGoodstwotypeIdOrderBySort
(
String
categoryTwo
);
int
countByGoodstwotypeId
(
String
id
);
int
countByGoodstwotypeId
(
String
id
);
boolean
existsByDescripitionNameAndTempId
(
String
name
,
String
tempId
);
TbCfDescripiton
findFirstByDescripitionNameAndTempId
(
String
name
,
String
tempId
);
}
}
src/main/java/com/example/afrishop_v3/repository/TbCfGoodstwotypeRepository.java
浏览文件 @
67591291
package
com
.
example
.
afrishop_v3
.
repository
;
package
com
.
example
.
afrishop_v3
.
repository
;
import
com.example.afrishop_v3.models.TbCfGoodstwotype
;
import
com.example.afrishop_v3.models.TbCfGoodstwotype
;
import
com.example.afrishop_v3.models.TbCfGoodstype
;
import
org.springframework.data.jpa.repository.Query
;
import
org.springframework.data.repository.PagingAndSortingRepository
;
import
org.springframework.data.repository.PagingAndSortingRepository
;
import
java.util.List
;
import
java.util.List
;
...
@@ -10,4 +12,11 @@ public interface TbCfGoodstwotypeRepository extends PagingAndSortingRepository<T
...
@@ -10,4 +12,11 @@ public interface TbCfGoodstwotypeRepository extends PagingAndSortingRepository<T
int
countByGoodstypeId
(
String
id
);
int
countByGoodstypeId
(
String
id
);
@Query
(
value
=
"select max(sort) from TbCfGoodstwotype where goodstypeId=:goodstypeId"
)
int
findMaxSort
(
String
goodstypeId
);
boolean
existsByGoodstwotypeTitleAndTempId
(
String
name
,
String
tempId
);
TbCfGoodstwotype
findFirstByGoodstwotypeTitleAndTempId
(
String
name
,
String
tempId
);
}
}
src/main/java/com/example/afrishop_v3/repository/TbCfGoodstypeRepository.java
浏览文件 @
67591291
package
com
.
example
.
afrishop_v3
.
repository
;
package
com
.
example
.
afrishop_v3
.
repository
;
import
com.example.afrishop_v3.models.TbCfGoodstype
;
import
com.example.afrishop_v3.models.TbCfGoodstype
;
import
org.springframework.data.jpa.repository.Query
;
import
org.springframework.data.repository.PagingAndSortingRepository
;
import
org.springframework.data.repository.PagingAndSortingRepository
;
public
interface
TbCfGoodstypeRepository
extends
PagingAndSortingRepository
<
TbCfGoodstype
,
String
>
{
public
interface
TbCfGoodstypeRepository
extends
PagingAndSortingRepository
<
TbCfGoodstype
,
String
>
{
@Query
(
value
=
"select max(goodstypeSort) from TbCfGoodstype"
)
int
findMaxSort
();
boolean
existsByGoodstypeTitle
(
String
name
);
TbCfGoodstype
findByGoodstypeTitle
(
String
name
);
}
}
src/main/java/com/example/afrishop_v3/repository/TbCfStationItemRepository.java
浏览文件 @
67591291
...
@@ -62,4 +62,7 @@ public interface TbCfStationItemRepository extends PagingAndSortingRepository<Tb
...
@@ -62,4 +62,7 @@ public interface TbCfStationItemRepository extends PagingAndSortingRepository<Tb
@Transactional
@Transactional
int
updateItmeImg
(
@Param
(
"itemImg"
)
String
itemImg
,
@Param
(
"itemId"
)
String
itemId
);
int
updateItmeImg
(
@Param
(
"itemImg"
)
String
itemImg
,
@Param
(
"itemId"
)
String
itemId
);
// @Query("select i from #{#entityName} i where tempId is not null")
List
<
TbCfStationItem
>
findAllByTempIdIsNotNull
();
}
}
src/main/java/com/example/afrishop_v3/util/PayPalUtil.java
浏览文件 @
67591291
...
@@ -34,6 +34,7 @@ public class PayPalUtil {
...
@@ -34,6 +34,7 @@ public class PayPalUtil {
Response
response
=
client
.
newCall
(
request
).
execute
();
Response
response
=
client
.
newCall
(
request
).
execute
();
String
string
=
response
.
body
().
string
();
String
string
=
response
.
body
().
string
();
System
.
out
.
println
(
"================"
+
string
);
net
.
sf
.
json
.
JSONObject
jsonObject
=
JSONObject
.
fromObject
(
string
);
net
.
sf
.
json
.
JSONObject
jsonObject
=
JSONObject
.
fromObject
(
string
);
String
token_type
=
jsonObject
.
getString
(
"token_type"
);
String
token_type
=
jsonObject
.
getString
(
"token_type"
);
String
access_token
=
jsonObject
.
getString
(
"access_token"
);
String
access_token
=
jsonObject
.
getString
(
"access_token"
);
...
...
src/main/resources/application-test.yml
浏览文件 @
67591291
server
:
server
:
servlet
:
servlet
:
context-path
:
/afrishop
context-path
:
/afrishop
port
:
80
99
port
:
80
12
spring
:
spring
:
datasource
:
datasource
:
...
...
src/main/resources/application.properties
浏览文件 @
67591291
...
@@ -2,7 +2,7 @@ server.servlet.context-path=/zion
...
@@ -2,7 +2,7 @@ server.servlet.context-path=/zion
spring.jpa.hibernate.ddl-auto
=
update
spring.jpa.hibernate.ddl-auto
=
update
server.port
=
8083
server.port
=
8083
spring.profiles.active
=
test
spring.profiles.active
=
test
#spring.datasource.url=jdbc:mysql://${MYSQL_HOST:localhost}:3306/afrishop_test?useUnicode=true&connectionCollation=utf8mb4_general_ci&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
#spring.datasource.url=jdbc:mysql://${MYSQL_HOST:localhost}:3306/afrishop_test?useUnicode=true&connectionCollation=utf8mb4_general_ci&characterEncoding=UTF-8&useJDBCCompliant
\
TimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
#spring.datasource.username=root
#spring.datasource.username=root
#spring.datasource.password=Diaoyunnuli.8
#spring.datasource.password=Diaoyunnuli.8
#spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
#spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
...
@@ -25,5 +25,5 @@ spring.servlet.multipart.max-request-size=456128KB
...
@@ -25,5 +25,5 @@ spring.servlet.multipart.max-request-size=456128KB
bezkoder.app.jwtSecret
=
bezKoderSecretKey
bezkoder.app.jwtSecret
=
bezKoderSecretKey
bezkoder.app.jwtExpirationMs
=
86400000
bezkoder.app.jwtExpirationMs
=
86400000
#spring.jpa.show-sql=true
spring.jpa.show-sql
=
true
#
spring.jpa.properties.hibernate.format_sql
=
true
spring.jpa.properties.hibernate.format_sql
=
true
\ No newline at end of file
\ No newline at end of file
src/test/java/com/example/afrishop_v3/AfrishopV3ApplicationTests.java
浏览文件 @
67591291
...
@@ -214,6 +214,12 @@
...
@@ -214,6 +214,12 @@
// return output.toByteArray();
// return output.toByteArray();
// }
// }
//
//
// @Test
// public void test001(){
// Date now = DateUtil.getNow();
// System.out.println(now);
// }
//
//
//
//
//}
//}
src/test/java/com/example/afrishop_v3/MainTest.java
0 → 100644
浏览文件 @
67591291
//package com.example.afrishop_v3;
//
//import com.example.afrishop_v3.enums.CategoryEnum;
//import com.example.afrishop_v3.models.Country;
//import com.example.afrishop_v3.util.HttpClientUtil;
//import net.sf.json.JSONArray;
//import net.sf.json.JSONObject;
//import org.junit.Test;
//
//import java.io.IOException;
//import java.util.*;
//import java.util.stream.Collectors;
//
//public class MainTest {
//// usd_shop_price(现价) usd_market_price(原价)
// //https://apiv2.lovelywholesale.com/lw-api/product/item/296341?Origin=https:%2F%2Fm.lovelywholesale.com%2F&v=1619262060361
// private final String ITEM_URL="https://goapi.lovelywholesale.com/search/category/products";
// private volatile Integer page=1;
// private final Integer limit=48;
// private int total_page=0;
//// @Test
// public void importItems(Integer category_id) throws IOException {
// JSONArray items=null;
// do {
// page++ ;
// Map<String,Object> params=new LinkedHashMap<>();
// params.put("offset",page);
// params.put("limit",limit);
// params.put("category_id",category_id);
// params.put("original_category_id",category_id);
// params.put("is_virtual",1);
// String response = HttpClientUtil.sendPostWithBodyParameter(ITEM_URL, params);
// JSONObject jsonObject = JSONObject.fromObject(response);
// JSONObject data = jsonObject.getJSONObject("data");
// total_page = data.getInt("total_page");
// items = data.getJSONArray("search_list");
// for (int i = 0; i < items.size(); i++) {
// JSONObject item = items.getJSONObject(i);
// String itemId = item.getString("goods_id");
// String itemName = item.getString("goods_name");
// String categoryName = item.getString("category_name");
// }
//
// }while (page<total_page);
//
//
// }
//
// private final String CATEGORY_URL="https://apiv2.lovelywholesale.com/lw-api/head/switch-top-category";
//
// @Test
// public void importCategory() throws IOException {
// String topCategory = null;
// List<Integer> ids= Arrays.asList(1,3,5,4);
// for (int i = 0; i < ids.size(); i++) {
// Integer catId = ids.get(i);
// if (CategoryEnum.WOMEN.getCategoryId()==catId){
// topCategory=CategoryEnum.WOMEN.getCategoryName();
// }else if (CategoryEnum.CURVE.getCategoryId()==catId){
// topCategory=CategoryEnum.CURVE.getCategoryName();
// }else if (CategoryEnum.MEN.getCategoryId()==catId){
// topCategory=CategoryEnum.MEN.getCategoryName();
// }else if (CategoryEnum.KIDS.getCategoryId()==catId){
// topCategory=CategoryEnum.KIDS.getCategoryName();
// }
// Map<String,Object> params=new LinkedHashMap<>();
// params.put("top_cat_id",catId);
// String response=HttpClientUtil.sendPostWithBodyParameter(CATEGORY_URL,params);
// JSONObject jsonObject = JSONObject.fromObject(response);
// JSONObject data = jsonObject.getJSONObject("data");
// JSONArray categorys = data.getJSONArray("categorys");
// for (int j = 0; j < categorys.size(); j++) {
// JSONObject category = categorys.getJSONObject(j);
// String categoryId = category.getString("nav_id");
// String navName = category.getString("nav_name");
// Map<String, String> children = getCategoryChildren(categoryId);
// System.err.println("一级分类:"+topCategory+"---"+"二级分类-:"+categoryId+"---"+navName);
// //二级分类入库
//// children.entrySet().stream().forEach(System.err::println);
// //三级分类入库
// //通过三级分类查询商品、入库
// children.forEach((k, v) ->{
// try {
// importItems(Integer.parseInt(k));
// } catch (IOException e) {
// e.printStackTrace();
// }
// });
// }
//
//
// }
//
// }
//
// private final String url="https://apiv2.lovelywholesale.com/lw-api/list/get_child_cat";
//
//// @Test
// public Map<String,String> getCategoryChildren(String categoryId) throws IOException {
// Map<String,String> results=new LinkedHashMap<>();
// Map<String,Object> params=new LinkedHashMap<>();
// params.put("nav_id",categoryId);
// String response=HttpClientUtil.sendPostWithBodyParameter(url,params);
// JSONObject jsonObject = JSONObject.fromObject(response);
// JSONObject data = jsonObject.getJSONObject("data");
// JSONArray categorys = data.getJSONArray("category");
// for (int j = 0; j < categorys.size(); j++) {
// JSONObject category = categorys.getJSONObject(j);
// JSONArray childs = category.getJSONArray("child");
// for (int i = 0; i < childs.size(); i++) {
// JSONObject child = childs.getJSONObject(i);
// String name = child.getString("nav_name");
// String cat_id = child.getJSONObject("cat_info").getString("cat_id");
// System.err.println(cat_id+"---"+name);
// results.put(cat_id,name);
// }
// }
// return results;
// }
//
//}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论