puzhibing
2026-02-12 3d5fe714ee7af4901e094ea360154456d70c4284
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
package com.xiaopeng.account.controller;
 
import com.xiaopeng.account.service.IXpAppUserService;
import com.xiaopeng.api.dto.statistics.StatisticsQueryDTO;
import com.xiaopeng.api.dto.statistics.UserStatisticsDTO;
import com.xiaopeng.api.model.account.XpAppUser;
import com.xiaopeng.common.core.domain.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
 
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
 
/**
 * <p>
 * 小程序用户 前端控制器
 * </p>
 *
 * @author mitao
 * @since 2026-02-03
 */
@Slf4j
@RestController
@Api(tags = "小程序用户")
public class XpAppUserController {
 
    @Resource
    private IXpAppUserService xpAppUserService;
 
    /**
     * 获取用户统计数据(内部接口)
     *
     * @param query 查询参数
     * @return 用户统计数据
     */
    @ApiOperation(value = "获取用户统计数据", tags = {"内部接口"})
    @PostMapping("/inner/appUser/statistics")
    public R<UserStatisticsDTO> getUserStatistics(@RequestBody StatisticsQueryDTO query) {
        return R.ok(xpAppUserService.getUserStatistics(query));
    }
 
    /**
     * 根据ID列表批量查询用户信息(内部接口)
     *
     * @param ids 用户ID列表
     * @return 用户列表
     */
    @ApiOperation(value = "批量查询用户信息", tags = {"内部接口"})
    @PostMapping("/inner/appUser/listByIds")
    public R<List<XpAppUser>> listByIds(@RequestBody List<Long> ids) {
        if (CollectionUtils.isEmpty(ids)) {
            return R.ok(new ArrayList<>());
        }
        return R.ok(xpAppUserService.listByIds(ids));
    }
}