fix bug
This commit is contained in:
parent
1518e5d1c9
commit
5fad8ac24e
|
|
@ -40,7 +40,7 @@ public class PlayletUserItemAppServiceImpl implements PlayletUserItemAppService
|
|||
@Override
|
||||
public String addUserItem(PlayletUserItem playletUserItem) {
|
||||
PlayletUserItem model = iPlayletUserItemService.lambdaQuery()
|
||||
.eq(PlayletUserItem::getPlayletItem, playletUserItem.getItemId())
|
||||
.eq(PlayletUserItem::getItemId, playletUserItem.getItemId())
|
||||
.eq(PlayletUserItem::getUserId, playletUserItem.getUserId())
|
||||
.one();
|
||||
if(model == null){
|
||||
|
|
@ -48,17 +48,8 @@ public class PlayletUserItemAppServiceImpl implements PlayletUserItemAppService
|
|||
iPlayletUserItemService.save(playletUserItem);
|
||||
model = playletUserItem;
|
||||
}
|
||||
JSONObject body = new JSONObject();
|
||||
body.put("clientId","1000123");
|
||||
body.put("channelId","34661");
|
||||
body.put("bookId","41000103084");
|
||||
body.put("chapterIdx","1");
|
||||
body.put("name","ai种草达人");
|
||||
body.put("mediaSource","dy");
|
||||
// 调用推广api返回链接
|
||||
String result = HttpUtil.post("https://video.wqxsw.com/api/channelapi/referralsave", body);
|
||||
log.info("请求返回内容为 : {}", result);
|
||||
return "等待返回实际推广链接";
|
||||
// JSONObject body = new JSONObject();
|
||||
return this.getPlayletUrl();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -76,7 +67,7 @@ public class PlayletUserItemAppServiceImpl implements PlayletUserItemAppService
|
|||
return PageInfo.of(list);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
private String getPlayletUrl(){
|
||||
String token = "zlwaiSrEM9KEbilu5f";
|
||||
String timestamp = String.valueOf((int)(System.currentTimeMillis()/1000));
|
||||
String clientId = "10005693";
|
||||
|
|
@ -99,5 +90,11 @@ public class PlayletUserItemAppServiceImpl implements PlayletUserItemAppService
|
|||
HttpResponse result = HttpUtil.createPost(url).addHeaders(headerMap).body(com.alibaba.fastjson.JSONObject.toJSONString(body)).execute();
|
||||
// String result = HttpUtil.post("https://video.wqxsw.com/api/v1/channelapi/getminiqrcode", body);
|
||||
log.info("请求入参:{}, 地址:{}, 返回:{}", body, url, result.body());
|
||||
com.alibaba.fastjson.JSONObject json = com.alibaba.fastjson.JSONObject.parseObject(result.body());
|
||||
if("1".equals(json.getString("code"))){
|
||||
return json.getJSONObject("data").getString("monitor");
|
||||
}else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ server:
|
|||
port: 18080
|
||||
servlet:
|
||||
# 应用的访问路径
|
||||
context-path: /
|
||||
context-path: /playlet/
|
||||
tomcat:
|
||||
# tomcat的URI编码
|
||||
uri-encoding: UTF-8
|
||||
|
|
|
|||
Loading…
Reference in New Issue