package com.uas.platform.b2b.model;

import java.io.Serializable;

import javax.persistence.Cacheable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

/**
 * 系统可请求资源
 * 
 * @author yingp
 * 
 */
@Table(name = "sec$resourceitems")
@Entity
@Cacheable
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE, region = "com.uas.platform.b2b.model.ResourceItem")
public class ResourceItem implements Serializable{

	/**
	 * 序列号
	 */
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "item_id")
	private Long id;

	/**
	 * 资源名称
	 */
	@Column(name = "item_name", unique = true)
	private String name;
	/**
	 * 资源类型GET、POST、PUT、DELETE等
	 */
	@Column(name = "item_method")
	private String method;
	/**
	 * 资源请求URL链接
	 */
	@Column(name = "item_url")
	private String url;
	/**
	 * 对资源的具体操作对象及行为的描述
	 */
	@Column(name = "item_desc")
	private String desc;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getMethod() {
		return method == null ? "" : method;
	}

	public void setMethod(String method) {
		this.method = method;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

}
