修改授权逻辑

master
wujingtao 3 years ago
parent 64ab68f69c
commit b0b305e750

@ -66,15 +66,21 @@ public class RequestCore {
* @param payTemplateId
* @return
*/
public String authorizeChildrenAccount(Long parentAccountId, String nickName, Long payTemplateId) {
public JSONObject authorizeChildrenAccount(Long parentAccountId, String nickName, Long payTemplateId) {
String reqUrl = url + API_PREFIX + "/account/authorize";
Map<String, Object> map = new HashMap<>();
map.put("parentAccountId", parentAccountId);
map.put("nickName", nickName);
map.put("payTemplateId", payTemplateId);
String post = HttpUtil.post(reqUrl, JSONUtil.parseObj(map).toString());
log.info(post);
return post;
log.info("子账号授权返回值,{}", post);
JSONObject jsonObject;
try {
jsonObject = JSONUtil.parseObj(post).getJSONObject("data");
} catch (Exception e) {
return null;
}
return jsonObject;
}
/**

@ -430,7 +430,7 @@ public class SellerAccountServiceImpl implements SellerAccountService {
@Transactional(rollbackFor = Exception.class)
public CommonResult<Object> authorizeChildrenAccount(AuthorizeChildrenAccountVo authorizeChildrenAccountVo) {
//查询出套餐模板
PayTemplate payTemplateByTemplateId = payTemplateRepository.findPayTemplateByTemplateId(authorizeChildrenAccountVo.getTemplateId());
PayTemplate payTemplateByTemplateId = payTemplateRepository.findPayTemplateByTemplateId(authorizeChildrenAccountVo.getPayTemplateId());
if (ObjectUtil.isEmpty(payTemplateByTemplateId)) {
return new CommonResult<>().failed("未查询到套餐");
}

@ -1,7 +1,6 @@
package com.hchbox.vo;
import lombok.Data;
import lombok.NonNull;
import javax.validation.constraints.NotNull;
@ -16,5 +15,5 @@ public class AuthorizeChildrenAccountVo {
@NotNull
private String nickName;
@NotNull
private Long templateId;
private Long payTemplateId;
}

Loading…
Cancel
Save