|
|
|
@ -1,12 +1,17 @@
|
|
|
|
package com.flossom.miniProgram.controller;
|
|
|
|
package com.flossom.miniProgram.controller;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.flossom.common.core.utils.StringUtils;
|
|
|
|
import com.flossom.common.core.web.controller.BaseController;
|
|
|
|
import com.flossom.common.core.web.controller.BaseController;
|
|
|
|
import com.flossom.common.core.web.domain.AjaxResult;
|
|
|
|
import com.flossom.common.core.web.domain.AjaxResult;
|
|
|
|
import com.flossom.miniProgram.domain.vo.UserMemberUpdateVo;
|
|
|
|
import com.flossom.miniProgram.domain.vo.UserMemberUpdateVo;
|
|
|
|
import com.flossom.miniProgram.service.IWxUserMemberService;
|
|
|
|
import com.flossom.miniProgram.service.IWxUserMemberService;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.validation.constraints.NotNull;
|
|
|
|
|
|
|
|
import javax.validation.constraints.Size;
|
|
|
|
|
|
|
|
|
|
|
|
@RestController
|
|
|
|
@RestController
|
|
|
|
@RequestMapping("/user")
|
|
|
|
@RequestMapping("/user")
|
|
|
|
public class UserMemberController extends BaseController {
|
|
|
|
public class UserMemberController extends BaseController {
|
|
|
|
@ -23,6 +28,10 @@ public class UserMemberController extends BaseController {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@PostMapping("/login")
|
|
|
|
@PostMapping("/login")
|
|
|
|
public AjaxResult login(@RequestParam(value = "code") String code) throws Exception {
|
|
|
|
public AjaxResult login(@RequestParam(value = "code") String code) throws Exception {
|
|
|
|
|
|
|
|
if (StringUtils.isBlank(code)) {
|
|
|
|
|
|
|
|
logger.error("登录code不能为空");
|
|
|
|
|
|
|
|
return AjaxResult.error("登录失败");
|
|
|
|
|
|
|
|
}
|
|
|
|
return AjaxResult.success(wxUserMemberService.login(code));
|
|
|
|
return AjaxResult.success(wxUserMemberService.login(code));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -36,6 +45,10 @@ public class UserMemberController extends BaseController {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@PostMapping("/upgradeMember")
|
|
|
|
@PostMapping("/upgradeMember")
|
|
|
|
public AjaxResult upgradeMember(@RequestParam(value = "code") String code) throws Exception {
|
|
|
|
public AjaxResult upgradeMember(@RequestParam(value = "code") String code) throws Exception {
|
|
|
|
|
|
|
|
if (StringUtils.isBlank(code)) {
|
|
|
|
|
|
|
|
logger.error("获取手机号code不能为空");
|
|
|
|
|
|
|
|
return AjaxResult.error("获取手机号失败");
|
|
|
|
|
|
|
|
}
|
|
|
|
return AjaxResult.success("获取成功", wxUserMemberService.upgradeMember(code));
|
|
|
|
return AjaxResult.success("获取成功", wxUserMemberService.upgradeMember(code));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -45,7 +58,7 @@ public class UserMemberController extends BaseController {
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@PostMapping("/updateUser")
|
|
|
|
@PostMapping("/updateUser")
|
|
|
|
public AjaxResult updateUser(@RequestBody UserMemberUpdateVo userMemberUpdateVo) {
|
|
|
|
public AjaxResult updateUser(@RequestBody @Validated UserMemberUpdateVo userMemberUpdateVo) {
|
|
|
|
wxUserMemberService.updateUser(userMemberUpdateVo);
|
|
|
|
wxUserMemberService.updateUser(userMemberUpdateVo);
|
|
|
|
return AjaxResult.success();
|
|
|
|
return AjaxResult.success();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|