|
@@ -3,6 +3,7 @@ package cn.tr.module.smart.wx.controller;
|
|
|
import cn.binarywang.wx.miniapp.api.WxMaService;
|
|
import cn.binarywang.wx.miniapp.api.WxMaService;
|
|
|
import cn.binarywang.wx.miniapp.bean.WxMaUserInfo;
|
|
import cn.binarywang.wx.miniapp.bean.WxMaUserInfo;
|
|
|
import cn.binarywang.wx.miniapp.util.WxMaConfigHolder;
|
|
import cn.binarywang.wx.miniapp.util.WxMaConfigHolder;
|
|
|
|
|
+import cn.tr.core.annotation.TenantIgnore;
|
|
|
import cn.tr.core.exception.ServiceException;
|
|
import cn.tr.core.exception.ServiceException;
|
|
|
import cn.tr.core.exception.TRExcCode;
|
|
import cn.tr.core.exception.TRExcCode;
|
|
|
import cn.tr.core.pojo.CommonResult;
|
|
import cn.tr.core.pojo.CommonResult;
|
|
@@ -21,7 +22,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
@RestController
|
|
@RestController
|
|
|
@AllArgsConstructor
|
|
@AllArgsConstructor
|
|
|
@Slf4j
|
|
@Slf4j
|
|
|
-@RequestMapping("/wx/user/{appid}")
|
|
|
|
|
|
|
+@RequestMapping("/wx/user")
|
|
|
@Api(tags = "微信小程序用户")
|
|
@Api(tags = "微信小程序用户")
|
|
|
public class WxAppletUserController {
|
|
public class WxAppletUserController {
|
|
|
private final WxMaService wxMaService;
|
|
private final WxMaService wxMaService;
|
|
@@ -31,7 +32,7 @@ public class WxAppletUserController {
|
|
|
* 获取用户信息接口
|
|
* 获取用户信息接口
|
|
|
* </pre>
|
|
* </pre>
|
|
|
*/
|
|
*/
|
|
|
- @PostMapping("/info")
|
|
|
|
|
|
|
+ @PostMapping("/{appid}/info")
|
|
|
@ApiOperation("获取微信用户信息")
|
|
@ApiOperation("获取微信用户信息")
|
|
|
public CommonResult<WxMaUserInfo> info(@PathVariable String appid, @RequestBody WxAppletEncodeInfoDTO source) {
|
|
public CommonResult<WxMaUserInfo> info(@PathVariable String appid, @RequestBody WxAppletEncodeInfoDTO source) {
|
|
|
if (!wxMaService.switchover(appid)) {
|
|
if (!wxMaService.switchover(appid)) {
|
|
@@ -49,4 +50,12 @@ public class WxAppletUserController {
|
|
|
WxMaConfigHolder.remove();//清理ThreadLocal
|
|
WxMaConfigHolder.remove();//清理ThreadLocal
|
|
|
return CommonResult.success(userInfo);
|
|
return CommonResult.success(userInfo);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ @PostMapping("/{tenantId}")
|
|
|
|
|
+ @ApiOperation("切换用户当前登录的医院")
|
|
|
|
|
+ public CommonResult<Boolean> shiftTenant(@PathVariable("tenantId") String tenantId){
|
|
|
|
|
+
|
|
|
|
|
+ return CommonResult.success(Boolean.TRUE);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|