Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gxpt_ht
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pseer
gxpt_ht
Commits
bc308363
Commit
bc308363
authored
Jan 30, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加Tiktok实体类
parent
f2ba6e18
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
97 additions
and
19 deletions
+97
-19
TiktokController.java
...in/java/share/web/controller/system/TiktokController.java
+3
-2
Poi.java
...-system/src/main/java/share/system/domain/tiktok/Poi.java
+11
-0
Sku.java
...-system/src/main/java/share/system/domain/tiktok/Sku.java
+5
-0
TicktokProduct.java
.../main/java/share/system/domain/tiktok/TicktokProduct.java
+26
-0
TiktokCouponDto.java
...main/java/share/system/domain/tiktok/TiktokCouponDto.java
+1
-1
TiktokPoi.java
...m/src/main/java/share/system/domain/tiktok/TiktokPoi.java
+29
-0
TiktokService.java
...tem/src/main/java/share/system/service/TiktokService.java
+3
-3
TiktokServiceImpl.java
...ain/java/share/system/service/impl/TiktokServiceImpl.java
+19
-13
No files found.
share-front/src/main/java/share/web/controller/system/TiktokController.java
View file @
bc308363
...
...
@@ -5,7 +5,8 @@ import org.springframework.web.bind.annotation.GetMapping;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
share.system.domain.vo.OnlineQueryDto
;
import
share.system.domain.vo.TiktokCouponDto
;
import
share.system.domain.tiktok.TiktokCouponDto
;
import
share.system.domain.tiktok.TiktokPoi
;
import
share.system.service.TiktokService
;
import
java.util.List
;
...
...
@@ -47,7 +48,7 @@ public class TiktokController {
}
@GetMapping
(
"/poi/query"
)
public
Object
poiQuery
(
TiktokCouponDto
tiktokCouponDto
)
{
public
List
<
TiktokPoi
>
poiQuery
(
TiktokCouponDto
tiktokCouponDto
)
{
return
tiktokService
.
poiQuery
(
tiktokCouponDto
);
}
...
...
share-system/src/main/java/share/system/domain/tiktok/Poi.java
0 → 100644
View file @
bc308363
package
share
.
system
.
domain
.
tiktok
;
import
lombok.Data
;
//查询商品线上数据列表中的店铺类
@Data
public
class
Poi
{
private
String
supplier_ext_id
;
private
String
poi_id
;
private
Integer
supplier_id
;
}
share-system/src/main/java/share/system/domain/tiktok/Sku.java
0 → 100644
View file @
bc308363
package
share
.
system
.
domain
.
tiktok
;
public
class
Sku
{
private
String
supplier_ext_id
;
}
share-system/src/main/java/share/system/domain/tiktok/TicktokProduct.java
0 → 100644
View file @
bc308363
package
share
.
system
.
domain
.
tiktok
;
import
lombok.Data
;
import
java.util.List
;
import
java.util.Map
;
//查询商品线上数据列表中的商品类
@Data
public
class
TicktokProduct
{
private
String
product_id
;
private
String
out_id
;
private
String
product_name
;
private
String
category_full_name
;
private
Integer
category_id
;
private
Integer
product_type
;
private
Integer
biz_line
;
private
String
account_name
;
private
Integer
sold_start_time
;
private
Integer
sold_end_time
;
private
Integer
create_time
;
private
Integer
update_time
;
private
List
<
Poi
>
pois
;
private
Map
<
String
,
String
>
attr_key_value_map
;
}
share-system/src/main/java/share/system/domain/
vo
/TiktokCouponDto.java
→
share-system/src/main/java/share/system/domain/
tiktok
/TiktokCouponDto.java
View file @
bc308363
package
share
.
system
.
domain
.
vo
;
package
share
.
system
.
domain
.
tiktok
;
import
lombok.Data
;
...
...
share-system/src/main/java/share/system/domain/tiktok/TiktokPoi.java
0 → 100644
View file @
bc308363
package
share
.
system
.
domain
.
tiktok
;
import
lombok.Data
;
@Data
public
class
TiktokPoi
{
//抖音门店 ID
private
String
poi_id
;
//抖音门店名称
private
String
poi_name
;
//门店地址
private
String
address
;
//门店坐标 - 纬度
private
Float
latitude
;
//门店坐标 - 经度
private
Float
longitude
;
public
TiktokPoi
()
{
}
public
TiktokPoi
(
String
poi_id
,
String
poi_name
,
String
address
,
Float
latitude
,
Float
longitude
)
{
this
.
poi_id
=
poi_id
;
this
.
poi_name
=
poi_name
;
this
.
address
=
address
;
this
.
latitude
=
latitude
;
this
.
longitude
=
longitude
;
}
}
share-system/src/main/java/share/system/service/TiktokService.java
View file @
bc308363
package
share
.
system
.
service
;
import
cn.hutool.json.JSONArray
;
import
share.system.domain.vo.OnlineQueryDto
;
import
share.system.domain.vo.TiktokCouponDto
;
import
share.system.domain.tiktok.TiktokCouponDto
;
import
share.system.domain.tiktok.TiktokPoi
;
import
java.util.List
;
...
...
@@ -17,7 +17,7 @@ public interface TiktokService {
String
certificateGet
(
TiktokCouponDto
tiktokCouponDto
);
Object
poiQuery
(
TiktokCouponDto
tiktokCouponDto
);
List
<
TiktokPoi
>
poiQuery
(
TiktokCouponDto
tiktokCouponDto
);
Object
onlineQuery
(
OnlineQueryDto
onlineQueryDto
);
...
...
share-system/src/main/java/share/system/service/impl/TiktokServiceImpl.java
View file @
bc308363
...
...
@@ -4,7 +4,6 @@ import cn.hutool.core.date.DatePattern;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.http.HttpGlobalConfig
;
import
cn.hutool.http.HttpRequest
;
import
cn.hutool.http.HttpUtil
;
import
cn.hutool.json.JSONArray
;
import
cn.hutool.json.JSONObject
;
import
com.github.pagehelper.util.StringUtil
;
...
...
@@ -15,9 +14,11 @@ import org.springframework.stereotype.Service;
import
share.common.core.redis.RedisUtil
;
import
share.common.enums.*
;
import
share.system.domain.vo.OnlineQueryDto
;
import
share.system.domain.vo.TiktokCouponDto
;
import
share.system.domain.tiktok.TiktokCouponDto
;
import
share.system.domain.tiktok.TiktokPoi
;
import
share.system.service.TiktokService
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
...
...
@@ -169,7 +170,7 @@ public class TiktokServiceImpl implements TiktokService {
}
@Override
public
Object
poiQuery
(
TiktokCouponDto
tiktokCouponDto
)
{
public
List
<
TiktokPoi
>
poiQuery
(
TiktokCouponDto
tiktokCouponDto
)
{
String
accessToken
=
obtain
();
// String url = "https://open.douyin.com/goodlife/v1/shop/poi/query/";
String
result
=
null
;
...
...
@@ -193,16 +194,22 @@ public class TiktokServiceImpl implements TiktokService {
JSONObject
entries
=
new
JSONObject
(
result
);
JSONObject
data
=
entries
.
getJSONObject
(
"data"
);
if
(!
data
.
getStr
(
"error_code"
).
equals
(
ErrorCodeEnum
.
SUCCESS
.
getCode
()))
{
return
data
.
getStr
(
"description"
);
throw
new
RuntimeException
(
data
.
getStr
(
"description"
)
);
}
JSONArray
pois
=
data
.
getJSONArray
(
"pois"
);
Object
o
=
pois
.
get
(
0
);
JSONObject
object
=
new
JSONObject
(
o
);
//门店信息
JSONObject
poi
=
object
.
getJSONObject
(
"poi"
);
//生活服务商家账户信息
JSONObject
rootAccount
=
object
.
getJSONObject
(
"root_account"
);
return
pois
;
List
<
TiktokPoi
>
tiktokPois
=
new
ArrayList
<>();
List
<
JSONObject
>
list
=
pois
.
toList
(
JSONObject
.
class
);
list
.
stream
().
forEach
(
e
->
{
JSONObject
poi
=
e
.
getJSONObject
(
"poi"
);
TiktokPoi
tiktokPoi
=
new
TiktokPoi
();
tiktokPoi
.
setPoi_id
(
poi
.
getStr
(
"poi_id"
));
tiktokPoi
.
setPoi_name
(
poi
.
getStr
(
"poi_name"
));
tiktokPoi
.
setAddress
(
poi
.
getStr
(
"address"
));
tiktokPoi
.
setLatitude
(
poi
.
getFloat
(
"latitude"
));
tiktokPoi
.
setLongitude
(
poi
.
getFloat
(
"longitude"
));
tiktokPois
.
add
(
tiktokPoi
);
});
return
tiktokPois
;
}
@Override
...
...
@@ -211,9 +218,8 @@ public class TiktokServiceImpl implements TiktokService {
String
result
=
HttpRequest
.
get
(
TiktokUrlEnum
.
ONLINE_QUERY
.
getUrl
())
.
contentType
(
"application/json"
)
.
header
(
"access-token"
,
accessToken
)
.
form
(
"cursor"
,
onlineQueryDto
.
getCursor
())
.
form
(
"count"
,
20
)
.
form
(
"status"
,
onlineQueryDto
.
getStatus
()
)
.
form
(
"status"
,
1
)
.
form
(
"account_id"
,
onlineQueryDto
.
getAccountId
())
.
form
(
"goods_creator_type"
,
1
)
.
form
(
"query_all_poi"
,
YesNoEnum
.
yes
.
getFlag
())
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment