luodangjia
2024-11-25 86f2f7e0023bfc56b2c20f2c594dc6a935a41a9d
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
package com.ruoyi.account.controller;
 
 
import com.ruoyi.account.api.model.AppUser;
import com.ruoyi.account.service.AppUserService;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.security.service.TokenService;
import org.junit.Test;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
 
import javax.annotation.Resource;
import java.util.List;
 
/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author luodangjia
 * @since 2024-11-21
 */
@RestController
@RequestMapping("/app-user")
public class AppUserController {
    @Resource
    private TokenService tokenService;
    @Resource
    private AppUserService appUserService;
    @PostMapping("/index")
    @ApiOperation(value = "个人中心首页", tags = {"小程序-个人中心首页"})
    @Test
    public void index(){
        System.err.println("=-====");
//        Long userId = tokenService.getLoginUserApplet().getUserId();
     }
      public  void test(Long userId,Integer count){
          List<AppUser> list = appUserService.lambdaQuery().eq(AppUser::getInviteUserId, userId).list();
          count = count + list.size();
          for (AppUser appUser : list) {
              test(appUser.getId(),count);
          }
 
 
      }
 
 
}