puzhibing
2023-02-26 8883d654f52171657b62aaec85027f29ef0a4dd0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
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());
        }
    }
}