package com.ruoyi.controller;

import com.ruoyi.annotations.UserLoginToken;
import com.ruoyi.common.page.PageResult;
import com.ruoyi.controller.resp.IntegralPageResp;
import com.ruoyi.frequency.integralrecord.service.IntegralRecordService;
import com.ruoyi.response.ResponseData;
import com.ruoyi.vo.PageBasic;
import com.ruoyi.vo.RyController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;


/**
 * 积分
 */
@Slf4j
@RestController
@RequestMapping("/api/integral")
@Api(tags = "积分")
public class ApiIntegralController extends RyController {

    @Autowired
    private IntegralRecordService integralRecordService;

    @UserLoginToken
    @RequestMapping(value = "/integralPage", method = RequestMethod.POST)
    @ApiOperation(value = "积分明细")
    public ResponseData<PageResult<IntegralPageResp>> integralPage(@RequestBody PageBasic req) {
        return integralRecordService.integralPage(req, getUserVo());
    }
}


