package com.supersavedriving.user.modular.api;
|
|
import com.supersavedriving.user.core.common.annotion.ServiceLog;
|
import com.supersavedriving.user.core.util.ToolUtil;
|
import com.supersavedriving.user.modular.system.service.IAppUserService;
|
import com.supersavedriving.user.modular.system.util.ResultUtil;
|
import com.supersavedriving.user.modular.system.warpper.ResponseWarpper;
|
import com.supersavedriving.user.modular.system.warpper.SignInToRegister;
|
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.annotations.ApiOperation;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.RestController;
|
|
/**
|
* 用户控制器
|
*/
|
@RestController
|
@RequestMapping("")
|
public class AppUserController {
|
|
@Autowired
|
private IAppUserService appUserService;
|
|
|
@ResponseBody
|
@PostMapping("/base/appUser/appUserLogin")
|
@ServiceLog(name = "微信登录", url = "/base/appUser/appUserLogin")
|
@ApiOperation(value = "微信登录", tags = {"用户端-首页"}, notes = "")
|
@ApiImplicitParams({
|
@ApiImplicitParam(value = "微信jscode", name = "jscode", required = true, dataType = "string"),
|
})
|
public ResponseWarpper appUserLogin(String jscode){
|
if(ToolUtil.isEmpty(jscode)){
|
return ResponseWarpper.success(ResultUtil.paranErr("jscode"));
|
}
|
try {
|
ResultUtil resultUtil = appUserService.appUserLogin(jscode);
|
return ResponseWarpper.success(resultUtil);
|
}catch (Exception e){
|
e.printStackTrace();
|
return new ResponseWarpper(500, e.getMessage());
|
}
|
}
|
|
|
|
@ResponseBody
|
@PostMapping("/base/appUser/signInToRegister")
|
@ServiceLog(name = "微信手机授权登录", url = "/base/appUser/signInToRegister")
|
@ApiOperation(value = "微信手机授权登录", tags = {"用户端-首页"}, notes = "")
|
@ApiImplicitParams({
|
})
|
public ResponseWarpper signInToRegister(SignInToRegister signInToRegister){
|
try {
|
ResultUtil resultUtil = appUserService.signInToRegister(signInToRegister);
|
return ResponseWarpper.success(resultUtil);
|
}catch (Exception e){
|
e.printStackTrace();
|
return new ResponseWarpper(500, e.getMessage());
|
}
|
}
|
}
|