package com.red.circle.wallet.inner.endpoint.user;

import com.red.circle.framework.dto.ResultResponse;
import com.red.circle.wallet.inner.endpoint.user.api.PayAuthClientApi;
import com.red.circle.wallet.inner.service.user.PayAuthClientService;
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 zongpubin on 2024/1/29
 */
@Validated
@RestController
@RequestMapping(value = PayAuthClientApi.API_PREFIX, produces = MediaType.APPLICATION_JSON_VALUE)
@RequiredArgsConstructor
public class PayAuthClientEndpoint implements PayAuthClientApi {

  private final PayAuthClientService payAuthClientService;

  @Override
  public ResultResponse<Void> initUserPayAuth(Long userId) {
    payAuthClientService.initUserPayAuth(userId);
    return ResultResponse.success();
  }

  @Override
  public ResultResponse<Void> deleteUserPayAuth(Long userId) {
    payAuthClientService.deleteUserPayAuth(userId);
    return ResultResponse.success();
  }
}
