package com.softwarebr.nunu.globals;

/**
 * @author lilin
 * @date 2020/2/21 15:25
 *
 */
public class SystemConst {

    /**
     * 已删除
     */
    public final static Integer MARKER_STATUS_YES = 0;
    /**
     * 未删除
     */
    public final static Integer MARKER_STATUS_NO = 1;


    /**
     * 审核人员 发布者
     */
    public final static Integer AUDITOR_PUBLISHER = 1;

    /**
     * 审核人员 平台
     */
    public final static Integer AUDITOR_ADMIN = 2;

    /**
     * 1待审核
     */
    public final static int VERIFY_AWAIT = 1;
    /**
     * 2审核通过
     */
    public final static int VERIFY_ADOPT = 2;
    /**
     * 3审核驳回
     */
    public final static int VERIFY_REJECT = 3;

    /**
     * 是否推荐至首页->0不推荐
     */
    public final static Integer INDEX_TYPE_NO = 0;
    /**
     * 是否推荐至首页->1推荐
     */
    public final static Integer INDEX_TYPE_YES = 1;

    /**
     * 下架
     */
    public final static int STATUS_LOWER_SHELF = 0;
    /**
     * 上架
     */
    public final static int STATUS_UPPER_SHELF = 1;

    /**
     * 公开
     */
    public final static int PUBLICITY_PUBLIC = 1;
    /**
     * 隐私
     */
    public final static int PUBLICITY_PRIVATE = 2;
    /**
     * 平台可见
     */
    public final static int PUBLICITY_ADMIN_PUBLIC = 3;

    /**
     * Mysql的in查询限制
     */
    public final static int CONSTANT_GROBAL_MYSQL_IN_QUERY_LIMIT = 1000;

    /**
     * 公开状态处理
     * @param publicity 公开状态
     * @return
     */
    public static String publicityHandle(int publicity){
        switch (publicity){
            case PUBLICITY_PUBLIC:
                return "公开";
            case PUBLICITY_PRIVATE:
                return "隐私";
            case PUBLICITY_ADMIN_PUBLIC:
                return "平台可见";
        }
        return "";
    }

    /**
     * 上下架状态处理
     * @param statusUpper 上下架状态
     * @return
     */
    public static String statusUpperHandle(int statusUpper){
        switch (statusUpper) {
            case STATUS_UPPER_SHELF:
                return "上架";
            case STATUS_LOWER_SHELF:
                return "下架";
        }
        return "";
    }

    /**
     * 审核状态处理
     * @param verify 审核状态
     * @return
     */
    public static String verifyHandle(int verify){
        switch (verify) {
            case VERIFY_AWAIT:
                return "待审核";
            case VERIFY_ADOPT:
                return "审核通过";
            case VERIFY_REJECT:
                return "审核不通过";
        }
        return "";
    }

}
