package com.iformall.domain.po;

import com.baomidou.mybatisplus.annotation.TableName;
import com.iformall.domain.po.base.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

@TableName(value = "wx_pay_account")
@Data
@EqualsAndHashCode(callSuper = true)
public class WxPayAccount extends BaseEntity {
	private static final long serialVersionUID = 1L;
	
    protected Long id;

    @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId")
	private String tenantId;
	@io.swagger.annotations.ApiModelProperty(value="微信商户号/特约服务商号",name="mchId")
	private String mchId;
	@io.swagger.annotations.ApiModelProperty(value="微信服务商号",name="subMchId")
	private String subMchId;
	@io.swagger.annotations.ApiModelProperty(value="支付密钥",name="apiKey")
	private String apiKey;
	@io.swagger.annotations.ApiModelProperty(value="微信回调,支持3种回调，（1.url/pay 2.url/refund3.url/separate）",name="notifyUrl")
	private String notifyUrl;
	@io.swagger.annotations.ApiModelProperty(value="证书本地存放位置",name="certPath")
	private String certPath;
	@io.swagger.annotations.ApiModelProperty(value="商户模式-0:普通商户模式1:服务商模式",name="type")
	private Integer type;
	@io.swagger.annotations.ApiModelProperty(value="是否开启分账(0:未开启分账1:开启分账)",name="type")
	private Integer share;
	@io.swagger.annotations.ApiModelProperty(value="手续费(万分之几,默认60)",name="rate")
	private Integer rate;
    @io.swagger.annotations.ApiModelProperty(value="实际手续费(万分之几,默认60)",name="realRate")
    private Integer realRate;

	public String getPayNotifyUrl() {
		return notifyUrl + "/pay";
	}
	public String getRefundNotifyUrl() {
		return notifyUrl + "/refund";
	}
	public String getSubsidyNotifyUrl() {
		return notifyUrl + "/subsidyPay";
	}

	public boolean checkShare() { return share > 0; }

}
