Commit 534927e6 by 袁伟铭

更新API微信登录方法

parent e20011cc
...@@ -3,14 +3,15 @@ package com.zq.api.feign; ...@@ -3,14 +3,15 @@ package com.zq.api.feign;
import com.zq.api.config.FeignConfig; import com.zq.api.config.FeignConfig;
import com.zq.common.vo.ResultVo; import com.zq.common.vo.ResultVo;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.Map;
/** /**
* @author wilmiam * @author wilmiam
* @since 2021-07-13 09:56 * @since 2021-07-13 09:56
*/ */
@FeignClient(name = "USER-SERVER", path = "/user/app", configuration = FeignConfig.class) @FeignClient(name = "USER-SERVER", path = "/user/api", configuration = FeignConfig.class)
public interface UserFeign { public interface UserFeign {
/** /**
...@@ -22,4 +23,16 @@ public interface UserFeign { ...@@ -22,4 +23,16 @@ public interface UserFeign {
@GetMapping(value = "/sendCode") @GetMapping(value = "/sendCode")
ResultVo sendCode(@RequestParam String phone); ResultVo sendCode(@RequestParam String phone);
@PostMapping(value = "/wxLogin")
ResultVo wxLogin(@RequestBody Map<String, Object> paramsMap);
@PostMapping(value = "/getWxPhone")
ResultVo getWxPhone(@RequestBody Map<String, Object> paramsMap);
@PostMapping(value = "/updateWxUserInfo")
ResultVo updateWxUserInfo(@RequestBody Map<String, Object> paramsMap);
@GetMapping(value = "/getWxUserInfo/{userId}")
ResultVo getWxUserInfo(@PathVariable String userId);
} }
...@@ -14,4 +14,16 @@ public interface IApiLogic extends IApiCommon { ...@@ -14,4 +14,16 @@ public interface IApiLogic extends IApiCommon {
@ApiMethod(name = "发送验证码", service = "USER-SERVER") @ApiMethod(name = "发送验证码", service = "USER-SERVER")
ApiResp sendCode(ApiForm form); ApiResp sendCode(ApiForm form);
@ApiMethod(name = "微信登录", service = "USER-SERVER")
ApiResp wxLogin(ApiForm form);
@ApiMethod(name = "解密获取微信用户手机号", service = "USER-SERVER")
ApiResp getWxPhone(ApiForm form);
@ApiMethod(name = "微信用户信息更新", service = "USER-SERVER")
ApiResp updateWxUserInfo(ApiForm form);
@ApiMethod(name = "获取微信用户信息", service = "USER-SERVER")
ApiResp getWxUserInfo(ApiForm form);
} }
...@@ -25,4 +25,24 @@ public class ApiV100Logic extends BaseApiLogic implements IApiLogic { ...@@ -25,4 +25,24 @@ public class ApiV100Logic extends BaseApiLogic implements IApiLogic {
return ApiUtils.toApiResp(form, userFeign.sendCode(form.getString("phone"))); return ApiUtils.toApiResp(form, userFeign.sendCode(form.getString("phone")));
} }
@Override
public ApiResp wxLogin(ApiForm form) {
return ApiUtils.toApiResp(form, userFeign.wxLogin(form.getParamsMap()));
}
@Override
public ApiResp getWxPhone(ApiForm form) {
return ApiUtils.toApiResp(form, userFeign.getWxPhone(form.getParamsMap()));
}
@Override
public ApiResp updateWxUserInfo(ApiForm form) {
return ApiUtils.toApiResp(form, userFeign.updateWxUserInfo(form.getParamsMap(true, "id")));
}
@Override
public ApiResp getWxUserInfo(ApiForm form) {
return ApiUtils.toApiResp(form, userFeign.getWxUserInfo(form.getUserId()));
}
} }
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