package com.cloudcross.ssp.base.service;

import java.util.Collection;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.SpringSecurityCoreVersion;
import org.springframework.security.core.userdetails.User;

public class MyUser extends User{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = SpringSecurityCoreVersion.SERIAL_VERSION_UID;
	
	private Integer userType;
	private Long operatorId;
	private Long advertiserId;
	private Long agentId;
	
	public Integer getUserType() {
		return userType;
	}


	public void setUserType(Integer userType) {
		this.userType = userType;
	}


	public Long getOperatorId() {
		return operatorId;
	}


	public void setOperatorId(Long operatorId) {
		this.operatorId = operatorId;
	}


	public Long getAdvertiserId() {
		return advertiserId;
	}


	public void setAdvertiserId(Long advertiserId) {
		this.advertiserId = advertiserId;
	}


	public Long getAgentId() {
		return agentId;
	}


	public void setAgentId(Long agentId) {
		this.agentId = agentId;
	}


	
	
	
	public MyUser(String username, String password, boolean enabled,
			boolean accountNonExpired, boolean credentialsNonExpired,
			boolean accountNonLocked,
			Collection<? extends GrantedAuthority> authorities,Integer type,Long operatorId,Long agentId,Long advertiserId) {
		super(username, password, enabled, accountNonExpired, credentialsNonExpired,
				accountNonLocked, authorities);
		// TODO Auto-generated constructor stub
		this.setAdvertiserId(advertiserId);
		this.setAgentId(agentId);
		this.setOperatorId(operatorId);
		this.setUserType(type);
	}


	@Override
	public String toString() {
		return "MyUser [userType=" + userType + ", operatorId=" + operatorId
				+ ", advertiserId=" + advertiserId + ", agentId=" + agentId
				+ ", toString()=" + super.toString() + "]";
	}

}
