相比较对于直接把常量写到常量类里,好像写成枚举比较好
package com.wscar.xny.recommender.constants;
/**
* status状态约束
*
* @author blue
*/
public enum StatusConstants {
/**
* 有效,未锁定,上架,开通
*/
VALID(2, "开通"),
/**
* 失效,锁定,下架,未开通
*/
INVALID(3, "未开通"),
/**
* 待审核
*/
PENDING(4, "待审核");
/**
* 状态标识
*/
private Integer identity;
/**
* 说明
*/
private String disc;
StatusConstants(Integer identity, String disc) {
this.identity = identity;
this.disc = disc;
}
public int getIdentity() {
return identity;
}
public String getDisc() {
return disc;
}
}
常量类
package com.wanshun.config.constants;
public class LabelCode {
/**
* 标签查询
*/
public final static int CREADIT_CONSOLE_LABEL_STATUS= 1; //启用
public final static int CREADIT_CONSOLE_LABEL_DELETE= 2; //禁用
/**
* 信任值
*/
public final static int CREADIT_CONSOLE_CREADIT_STATUS= 1; //启用
public final static int CREADIT_CONSOLE_CREADIT__DELETE= 2; //禁用
/***
* 首页公告
*/
public final static int CREADIT_CONSOLE_NATICE__TOSTAYON= 1; //待上架
public final static int CREADIT_CONSOLE_NATICE__ONSHELVES= 2; //已上架
public final static int CREADIT_CONSOLE_NATICE__OFFSHELF= 3; //已下架
/**
* 标签类型
*/
public final static int CREADIT_CONSOLE_LABEL_TYPE_CANCEL= 1; //取消原因标签
public final static int CREADIT_CONSOLE_LABEL_TYPE_COMPLAIN= 2; //投诉标签
public final static int CREADIT_CONSOLE_LABEL_TYPE_EVALUATE= 3; //评价标签
public final static int CREADIT_CONSOLE_LABEL_TYPE_TRIP= 4; //发布行程标签
}
图文不太符,自我笔记