Commit b441c085 authored by guangjing.gao's avatar guangjing.gao

根据用户ID或手机号或应用名称 查询微信openId

parent 8b1c9564
......@@ -55,12 +55,26 @@ public class WxController {
return JsonResult.buildSuccessResultGeneric(wechatUserInfo.getOpenId());
}
/**
* @ yapi http://yapi.quantgroups.com/project/17/interface/api/30122
* @param userId
* @param appName
* @param tenantId
* @return
*/
@GetMapping("/userId/{userId}/{appName}")
public JsonResult openId(@PathVariable Long userId,@PathVariable String appName) {
public JsonResult openId(@PathVariable Long userId,@PathVariable String appName, @RequestParam(required = false) Integer tenantId) {
WechatUserInfo wechatUserInfo = wechatService.queryByUserId(userId,appName);
if (wechatUserInfo == null) {
return JsonResult.buildSuccessResult();
}
/* 校验租户ID */
if (TenantUtil.validationTenantIdIsNullOrZero(tenantId)) {
wechatUserInfo = tenantService.getTenantCustomerInfo(wechatUserInfo, tenantId);
if (wechatUserInfo == null) {
return JsonResult.buildSuccessResult();
}
}
return JsonResult.buildSuccessResultGeneric(wechatUserInfo.getOpenId());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment