package com.red.circle.other.app.inner.endpoint.activity;

import com.red.circle.framework.dto.ResultResponse;
import com.red.circle.other.app.inner.service.activity.CumulativeRechargeClientService;
import com.red.circle.other.inner.endpoint.activity.api.CumulativeRechargeClientApi;
import lombok.RequiredArgsConstructor;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 累积充值.
 *
 * @author pengliang on 2023/8/18
 */
@Validated
@RestController
@RequestMapping(value = CumulativeRechargeClientApi.API_PREFIX, produces = MediaType.APPLICATION_JSON_VALUE)
@RequiredArgsConstructor
public class CumulativeRechargeClientEndpoint implements CumulativeRechargeClientApi {

  private final CumulativeRechargeClientService cumulativeRechargeClientService;

  @Override
  public ResultResponse<Void> incrTodayRechargeScore(Long userId, Double rechargeScore) {
    cumulativeRechargeClientService.incrTodayRechargeScore(userId, rechargeScore);
    return ResultResponse.success();
  }

  @Override
  public ResultResponse<Void> decrTodayRechargeScore(Long userId, Double rechargeScore) {
    cumulativeRechargeClientService.decrTodayRechargeScore(userId, rechargeScore);
    return ResultResponse.success();
  }

}
