
package com.tmerclub.cloud.user.controller.platform;

import com.tmerclub.cloud.common.database.dto.PageDTO;
import com.tmerclub.cloud.common.database.vo.PageVO;
import com.tmerclub.cloud.common.response.ServerResponseEntity;
import com.tmerclub.cloud.user.service.UserGrowthLogService;
import com.tmerclub.cloud.user.vo.UserGrowthLogVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户成长值记录
 *
 * @author cl
 * @date 2021-05-08 20:16:53
 */
@RestController("platformUserGrowthLogController")
@RequestMapping("/p/userGrowthLog")
@Tag(name = "platform-用户成长值记录")
public class UserGrowthLogController {

    @Autowired
    private UserGrowthLogService userGrowthLogService;


    @Operation(summary = "分页获取用户成长值记录列表", description = "分页获取用户成长值记录列表")
    @GetMapping("/page")
    public ServerResponseEntity<PageVO<UserGrowthLogVO>> getPageByUserId(@Valid PageDTO pageDTO, Long userId) {
        PageVO<UserGrowthLogVO> resPage = userGrowthLogService.getPageByUserId(pageDTO, userId);
        return ServerResponseEntity.success(resPage);
    }
}
