package com.red.circle.order.infra.database.rds.service.pay.impl;

import com.red.circle.framework.core.asserts.ResponseAssert;
import com.red.circle.framework.core.response.CommonErrorCode;
import com.red.circle.framework.mybatis.service.impl.BaseServiceImpl;
import com.red.circle.order.infra.database.rds.dao.pay.PayApplicationDAO;
import com.red.circle.order.infra.database.rds.entity.pay.PayApplication;
import com.red.circle.order.infra.database.rds.service.pay.PayApplicationService;
import org.springframework.dao.DuplicateKeyException;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 开通支付应用 服务实现类.
 * </p>
 *
 * @author pengshigang
 * @since 2021-12-08
 */
@Service
public class PayApplicationServiceImpl extends
    BaseServiceImpl<PayApplicationDAO, PayApplication> implements PayApplicationService {


  @Override
  public void addApplication(PayApplication param) {
    try {
      save(param);
    } catch (DuplicateKeyException ignore) {
      ResponseAssert.failure(CommonErrorCode.INFORMATION_EXISTS);
    }
  }
}
