package com.iformall.domain.po;

import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.List;

@Table(name = "wx_msg_config")
public class WxMsgConfig implements Serializable {
	private static final long serialVersionUID = 1L;
	
	@Id
    protected Long id;
    
    @Transient
    protected List<String> ids;
    @Transient
    protected String sortColumns;
  
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}
	
	public String getSortColumns() {
		return sortColumns;
	}
	 
	public List<String> getIds() {
		return ids;
	}
	public void setIds(List<String> ids) {
		this.ids = ids;
	}
	
	
	
	/*租户ID**/
	@io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId")
	private String tenantId;
	/***/
	@io.swagger.annotations.ApiModelProperty(value="",name="secret")
	private String secret;
	/***/
	@io.swagger.annotations.ApiModelProperty(value="",name="publickey")
	private String publickey;
	/***/
	@io.swagger.annotations.ApiModelProperty(value="",name="bid")
	private String bid;
	/*充值条数**/
	@io.swagger.annotations.ApiModelProperty(value="充值条数",name="recharge")
	private Long recharge;
	/*剩余条数**/
	@io.swagger.annotations.ApiModelProperty(value="剩余条数",name="remains")
	private Long remains;
	/*短信总数**/
	@io.swagger.annotations.ApiModelProperty(value="短信总数",name="total")
	private Long total;
	/***/
	@io.swagger.annotations.ApiModelProperty(value="",name="account")
	private String account;
	/***/
	@io.swagger.annotations.ApiModelProperty(value="",name="reminderstatus")
	private Integer reminderstatus;
	/***/
	@io.swagger.annotations.ApiModelProperty(value="",name="reminder")
	private Long reminder;
	/***/
	@io.swagger.annotations.ApiModelProperty(value="",name="phone")
	private String phone;
	/*回调地址**/
	@io.swagger.annotations.ApiModelProperty(value="回调地址",name="notifyurl")
	private String notifyurl;

	/*模板回调地址**/
	@io.swagger.annotations.ApiModelProperty(value="模板回调地址",name="modelnotifyurl")
	private String modelnotifyurl;

	@io.swagger.annotations.ApiModelProperty(value="模板回调地址",name="verifynotifyurl")
	private String verifynotifyurl;

	@io.swagger.annotations.ApiModelProperty(value="appid",name="appid")
	private String appid;


	public String  getTenantId() {
		return tenantId;
	}
	public void setTenantId(String _tenantId) {
		tenantId = _tenantId;
	}
	public String  getSecret() {
		return secret;
	}
	public void setSecret(String _secret) {
		secret = _secret;
	}
	public String  getPublickey() {
		return publickey;
	}
	public void setPublickey(String _publickey) {
		publickey = _publickey;
	}
	public String  getBid() {
		return bid;
	}
	public void setBid(String _bid) {
		bid = _bid;
	}
	public Long  getRecharge() {
		return recharge;
	}
	public void setRecharge(Long _recharge) {
		recharge = _recharge;
	}
	public Long  getRemains() {
		return remains;
	}
	public void setRemains(Long _remains) {
		remains = _remains;
	}
	public Long  getTotal() {
		return total;
	}
	public void setTotal(Long _total) {
		total = _total;
	}
	public String  getAccount() {
		return account;
	}
	public void setAccount(String _account) {
		account = _account;
	}
	public Integer  getReminderstatus() {
		return reminderstatus;
	}
	public void setReminderstatus(Integer _reminderstatus) {
		reminderstatus = _reminderstatus;
	}
	public Long  getReminder() {
		return reminder;
	}
	public void setReminder(Long _reminder) {
		reminder = _reminder;
	}
	public String  getPhone() {
		return phone;
	}
	public void setPhone(String _phone) {
		phone = _phone;
	}
	public String  getNotifyurl() {
		return notifyurl;
	}
	public void setNotifyurl(String _notifyurl) {
		notifyurl = _notifyurl;
	}


	public String getModelnotifyurl() {
		return modelnotifyurl;
	}

	public void setModelnotifyurl(String modelnotifyurl) {
		this.modelnotifyurl = modelnotifyurl;
	}

	public String getVerifynotifyurl() {
		return verifynotifyurl;
	}

	public void setVerifynotifyurl(String verifynotifyurl) {
		this.verifynotifyurl = verifynotifyurl;
	}

	public String getAppid() {
		return appid;
	}

	public void setAppid(String appid) {
		this.appid = appid;
	}

	public static enum Field
	{
		Id_ASC("`id` ASC"),Id_DESC("`id` DESC")
			,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC")
			,Secret_ASC("`secret` ASC"),Secret_DESC("`secret` DESC")
			,Publickey_ASC("`publickey` ASC"),Publickey_DESC("`publickey` DESC")
			,Bid_ASC("`bid` ASC"),Bid_DESC("`bid` DESC")
			,Recharge_ASC("`recharge` ASC"),Recharge_DESC("`recharge` DESC")
			,Remains_ASC("`remains` ASC"),Remains_DESC("`remains` DESC")
			,Total_ASC("`total` ASC"),Total_DESC("`total` DESC")
			,Account_ASC("`account` ASC"),Account_DESC("`account` DESC")
			,Reminderstatus_ASC("`reminderstatus` ASC"),Reminderstatus_DESC("`reminderstatus` DESC")
			,Reminder_ASC("`reminder` ASC"),Reminder_DESC("`reminder` DESC")
			,Phone_ASC("`phone` ASC"),Phone_DESC("`phone` DESC")
			,Notifyurl_ASC("`notifyurl` ASC"),Notifyurl_DESC("`notifyurl` DESC")
	;
		private String value;
		Field(String value){
			this.value = value;
		}
		public String getValue() {
			return value;
		}
		public void setCol(String value) {
			this.value = value;
		}
		@Override
		public String toString() {
			return this.getValue();
		}
	}
	
	public void setSortColumns(WxMsgConfig.Field... fields)
	{
		if (fields == null || fields.length == 0) {
			return;
		}
		for (int k = 0; k < fields.length; k++) {
			if (fields[k] == null) {
				return;
			}
		}
		StringBuilder sb = new StringBuilder(fields[0].toString());
		for (int k = 1; k < fields.length; k++) {
			sb.append(",");
			sb.append(fields[k].toString());
		}
		 
	}
	
	public void setSortColumns(String sortColumns)
	{
		if (sortColumns == null || "".equals(sortColumns.trim())) {
			return;
		}
		if (sortColumns.contains(",")) {
			String[] cols = sortColumns.split(",");
			java.util.List<Field> fList = new java.util.ArrayList();
			for (int k = 0; k < cols.length; k++) {
				fList.add(Field.valueOf(cols[k]));
			}
			this.setSortColumns(fList.toArray(new Field[fList.size()]));
		} else {
			this.setSortColumns(Field.valueOf(sortColumns));
		}
	}
}
