package cn.newfeifan.mall.module.distri.controller.app.integral;

import cn.newfeifan.mall.framework.common.pojo.CommonResult;
import cn.newfeifan.mall.module.distri.controller.app.integral.vo.IntegralTransitionRespVO;
import cn.newfeifan.mall.module.distri.service.integral.IntegralService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import static cn.newfeifan.mall.framework.common.pojo.CommonResult.success;

@Tag(name = "管理后台 - 推荐用户积分")
@RestController
@RequestMapping("/distri/integral")
@Validated
public class IntegralController {

    @Resource
    private IntegralService integralService;

    @PutMapping("/quotaTransition")
    @Operation(summary = "积分转化")
    public CommonResult<Boolean> quotaTransition(@Validated @RequestBody IntegralTransitionRespVO respVO) {
        return success(integralService.quotaTransition(respVO));
    }
}