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

import com.red.circle.framework.dto.PageResult;
import com.red.circle.framework.dto.ResultResponse;
import com.red.circle.other.inner.model.cmd.user.UserBankIdentityInfoCmd;
import com.red.circle.other.inner.model.cmd.user.UserBankIdentityInfoExportQryCmd;
import com.red.circle.other.inner.model.cmd.user.UserBankIdentityInfoQryCmd;
import com.red.circle.other.inner.model.dto.user.UserBankIdentityInfoDTO;
import com.red.circle.other.app.inner.service.user.user.BankIdentityInfoClientService;
import com.red.circle.other.inner.endpoint.user.user.api.UserBankIdentityInfoClientApi;
import java.util.List;
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/10/13
 */
@Validated
@RestController
@RequestMapping(value = UserBankIdentityInfoClientApi.API_PREFIX, produces = MediaType.APPLICATION_JSON_VALUE)
@RequiredArgsConstructor
public class UserBankIdentityInfoClientEndpoint implements UserBankIdentityInfoClientApi {

  private final BankIdentityInfoClientService bankIdentityInfoService;


  @Override
  public ResultResponse<PageResult<UserBankIdentityInfoDTO>> pageListQuery(
      UserBankIdentityInfoQryCmd query) {
    return ResultResponse.success(bankIdentityInfoService.pageListQuery(query));
  }

  @Override
  public ResultResponse<List<UserBankIdentityInfoDTO>> listExport(
      UserBankIdentityInfoExportQryCmd query) {
    return ResultResponse.success(bankIdentityInfoService.listExport(query));
  }

  @Override
  public ResultResponse<Boolean> updateInfo(UserBankIdentityInfoCmd userBankIdentityInfo) {
    return ResultResponse.success(bankIdentityInfoService.updateInfo(userBankIdentityInfo));
  }

}
