package com.ylcm.sys.common;

import java.util.ArrayList;
import java.util.List;

/**
 * 参数常量类
 *
 */
public class Constants {
	
	/** utf8字符编码 **/
	public final static String ENCODING_UTF8 = "UTF-8";
	
	/** 网站根地址 **/
	public final static String PATH_BASE = Config.getValue("baseUrl");
	/** 静态资源根地址 **/
	public final static String PATH_STATIC = Config.getValue("resRoot");
	
	/**
	 * 默认分页大小
	 */
	public final static int PAGE_SIZE_DEFAULT = 10;
	/**
	 * 菜单类型
	 */
	public final static String MENU_TYPE = "menu"; 
	public final static String SUB_MENU_TYPE = "submenu";
	public final static String MENU_FUNC = "func";
	/**
	 * 返回信息
	 */
	public static final String MSG_FAIL = "服务器错误！";
	public static final String MSG_SUCCESS = "操作成功！";
	public static final String MSG_EXCEL_TYPE_ERROR = "文件格式不正确！";
	
	/**
	 * 日志类型
	 */
	public static final String LOG_TYPE_LOGIN ="登录";
	public static final String LOG_TYPE_LOGOUT ="登出";
	public static final String LOG_TYPE_VIEW ="访问";
	
	/**成功code*/
    public static final int CODE_SUCCESS = 1;
    /**失败code*/
    public static final int CODE_FAIL = 0;
    
    //EXCEL文件类型
  	public static final List<String> EXCEL_TYPES = new ArrayList<String>();
  	static {
  		EXCEL_TYPES.add("application/vnd.ms-excel");
  		EXCEL_TYPES.add("application/vnd_ms-excel");
  		EXCEL_TYPES.add("application/x-xls");
  		EXCEL_TYPES.add("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
  		EXCEL_TYPES.add("application/octet-stream");
  	}

	/*******************************各实体对象状态类型值******************************************/
    /** 
	 * 用户状态  0-正常状态  4-删除
	 */
	public final static int STATUS_USER_NORMAL = 0;
	public final static int STATUS_USER_DEL = 4;
	/**
	 * DDL状态 0-正常状态 4-逻辑删除
	 * */
	public final static int STATUS_DDL_NORMAL = 0;
    public final static int STATUS_DDL_DEL = 4;
	/**
	 * 图库图片类型 1:媒体logo 2:品牌logo  3:品牌植入
	 */
	public final static int TYPE_IMG_LIB_PRODUCT = 1;
	public final static int TYPE_IMG_LIB_PLATFORM = 2;
	public final static int TYPE_IMG_LIB_TV = 3;
	public final static int TYPE_IMG_LIB_MEDIA = 4;
    /**************************************************************************************/
	
	/*******************************配置文件读取******************************************/
	/**
	 * 图片域名
	 */
	public final static String PIC_BASE_URL = Config.getValue("pic_base_url");
	/**
	 * 图片上传地址前缀
	 */
	public final static String PIC_URL_PREFIX = Config.getValue("pic_url.prefix");
	/**
	 * 图片上传地址
	 */
	public final static String PIC_URL = Config.getValue("pic_url");
	/**
	 * LOGO上传地址
	 */
	public final static String LOGO_PREFIX = Config.getValue("logo_prefix");
	
	/**************************************************************************************/

	// 非登录状态下可调用的接口
	public static List<String> uninterceptUrl = new ArrayList<String>();
	static{
		uninterceptUrl.add("login.do");
		uninterceptUrl.add("index.do");
		uninterceptUrl.add("logout.do");
		uninterceptUrl.add("doLogin.do");
	}
	
	/**
	 * 导出EXCEL数据查询参数
	 */
	public final static String USER_SEARCH_PARAMETERS = "user_search_parameters";
	
	
	/**
	 * 数据字典
	 */
	public final static String PLACEMENT_MODE = Config.getValue("placement_mode");
	
	public final static String AD_MODE = Config.getValue("ad_form");
	
	public final static String DEFAULT_IMG = "static/img/noimg.jpg";
	
}