gitweixin
  • 首页
  • 小程序代码
    • 资讯读书
    • 工具类
    • O2O
    • 地图定位
    • 社交
    • 行业软件
    • 电商类
    • 互联网类
    • 企业类
    • UI控件
  • 大数据开发
    • Hadoop
    • Spark
    • Hbase
    • Elasticsearch
    • Kafka
    • Flink
    • 数据仓库
    • 数据挖掘
    • flume
    • Kafka
    • Hive
    • shardingsphere
    • solr
  • 开发博客
    • Android
    • php
    • python
    • 运维
    • 技术架构
    • 数据库
  • 程序员网赚
  • bug清单
  • 量化投资
  • 在线查询工具
    • 去行号
    • 在线时间戳转换工具
    • 免费图片批量修改尺寸在线工具
    • SVG转JPG在线工具

分类归档Java

精品微信小程序开发门户,代码全部亲测可用

  • 首页   /  大数据开发
  • 分类归档: "Java"
  • ( 页面5 )
Java 12月 7,2020

汉字转换位汉语拼音工具类

public final class Cn2Spell {

private Cn2Spell() {

}

/**
* 汉字转换位为语拼音首字母,英文字符不变
*
*
@param chines 汉字
*
@return 拼音
*/
public static String converterToFirstSpell(String chines) {
if (StringUtils.isBlank(chines)) {
return chines;
}
String pinyinName = "";
char[] nameChar = chines.toCharArray();
HanyuPinyinOutputFormat defaultFormat = new HanyuPinyinOutputFormat();
defaultFormat.setCaseType(HanyuPinyinCaseType.LOWERCASE);
defaultFormat.setToneType(HanyuPinyinToneType.WITHOUT_TONE);
for (int i = 0; i < nameChar.length; i++) {
if (nameChar[i] > 128) {
try {
pinyinName += PinyinHelper.toHanyuPinyinStringArray(nameChar[i], defaultFormat)[0].charAt(0);
} catch (BadHanyuPinyinOutputFormatCombination e) {
e.printStackTrace();
}
} else {
pinyinName += nameChar[i];
}
}
return pinyinName.toUpperCase();
}

/**
* 汉字转换为汉语拼音,英文字符不变
*
*
@param chines 汉字
*
@return 拼音
*/
public static String converterToSpell(String chines) {
if (StringUtils.isBlank(chines)) {
return chines;
}
String pinyinName = "";
int index = 0;
char[] nameChar = chines.toCharArray();
HanyuPinyinOutputFormat defaultFormat = new HanyuPinyinOutputFormat();
defaultFormat.setCaseType(HanyuPinyinCaseType.LOWERCASE);
defaultFormat.setToneType(HanyuPinyinToneType.WITHOUT_TONE);
for (int i = 0; i < nameChar.length; i++) {
if (nameChar[i] > 128) {
try {
if (index == 0 && i != 0) {
pinyinName += "_" + PinyinHelper.toHanyuPinyinStringArray(nameChar[i], defaultFormat)[0];
} else {
pinyinName += PinyinHelper.toHanyuPinyinStringArray(nameChar[i], defaultFormat)[0];
}
index++;
} catch (BadHanyuPinyinOutputFormatCombination e) {
e.printStackTrace();
}
} else {
if (index > 0) {
pinyinName += "_" + nameChar[i];
index = 0;
} else {
pinyinName += nameChar[i];
}

}
}
return pinyinName.toUpperCase();
}

/**
* 判断是否有中文
*
*
@param str
*
@return
*/
public static boolean isChineseChar(String str) {
boolean temp = false;
// 即[\\u4e00-\\u9fa5]字符,因代码检查不通过,需如下处理
StringBuilder sb = new StringBuilder();
sb.append("[\\u").append("4e00-\\u").append("9fa5]");

Pattern p = Pattern.compile(sb.toString());
Matcher m = p.matcher(str);

if (m.find()) {
temp = true;
}
return temp;
}
}
作者 east
Java 12月 7,2020

中文转数字Java工具类


import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.math.NumberUtils;


public final class CnNumericToArabicUtil {

/**
* 无参构造函数
*/
private CnNumericToArabicUtil() {
}

/**
* 中文数字数组
*/
private static final Character[] CN_NUMERIC = { '一', '二', '三', '四', '五', '六', '七', '八', '九', '壹', '贰', '叁', '肆',
'伍', '陆', '柒', '捌', '玖', '○', 'O', '零', '十', '百', '千', '拾', '佰', '仟', '万', '亿' };

private static Map<Character, Integer> cnNumeric = null;

static {
cnNumeric = new HashMap<Character, Integer>(40, 0.85f);
for (int j = 0; j < 9; j++) {
cnNumeric.put(CN_NUMERIC[j], j + 1);
}
for (int j = 9; j < 18; j++) {
cnNumeric.put(CN_NUMERIC[j], j - 8);
}
for (int j = 18; j < 21; j++) {
cnNumeric.put(CN_NUMERIC[j], 0);
}

cnNumeric.put(' ', 0);
cnNumeric.put('两', 2);
cnNumeric.put('十', 10);
cnNumeric.put('拾', 10);
cnNumeric.put('百', 100);
cnNumeric.put('佰', 100);
cnNumeric.put('千', 1000);
cnNumeric.put('仟', 1000);
cnNumeric.put('万', 10000);
cnNumeric.put('亿', 100000000);
}

/**
* 中文数字转换为阿拉伯数字<br>
* TODO 该方法不完善的地方为只能纯的中文数字或者纯的阿拉伯数字,如果互相掺杂,得到的结果不准确,后期再完善<br>
*
*
@param cn 中文数字
*
@return int
*/
public static int cnNumericToArabic(String cn) {

// 中文数字参数为空判断,为空时返回0
if (StringUtils.isEmpty(cn)) {
return 0;
}

cn = cn.trim();

// 阿拉伯数字,类型转换后,直接返回结果
if (NumberUtils.isNumber(cn)) {
return Integer.parseInt(cn);
}

if (cn.length() == 1) {
return isCnNumeric(cn.charAt(0));
}

cn = cn.replace('佰', '百').replace('仟', '千').replace('拾', '十').replace('零', ' ');

// 结果值
int val = 0;

// 根据中文单位,将中文数字转换为阿拉伯数字,得到结果数组
// 亿
String[] cnNumericToArabicByCnUnitResults = cnNumericToArabicByCnUnit(cn, '亿', 100000000);
cn = cnNumericToArabicByCnUnitResults[0];
val += Integer.parseInt(cnNumericToArabicByCnUnitResults[1]);

// 万
cnNumericToArabicByCnUnitResults = cnNumericToArabicByCnUnit(cn, '万', 10000);
cn = cnNumericToArabicByCnUnitResults[0];
val += Integer.parseInt(cnNumericToArabicByCnUnitResults[1]);

// 千
cnNumericToArabicByCnUnitResults = cnNumericToArabicByCnUnit(cn, '千', 1000);
cn = cnNumericToArabicByCnUnitResults[0];
val += Integer.parseInt(cnNumericToArabicByCnUnitResults[1]);

// 百
cnNumericToArabicByCnUnitResults = cnNumericToArabicByCnUnit(cn, '百', 100);
cn = cnNumericToArabicByCnUnitResults[0];
val += Integer.parseInt(cnNumericToArabicByCnUnitResults[1]);

// 十
int ten = -1;
ten = cn.lastIndexOf('十');
if (ten > -1) {
if (ten == 0) {
val += 1 * 10;
} else {
val += cnNumericToArabic(cn.substring(0, ten)) * 10;
}
if (ten < cn.length() - 1) {
cn = cn.substring(ten + 1, cn.length());
} else {
cn = "";
}
}

cn = cn.trim();
for (int j = 0; j < cn.length(); j++) {
val += isCnNumeric(cn.charAt(j));
}
return val;
}

/**
* 中文数字转阿拉伯数字<BR>
* 如果字符串中文数字表达不全或错误,则只会解析部分(例如三十二百五六返回32)
*
*
@param numStr 待转换的字符串
*
@param numArrays 阿拉伯数值数组
*
@return
*/
public static String cnNumericToArabic(String numStr, char[] numArrays) {

if (StringUtils.isEmpty(numStr)) {
return "";
}

StringBuffer strRs = new StringBuffer();
boolean isFirst = (null == numArrays || numArrays.length == 0);
numStr = filterStr(numStr);
Pattern pattern = Pattern.compile("^\\d+$");

if (pattern.matcher(numStr).find()) {
return numStr;
}
char[] args = numStr.toCharArray();
int index = 0;
for (int i = UNITS_2.length - 1; i > 0; i--) {
index = numStr.indexOf(UNITS_2[i]);

if (index > 0) {
if (null == numArrays || numArrays.length == 0) {
numArrays = new char[Arrays.binarySearch(UNITS_2, args[index]) * 4];
Arrays.fill(numArrays, '0');
}
cnNumericToArabic(numStr.substring(index), numArrays);
break;
}
}

try {
process(numStr, numArrays, strRs, isFirst, index);

} catch (Exception e) {
return "";
}
// 避免只有单位没数字 比如十三这个“十”单位前没数字,根据习惯默认为一
return strRs.toString().replaceAll("[十,百,千,万,亿]", "1");
}

/**
* 检查是否为中文字符
*
*
@param ch 中文字符
*
@return boolean true:是中文数字;false:不是中文数字
*/
private static int isCnNumeric(char ch) {
Integer i = cnNumeric.get(ch);
if (i == null) {
return 0;
}
return i.intValue();
}

/**
* 根据中文单位,将中文数字转换为阿拉伯数字
*
*
@param cn 中文数字
*
@param cnUnit 中文单位,如:亿、万、千、百、十
*
@param unitVal 单位值,如:亿-100000000
*
@return String[] 字符串数组,格式为:{处理后的中文数字、结果值}
*/
private static String[] cnNumericToArabicByCnUnit(String cn, char cnUnit, int unitVal) {
// 中文数字为空判断,当为空时直接返回空字符串和结果值为0的数组
if (StringUtils.isEmpty(cn)) {
return new String[] { "", "0" };
}

// 结果值
int val = 0;
// 中文单位所在位置
int unitPos = cn.lastIndexOf(cnUnit);
if (unitPos > -1) {
// 中文数字转换为阿拉伯数字
val += cnNumericToArabic(cn.substring(0, unitPos)) * unitVal;
if (unitPos < cn.length() - 1) {
cn = cn.substring(unitPos + 1, cn.length());
} else {
cn = "";
}

if (cn.length() == 1) {
int arbic = isCnNumeric(cn.charAt(0));
if (arbic <= 10) {
val += arbic * unitVal * 0.1;
}
cn = "";
}
}
return new String[] { cn, "" + val };
}

/** 中文数值 */
private static final Character[] CN_NUMBER_1 = { 'O', '一', '二', '三', '四', '五', '六', '七', '八', '九' };

/** 中文数值 */
private static final Character[] CN_NUMBER_2 = { '零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖' };

/** 阿拉伯数值 */
private static final Character[] ARABIC_NUMBER = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' };

/** 用于辅助定位单位 */
private static final String UNITS_1_STR = " 十百千";

/** 单位一 */
private static final Character[] UNITS_1 = { ' ', '十', '百', '千' };

/** 单位一的同义词 */
private static final Character[] UNITS_1_T = { ' ', '拾', '佰', '仟' };

/** 单位2 */
private static final Character[] UNITS_2 = { ' ', '万', '亿' };

/**
* 从字符串中提取满足当前可转换为阿拉伯数字的字符串
*
*
@param str 待转换的字符串
*
@return
*/
public static String getCnNumericStr(String str) {
StringBuffer regx = new StringBuffer("([");
for (Character c : CN_NUMBER_1) {
regx.append(c.charValue());
}
for (Character c : CN_NUMBER_2) {
regx.append(c.charValue());
}
for (Character c : ARABIC_NUMBER) {
regx.append(c.charValue());
}
for (Character c : UNITS_1) {
regx.append(String.valueOf(c.charValue()).trim());
}
for (Character c : UNITS_1_T) {
regx.append(String.valueOf(c.charValue()).trim());
}
for (Character c : UNITS_2) {
regx.append(String.valueOf(c.charValue()).trim());
}
regx.append("两Oo○");
regx.append("]+)");
Pattern pattern = Pattern.compile(regx.toString());
Matcher matcher = pattern.matcher(str);
if (matcher.find()) {
return matcher.group();
}
return "";
}

/**
* 从字符串中提取满足当前可转换为阿拉伯数字的字符串,并将转换后的中文数字用阿拉伯数字替换掉原来字符串中的数值,并且返回
*
*
@param str 待转换的字符串
*
@return
*/
public static String transCnNumericStr(String str) {
if (StringUtils.isEmpty(str)) {
return "";
}
StringBuffer regx = new StringBuffer("([");
for (Character c : CN_NUMBER_1) {
regx.append(c.charValue());
}
for (Character c : CN_NUMBER_2) {
regx.append(c.charValue());
}
for (Character c : ARABIC_NUMBER) {
regx.append(c.charValue());
}
for (Character c : UNITS_1) {
regx.append(String.valueOf(c.charValue()).trim());
}
for (Character c : UNITS_1_T) {
regx.append(String.valueOf(c.charValue()).trim());
}
for (Character c : UNITS_2) {
regx.append(String.valueOf(c.charValue()).trim());
}
regx.append("两Oo○");
regx.append("]+)");
Pattern pattern = Pattern.compile(regx.toString());

Matcher matcher = pattern.matcher(str);
String value = "";
if (matcher.find()) {
value = matcher.group();
}
return str.replaceFirst(regx.toString(), CnNumericToArabicUtil.cnNumericToArabic(value, null));
}

/**
* 进行解析处理
*
*
@param numStr 需要解析的数值字符串
*
@param numArrays 数值对应的数组
*
@param strRs 结果
*
@param isFirst 是否第一次遍历
*
@param index 分隔索引
*
@throws Exception
*/
private static void process(String numStr, char[] numArrays, StringBuffer strRs, boolean isFirst, int index)
throws Exception {
char[] args;

if (isFirst) {
firstParse(numStr, numArrays, strRs, index);
} else {
// 大于万
if (index > 0) {
args = numStr.substring(0, index).toCharArray();
numStr = numStr.substring(0, index);
} else {
args = numStr.toCharArray();
}
// 找到起始位置
int start = numArrays.length - Arrays.binarySearch(UNITS_2, args[0]) * 4;

for (int i = 1, j = 0; i < UNITS_1.length; i++) {
j = numStr.indexOf(UNITS_1[i]);
// 包含十, 百, 千单位
if (j > 0) {
numArrays[start + (3 - i)] = args[j - 1];

if (i == 1 && j + 1 < args.length) {
numArrays[start + (3 - i) + 1] = args[j + 1];
}
} else {
// 找上级(比如十没找到,则找百)
for (int ii = 1 + i; ii < UNITS_1.length; ii++) {
j = numStr.indexOf(UNITS_1[ii]);
// 找到上级
if (j > 0) {
numArrays[start + (3 - ii)] = args[j - 1];
break;
}
}
// 如果没有任何上级,且当前索引必须小于千,则按十-千填入数字
if (j < 0 && args.length - 1 - i >= 0 && i < 3) {
// 填入当前位置的数值
if (NumberUtils.isNumber(String.valueOf(args[args.length - 1 - i]))) {
numArrays[start + (3 - i)] = args[args.length - 1 - i];
}
// 填入当前位置后面的数值
if (NumberUtils.isNumber(String.valueOf(args[args.length - i]))) {
numArrays[start + (3 - i) + 1] = args[args.length - i];
}
}
}
}
}
}

/**
* 第一次解析
*
*
@param numStr 需要解析的数值字符串
*
@param numArrays 数值对应的数组
*
@param strRs 结果
*
@param index 为万级别的索引
*/
private static void firstParse(String numStr, char[] numArrays, StringBuffer strRs, int index) {
char[] args;
// 数值不超过5位
if (index <= 0) {
index = numStr.length();
}
args = numStr.substring(0, index).toCharArray();

if (null != args && args.length > 1) {
// 第二位为单位(十百千)
int k = UNITS_1_STR.indexOf(args[1]);
// 此位为单位(十百千),则创建此段空数组,准备填入数值
if (k > 0) {
char[] arrays = new char[k + 1];
// 默认为0
Arrays.fill(arrays, '0');
// 从十百千依次开始
for (int i = 1, j = 0; k > 0 && i < UNITS_1.length; i++, k--) {
j = numStr.substring(0, index).indexOf(UNITS_1[i]);
// 此字符串包含十百千,j的前一位肯定是数字
if (j > 0) {
// 在对应的数组位置填上其数值
arrays[arrays.length - 1 - i] = args[j - 1];
// i为1说明当前处于十位,则需要补全个位数
if (i == 1 && j + 1 < args.length) {
arrays[arrays.length - i] = args[j + 1];
}
// 没找到单位
} else {
// 找上级(比如十没找到,则找百)
for (int ii = 1 + i; ii < UNITS_1.length; ii++) {
j = numStr.substring(0, index).indexOf(UNITS_1[ii]);
// 找到上级
if (j > 0) {
// 如果上级索引位置后面还有数字个数大于等于理论上的数字减一,则填入当前索引位的最后一位
if ((args.length - j - 1) >= (ii - 1)) {
arrays[arrays.length - i] = args[args.length - i];
}
}

}
}
}

strRs.append(String.valueOf(arrays));

if (null != numArrays) {
strRs.append(String.valueOf(numArrays));
}
} else {
// 不规则的情况(单位前没数字) 十二、百三十
strRs.append(numStr.substring(0, index));
if (null != numArrays) {
strRs.append(String.valueOf(numArrays));
}
}
} else {
// 解析位只有1位,则判断其是否为单位属性
if (null != args && args.length == 1) {
int k = UNITS_1_STR.indexOf(args[0]);
if (k > 0) {
char[] arrays = new char[k + 1];
Arrays.fill(arrays, '0');
arrays[0] = '1';
strRs.append(String.valueOf(arrays));
}
}
// 如果不包含单位,则直接添加此数值
if (!UNITS_1_STR.contains(numStr.substring(0, index))) {
strRs.append(numStr.substring(0, index));
}

if (null != numArrays) {
strRs.append(String.valueOf(numArrays));
}
}
}

/**
* 将中文数值转换为阿拉伯数字
*
*
@param numStr 待过滤的字符串
*
@return
*/
private static String filterStr(String numStr) {
numStr = numStr.replace('O', ARABIC_NUMBER[0].charValue());
numStr = numStr.replace('○', ARABIC_NUMBER[0].charValue());
numStr = numStr.replace('两', ARABIC_NUMBER[2].charValue());
for (int i = 0; i < ARABIC_NUMBER.length; i++) {
numStr = numStr.replace(CN_NUMBER_1[i].charValue(), ARABIC_NUMBER[i].charValue());
numStr = numStr.replace(CN_NUMBER_2[i].charValue(), ARABIC_NUMBER[i].charValue());
}
for (int i = 1; i < UNITS_1.length; i++) {
numStr = numStr.replace(UNITS_1_T[i].charValue(), UNITS_1[i].charValue());
}
return numStr;
}
}
作者 east
Java 12月 7,2020

非spring容器下的配置工具类

1、按照spring boot的约定,配置文件名称默认是classpath根路径下的application.properties,并按其约定加载多个配置文件
2、按指定配置文件的路径及名称读取配置,一般是兼容旧工程没有按spring boot约定命名的配置文件 <br>
3、新增读取yml配置文件的功能,默认先读取properties文件,如果不存在再读取yml文件

public final class ConfigUtil {

    private static Logger log = LoggerFactory.getLogger(DataBaseUtil.class);

    /**
     * spring boot默认的配置文件名称
     */
    private static final String CONFIG_FILENAME = "application";

    private static final String DEFAULT_SUFFIX = ".properties";

    private static final String YML_SUFFIX = ".yml";

    /**
     * spring boot通过application.properties配置文件中的spring.profiles.active配置项值指定生效的配置文件名称<br>
     * 如spring.profiles.active=business,表示application-business.properties配置文件生效
     */
    private static final String SPRING_PROFILES_ACTIVE = "spring.profiles.active";

    /**
     * spring boot约定命名格式"application-{profile}.properties"来定义多个配置文件,其中{profile}是可变部分
     */
    private static final String SPRING_BOOT_PROFILE_TEMPLATE = "application-{profile}";

    /**
     * 属性对象集合,注意这里是线程安全的
     */
    private static Map<String, Properties> props = new ConcurrentHashMap<>();

    /** 私有的构造函数 */
    private ConfigUtil() {

    }

    /**
     * 加载指定配置文件中的配置
     * 
     * @param fileName
     * @return
     */
    private static Properties loadPropFromFile(String fileName) {
        Properties prop = new Properties();

        try {
            prop.load(ConfigUtil.class.getClassLoader().getResourceAsStream(fileName));
        } catch (IOException e) {
            e.printStackTrace();
            String error = "配置文件工具类加载配置文件" + fileName + "出现异常!";
            log.error(e.getMessage()+":===:"+error);
            throw new RuntimeException(error);
        }
        return prop;
    }

    /**
     * 将yml格式文件加载到Properties中
     * 
     * @param fileName 文件名
     * @return
     */
    private static Properties loadYmlFromFile(String fileName) {
        Properties prop = new Properties();
        LoaderOptions options = new LoaderOptions();
        // 是否允许读取重复key值,默认为true
        options.setAllowDuplicateKeys(false);
        Yaml yaml = new Yaml(options);

        // 加载yml文件流
        InputStream inStream = ConfigUtil.class.getClassLoader().getResourceAsStream(fileName);
        // 按照文件编码读取流
        Reader reader = new UnicodeReader(inStream);
        Iterable<Object> it = yaml.loadAll(reader);
        Map<String, Object> result = new LinkedHashMap<>();

        for (Object object : it) {
            // 构建map类型数据
            buildFlattenedMap(result, asMap(object), null);
        }
        prop.putAll(result);
        return prop;
    }

    /**
     * 递归转换map源数据,将递归的key值用"."拼接成最终目标map的key值,最终的value为目标map的value值
     * 
     * @param result
     * @param source
     * @param path
     */
    @SuppressWarnings("unchecked")
    private static void buildFlattenedMap(Map<String, Object> result, Map<String, Object> source, String path) {
        source.forEach((key, value) -> {

            if (hasText(path)) {
                if (key.startsWith("[")) {
                    key = path + key;
                } else {
                    // 分层读取key值,使用"."拼接
                    key = path + '.' + key;
                }
            }

            if (value instanceof String) {
                result.put(key, value);
            } else if (value instanceof Map) {
                // Need a compound key
                Map<String, Object> map = (Map<String, Object>) value;
                // 递归构造map
                buildFlattenedMap(result, map, key);
            } else if (value instanceof Collection) {
                // Need a compound key
                Collection<Object> collection = (Collection<Object>) value;

                if (collection.isEmpty()) {
                    result.put(key, "");
                } else {
                    int count = 0;
                    for (Object object : collection) {
                        buildFlattenedMap(result, Collections.singletonMap("[" + (count++) + "]", object), key);
                    }
                }
            } else {
                result.put(key, (value != null ? value : ""));
            }
        });
    }

    /**
     * 将object数据转换为Map
     * 
     * @param object
     * @return
     */
    @SuppressWarnings("unchecked")
    private static Map<String, Object> asMap(Object object) {
        // YAML can have numbers as keys
        Map<String, Object> result = new LinkedHashMap<>();

        if (!(object instanceof Map)) {
            // A document can be a text literal
            result.put("document", object);
            return result;
        }
        Map<Object, Object> map = (Map<Object, Object>) object;

        map.forEach((key, value) -> {

            if (value instanceof Map) {
                value = asMap(value);
            }

            if (key instanceof CharSequence) {
                result.put(key.toString(), value);
            } else {
                // It has to be a map key in this case
                result.put("[" + key.toString() + "]", value);
            }
        });
        return result;
    }

    // 判断字符串是否有值(不为空、不为null、必须包含字符串)
    private static boolean hasText(@Nullable String str) {
        return (str != null && !str.isEmpty() && containsText(str));
    }

    // 是否包含字符
    private static boolean containsText(CharSequence str) {
        int strLen = str.length();

        for (int i = 0; i < strLen; i++) {

            if (!Character.isWhitespace(str.charAt(i))) {
                return true;
            }
        }
        return false;
    }

    /**
     * 根据属性key得到对应的属性值<br>
     * 配置文件按spring boot的约定的配置文件命名规则进行加载<br>
     * <font color=red>注意: 暂不支持yml文件属性读取</font>
     * 
     * @param key 键名称
     * @return
     */
    public static String getPropsValueByKey(String key) {
        // TODO 暂时不支持读取yml格式文件,yml文件支持map和list格式数据,需要另写方法支持
        if (!props.containsKey(CONFIG_FILENAME)) {
            Properties prop = new Properties();
            prop = getPropertiesByFileName(CONFIG_FILENAME);

            if (prop.get(SPRING_PROFILES_ACTIVE) != null) {
                // 依次读取指定的配置文件
                for (String partName : prop.get(SPRING_PROFILES_ACTIVE).toString().split(",")) {
                    prop.putAll(getPropertiesByFileName(SPRING_BOOT_PROFILE_TEMPLATE.replace("{profile}", partName)));
                }
            }
            props.put(CONFIG_FILENAME, prop);
        }
        Object obj = props.get(CONFIG_FILENAME).get(key);
        if (obj == null) {
            return null;
        } else {
            return obj.toString();
        }
    }

    /**
     * 根据配置文件名称和属性key得到对应的属性值.<br>
     * 一般用于非spring boot约定的配置文件名称,比如集成其它系统的功能时,有固定名称的配置文件,或兼容旧系统<br>
     * <font color=red>注意: 暂不支持yml文件属性读取</font>
     * 
     * @param configFileName 配置文件名称
     * @param key 属性key值
     * @return
     * 
     */
    public static String getPropsValueByKey(String configFileName, String key) {
        // TODO 暂时不支持读取yml格式文件,yml文件支持map和list格式数据,需要另写方法支持
        if (!props.containsKey(configFileName)) {
            props.put(configFileName, loadPropFromFile(configFileName));
        }
        return props.get(configFileName).getProperty(key);
    }

    /**
     * 根据文件名称获取Properties
     * 
     * @param fileName 文件名
     * @return
     */
    private static Properties getPropertiesByFileName(String fileName) {
        String fileFullName = fileName + DEFAULT_SUFFIX;
        InputStream inputStream = ConfigUtil.class.getClassLoader().getResourceAsStream(fileFullName);

        if (inputStream == null) {
            fileFullName = fileName + YML_SUFFIX;
            // 读取yml配置文件
            inputStream = ConfigUtil.class.getClassLoader().getResourceAsStream(fileFullName);
            return loadYmlFromFile(fileFullName);
        } else {
            // 读取properties文件
            return loadPropFromFile(fileFullName);
        }
    }

    public static String getBody(String bodyName,JSONObject jsonObject) {
        String body = (String) jsonObject.get(bodyName);
        String reqBody = body;
        String pattern = "\\$\\{.*?\\}";
        Pattern r = Pattern.compile(pattern);
        Matcher matcher = r.matcher(body);
        while (matcher.find()) {
            String substring = body.substring(matcher.start(), matcher.end());
            String s = getPropsValueByKey(substring.substring(2, substring.length() - 1));
            reqBody = reqBody.replace(substring, s);
        }
        return reqBody;
    }

}
作者 east
Java 12月 7,2020

Excel快速导入导出工具(仅提供excel2007以及更高版本的支持)

public class ExcelWriter {

/** 日志 */
private static Logger LOG = LoggerFactory.getLogger(ExcelWriter.class);

/** 原生HttpServletResponse对象 */
private HttpServletResponse response = null;

/**
* 用于导入excel的构造函数
*/
private ExcelWriter() {

}

/**
* 用于导出excel的构造函数 <br>
* List(Bean)格式
*
* @param clazz
* @param response
*/
private ExcelWriter(Class<?> clazz, HttpServletResponse response) {
// this.clazz == clazz;
this.response = response;
}

/**
* 用于导出excel的构造函数 <br>
* List(String[]) 格式
*
* @param response
*/
private ExcelWriter(HttpServletResponse response) {
this.response = response;
}

/**
* 用于浏览器导出excel的实例化
*
* @param clazz 实体Class对象
* @param response 原生HttpServletResponse对象
* @return ExcelUtils
*/
public static ExcelWriter exportInit(HttpServletResponse response) {
return new ExcelWriter(response);
}

/**
* 用于浏览器导出excel的实例化
*
* @param clazz 实体Class对象
* @param response 原生HttpServletResponse对象
* @return ExcelUtils
*/
public static ExcelWriter exportInit(Class<?> clazz, HttpServletResponse response) {
return new ExcelWriter(clazz, response);
}

/**
* 导出Excel,响应到浏览器下载(List<String[]>格式)
*
* @param headers 表头
* @param data 数据
* @param fileName 文件名称
* @param sheetName 工作表名
* @return
*/
public boolean writeExcel(List<String> headers, List<String[]> datas, String fileName, String sheetName) {
if (response == null) {
throw new IllegalArgumentException("请先使用exportInit(HttpServletResponse)初始化参数。");
}
long begin = System.currentTimeMillis();

if (ListUtils.isEmpty(datas)) {
LOG.error("没有检测到数据,不执行导出操作。");
return false;
}
int dataSize = datas.size();
LOG.info(String.format("即将导出excel数据 : %s条,请稍后...", dataSize));
try {
// 输出流
OutputStream outputStream = response.getOutputStream();
// 创建新的工作薄
SXSSFWorkbook wb = PoiUtils.newSXSSFWorkbook();
// 表头的样式
CellStyle cellStyle = wb.createCellStyle();
Font font = wb.createFont();
// 对齐
cellStyle.setAlignment(CellStyle.ALIGN_LEFT);
font.setBoldweight(Font.BOLDWEIGHT_NORMAL);
// 字体大小
font.setFontHeightInPoints((short) 12);
font.setFontName("宋体");
// 应用标题字体到标题样式
cellStyle.setFont(font);
// 设置单元格文本形式
DataFormat dataFormat = wb.createDataFormat();
cellStyle.setDataFormat(dataFormat.getFormat("@"));

// 表头的值
String headerValue = null;
// 单元格的值
String cellValue = null;
// 创建sheet
SXSSFSheet sheet = PoiUtils.newSXSSFSheet(wb, sheetName);
// 创建行表头
SXSSFRow headerRow = PoiUtils.newSXSSFRow(sheet, 0);
for (int i = 0, size = headers.size(); i < size; i++) {
headerValue = headers.get(i);
SXSSFCell cell = PoiUtils.newSXSSFCell(headerRow, i);
cell.setCellValue(headerValue);
cell.setCellStyle(cellStyle);
}

// 明细行数组
String[] bodys = null;
for (int i = 0; i < dataSize; i++) {
// 创建行数据
SXSSFRow bodyRow = PoiUtils.newSXSSFRow(sheet, i + 1);
bodys = datas.get(i);
for (int j = 0, len = bodys.length; j < len; j++) {
cellValue = bodys[j];
if (StringUtils.isBlank(cellValue)) {
// FIXME: 当值为""时,当前index的cell会失效,这里设置为null
cellValue = null;
}

// 创建列
SXSSFCell cell = PoiUtils.newSXSSFCell(bodyRow, j);
cell.setCellValue(cellValue);
cell.setCellType(SXSSFCell.CELL_TYPE_STRING);
}
}

writeByBrowser(response, fileName, wb, outputStream);
LOG.info(String.format("excel处理完成,共生成数据 : %s行,耗时 : %s seconds.", dataSize,
(System.currentTimeMillis() - begin) / 1000.0));
} catch (Exception e) {
LOG.error("导出excel失败 : " + e.getMessage(), e);
}
return true;
}

/**
* 响应到浏览器下载
*
* @param response
* @param fileName
* @param wb
* @param out
* @throws Exception
*/
private static void writeByBrowser(HttpServletResponse response, String fileName, SXSSFWorkbook wb,
OutputStream out) throws Exception {
// response对象不为空,响应到浏览器下载
if (response != null) {
response.setContentType(ConstantUtils.CONTENT_TYPE);
response.setCharacterEncoding("UTF-8");
fileName = new String(fileName.getBytes("UTF-8"), "ISO8859-1") + ConstantUtils.XLSX_SUFFIX;
response.setHeader("Content-Disposition", "attachment;filename=" + fileName);
if (out == null) {
out = response.getOutputStream();
}
}
wb.write(out);
out.flush();
out.close();
}

/**
* 保存文件到本地
*
* @param headers 表头
* @param datas 转换好的数据
* @param filePath 路径
* @param sheetName 工作表名
* @param type 类型 0-转换成功 1-转换失败
*/
public static void saveByLocal(List<String> headers, List<String[]> datas, String filePath, int type) {
long begin = System.currentTimeMillis();

if (ListUtils.isEmpty(datas)) {
LOG.error("没有检测到数据,不执行导出操作。");
return;
}
int dataSize = datas.size();
LOG.info(String.format("即将保存excel数据 : %s条,请稍后...", dataSize));
// 输出流
FileOutputStream fileOutputStream = null;
BufferedOutputStream bufferedOutputStream = null;
try {
fileOutputStream = new FileOutputStream(filePath);
bufferedOutputStream = new BufferedOutputStream(fileOutputStream);
String sheetName = "";
if (type == 0) {
sheetName = PropertyUtils.getProperty("successConversion");
} else if (type == 1) {
sheetName = PropertyUtils.getProperty("failConversion");
}
// 创建新的工作薄
SXSSFWorkbook wb = PoiUtils.newSXSSFWorkbook();
// 表头的样式
CellStyle cellStyle = wb.createCellStyle();
Font font = wb.createFont();
// 对齐
cellStyle.setAlignment(CellStyle.ALIGN_LEFT);
font.setBoldweight(Font.BOLDWEIGHT_NORMAL);
// 字体大小
font.setFontHeightInPoints((short) 12);
font.setFontName("宋体");
// 应用标题字体到标题样式
cellStyle.setFont(font);
// 设置单元格文本形式
DataFormat dataFormat = wb.createDataFormat();
cellStyle.setDataFormat(dataFormat.getFormat("@"));

// 表头的值
String headerValue = null;
// 单元格的值
String cellValue = null;
// 创建sheet
SXSSFSheet sheet = PoiUtils.newSXSSFSheet(wb, sheetName);
// 创建行表头
SXSSFRow headerRow = PoiUtils.newSXSSFRow(sheet, 0);
for (int i = 0, size = headers.size(); i < size; i++) {
headerValue = headers.get(i);
SXSSFCell cell = PoiUtils.newSXSSFCell(headerRow, i);
cell.setCellValue(headerValue);
cell.setCellStyle(cellStyle);
}

// 明细行数组
String[] bodys = null;
for (int i = 0; i < dataSize; i++) {
// 创建行数据
SXSSFRow bodyRow = PoiUtils.newSXSSFRow(sheet, i + 1);
bodys = datas.get(i);
for (int j = 0, len = bodys.length; j < len; j++) {
cellValue = bodys[j];
if (StringUtils.isBlank(cellValue)) {
// FIXME: 当值为""时,当前index的cell会失效,这里设置为null
cellValue = null;
}

// 创建列
SXSSFCell cell = PoiUtils.newSXSSFCell(bodyRow, j);
cell.setCellValue(cellValue);
cell.setCellType(SXSSFCell.CELL_TYPE_STRING);
}
}

wb.write(bufferedOutputStream);
LOG.info(String.format("excel处理完成,共生成数据 : %s行,耗时 : %s seconds.", dataSize,
(System.currentTimeMillis() - begin) / 1000.0));
} catch (Exception e) {
LOG.error("保存excel失败 : " + e.getMessage(), e);
} finally {
if (bufferedOutputStream != null) {
try {
bufferedOutputStream.close();
} catch (IOException e) {
LOG.error("文件流关闭异常");
}
}
}
}

}
作者 east
Java 12月 7,2020

GAT1400视图库没有视图库账户对接遇到的坑

没有视图库账号对接视图库,把DeviceId没有写自己的视图库账号,错误写成要对接的视图库账号,一直返回“用户名错误”。后来才知道,只要按照GAT1400标准,20位的视图库账号可以自己按照标准进行编写一个,然后让要对接的视图库厂商后台配置一下。

作者 east
Java 12月 7,2020

用AOP写的日志管理工具

 使用AOP,将日志记录,异常报告等代码从业务逻辑代码中划分出来,通过对这些行为的分离,我们希望可以将它们独立到非指导业务逻辑的方法中,进而改变这些行为的时候不影响业务逻辑的代码。 
import com.alibaba.fastjson.JSONObject;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;

@Component
@Aspect
public class LogManageUtil {
private static Logger logger = LoggerFactory.getLogger(LogManageUtil.class);
private static final String serverName = "cloudsearch";
private static final Integer showRows = 5;

@Pointcut("execution(* com.funny.services.web..*.*(..))")
public void controllerLogProxy() {

}

@Before("controllerLogProxy()")
public void beforeLogInfo(JoinPoint joinPoint) {
Object[] params = joinPoint.getArgs();
String paramStr = "";
for (int i = 0; i < params.length; i++) {
Object param = params[i];
if (i == 0){
logger.info(param.getClass().getSimpleName());
if(param.getClass().getSimpleName().equals("SessionRepositoryRequestWrapper")) {
paramStr = "该接口无参数";
}else{
paramStr += JSONObject.toJSONString(param);
}
}

else
paramStr += "," + JSONObject.toJSONString(param);
}
logger.info("service:[" + serverName + "] -- API:[" + getApiUrl() + "] 请求参数:" + paramStr);
}

@AfterReturning(pointcut = "controllerLogProxy()", returning = "result")
public void afterLogInfo(Object result) {
if (result instanceof ResultData) {
ResultData tmpRs = (ResultData) result;
ResultData rs = new ResultData();
BeanUtils.copyProperties(tmpRs, rs);
if (rs.getCode()==ResultStatus.SUCCESS_CODE) {
if (rs.getData() instanceof List) {
List<Object> list = (List) rs.getData();
List<Object> tmpList = new ArrayList<>();
if (list != null && (list.size() > showRows)) {
for (int i = 0; i < showRows; i++) {
tmpList.add(list.get(i));
}
Object more = "more...";
tmpList.add(more);
rs.setData(tmpList);
}
}
}
logger.info("service:[" + serverName + "] -- API:[" + getApiUrl() + "] 返回结果:" + JSONObject.toJSONString(rs));
}
}

public static String getApiUrl() {
RequestAttributes ra = RequestContextHolder.getRequestAttributes();
ServletRequestAttributes sra = (ServletRequestAttributes) ra;
HttpServletRequest request = sra.getRequest();
String url = request.getRequestURL().toString();
int startIndex = url.indexOf(serverName);
String ApiUrl = url.substring(startIndex + serverName.length(), url.length());
return ApiUrl;
}

public static void serviceErrorPrint(Exception e) {
logger.error("service:[" + serverName + "] -- API:[" + getApiUrl() + "] 错误信息:" + e.getMessage());
}


}
作者 east
Java 11月 17,2020

GAT1400的注册流程RFC2617认证

此图像的alt属性为空;文件名为image.png


Authorization 请求头字段

  • response: 客户端根据算法算出的摘要值
  • username: 要认证的用户名
  • realm: 认证域,可取任意标识值
  • uri: 请求的资源位置
  • qop: 保护质量
  • nonce: 服务器密码随机数
  • nc: 16进制请求认证计数器,第一次 00000001
  • algorithm: 默认MD5算法
  • cnonce: 客户端密码随机数

Request-Digest 摘要计算过程

若算法是:MD5 或者是未指定
则 A1= <username>:<realm>:<passwd>

若 qop 未定义或者 auth:
则 A2= <request-method>:<digest-uri-value>

若 qop 为 auth
      response=MD5(MD5(A1):<nonce>:<nc>:<cnonce>:<qop>:MD5(A2)) 
若 qop 没有定义
      response=MD5(MD5(A1):<nonce>:MD5(A2)) 

import org.apache.commons.codec.binary.Hex;
import org.apache.commons.lang3.Validate;

import java.io.UnsupportedEncodingException;
import java.security.GeneralSecurityException;
import java.security.MessageDigest;
import java.security.SecureRandom;
import java.util.Random;

/**
 * Http Digest
 * @author zhouzhixiang
 * @date 2019-05-14
 */
public class Digests {

    private static SecureRandom random = new SecureRandom();
    /**
     * 加密遵循RFC2671规范 将相关参数加密生成一个MD5字符串,并返回
     */
    public static String http_da_calc_HA1(String username, String realm, String password,
                                          String nonce, String nc, String cnonce, String qop,
                                          String method, String uri, String algorithm) {
        String HA1, HA2;
        if ("MD5-sess".equals(algorithm)) {
            HA1 = HA1_MD5_sess(username, realm, password, nonce, cnonce);
        } else {
            HA1 = HA1_MD5(username, realm, password);
        }
        byte[] md5Byte = md5(HA1.getBytes());
        HA1 = new String(Hex.encodeHex(md5Byte));

        md5Byte = md5(HA2(method, uri).getBytes());
        HA2 = new String(Hex.encodeHex(md5Byte));

        String original = HA1 + ":" + (nonce + ":" + nc + ":" + cnonce + ":" + qop) + ":" + HA2;

        md5Byte = md5(original.getBytes());
        return new String(Hex.encodeHex(md5Byte));

    }

    /**
     * algorithm值为MD5时规则
     */
    private static String HA1_MD5(String username, String realm, String password) {
        return username + ":" + realm + ":" + password;
    }

    /**
     * algorithm值为MD5-sess时规则
     */
    private static String HA1_MD5_sess(String username, String realm, String password, String nonce, String cnonce) {
        //      MD5(username:realm:password):nonce:cnonce

        String s = HA1_MD5(username, realm, password);
        byte[] md5Byte = md5(s.getBytes());
        String smd5 = new String(Hex.encodeHex(md5Byte));

        return smd5 + ":" + nonce + ":" + cnonce;
    }

    private static String HA2(String method, String uri) {
        return method + ":" + uri;
    }

    /**
     * 对输入字符串进行md5散列.
     */
    public static byte[] md5(byte[] input) {
        return digest(input, "MD5", null, 1);
    }

    /**
     * 对字符串进行散列, 支持md5与sha1算法.
     */
    private static byte[] digest(byte[] input, String algorithm, byte[] salt, int iterations) {
        try {
            MessageDigest digest = MessageDigest.getInstance(algorithm);

            if (salt != null) {
                digest.update(salt);
            }

            byte[] result = digest.digest(input);

            for (int i = 1; i < iterations; i++) {
                digest.reset();
                result = digest.digest(result);
            }
            return result;
        } catch (GeneralSecurityException e) {
            throw new RuntimeException(e);
        }
    }

    /**
     * 随机生成numBytes长度数组
     * @param numBytes
     * @return
     */
    public static byte[] generateSalt(int numBytes) {
        Validate.isTrue(numBytes > 0, "numBytes argument must be a positive integer (1 or larger)", (long)numBytes);
        byte[] bytes = new byte[numBytes];
        random.nextBytes(bytes);
        return bytes;
    }

    @Deprecated
    public static String generateSalt2(int length) {
        String val = "";
        Random random = new Random();
        //参数length,表示生成几位随机数
        for(int i = 0; i < length; i++) {
            String charOrNum = random.nextInt(2) % 2 == 0 ? "char" : "num";
            //输出字母还是数字
            if( "char".equalsIgnoreCase(charOrNum) ) {
                //输出是大写字母还是小写字母
                int temp = random.nextInt(2)%2 == 0 ? 65 : 97;
                val += (char)(random.nextInt(26) + temp);
            } else if( "num".equalsIgnoreCase(charOrNum) ) {
                val += String.valueOf(random.nextInt(10));
            }
        }
        return val.toLowerCase();
    }


    //测试
    public static void main(String[] args) throws UnsupportedEncodingException {
        // String s = http_da_calc_HA1("povodo", "realm@easycwmp", "povodo",
        //                             "c10c9897f05a9aee2e2c5fdebf03bb5b0001b1ef", "00000001", "d5324153548c43d8", "auth",
        //                             "GET", "/", "MD5");
        // System.out.println("加密后response为:" + s);

        // String s = new String(generateSalt(8),"UTF-8");

        // System.out.println(s);
    }
}

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**

  • Http Digest Request contains POST、GET、PUT
  • @author zhouzhixiang
  • @date 2019-05-14
    */
    public class HttpRequestUtils { private static final Logger logger = LoggerFactory.getLogger(HttpRequestUtils.class); public static void main(String[] args) {
    // String url = “http://192.168.200.117:8087/v2/servers/defaultServer/vhosts/defaultVHost/applications/live/publishers”;
    // String url = “http://192.168.200.117:8087/v2/servers/defaultServer/vhosts/defaultVHost/applications/Relay/streamfiles/1234566/actions/connect?&vhost=defaultVHost&appType=live&appName=Relay&appInstance=definst&connectAppName=Relay&connectAppInstance=definst&streamFile=1234566.stream&mediaCasterType=liverepeater”;
    String param = “”;
    String username = “xxxxxx”;
    String password = “xxxxxx”;
    // String json = “{ \”password\”: \”plmo13579123\”, \”publisherName\”: \”4\”, \”serverName\”: \”defaultServer\”, \”description\”: \”\”, \”saveFieldList\”: [ \”\” ], \”version\”: \”v1.0\” }”;
    // String s = sendPost(url, param, username, password, json); // String s = sendPost(url, param, username, password, json); // -----------------GET-success------------------ String getUrl = "http://192.168.200.117:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications"; // String s = sendGet(getUrl, param, username, password, null); // -----------------GET-success------------------ // -----------------PUT-success------------------ String putUrl = "http://192.168.200.117:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/Relay/streamfiles/6D07D7E7623B95889C33DC5901307461_0/actions/connect"; String putJson = "{ \"vhost\":\"_defaultVHost_\", \"mediaCasterType\":\"liverepeater\" }"; // String s = sendPUT(putUrl, param, username, password, putJson, null); // -----------------PUT-success------------------ // -----------------POST-success------------------ String postUrl = "http://192.168.200.117:8087/v2/servers/_defaultServer_/users"; String postJson = "{ \"password\": \"123456\", \"serverName\": \"_defaultServer_\", \"description\": \"\", \"groups\": [ \"\" ], \"saveFieldList\": [ \"\" ], \"userName\": \"test6\", \"version\": \"v1.0\" }"; // String s = sendPost(postUrl, param, username, password, postJson, null); // -----------------POST-success------------------ // -----------------POST-success------------------ String postUrl2 = "http://192.168.200.117:8087/v2/servers/_defaultServer_/publishers"; String postJson2 = "{ \"password\": \"1579655633@qq.com\", \"name\": \"test11\", \"serverName\": \"_defaultServer_\", \"description\": \"test\", \"saveFieldList\": [ \"\" ], \"version\": \"v1.0\" }"; // String s = sendPost(postUrl2, param, username, password, postJson2, null); // -----------------POST-success------------------ // -----------------DELETE-success------------------ String deleteUrl = "http://192.168.200.117:8087/v2/servers/_defaultServer_/users/test5"; // String deleteJson = "{ \"password\": \"1579655633@qq.com\", \"name\": \"test11\", \"serverName\": \"_defaultServer_\", \"description\": \"test\", \"saveFieldList\": [ \"\" ], \"version\": \"v1.0\" }"; String s = sendDelete(deleteUrl, param, username, password, null, null); // -----------------DELETE-success------------------ System.out.println(s); } static int nc = 0; //调用次数
    private static final String GET = “GET”;
    private static final String POST = “POST”;
    private static final String PUT = “PUT”;
    private static final String DELETE = “DELETE”; /**
    • 向指定URL发送DELETE方法的请求
    • @param url 发送请求的URL
    • @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
    • @param username 验证所需的用户名
    • @param password 验证所需的密码
    • @param json 请求json字符串
    • @param type 返回xml和json格式数据,默认xml,传入json返回json数据
    • @return URL 所代表远程资源的响应结果
      */
      public static String sendDelete(String url, String param, String username, String password, String json, String type) { StringBuilder result = new StringBuilder();
      BufferedReader in = null;
      try {
      String wwwAuth = sendGet(url, param); //发起一次授权请求
      if (wwwAuth.startsWith(“WWW-Authenticate:”)) {
      wwwAuth = wwwAuth.replaceFirst(“WWW-Authenticate:”, “”);
      } else {
      return wwwAuth;
      }
      nc ++;
      String urlNameString = url + (StringUtils.isNotEmpty(param) ? “?” + param : “”);
      URL realUrl = new URL(urlNameString);
      // 打开和URL之间的连接
      HttpURLConnection connection = (HttpURLConnection)realUrl.openConnection(); // 设置是否向connection输出,因为这个是post请求,参数要放在 // http正文内,因此需要设为true connection.setDoOutput(true); // Read from the connection. Defaultis true. connection.setDoInput(true); // 默认是 GET方式 connection.setRequestMethod(DELETE); // 设置通用的请求属性 setRequestProperty(connection, wwwAuth, realUrl, username, password, DELETE, type); if (!StringUtils.isEmpty(json)) { byte[] writebytes =json.getBytes(); connection.setRequestProperty("Content-Length",String.valueOf(writebytes.length)); OutputStream outwritestream = connection.getOutputStream(); outwritestream.write(json.getBytes()); outwritestream.flush(); outwritestream.close(); } if (connection.getResponseCode() == 200) { in = new BufferedReader(new InputStreamReader(connection.getInputStream())); String line; while ((line = in.readLine()) != null) { result.append(line); } } else { String errResult = formatResultInfo(connection, type); logger.info(errResult); return errResult; } nc = 0; } catch (Exception e) {
      nc = 0;
      throw new RuntimeException(e);
      } finally {
      try {
      if (in != null) in.close();
      } catch (Exception e2) {
      e2.printStackTrace();
      }
      }
      return result.toString();
      }
    /**
    • 向指定URL发送PUT方法的请求
    • @param url 发送请求的URL
    • @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
    • @param username 验证所需的用户名
    • @param password 验证所需的密码
    • @param json 请求json字符串
    • @param type 返回xml和json格式数据,默认xml,传入json返回json数据
    • @return URL 所代表远程资源的响应结果
      */
      public static String sendPUT(String url, String param, String username, String password, String json, String type) { StringBuilder result = new StringBuilder();
      BufferedReader in = null;
      try {
      String wwwAuth = sendGet(url, param); //发起一次授权请求
      if (wwwAuth.startsWith(“WWW-Authenticate:”)) {
      wwwAuth = wwwAuth.replaceFirst(“WWW-Authenticate:”, “”);
      } else {
      return wwwAuth;
      }
      nc ++;
      String urlNameString = url + (StringUtils.isNotEmpty(param) ? “?” + param : “”);
      URL realUrl = new URL(urlNameString);
      // 打开和URL之间的连接
      HttpURLConnection connection = (HttpURLConnection)realUrl.openConnection(); // 设置是否向connection输出,因为这个是post请求,参数要放在 // http正文内,因此需要设为true connection.setDoOutput(true); // Read from the connection. Defaultis true. connection.setDoInput(true); // 默认是 GET方式 connection.setRequestMethod(PUT); // Post 请求不能使用缓存 connection.setUseCaches(false); // 设置通用的请求属性 setRequestProperty(connection, wwwAuth,realUrl, username, password, PUT, type); if (!StringUtils.isEmpty(json)) { byte[] writebytes =json.getBytes(); connection.setRequestProperty("Content-Length",String.valueOf(writebytes.length)); OutputStream outwritestream = connection.getOutputStream(); outwritestream.write(json.getBytes()); outwritestream.flush(); outwritestream.close(); } if (connection.getResponseCode() == 200) { in = new BufferedReader(new InputStreamReader(connection.getInputStream())); String line; while ((line = in.readLine()) != null) { result.append(line); } } else { String errResult = formatResultInfo(connection, type); logger.info(errResult); return errResult; } nc = 0; } catch (Exception e) {
      nc = 0;
      throw new RuntimeException(e);
      } finally {
      try {
      if (in != null) in.close();
      } catch (Exception e2) {
      e2.printStackTrace();
      }
      }
      return result.toString();
      }
    /**
    • 向指定URL发送POST方法的请求
    • @param url 发送请求的URL
    • @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
    • @param username 验证所需的用户名
    • @param password 验证所需的密码
    • @param json 请求json字符串
    • @param type 返回xml和json格式数据,默认xml,传入json返回json数据
    • @return URL 所代表远程资源的响应结果
      */
      public static String sendPost(String url, String param, String username, String password, String json, String type) { StringBuilder result = new StringBuilder();
      BufferedReader in = null;
      try {
      String wwwAuth = sendGet(url, param); //发起一次授权请求
      if (wwwAuth.startsWith(“WWW-Authenticate:”)) {
      wwwAuth = wwwAuth.replaceFirst(“WWW-Authenticate:”, “”);
      } else {
      return wwwAuth;
      }
      nc ++;
      String urlNameString = url + (StringUtils.isNotEmpty(param) ? “?” + param : “”);
      URL realUrl = new URL(urlNameString);
      // 打开和URL之间的连接
      HttpURLConnection connection = (HttpURLConnection)realUrl.openConnection(); // 设置是否向connection输出,因为这个是post请求,参数要放在 // http正文内,因此需要设为true connection.setDoOutput(true); // Read from the connection. Defaultis true. connection.setDoInput(true); // 默认是 GET方式 connection.setRequestMethod(POST); // Post 请求不能使用缓存 connection.setUseCaches(false); // 设置通用的请求属性 setRequestProperty(connection, wwwAuth,realUrl, username, password, POST, type); if (!StringUtils.isEmpty(json)) { byte[] writebytes =json.getBytes(); connection.setRequestProperty("Content-Length",String.valueOf(writebytes.length)); OutputStream outwritestream = connection.getOutputStream(); outwritestream.write(json.getBytes()); outwritestream.flush(); outwritestream.close(); } if (connection.getResponseCode() == 200 || connection.getResponseCode() == 201) { in = new BufferedReader(new InputStreamReader(connection.getInputStream())); String line; while ((line = in.readLine()) != null) { result.append(line); } } else { String errResult = formatResultInfo(connection, type); logger.info(errResult); return errResult; } nc = 0; } catch (Exception e) {
      nc = 0;
      throw new RuntimeException(e);
      } finally {
      try {
      if (in != null) in.close();
      } catch (Exception e2) {
      e2.printStackTrace();
      }
      }
      return result.toString();
      }
    /**
    • 向指定URL发送GET方法的请求
    • @param url 发送请求的URL
    • @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
    • @param username 验证所需的用户名
    • @param password 验证所需的密码
    • @param type 返回xml和json格式数据,默认xml,传入json返回json数据
    • @return URL 所代表远程资源的响应结果
      */
      public static String sendGet(String url, String param, String username, String password, String type) { StringBuilder result = new StringBuilder();
      BufferedReader in = null;
      try {
      String wwwAuth = sendGet(url, param); //发起一次授权请求
      if (wwwAuth.startsWith(“WWW-Authenticate:”)) {
      wwwAuth = wwwAuth.replaceFirst(“WWW-Authenticate:”, “”);
      } else {
      return wwwAuth;
      }
      nc ++;
      String urlNameString = url + (StringUtils.isNotEmpty(param) ? “?” + param : “”);
      URL realUrl = new URL(urlNameString);
      // 打开和URL之间的连接
      HttpURLConnection connection = (HttpURLConnection)realUrl.openConnection();
      // 设置通用的请求属性
      setRequestProperty(connection, wwwAuth,realUrl, username, password, GET, type);
      // 建立实际的连接
      // connection.connect();
      in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String line;
      while ((line = in.readLine()) != null) {
      result.append(line);
      }
      nc = 0;
      } catch (Exception e) {
      nc = 0;
      throw new RuntimeException(e);
      } finally {
      try {
      if (in != null) in.close();
      } catch (Exception e2) {
      e2.printStackTrace();
      }
      }
      return result.toString();
      }
    /**
    • 生成授权信息
    • @param authorization 上一次调用返回401的WWW-Authenticate数据
    • @param username 用户名
    • @param password 密码
    • @return 授权后的数据, 应放在http头的Authorization里
    • @throws IOException 异常
      */
      private static String getAuthorization(String authorization, String uri, String username, String password, String method) throws IOException { uri = StringUtils.isEmpty(uri) ? “/” : uri;
      // String temp = authorization.replaceFirst(“Digest”, “”).trim();
      String temp = authorization.replaceFirst(“Digest”, “”).trim().replace(“MD5″,”\”MD5\””);
      // String json = “{\”” + temp.replaceAll(“=”, “\”:”).replaceAll(“,”, “,\””) + “}”;
      String json = withdrawJson(authorization);
      // String json = “{ \”realm\”: \”Wowza\”, \” domain\”: \”/\”, \” nonce\”: \”MTU1NzgxMTU1NzQ4MDo2NzI3MWYxZTZkYjBiMjQ2ZGRjYTQ3ZjNiOTM2YjJjZA==\”, \” algorithm\”: \”MD5\”, \” qop\”: \”auth\” }”; JSONObject jsonObject = JSON.parseObject(json);
      // String cnonce = new String(Hex.encodeHex(Digests.generateSalt(8))); //客户端随机数
      String cnonce = Digests.generateSalt2(8);
      String ncstr = (“00000000” + nc).substring(Integer.toString(nc).length()); //认证的次数,第一次是1,第二次是2…
      // String algorithm = jsonObject.getString(“algorithm”);
      String algorithm = jsonObject.getString(“algorithm”);
      String qop = jsonObject.getString(“qop”);
      String nonce = jsonObject.getString(“nonce”);
      String realm = jsonObject.getString(“realm”); String response = Digests.http_da_calc_HA1(username, realm, password,
      nonce, ncstr, cnonce, qop,
      method, uri, algorithm); //组成响应authorization
      authorization = “Digest username=\”” + username + “\”,” + temp;
      authorization += “,uri=\”” + uri
      + “\”,nc=\”” + ncstr
      + “\”,cnonce=\”” + cnonce
      + “\”,response=\”” + response+”\””;
      return authorization;
      }
    /**
    • 将返回的Authrization信息转成json
    • @param authorization authorization info
    • @return 返回authrization json格式数据 如:String json = “{ \”realm\”: \”Wowza\”, \” domain\”: \”/\”, \” nonce\”: \”MTU1NzgxMTU1NzQ4MDo2NzI3MWYxZTZkYjBiMjQ2ZGRjYTQ3ZjNiOTM2YjJjZA==\”, \” algorithm\”: \”MD5\”, \” qop\”: \”auth\” }”;
      */
      private static String withdrawJson(String authorization) {
      String temp = authorization.replaceFirst(“Digest”, “”).trim().replaceAll(“\””,””);
      // String noncetemp = temp.substring(temp.indexOf(“nonce=”), temp.indexOf(“uri=”));
      // String json = “{\”” + temp.replaceAll(“=”, “\”:”).replaceAll(“,”, “,\””) + “}”;
      String[] split = temp.split(“,”);
      Map map = new HashMap<>();
      Arrays.asList(split).forEach(c -> {
      String c1 = c.replaceFirst(“=”,”:”);
      String[] split1 = c1.split(“:”);
      map.put(split1[0].trim(), split1[1].trim());
      });
      return JSONObject.toJSONString(map);
      }
    /**
    • 向指定URL发送GET方法的请求
    • @param url 发送请求的URL
    • @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
    • @return URL 所代表远程资源的响应结果
      */
      public static String sendGet(String url, String param) {
      StringBuilder result = new StringBuilder();
      BufferedReader in = null;
      try { String urlNameString = url + (StringUtils.isNotEmpty(param) ? "?" + param : ""); URL realUrl = new URL(urlNameString); // 打开和URL之间的连接 URLConnection connection = realUrl.openConnection(); // 设置通用的请求属性 connection.setRequestProperty("accept", "*/*"); connection.setRequestProperty("connection", "Keep-Alive"); connection.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)"); connection.connect(); //返回401时需再次用用户名和密码请求 //此情况返回服务器的 WWW-Authenticate 信息 if (((HttpURLConnection) connection).getResponseCode() == 401) { Map<String, List<String>> map = connection.getHeaderFields(); return "WWW-Authenticate:" + map.get("WWW-Authenticate").get(0); } in = new BufferedReader(new InputStreamReader(connection.getInputStream())); String line; while ((line = in.readLine()) != null) { result.append(line); } } catch (Exception e) {
      throw new RuntimeException(“get请求发送失败”,e);
      }
      // 使用finally块来关闭输入流
      finally {
      try {
      if (in != null) in.close();
      } catch (Exception e2) {
      e2.printStackTrace();
      }
      }
      return result.toString();
      }
    /**
    • HTTP set request property
      *
    • @param connection HttpConnection
    • @param wwwAuth 授权auth
    • @param realUrl 实际url
    • @param username 验证所需的用户名
    • @param password 验证所需的密码
    • @param method 请求方式
    • @param type 返回xml和json格式数据,默认xml,传入json返回json数据
      */
      private static void setRequestProperty(HttpURLConnection connection, String wwwAuth, URL realUrl, String username, String password, String method, String type)
      throws IOException { if (type != null && type.equals(“json”)) {
      // 返回json
      connection.setRequestProperty(“accept”, “application/json;charset=UTF-8”);
      connection.setRequestProperty(“Content-Type”,”application/json;charset=UTF-8″);
      connection.setRequestProperty(“connection”, “Keep-Alive”);
      connection.setRequestProperty(“user-agent”,
      “Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)”);
      } else {
      // 返回xml
      if (!method.equals(GET)) {
      connection.setRequestProperty(“Content-Type”,”application/json;charset=UTF-8″);
      }
      connection.setRequestProperty(“accept”, “/“);
      connection.setRequestProperty(“connection”, “Keep-Alive”);
      // connection.setRequestProperty(“Cache-Control”, “no-cache”);
      connection.setRequestProperty(“user-agent”,
      “Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)”); }
      //授权信息
      String authentication = getAuthorization(wwwAuth, realUrl.getPath(), username, password, method);
      connection.setRequestProperty(“Authorization”, authentication);
      }
    /**
    • 格式化请求返回信息,支持json和xml格式
    • @param connection HttpConnection
    • @param type 指定返回数据格式,json、xml,默认xml
    • @return 返回数据
      */
      private static String formatResultInfo(HttpURLConnection connection, String type) throws IOException {
      String result = “”;
      if (type != null && type.equals(“json”)) {
      result = String.format(“{\”errCode\”:%s, \”message\”:%s}”,connection.getResponseCode(),connection.getResponseMessage());
      } else {
      result = String.format(” “
      + ” ” + ” %d” + ” %s” + ” “,connection.getResponseCode(),connection.getResponseMessage());
      }
      return result;
      }

}

作者 east
Java 11月 8,2020

GAT1400人脸相关接口

人脸相关接口

批量人脸新增

1.接口概览

URI /VIID/Faces
方法 查询字符串 消息体 返回结果
POST 无 <FaceList> <ResponseStatusList>
备注  

2.消息体特征参数

消息体结构参考C.9,字段定义参考A.9 。

3.返回消息

         结构参考C.25,字段定义参考A.26。

4.示例

URI /VIID/ Faces
请求方法 POST
请求头 参见请求参数
请求体 {     “FaceListObject”: {         “FaceObject”: [             {                 “FaceID”: “650100000011900000010220171219100515999830656599”,                 “InfoKind”: 1,                 “SourceID”: “66000000001190123456022017120110101000007”,                 “DeviceID”: “55000111221190000007”,                 “LeftTopX”: 1,                 “LeftTopY”: 1,                 “RightBtmX”: 1,                 “RightBtmY”: 1,                 “LocationMarkTime”: “19981230010000”,                 “FaceAppearTime”: “19981230010000”,                 “FaceDisAppearTime”: “19981230010000”,                 “IDType”: “111”,                 “IDNumber”: “1”,                 “Name”: “大华”,                 “UsedName”: “dahua”,                 “Alias”: “dahua”,                 “GenderCode”: “1”,                 “AgeUpLimit”: 10,                 “AgeLowerLimit”: 20,                 “EthicCode”: “01”,                 “NationalityCode”: “CHN”,                 “NativeCityCode”: “330108”,                 “ResidenceAdminDivision”: “330100”,                 “ChineseAccentCode”: “1”,                 “JobCategory”: “1”,                 “AccompanyNumber”: 1,                 “SkinColor”: “1”,                 “HairStyle”: “1”,                 “HairColor”: “1”,                 “FaceStyle”: “1”,                 “FacialFeature”: “1”,                 “PhysicalFeature”: “1”,                 “RespiratorColor”: “1”,                 “CapStyle”: “1”,                 “CapColor”: “1”,                 “GlassStyle”: “1”,                 “GlassColor”: “1”,                 “IsDriver”: 1,                 “IsForeigner”: 1,                 “PassportType”: “1”,                 “ImmigrantTypeCode”: “1”,                 “IsSuspectedTerrorist”: 1,                 “SuspectedTerroristNumber”: “1”,                 “IsCriminalInvolved”: 1,                 “CriminalInvolvedSpecilisationCode”: “1”,                 “BodySpeciallMark”: “1”,                 “CrimeMethod”: “1”,                 “CrimeCharacterCode”: “111”,                 “EscapedCriminalNumber”: “11111111111111111111111”,                 “IsDetainees”: 1,                 “DetentionHouseCode”: “111111111”,                 “DetaineesIdentity”: “1”,                 “DetaineesSpecialIdentity”: “1”,                 “MemberTypeCode”: “1”,                 “IsVictim”: 1,                 “VictimType”: “1”,                 “InjuredDegree”: “1”,                 “CorpseConditionCode”: “1”,                 “IsSuspiciousPerson”: 1,                 “Attitude”: 1,                 “Similaritydegree”: 1,                 “EyebrowStyle”: “1”,                 “NoseStyle”: “1”,                 “MustacheStyle”: “1”,                 “LipStyle”: “1”,                 “WrinklePouch”: “1”,                 “AcneStain”: “1”,                 “FreckleBirthmark”: “1”,                 “ScarDimple”: “1”,                 “OtherFeature”: “1”,                 “SubImageList”: {                     “SubImageInfoObject”: [                         {                             “ImageID”: “33020300001190000001022017122111111100001”,                             “EventSort”: 11,                             “DeviceID”: “33070299011190000253”,                             “StoragePath”: “http://10.33.6.108:9080/testx_108_20170908/a2421c4fde6d4a74ac923e8470d6e7fa.jpg”,                             “Type”: “01”,                             “FileFormat”: “Jpeg”,                             “ShotTime”: “20170825032455”,                             “Width”: 437,                             “Height”: 350                         }                     ]                 }             }         ]     } }
响应体 {     “ResponseStatusListObject”: {         “ResponseStatusObject”: [             {                 “RequestURL”: “http://localhost:8080/VIID/Faces”,                 “StatusCode”: 0,                 “StatusString”: “正常”,                 “Id”: “650100000011900000010220171219100515999830656599”,                 “LocalTime”: “20171222162927”             }         ]     } }

批量人脸查询

1.接口概览

URI /VIID/Faces
方法 查询字符串 消息体 返回结果
GET Face属性键-值对 无 < FaceList>
备注  

2.查询字符串

查询指令为Face属性键-值对,特征属性定义参考A.9 。

3.返回结果

结构参考C.9,字段定义参考A.9。

4.示例

URI /VIID/ Faces
请求方法 GET
请求头 参见请求参数
查询参数 ?FaceID =650100000011900000010220171219100515999830656599 &InfoKind=1 &IDType=111 &LocationMarkTime=19981230010000…
响应体 {     “FaceListObject”: {         “FaceObject”: [             {                 “FaceID”: “650100000011900000010220171219100515999830656489”,                 “InfoKind”: 1,                 “SourceID”: “66000000001190123456022017120110101000007”,                 “DeviceID”: “55000111221190000007”,                 “LeftTopX”: 1,                 “LeftTopY”: 1,                 “RightBtmX”: 1,                 “RightBtmY”: 1,                 “LocationMarkTime”: “19981230010000”,                 “FaceAppearTime”: “19981230010000”,                 “FaceDisAppearTime”: “19981230010000”,                 “IDType”: “111”,                 “IDNumber”: “1”,                 “Name”: “大华”,                 “UsedName”: “dahua”,                 “Alias”: “dahua”,                 “GenderCode”: “1”,                 “AgeUpLimit”: 10,                 “AgeLowerLimit”: 20,                 “EthicCode”: “1”,                 “NationalityCode”: “CHN”,                 “NativeCityCode”: “330108”,                 “ResidenceAdminDivision”: “330100”,                 “ChineseAccentCode”: “1”,                 “JobCategory”: “1”,                 “AccompanyNumber”: 1,                 “SkinColor”: “1”,                 “HairStyle”: “1”,                 “HairColor”: “1”,                 “FaceStyle”: “1”,                 “FacialFeature”: “1”,                 “PhysicalFeature”: “1”,                 “RespiratorColor”: “1”,                 “CapStyle”: “1”,                 “CapColor”: “1”,                 “GlassStyle”: “1”,                 “GlassColor”: “1”,                 “IsDriver”: 1,                 “IsForeigner”: 1,                 “PassportType”: “1”,                 “ImmigrantTypeCode”: “1”,                 “IsSuspectedTerrorist”: 1,                 “SuspectedTerroristNumber”: “1”,                 “IsCriminalInvolved”: 1,                 “CriminalInvolvedSpecilisationCode”: “1”,                 “BodySpeciallMark”: “1”,                 “CrimeMethod”: “1”,                 “CrimeCharacterCode”: “111”,                 “EscapedCriminalNumber”: “11111111111111111111111”,                 “IsDetainees”: 1,                 “DetentionHouseCode”: “111111111”,                 “DetaineesIdentity”: “1”,                 “DetaineesSpecialIdentity”: “1”,                 “MemberTypeCode”: “1”,                 “IsVictim”: 1,                 “VictimType”: “1”,                 “InjuredDegree”: “1”,                 “CorpseConditionCode”: “1”,                 “IsSuspiciousPerson”: 1,                 “Attitude”: 1,                 “Similaritydegree”: 1,                 “EyebrowStyle”: “1”,                 “NoseStyle”: “1”,                 “MustacheStyle”: “1”,                 “LipStyle”: “1”,                 “WrinklePouch”: “1”,                 “AcneStain”: “1”,                 “FreckleBirthmark”: “1”,                 “ScarDimple”: “1”,                 “OtherFeature”: “1”,                 “SubImageList”: {                     “SubImageInfoObject”: [                         {                             “ImageID”: “33020300001190000001022017122111111100001”,                             “EventSort”: 1,                             “DeviceID”: “33070299011190000253”,                             “StoragePath”: “http://172.26.8.236:11180/pictures//07314a17009347ab86d1d4a9b52abd1d.jpg”,                             “Type”: “11”,                             “FileFormat”: “Jpeg”,                             “ShotTime”: “20171221104550”,                             “Width”: 358,                             “Height”: 441                         }                     ]                 }             }         ]     } }

批量人脸修改

1.   接口概览

URI /VIID/Faces
方法 查询字符串 消息体 返回结果
PUT 无 <FaceList> <ResponseStatusList>
备注 消息体中FaceID必填,否则操作无效

2.消息体特征参数

消息体结构参考C.9,字段定义参考A.9 。

3.返回结果

         结构参考C.25,字段定义参考A.26。

4.示例

URI /VIID/Faces
请求方法 PUT
请求头 参见请求参数
请求体 {     “FaceListObject”: {         “FaceObject”: [             {                 “FaceID”: “650100000011900000010220171219100515999830656489”,                 “InfoKind”: 2,                 “LeftTopX”: 10,                 “LeftTopY”: 10,                 “RightBtmX”: 10,                 “RightBtmY”: 10,                 “NativeCityCode”: “330109”,                 “ResidenceAdminDivision”: “330101”,                 “ChineseAccentCode”: “2”,                 “JobCategory”: “2”,                 “AccompanyNumber”: 2,                 “SkinColor”: “2”,                 “HairStyle”: “2”,                 “HairColor”: “2”,                 “FaceStyle”: “2”,                 “FacialFeature”: “2”,                 “PhysicalFeature”: “2” …             }         ]     } }            
响应体 {     “ResponseStatusListObject”: {         “ResponseStatusObject”: [             {                 “RequestURL”: “http://localhost:8080/VIID/Faces”,                 “StatusCode”: 0,                 “StatusString”: “正常”,                 “Id”: “650100000011900000010220171219100515999830656489”,                 “LocalTime”: “20171223094319”             }         ]     } }

批量人脸删除

1.接口概览

URI /VIID/Faces
方法 请求参数 消息体 返回结果
DELETE 键为IDList,值为用英文半角分号”,”分隔的字符串 无 <ResponseStatusList>
备注  

2.请求参数

IDList=<FaceID >,< FaceID >。

3.返回结果

         结构参考C.25,字段定义参考A.26。

4.示例

URI /VIID/ Faces
请求方法 DELETE
请求头 参见请求参数
请求参数 ?IDList=650100000011900000010220171219100515999830656489,650100000011900000010220171219100515999830656490  
响应体 {     “ResponseStatusListObject”: {         “ResponseStatusObject”: [             {                 “RequestURL”: “http://localhost:8080/VIID/Faces”,                 “StatusCode”: 0,                 “StatusString”: “正常”,                 “Id”: “650100000011900000010220171219100515999830656489”,                 “LocalTime”: “20171223094319”             },             {                 “RequestURL”: “http://localhost:8080/VIID/Faces”,                 “StatusCode”: 0,                 “StatusString”: “正常”,                 “Id”: “650100000011900000010220171219100515999830656490”,                 “LocalTime”: “20171223094319”             }         ]     } }

单个人脸查询

1.接口概览

URI /VIID/Faces/<FaceID>
方法 请求参数 消息体 返回结果
GET 无 无 <Face>
备注  

2.   请求参数

无

3.返回结果

         结构参考C.9,字段定义参考A.9。

4.示例

URI /VIID/Faces/650100000011900000010220171219100515999830656489
请求方法 GET
请求头 参见请求参数
请求体 无
响应体 {     “FaceObject”: {         “FaceID”: “650100000011900000010220171219100515999830656489”,         “InfoKind”: 2,         “SourceID”: “66000000001190123456022017120110101000007”,         “DeviceID”: “55000111221190000007”,         “LeftTopX”: 10,         “LeftTopY”: 10,         “RightBtmX”: 10,         “RightBtmY”: 10,         “LocationMarkTime”: “19981230010000”,         “FaceAppearTime”: “19981230010000”,         “FaceDisAppearTime”: “19981230010000”,         “IDType”: “111”,         “IDNumber”: “1”,         “Name”: “大华”,         “UsedName”: “dahua”,         “Alias”: “dahua”,         “GenderCode”: “1”,         “AgeUpLimit”: 10,         “AgeLowerLimit”: 20,         “EthicCode”: “1”,         “NationalityCode”: “CHN”,         “NativeCityCode”: “330109”,         “ResidenceAdminDivision”: “330101”,         “ChineseAccentCode”: “2”,         “JobCategory”: “2”,         “AccompanyNumber”: 2,         “SkinColor”: “2”,         “HairStyle”: “2”,         “HairColor”: “2”,         “FaceStyle”: “2”,         “FacialFeature”: “2”,         “PhysicalFeature”: “2”,         “RespiratorColor”: “1”,         “CapStyle”: “1”,         “CapColor”: “1”,         “GlassStyle”: “1”,         “GlassColor”: “1”,         “IsDriver”: 1,         “IsForeigner”: 1,         “PassportType”: “1”,         “ImmigrantTypeCode”: “1”,         “IsSuspectedTerrorist”: 1,         “SuspectedTerroristNumber”: “1”,         “IsCriminalInvolved”: 1,         “CriminalInvolvedSpecilisationCode”: “1”,         “BodySpeciallMark”: “1”,         “CrimeMethod”: “1”,         “CrimeCharacterCode”: “111”,         “EscapedCriminalNumber”: “11111111111111111111111”,         “IsDetainees”: 1,         “DetentionHouseCode”: “111111111”,         “DetaineesIdentity”: “1”,         “DetaineesSpecialIdentity”: “1”,         “MemberTypeCode”: “1”,         “IsVictim”: 1,         “VictimType”: “1”,         “InjuredDegree”: “1”,         “CorpseConditionCode”: “1”,         “IsSuspiciousPerson”: 1,         “Attitude”: 1,         “Similaritydegree”: 1,         “EyebrowStyle”: “1”,         “NoseStyle”: “1”,         “MustacheStyle”: “1”,         “LipStyle”: “1”,         “WrinklePouch”: “1”,         “AcneStain”: “1”,         “FreckleBirthmark”: “1”,         “ScarDimple”: “1”,         “OtherFeature”: “1”,         “SubImageList”: {             “SubImageInfoObject”: [                 {                     “ImageID”: “33020300001190000001022017122111111100001”,                     “EventSort”: 4,                     “DeviceID”: “55220299011190000253”,                     “StoragePath”: “http://localhost:9080/testx_108_20170908/a2421c4fde6d4a74ac923e8470d6e7fa.jpg”,                     “Type”: “01”,                     “FileFormat”: “Jpeg”,                     “ShotTime”: “20170925032455”,                     “Width”: 437,                     “Height”: 350                 }             ]         }     } }

单个人脸修改

1.接口概览

URI /VIID/Faces/<FaceID>
方法 请求参数 消息体 返回结果
PUT  无 <Face> <ResponseStatus>
备注  

2.消息体特征参数

         结构参考C.9,字段定义参考A.9。

3.返回结果

         结构参考C.25,字段定义参考A.26。

4.示例

URI /VIID/Faces/650100000011900000010220171219100515999830656489
请求方法 PUT
请求头 参见请求参数
请求体 {     “FaceObject”: {         “FaceID”: “650100000011900000010220171219100515999830656489”,         “LeftTopX”: 10,         “LeftTopY”: 10,         “RightBtmX”: 10,         “RightBtmY”: 10 …     } }
响应体 {     “ResponseStatusObject”: {         “RequestURL”: “http://localhost:8080 /VIID/Faces/650100000011900000010220171219100515999830656589”,         “StatusCode”: 0,         “StatusString”: “正常”,         “Id”: “650100000011900000010220171219100515999830656589”,         “LocalTime”: “20171223135905”     } }

单个人脸删除

1.接口概览

URI /VIID/Faces/<FaceID>
方法 请求参数 消息体 返回结果
DELETE  无 无 <ResponseStatus>
备注  

2.请求参数

无

3.返回结果

         结构参考C.25,字段定义参考A.26。

4.示例

URI /VIID/Faces/650100000011900000010220171219100515999830656489
请求方法 DELETE
请求头 参见请求参数
请求体  
响应体 {     “ResponseStatusObject”: {         “RequestURL”: “http://localhost:8080 /VIID/Faces/650100000011900000010220171219100515999830656489”,         “StatusCode”: 0,         “StatusString”: “正常”,         “Id”: “650100000011900000010220171219100515999830656489”,         “LocalTime”: “20171223135905”     } }
作者 east
Java 11月 8,2020

GAT1400视图库卡口相关接口

卡口相关接口

卡口查询

1.接口概览

URI /VIID/Tollgates
方法 查询字符串 消息体 返回结果
GET Tollgate属性键-值对 无 <TollgateList>
备注  

2.查询字符串

查询指令为Tollgate属性键-值对,特征属性定义参考A.3 。

3.返回结果

         结构参考C.3,字段定义参考A.3。

4.示例

URI /VIID/Tollgates
请求方法 GET
请求头 参见请求参数
查询参数 ?TollgateID=65010000001210000080 & Name =huanggengxin & Longitude =13.145678 &…
响应体 {     “TollgateListObject”: {         “TollgateObject”: [             {                 “TollgateID”: “65010000001210000080”,                 “Name”: “huanggengxin”,                 “Longitude”: 13.145678,                 “Latitude”: 14.253654,                 “Place”: “jiedao”,                 “Status”: 1,                 “TollgateCat”: “30”,                 “TollgateCat2”: 80,                 “LaneNum”: 7,                 “OrgCode”: 650095768654,                 “ActiveTime”: “20171111122324”             }         ]     } }

车道相关接口

查询车道

1.接口概览

URI /VIID/Lanes
方法 查询字符串 消息体 返回结果
GET Lane 属性键-值对 无 <LaneList>
备注 Lane、LaneList 的定义应符合 C.4中的规定。

2.消息体特征参数

Lane 属性键-值对,字段定义参考A.4。

3.返回结果

         结构参考C.25,字段定义参考A.26。

4.示例

URI /VIID/Lanes
请求方法 GET
请求头 参见请求参数
查询参数 ?TollgateID=65010000001210000001 &LaneId=4 &LaneNo=1&…
响应体 {     “LaneListObject”: {         “LaneObject”: [             {                 “TollgateID”: “65010000001210000001”,                 “LaneId”: 4,                 “LaneNo”: 1,                 “Name”: “123123123”,                 “Direction”: 1,                 “Desc”: “123123123”,                 “MaxSpeed”: 120,                 “CityPass”: 1,                 “ApeID”: “65010000001190000001”             }         ]     } }

机动车相关接口

批量机动车新增

1.接口概览

URI /VIID/MotorVehicles
方法 查询字符串 消息体 返回结果
POST 无 <MotorVehicleList > <ResponseStatusList>
备注  

2.消息体特征参数

消息体结构参考C.10,字段定义参考A.10。

3.返回结果

         结构参考C.25,字段定义参考A.26。

4.示例

URI /VIID/MotorVehicles
请求方法 POST
请求头 参见请求参数
请求体 {     “MotorVehicleListObject”: {         “MotorVehicleObject”: [             {                 “MotorVehicleID”: “330101010012100000010220171018080608022060269899”,                 “InfoKind”: 1,                 “SourceID”: “33010101001210000001022017101808060802206”,                 “TollgateID”: “2141245”,                 “DeviceID”: “65010000001190000001”,                 “StorageUrl1”: “9527/upload/122/20130901/00/0524-NAS221-50151415-AS.jpg”,                 “StorageUrl3”: “3”,                 “StorageUrl5”: “1”,                 “LeftTopX”: 1,                 “LeftTopY”: 2,                 “RightBtmX”: 3,                 “RightBtmY”: 4,                 “LaneNo”: 1,                 “HasPlate”: “1”,                 “PlateClass”: “99”,                 “PlateColor”: “99”,                 “PlateNo”: “苏NF5676”,                 “PlateNoAttach”: “1”,                 “PlateDescribe”: “12”,                 “IsDecked”: “1”,                 “IsAltered”: “1”,                 “IsCovered”: “1”,                 “Speed”: 8,                 “Direction”: “0”,                 “DrivingStatusCode”: “1”,                 “UsingPropertiesCode”: “1”,                 “VehicleClass”: “1”,                 “VehicleBrand”: “1”,                 “VehicleModel”: “1”,                 “VehicleStyles”: “12”,                 “VehicleLength”: 0,                 “VehicleWidth”: 23,                 “VehicleHeight”: 31,                 “VehicleColor”: “1”,                 “VehicleColorDepth”: “2”,                 “VehicleHood”: “4”,                 “VehicleTrunk”: “5”,                 “VehicleWheel”: “1”,                 “WheelPrintedPattern”: “1”,                 “VehicleWindow”: “1”,                 “VehicleRoof”: “1”,                 “VehicleDoor”: “1”,                 “SideOfVehicle”: “1”,                 “CarOfVehicle”: “1”,                 “RearviewMirror”: “1”,                 “VehicleChassis”: “1”,                 “VehicleShielding”: “1”,                 “FilmColor”: “1”,                 “IsModified”: “1”,                 “HitMarkInfo”: “1”,                 “VehicleBodyDesc”: “1”,                 “VehicleFrontItem”: “1”,                 “DescOfFrontItem”: “1”,                 “VehicleRearItem”: “4”,                 “DescOfRearItem”: “3”,                 “NumOfPassenger”: 2,                 “PassTime”: “20160912220107”,                 “NameOfPassedRoad”: “12”,                 “IsSuspicious”: “1”,                 “PlateReliability”: “1”,                 “PlateCharReliability”: “苏-80,B-90,1-90,2-88,3-90,4-67,5-87”,                 “BrandReliability”: “1”,                 “SubImageList”: {                     “SubImageInfoObject”: [                         {                             “ImageID”: “33020300001190000001022017122111111100001”,                             “EventSort”: 4,                             “DeviceID”: “55220299011190000253”,                             “StoragePath”: “http://localhost:9080/testx_108_20170908/a2421c4fde6d4a74ac923e8470d6e7fa.jpg”,                             “Type”: “01”,                             “FileFormat”: “Jpeg”,                             “ShotTime”: “20170925032455”,                             “Width”: 437,                             “Height”: 350                         }                     ]                 }             }         ]     } }
响应体 {     “ResponseStatusListObject”: {         “ResponseStatusObject”: [             {                 “RequestURL”: “http://localhost:8080/VIID/MotorVehicles”,                 “StatusCode”: 0,                 “StatusString”: “正常”,                 “Id”: “330101010012100000010220171018080608022060269899”,                 “LocalTime”: “20171222104143”             }         ]     } }

批量机动车查询

1.接口概览

URI /VIID/MotorVehicles
方法 查询字符串 消息体 返回结果
GET MotorVehicle属性键-值对 无 < MotorVehicleList>
备注  

2. 查询字符串

查询指令为MotorVehicle属性键-值对,特征属性定义参考A.10 。

3.返回结果

         结构参考C.25,字段定义参考A.26。

4.示例

URI /VIID/MotorVehicles
请求方法 GET
请求头 参见请求参数
查询参数 ?MotorVehicleID=330101010012100000010220171018080608022060269895 &InfoKind=1 &SourceID=33010101001210000001022017101808060802206 &DeviceID=65010000001190000001&…
响应体 {     “MotorVehicleListObject”: {         “MotorVehicleObject”: [             {                 “MotorVehicleID”: “330101010012100000010220171018080608022060269895”,                 “InfoKind”: 1,                 “SourceID”: “33010101001210000001022017101808060802206”,                 “DeviceID”: “65010000001190000001”,                 “StorageUrl1”: “9527/upload/122/20130901/00/0524-NAS221-50151415-AS.jpg”,                 “StorageUrl3”: “3”,                 “StorageUrl5”: “1”,                 “LeftTopX”: 1,                 “LeftTopY”: 2,                 “RightBtmX”: 3,                 “RightBtmY”: 4,                 “LaneNo”: 1,                 “HasPlate”: “1”,                 “PlateClass”: “99”,                 “PlateColor”: “99”,                 “PlateNo”: “苏NF5676”,                 “PlateNoAttach”: “1”,                 “PlateDescribe”: “12”,                 “IsDecked”: “1”,                 “IsAltered”: “1”,                 “IsCovered”: “1”,                 “Speed”: 8,                 “Direction”: “9”,                 “DrivingStatusCode”: “1”,                 “VehicleClass”: “X99”,                 “VehicleBrand”: “1”,                 “VehicleModel”: “1”,                 “VehicleStyles”: “12”,                 “VehicleLength”: 0,                 “VehicleColor”: “1”,                 “VehicleColorDepth”: “2”,                 “VehicleHood”: “4”,                 “VehicleTrunk”: “5”,                 “VehicleWheel”: “1”,                 “WheelPrintedPattern”: “1”,                 “VehicleWindow”: “1”,                 “VehicleRoof”: “1”,                 “VehicleDoor”: “1”,                 “SideOfVehicle”: “1”,                 “CarOfVehicle”: “1”,                 “RearviewMirror”: “1”,                 “VehicleChassis”: “1”,                 “VehicleShielding”: “1”,                 “FilmColor”: “1”,                 “HitMarkInfo”: “1”,                 “VehicleBodyDesc”: “1”,                 “VehicleFrontItem”: “1”,                 “DescOfFrontItem”: “1”,                 “VehicleRearItem”: “4”,                 “DescOfRearItem”: “3”,                 “PassTime”: “20160912220107”,                 “NameOfPassedRoad”: “12”,                 “IsSuspicious”: “1”,                 “SafetyBelt”: 0,                 “PlateReliability”: “1”,                 “PlateCharReliability”: “苏-80,B-90,1-90,2-88,3-90,4-67,5-87”,                 “BrandReliability”: “1”,                 “SubImageList”: {                     “SubImageInfoObject”: [                         {                             “ImageID”: “33020300001190000001022017122111111100001”,                             “EventSort”: 1,                             “DeviceID”: “33070299011190000253”,                             “StoragePath”: “http://localhost:8080/pictures//07314a17009347ab86d1d4a9b52abd1d.jpg”,                             “Type”: “11”,                             “FileFormat”: “Jpeg”,                             “ShotTime”: “20171221104550”,                             “Width”: 100,                             “Height”: 100                         }                     ]                 }             }         ]     } }

批量机动车修改

1.接口概览

URI /VIID/MotorVehicles
方法 查询字符串 消息体 返回结果
PUT 无 <MotorVehicleList > <ResponseStatusList>
备注  

2.消息体特征参数

消息体结构参考C.10,字段定义参考A.10 。

3.返回结果

         结构参考C.25,字段定义参考A.26。

4.示例

URI /VIID/MotorVehicles
请求方法 PUT
请求头 参见请求参数
请求体 {     “MotorVehicleListObject”: {         “MotorVehicleObject”: [             {                 “MotorVehicleID”: “330101010012100000010220171018080608022060269899”,                 “InfoKind”: 1,                 “SourceID”: “33010101001210000001022017101808060802206”,                 “TollgateID”: “2141245”,                 “DeviceID”: “65010000001190000001”,                 “StorageUrl1”: “9527/upload/122/20130901/00/0524-NAS221-50151415-AS.jpg”,                 “StorageUrl3”: “3”,                 “StorageUrl5”: “1”,                 “LeftTopX”: 1,                 “LeftTopY”: 2,                 “RightBtmX”: 3,                 “RightBtmY”: 4,                 “LaneNo”: 1,                 “HasPlate”: “1”,                 “PlateClass”: “99”,                 “PlateColor”: “99”,                 “PlateNo”: “京A66666” …….             }         ]     } }
响应体 {     “ResponseStatusListObject”: {         “ResponseStatusObject”: [             {                 “RequestURL”: “http://localhost:8080/VIID/MotorVehicles”,                 “StatusCode”: 0,                 “StatusString”: “正常”,                 “Id”: “330101010012100000010220171018080608022060269899”,                 “LocalTime”: “20171223102656”             }         ]     } }

批量机动车删除

1.   接口概览

URI /VIID/MotorVehicles
方法 请求参数 消息体 返回结果
DELETE 键为IDList,值为用英文半角分号”,”分隔的字符串 无 <ResponseStatusList>
备注  

2. 请求参数

IDList=<MotorVehicleID>,<MotorVehicleID>。

3.返回结果

         结构参考C.25,字段定义参考A.26。

4.示例

URI /VIID/MotorVehicles
请求方法 DELETE
请求头 参见请求参数
请求参数 ?IDList=330101010012100000010220171018080608022060269895, 330101010012100000010220171018080608022060269899
响应体 {     “ResponseStatusListObject”: {         “ResponseStatusObject”: [             {                 “RequestURL”: “http://localhost:9080/VIID/MotorVehicles”,                 “StatusCode”: 0,                 “StatusString”: “正常”,                 “LocalTime”: “20171223103213”             },             {                 “RequestURL”: “http://localhost:9080/VIID/MotorVehicles”,                 “StatusCode”: 0,                 “StatusString”: “正常”,                 “LocalTime”: “20171223103213”             }         ]     } }

单个机动车查询

1.接口概览

URI /VIID/MotorVehicles/<ID>
方法 查询字符串 消息体 返回结果
GET 无 无 < MotorVehicle>
备注  

2.返回结果

         结构参考C.25,字段定义参考A.26。

3.示例

URI /VIID/MotorVehicles/330203000011900000010220171218150122000010200005
请求方法 GET
请求头 参见请求参数
响应体 {     “MotorVehicleObject”: {         “MotorVehicleID”: “330203000011900000010220171218150122000010200005”,         “InfoKind”: 1,         “SourceID”: “33020300001190000001022017122111111100001”,         “DeviceID”: “65010000001190000001”,         “StorageUrl1”: “http://localhost:8080/1.jpg”,         “StorageUrl2”: “http://localhost:8080/2.jpg”,         “StorageUrl3”: “http://localhost:8080/3.jpg”,         “StorageUrl4”: “http://localhost:8080/4.jpg”,         “StorageUrl5”: “http://localhost:8080/5.jpg”,         “LeftTopX”: 1,         “LeftTopY”: 2,         “RightBtmX”: 3,         “RightBtmY”: 4,         “MarkTime”: “20171102101241”,         “DisappearTime”: “20171102101241”,         “LaneNo”: 1,         “HasPlate”: “1”,         “PlateClass”: “99”,         “PlateColor”: “1”,         “PlateNo”: “京A66666”,         “PlateNoAttach”: “京A88888”,         “PlateDescribe”: “这是一个车牌号的描述”,         “IsDecked”: “1”,         “IsAltered”: “1”,         “IsCovered”: “1”,         “Speed”: 80,         “Direction”: “9”,         “DrivingStatusCode”: “01”,         “VehicleClass”: “X99”,         “VehicleBrand”: “0”,         “VehicleModel”: “这是车辆型号描述”,         “VehicleStyles”: “2000年”,         “VehicleLength”: 12345,         “VehicleColor”: “1”,         “VehicleColorDepth”: “1”,         “VehicleHood”: “这是车前盖的描述”,         “VehicleTrunk”: “这是车后盖的描述”,         “VehicleWheel”: “这是车轮的描述”,         “WheelPrintedPattern”: “11”,         “VehicleWindow”: “这是车窗的描述”,         “VehicleRoof”: “这是车顶的描述”,         “VehicleDoor”: “这是车门的描述”,         “SideOfVehicle”: “这是车侧的描述”,         “CarOfVehicle”: “这是车厢的描述”,         “RearviewMirror”: “这是后视镜的描述”,         “VehicleChassis”: “这是底盘的描述”,         “VehicleShielding”: “这是遮挡的描述”,         “FilmColor”: “1”,         “HitMarkInfo”: “1”,         “VehicleBodyDesc”: “这是车身的描述”,         “VehicleFrontItem”: “1”,         “DescOfFrontItem”: “这是车前部物品描述”,         “VehicleRearItem”: “1”,         “DescOfRearItem”: “这是车后部物品描述”,         “PassTime”: “20171218150122”,         “NameOfPassedRoad”: “这是经过道路的名称描述”,         “IsSuspicious”: “1”,         “Sunvisor”: 1,         “SafetyBelt”: 1,         “Calling”: 1,         “PlateReliability”: “80”,         “PlateCharReliability”: “苏-80,B-90,1-90,2-88,3-90,4-67,5-87”,         “BrandReliability”: “88”,         “SubImageList”: {             “SubImageInfoObject”: [                 {                     “ImageID”: “33020300001190000001022017122111111100001”,                     “EventSort”: 4,                     “DeviceID”: “55220299011190000253”,                     “StoragePath”: “http://localhost:8080/testx_108_20170908/a2421c4fde6d4a74ac923e8470d6e7fa.jpg”,                     “Type”: “01”,                     “FileFormat”: “Jpeg”,                     “ShotTime”: “20170925032455”,                     “Width”: 437,                     “Height”: 350                 }             ]         }     } }

单个机动车修改

1.接口概览

URI /VIID/MotorVehicles/<ID>
方法 查询字符串 消息体 返回结果
PUT 无 <MotorVehicle> <ResponseStatus>
备注  

2.消息体特征参数

消息体结构参考C.10,字段定义参考A.10 。

3.返回结果

         结构参考C.25,字段定义参考A.26。

4.示例

URI /VIID/MotorVehicles/330203000011900000010220171218150122000010200005
请求方法 PUT
请求头 参见请求参数
请求体 {     “MotorVehicleObject”: {         “InfoKind”: 1,         “SourceID”: “33010101001210000001022017101808060802206”,         “TollgateID”: “2141245”,         “DeviceID”: “65010000001190000001”,         “StorageUrl1”: “9527/upload/122/20130901/00/0524-NAS221-50151415-AS.jpg”,         “StorageUrl3”: “3”,         “StorageUrl5”: “1”,         “LeftTopX”: 1,         “LeftTopY”: 2,         “RightBtmX”: 3,         “RightBtmY”: 4,         “LaneNo”: 1,         “HasPlate”: “1”,         “PlateClass”: “99”,         “PlateColor”: “99”,         “PlateNo”: “苏NF5676”,         “PlateNoAttach”: “1”,         “PlateDescribe”: “12”,         “IsDecked”: “1”,         “IsAltered”: “1”,         “IsCovered”: “1”,         “Speed”: 8,         “Direction”: “0”,         “DrivingStatusCode”: “1”,         “UsingPropertiesCode”: “1”,         “VehicleClass”: “1”,         “VehicleBrand”: “1”,         “VehicleModel”: “1”,         “VehicleStyles”: “12”,         “VehicleLength”: 0,         “VehicleWidth”: 23,         “VehicleHeight”: 31,         “VehicleColor”: “1”,         “VehicleColorDepth”: “2”,         “VehicleHood”: “4”,         “VehicleTrunk”: “5”,         “VehicleWheel”: “1”,         “WheelPrintedPattern”: “1”,         “VehicleWindow”: “1”,         “VehicleRoof”: “1”,         “VehicleDoor”: “1”,         “SideOfVehicle”: “1”,         “CarOfVehicle”: “1”,         “RearviewMirror”: “1”,         “VehicleChassis”: “1”,         “VehicleShielding”: “1”,         “FilmColor”: “1”,         “IsModified”: “1”,         “HitMarkInfo”: “1”,         “VehicleBodyDesc”: “1”,         “VehicleFrontItem”: “1”,         “DescOfFrontItem”: “1”,         “VehicleRearItem”: “4”,         “DescOfRearItem”: “3”,         “NumOfPassenger”: 2,         “PassTime”: “20160912220107”,         “NameOfPassedRoad”: “12”,         “IsSuspicious”: “1”,         “PlateReliability”: “1”,         “PlateCharReliability”: “苏-80,B-90,1-90,2-88,3-90,4-67,5-87”,         “BrandReliability”: “1”,         “SubImageList”: {             “SubImageInfoObject”: [                 {                     “ImageID”: “33020300001190000001022017122111111100001”,                     “EventSort”: 4,                     “DeviceID”: “55220299011190000253”,                     “StoragePath”: “http://localhost:9080/testx_108_20170908/a2421c4fde6d4a74ac923e8470d6e7fa.jpg”,                     “Type”: “01”,                     “FileFormat”: “Jpeg”,                     “ShotTime”: “20170925032455”,                     “Width”: 437,                     “Height”: 350                 }             ]         }     } }
响应体 {     “ResponseStatusObject”: {         “RequestURL”: “http://localhost:8080/VIID/MotorVehicles/330203000011900000010220171218150122000010200005”,         “StatusCode”: 0,         “StatusString”: “正常”,         “Id”: “330203000011900000010220171218150122000010200005”,         “LocalTime”: “20171223135728”     } }

单个机动车删除

1.接口概览

URI /VIID/MotorVehicles/<ID>
方法 查询字符串 消息体 返回结果
DELETE 无 无 <ResponseStatus>
备注  

2.返回结果

         结构参考C.25,字段定义参考A.26。

3.示例

URI /VIID/DELETE/330203000011900000010220171218150122000010200005
请求方法 DELETE
请求头 参见请求参数
响应体 {     “ResponseStatusObject”: {         “RequestURL”: “http://172.6.3.107/VIID/MotorVehicles/330203000011900000010220171218150122000010200005”,         “StatusCode”: 0,         “StatusString”: “正常”,         “LocalTime”: “20171223140026”     } }

非机动车相关接口

批量非机动车新增

1.接口概览

URI /VIID/NonMotorVehicles
方法 查询字符串 消息体 返回结果
POST 无 <NonMotorVehicleList > <ResponseStatusList>
备注  

2.消息体特征参数

消息体结构参考 C.11,字段定义参考A.11 。

3.返回结果

         结构参考C.25,字段定义参考A.26。

4.示例

URI /VIID/NonMotorVehicles
请求方法 POST
请求头 参见请求参数
请求体 {     “NonMotorVehicleListObject”: {         “NonMotorVehicleObject”: [             {                 “NonMotorVehicleID”: “330101010012100000010220171018080608022060369856”,                 “InfoKind”: 1,                 “SourceID”: “33010101001210000001022017101808060802206”,                 “DeviceID”: “65010000001190000001”,                 “LeftTopX”: 4,                 “LeftTopY”: 2,                 “RightBtmX”: 21,                 “RightBtmY”: 23,                 “HasPlate”: “1”,                 “PlateClass”: “01”,                 “PlateColor”: “2”,                 “PlateNo”: “京A66666”,                 “PlateNoAttach”: “312”,                 “PlateDescribe”: “312”,                 “IsDecked”: “1”,                 “IsAltered”: “1”,                 “IsCovered”: “1”,                 “DrivingStatusCode”: “5”,                 “UsingPropertiesCode”: “152”,                 “VehicleBrand”: “2”,                 “VehicleType”: “1”,                 “VehicleLength”: 12,                 “VehicleWidth”: 45,                 “VehicleHeight”: 45,                 “VehicleColor”: “2”,                 “VehicleHood”: “44”,                 “VehicleTrunk”: “55”,                 “VehicleWheel”: “33”,                 “WheelPrintedPattern”: “2”,                 “VehicleWindow”: “013”,                 “VehicleRoof”: “1”,                 “VehicleDoor”: “1”,                 “SideOfVehicle”: “1”,                 “CarOfVehicle”: “1”,                 “RearviewMirror”: “1”,                 “VehicleChassis”: “1”,                 “VehicleShielding”: “1”,                 “FilmColor”: “1”,                 “SubImageList”: {                     “SubImageInfoObject”: [                         {                             “ImageID”: “33020300001190000001022017122111111100001”,                             “EventSort”: 4,                             “DeviceID”: “55220299011190000253”,                             “StoragePath”: “http://localhost:9080/testx_108_20170908/a2421c4fde6d4a74ac923e8470d6e7fa.jpg”,                             “Type”: “01”,                             “FileFormat”: “Jpeg”,                             “ShotTime”: “20170925032455”,                             “Width”: 437,                             “Height”: 350                         }                     ]                 }             }         ]     } }
响应体 {     “ResponseStatusListObject”: {         “ResponseStatusObject”: [             {                 “RequestURL”: “http://localhost/VIID/NonMotorVehicles”,                 “StatusCode”: 0,                 “StatusString”: “正常”,                 “Id”: “330101010012100000010220171018080608022060369856”,                 “LocalTime”: “20171222104652”             }         ]     } }

批量非机动车查询

1.接口概览

URI /VIID/NonMotorVehicles
方法 查询字符串 消息体 返回结果
GET NonMotorVehicle属性键-值对 无 <NonMotorVehicleList>
备注  

2.查询字符串

查询指令为NonMotorVehicle属性键-值对,特征属性定义参考A.11 。

3.返回结果

         结构参考C.25,字段定义参考A.26。

4.示例

URI /VIID/NonMotorVehicles
请求方法 GET
请求头 参见请求参数
查询参数 ?NonMotorVehicleID=330101010012100000010220171018080608022060269856 &LeftTopX=4&…
响应体 {     “NonMotorVehicleListObject”: {         “NonMotorVehicleObject”: [             {                 “NonMotorVehicleID”: “330101010012100000010220171018080608022060269856”,                 “InfoKind”: 1,                 “SourceID”: “33010101001210000001022017101808060802206”,                 “DeviceID”: “33010101001210000001”,                 “LeftTopX”: 4,                 “LeftTopY”: 2,                 “RightBtmX”: 21,                 “RightBtmY”: 23,                 “HasPlate”: “1”,                 “PlateClass”: “1”,                 “PlateColor”: “2”,                 “PlateNo”: “312”,                 “PlateNoAttach”: “312”,                 “PlateDescribe”: “312”,                 “IsDecked”: “1”,                 “IsAltered”: “1”,                 “IsCovered”: “1”,                 “DrivingStatusCode”: “5”,                 “UsingPropertiesCode”: “152”,                 “VehicleBrand”: “2”,                 “VehicleType”: “1”,                 “VehicleLength”: 12,                 “VehicleWidth”: 45,                 “VehicleHeight”: 45,                 “VehicleColor”: “2”,                 “VehicleHood”: “44”,                 “VehicleTrunk”: “55”,                 “VehicleWheel”: “33”,                 “WheelPrintedPattern”: “2”,                 “VehicleWindow”: “013”,                 “VehicleRoof”: “1”,                 “VehicleDoor”: “1”,                 “SideOfVehicle”: “1”,                 “CarOfVehicle”: “1”,                 “RearviewMirror”: “1”,                 “VehicleChassis”: “1”,                 “VehicleShielding”: “1”,                 “FilmColor”: 1             }         ]     } }

批量非机动车修改

1.接口概览

URI /VIID/NonMotorVehicles
方法 查询字符串 消息体 返回结果
PUT 无 <NonMotorVehicleList > <ResponseStatusList>
备注  

2.消息体特征参数

消息体结构参考C.11,字段定义参考A.11 。

3.返回结果

         结构参考C.25,字段定义参考A.26。

4.示例

URI /VIID/NonMotorVehicles
请求方法 PUT
请求头 参见请求参数
请求体 {     “NonMotorVehicleListObject”: {         “NonMotorVehicleObject”: [             {                 “NonMotorVehicleID”: “330101010012100000010220171018080608022060369856”,                 “InfoKind”: 1,                 “SourceID”: “33010101001210000001022017101808060802206”,                 “DeviceID”: “65010000001190000001”,                 “LeftTopX”: 4,                 “LeftTopY”: 2,                 “RightBtmX”: 21,                 “RightBtmY”: 23,                 “HasPlate”: “1”,                 “PlateClass”: “01”,                 “PlateColor”: “2”,                 “PlateNo”: “京A66666”,                 “PlateNoAttach”: “312”,                 “PlateDescribe”: “312”,                 “IsDecked”: “1”,                 “IsAltered”: “1”,                 “IsCovered”: “1”,                 “DrivingStatusCode”: “5”,                 “UsingPropertiesCode”: “152”,                 “VehicleBrand”: “2”,                 “VehicleType”: “1”,                 “VehicleLength”: 12,                 “VehicleWidth”: 45,                 “VehicleHeight”: 45,                 “VehicleColor”: “2”,                 “VehicleHood”: “44”,                 “VehicleTrunk”: “55”,                 “VehicleWheel”: “33”,                 “WheelPrintedPattern”: “2” …             }         ]     } }
响应体 {     “ResponseStatusListObject”: {         “ResponseStatusObject”: [             {                 “RequestURL”: “http://localhost/VIID/NonMotorVehicles”,                 “StatusCode”: 0,                 “StatusString”: “正常”,                 “Id”: “330101010012100000010220171018080608022060369856”,                 “LocalTime”: “20171222104652”             }         ]     } }

批量非机动车删除

1.接口概览

URI /VIID/NonMotorVehicles
方法 查询字符串 消息体 返回结果
DELETE 键为IDList,值为用英文半角分号”,”分隔的字符串 无 <ResponseStatusList>
备注  

2.请求参数

IDList=<NonMotorVehicleID>,<NonMotorVehicleID>。

3.返回结果

         结构参考C.25,字段定义参考A.26。

4.示例

URI /VIID/NonMotorVehicles
请求方法 DELETE
请求头 参见请求参数
请求参数 ?IDList=330101010012100000010220171018080608022060369856  
响应体 {     “ResponseStatusListObject”: {         “ResponseStatusObject”: [             {                 “RequestURL”: “http://localhost:9080/VIID/NonMotorVehicles”,                 “StatusCode”: 0,                 “StatusString”: “正常”,                 “LocalTime”: “20171225095830”             }         ]     } }

单个非机动车查询

1.接口概览

URI /VIID/NonMotorVehicles/<ID>
方法 查询字符串 消息体 返回结果
GET 无 无 < NonMotorVehicle >
备注  

2.返回结果

         结构参考C.25,字段定义参考A.26。

3.示例

URI /VIID/NonMotorVehicles/330101010012100000010220171018080608022060369856
请求方法 GET
请求头 参见请求参数
响应体 {     “NonMotorVehicleObject”: {         “NonMotorVehicleID”: “330101010012100000010220171018080608022060369856”,         “InfoKind”: 1,         “SourceID”: “33010101001210000001022017101808060802206”,         “DeviceID”: “65010000001190000001”,         “LeftTopX”: 4,         “LeftTopY”: 2,         “RightBtmX”: 21,         “RightBtmY”: 23,         “HasPlate”: “1”,         “PlateClass”: “01”,         “PlateColor”: “2”,         “PlateNo”: “京A66666”,         “PlateNoAttach”: “312”,         “PlateDescribe”: “312”,         “IsDecked”: “1”,         “IsAltered”: “1”,         “IsCovered”: “1”,         “DrivingStatusCode”: “5”,         “UsingPropertiesCode”: “152”,         “VehicleBrand”: “2”,         “VehicleType”: “1”,         “VehicleLength”: 12,         “VehicleWidth”: 45,         “VehicleHeight”: 45,         “VehicleColor”: “2”,         “VehicleHood”: “44”,         “VehicleTrunk”: “55”,         “VehicleWheel”: “33”,         “WheelPrintedPattern”: “2”,         “VehicleWindow”: “013”,         “VehicleRoof”: “1”,         “VehicleDoor”: “1”,         “SideOfVehicle”: “1”,         “CarOfVehicle”: “1”,         “RearviewMirror”: “1”,         “VehicleChassis”: “1”,         “VehicleShielding”: “1”,         “FilmColor”: 1     } }

单个非机动车修改

1.接口概览

URI /VIID/NonMotorVehicles/<ID>
方法 查询字符串 消息体 返回结果
PUT 无 <NonMotorVehicle > <ResponseStatus>
备注  

2.消息体特征参数

消息体结构参考C.11,字段定义参考A.11 。

3.返回结果

         结构参考C.25,字段定义参考A.26。

4.示例

URI /VIID/NonMotorVehicles/330101010012100000010220171018080608022060369856
请求方法 PUT
请求头 参见请求参数
请求体 {     “NonMotorVehicleObject”: {         “NonMotorVehicleID”: “330101010012100000010220171018080608022060369856”,         “InfoKind”: 1,         “SourceID”: “33010101001210000001022017101808060802206”,         “DeviceID”: “65010000001190000001”,         “LeftTopX”: 4,         “LeftTopY”: 2,         “RightBtmX”: 21,         “RightBtmY”: 23,         “HasPlate”: “1”,         “PlateClass”: “01”,         “PlateColor”: “2”,         “PlateNo”: “京A66666”,         “PlateNoAttach”: “312”,         “PlateDescribe”: “312”,         “IsDecked”: “1”,         “IsAltered”: “1”,         “IsCovered”: “1”,         “DrivingStatusCode”: “5”,         “UsingPropertiesCode”: “152”,         “VehicleBrand”: “2”,         “VehicleType”: “1”,         “VehicleLength”: 12,         “VehicleWidth”: 45,         “VehicleHeight”: 45,         “VehicleColor”: “2”,         “VehicleHood”: “44”,         “VehicleTrunk”: “55”,         “VehicleWheel”: “33”,         “WheelPrintedPattern”: “2”,         “VehicleWindow”: “013”,         “VehicleRoof”: “1”,         “VehicleDoor”: “1”,         “SideOfVehicle”: “1”,         “CarOfVehicle”: “1”,         “RearviewMirror”: “1”,         “VehicleChassis”: “1”,         “VehicleShielding”: “1”,         “FilmColor”: “1”,         “SubImageList”: {             “SubImageInfoObject”: [                 {                     “ImageID”: “33020300001190000001022017122111111100001”,                     “EventSort”: 4,                     “DeviceID”: “55220299011190000253”,                     “StoragePath”: “http://localhost:9080/testx_108_20170908/a2421c4fde6d4a74ac923e8470d6e7fa.jpg”,                     “Type”: “01”,                     “FileFormat”: “Jpeg”,                     “ShotTime”: “20170925032455”,                     “Width”: 437,                     “Height”: 350                 }             ]         }     } }
响应体 {     “ResponseStatusObject”: {         “RequestURL”: “http://localhost:8080/VIID/NonMotorVehicles/330101010012100000010220171018080608022060369856”,         “StatusCode”: 0,         “StatusString”: “正常”,         “Id”: “330101010012100000010220171018080608022060369856”,         “LocalTime”: “20171225100249”     } }

单个非机动车删除

1.接口概览

URI /VIID/NonMotorVehicles/<ID>
方法 查询字符串 消息体 返回结果
DELETE 无 无 < ResponseStatus >
备注  

2.返回结果

         结构参考C.25,字段定义参考A.26。

3.示例

URI /VIID/NonMotorVehicles/330101010012100000010220171018080608022060369856
请求方法 DELETE
请求头 参见请求参数
响应体 {     “ResponseStatusObject”: {         “RequestURL”: “http://localhost:8080/VIID/NonMotorVehicles/330101010012100000010220171018080608022060369856”,         “StatusCode”: 0,         “StatusString”: “正常”,         “LocalTime”: “20171225100642”     } }
作者 east
Java 11月 8,2020

GAT1400视图库采集相关接口

采集设备相关接口

查询采集设备

1.接口概览

URI /VIID/APEs
方法 查询字符串 消息体 返回结果
GET APE属性键-值对 无 <APEList>
备注  

2.查询字符串

查询指令为采集设备对象属性键-值对,特征属性定义参考A.1.1。

3.返回结果

         结构参考C.1,字段定义参考A.1.1。

4.示例

URI /VIID/APEs
请求方法 GET
请求头 参见请求参数
查询参数 ?ApeID=33070299011190000253 &Name=这是一个采集设备
响应体 {     “APEListObject”: {         “APEObject”: [             {                 “ApeID”: “33070299011190000253”,                 “Name”: “这是一个采集设备”,                 “Model”: “这是采集设备的型号”,                 “IPAddr”: “192.168.1.1”,                 “Port”: 8888,                 “Longitude”: 56.654321,                 “Latitude”: 56.123456,                 “CapDirection”: 0,                 “MonitorDirection”: “9”,                 “IsOnline”: 2,                 “UserId”: “Administrator”,                 “Password”: “p@ssword”             }         ]     } }

采集设备口令修改

1.接口概览

URI /VIID/APEs
方法 查询字符串 消息体 返回结果
PUT 无 <APEList> <ResponseStatusList>
备注  

2.消息体

采集设备的ApeID、用户账户和口令,结构参考C.1,特征属性定义参考A.1.1。

3.返回结果

         结构参考C.25,字段定义参考A.26。

4.示例

URI /VIID/APEs
请求方法 PUT
请求头 参见请求参数
消息体 {     “APEListObject”: {         “APEObject”: [             {                 “ApeID”: “33070299011190000253”,                 “UserId”: “Administrator”,                 “Password”: “p@ssword”             },             {                 “ApeID”: “33070299011190000252”,                 “UserId”: “Administrator”,                 “Password”: “p@sswords”             }         ]     } }
响应体 {     “ResponseStatusListObject”: {         “ResponseStatusObject”: [             {                 “RequestURL”: “http://localhost:8080/VIID/APEs”,                 “StatusCode”: 0,                 “StatusString”: “正常”,                 “Id”: “33070299011190000253”,                 “LocalTime”: “20171220204451”             },             {                 “RequestURL”: “http://localhost:8080/VIID/APEs”,                 “StatusCode”: 0,                 “StatusString”: “正常”,                 “Id”: “33070299011190000252”,                 “LocalTime”: “20171220204451”             }         ]     } }

采集系统相关接口

采集系统查询

1.接口概览

URI /VIID/APSs
方法 查询字符串 消息体 返回结果
GET APS属性键-值对 无 <APSList>
备注  

2.查询字符串

查询指令为APS属性键-值对,特征属性定义参考A.2。

3.返回结果

         结构参考C.2,字段定义参考A.2。

4.示例

URI /VIID/APSs
请求方法 GET
请求头 参见请求参数
查询参数 ?TollgateID=65010000001210000080 & Name =采集系统 &…
响应体 {     “APSListObject”: {         “APSObject”: [             {                 “ApsID”: “65010000001200000083”,                 “Name”: “采集系统”,                 “IPAddr”: “6.39.64.5”,                 “IPV6Addr”: “fe80::248e:ff9c:302:e2d1%11”,                 “Port”: 2,                 “IsOnline”: 1             }         ]     } }
作者 east
Java 11月 8,2020

GAT1400视图库布控告警

布控、告警流程

上下级的概念同订阅(布控),通知(告警)。

布控-告警

布控-告警流程见图5:

图5 布控-告警流程

Step1:布控者(上级)向被布控者(下级)发送HTTP POST请求/VIID/Dispositions。

Step2:被布控者(下级)将布控成功与否的响应消息返回给布控者(上级)。

布控成功后,若被布控者(下级)发现布控相关信息,其会进行告警任务。

Step3:被布控者(下级)向布控者(上级)发送HTTP POST请求/VIID/DispositionNotifications。

Step4:布控者(上级)返回响应消息。

Step5:布控信息产生重复Step3,4的操作,如此循环。

撤销布控

如果布控者想撤销布控,流程如图6:

图6 撤销布控流程

Step1:布控者(上级)可以向被布控者(下级)发送HTTP PUT请求/VIID/Dispositions/<ID>。

Step2:被布控者(下级)将撤控成功与否的响应消息返回给布控者(上级)。 Step3:撤控成功后对应的告警流程将终止。

告警相关接口

批量告警

1.接口概览

URI /VIID/DispositionNotifications
方法 查询字符串 消息体 返回结果
POST 无 <DispositionNotificationList> <ResponseStatusList>
备注  

2.消息体特征参数

消息体结构参考C.18,字段定义参考A.18 。

3.返回结果

         结构参考C.25,字段定义参考A.26。

4.示例

URI /VIID/DispositionNotifications
请求方法 POST
请求头 参见请求参数
请求体 {     “DispositionNotificationListObject”: {         “DispositionNotificationObject”: [             {                 “NotificationID”: “003301020002022017121416234045581”,                 “DispositionID”: “003301020001012017121416234045581”,                 “Title”: “test”,                 “TriggerTime”: “20170920121314”,                 “CntObjectID”: “330203000011900000010220171218150200000010201928”,                 “MotorVehicleObject”: {                     “MotorVehicleID”: “330203000011900000010220171218150200000010201928”,                     “InfoKind”: 1,                     “SourceID”: “33020300001190000001022017122111111100001”,                     “DeviceID”: “65010000001190000001”,                     “StorageUrl1”: “http://localhost:80/1.jpg”,                     “StorageUrl2”: “http://localhost:80/2.jpg”,                     “StorageUrl3”: “http://localhost:80/3.jpg”,                     “StorageUrl4”: “http://localhost:80/4.jpg”,                     “StorageUrl5”: “http://localhost:80/5.jpg”,                     “LeftTopX”: 1,                     “LeftTopY”: 2,                     “RightBtmX”: 3,                     “RightBtmY”: 4,                     “MarkTime”: “20171102101241”,                     “DisappearTime”: “20171102101241”,                     “LaneNo”: 1,                     “HasPlate”: “1”,                     “PlateClass”: “99”,                     “PlateColor”: “1”,                     “PlateNo”: “京A66666”,                     “PlateNoAttach”: “京A88888”,                     “PlateDescribe”: “这是一个车牌号的描述”,                     “IsDecked”: “1”,                     “IsAltered”: “1”,                     “IsCovered”: “1”,                     “Speed”: 80,                     “Direction”: “9”,                     “DrivingStatusCode”: “01”,                     “VehicleClass”: “X99”,                     “VehicleBrand”: “0”,                     “VehicleModel”: “这是车辆型号描述”,                     “VehicleStyles”: “2000年”,                     “VehicleLength”: 12345,                     “VehicleColor”: “1”,                     “VehicleColorDepth”: “1”,                     “VehicleHood”: “这是车前盖的描述”,                     “VehicleTrunk”: “这是车后盖的描述”,                     “VehicleWheel”: “这是车轮的描述”,                     “WheelPrintedPattern”: “11”,                     “VehicleWindow”: “这是车窗的描述”,                     “VehicleRoof”: “这是车顶的描述”,                     “VehicleDoor”: “这是车门的描述”,                     “SideOfVehicle”: “这是车侧的描述”,                     “CarOfVehicle”: “这是车厢的描述”,                     “RearviewMirror”: “这是后视镜的描述”,                     “VehicleChassis”: “这是底盘的描述”,                     “VehicleShielding”: “这是遮挡的描述”,                     “FilmColor”: “1”,                     “HitMarkInfo”: “1”,                     “VehicleBodyDesc”: “这是车身的描述”,                     “VehicleFrontItem”: “1”,                     “DescOfFrontItem”: “这是车前部物品描述”,                     “VehicleRearItem”: “1”,                     “DescOfRearItem”: “这是车后部物品描述”,                     “PassTime”: “20171218150122”,                     “NameOfPassedRoad”: “这是经过道路的名称描述”,                     “IsSuspicious”: “1”,                     “Sunvisor”: 1,                     “SafetyBelt”: 1,                     “Calling”: 1,                     “PlateReliability”: “80”,                     “PlateCharReliability”: “苏-80,B-90,1-90,2-88,3-90,4-67,5-87”,                     “BrandReliability”: “88”                 }             }         ]     } }
响应体 {     “ResponseStatusListObject”: {         “ResponseStatusObject”: [             {                 “RequestURL”: “http://localhost:8080/VIID/DispositionNotifications”,                 “StatusCode”: 0,                 “StatusString”: “正常”,                 “Id”: “003301020002022017121416234045581”,                 “LocalTime”: “20171222155008”             }         ]     } }

告警查询

1.接口概览

URI /VIID/DispositionNotifications
方法 查询字符串 消息体 返回结果
GET DispositionNotification属性键-值对 无 <DispositionNotificationList>
备注  

2. 查询字符串

查询指令为Disposition属性键-值对,特征属性定义参考A.18 。

3.返回结果

         结构参考C.25,字段定义参考A.26。

4.示例

URI /VIID/DispositionNotifications
请求方法 GET
请求头 参见请求参数
查询参数 ?NotificationID=003301020002022017121416234045581 &DispositionID=003301020001012017121416234045581 &CntObjectID=330203000011900000010220171218150200000010201928&…
响应体 {     “DispositionNotificationListObject”: {         “DispositionNotificationObject”: [             {                 “NotificationID”: “003301020002022017121416234045581”,                 “DispositionID”: “003301020001012017121416234045581”,                 “Title”: “test”,                 “TriggerTime”: “20170920121314”,                 “CntObjectID”: “330203000011900000010220171218150200000010201928”,                 “MotorVehicleObject”: {                     “MotorVehicleID”: “330203000011900000010220171218150200000010201928”,                     “InfoKind”: 1,                     “SourceID”: “33020300001190000001022017122111111100001”,                     “DeviceID”: “65010000001190000001”,                     “StorageUrl1”: “http://192.168.1.1:80/1.jpg”,                     “StorageUrl2”: “http://192.168.1.1:80/2.jpg”,                     “StorageUrl3”: “http://192.168.1.1:80/3.jpg”,                     “StorageUrl4”: “http://192.168.1.1:80/4.jpg”,                     “StorageUrl5”: “http://192.168.1.1:80/5.jpg”,                     “LeftTopX”: 1,                     “LeftTopY”: 2,                     “RightBtmX”: 3,                     “RightBtmY”: 4,                     “MarkTime”: “20171102101241”,                     “DisappearTime”: “20171102101241”,                     “LaneNo”: 1,                     “HasPlate”: “1”,                     “PlateClass”: “99”,                     “PlateColor”: “1”,                     “PlateNo”: “京A66666”,                     “PlateNoAttach”: “京A88888”,                     “PlateDescribe”: “这是一个车牌号的描述”,                     “IsDecked”: “1”,                     “IsAltered”: “1”,                     “IsCovered”: “1”,                     “Speed”: 80,                     “Direction”: “9”,                     “DrivingStatusCode”: “01”,                     “VehicleClass”: “X99”,                     “VehicleBrand”: “0”,                     “VehicleModel”: “这是车辆型号描述”,                     “VehicleStyles”: “2000年”,                     “VehicleLength”: 12345,                     “VehicleColor”: “1”,                     “VehicleColorDepth”: “1”,                     “VehicleHood”: “这是车前盖的描述”,                     “VehicleTrunk”: “这是车后盖的描述”,                     “VehicleWheel”: “这是车轮的描述”,                     “WheelPrintedPattern”: “11”,                     “VehicleWindow”: “这是车窗的描述”,                     “VehicleRoof”: “这是车顶的描述”,                     “VehicleDoor”: “这是车门的描述”,                     “SideOfVehicle”: “这是车侧的描述”,                     “CarOfVehicle”: “这是车厢的描述”,                     “RearviewMirror”: “这是后视镜的描述”,                     “VehicleChassis”: “这是底盘的描述”,                     “VehicleShielding”: “这是遮挡的描述”,                     “FilmColor”: “1”,                     “HitMarkInfo”: “1”,                     “VehicleBodyDesc”: “这是车身的描述”,                     “VehicleFrontItem”: “1”,                     “DescOfFrontItem”: “这是车前部物品描述”,                     “VehicleRearItem”: “1”,                     “DescOfRearItem”: “这是车后部物品描述”,                     “PassTime”: “20171218150200”,                     “NameOfPassedRoad”: “这是经过道路的名称描述”,                     “IsSuspicious”: “1”,                     “Sunvisor”: 1,                     “SafetyBelt”: 1,                     “Calling”: 1,                     “PlateReliability”: “80”,                     “PlateCharReliability”: “苏-80,B-90,1-90,2-88,3-90,4-67,5-87”,                     “BrandReliability”: “88”,                     “SubImageList”: {                         “SubImageInfoObject”: [                             {                                 “ImageID”: “33020300001190000001022017122111111100001”,                                 “EventSort”: 4,                                 “DeviceID”: “55220299011190000253”,                                 “StoragePath”: “http://10.33.6.108:9080/testx_108_20170908/a2421c4fde6d4a74ac923e8470d6e7fa.jpg”,                                 “Type”: “01”,                                 “FileFormat”: “Jpeg”,                                 “ShotTime”: “20170925032455”,                                 “Width”: 437,                                 “Height”: 350,                                 “Data”: “/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBwYIDAoMDAsKCwsNDhIQDQ4RDgsLEBYQERMUFR…UVDA8XGBYUGBIUFRT/2wBDAQMEBAUEBQkFBQkUDQsNFBQUFBVt7IDwSOM1pKehagf/9k=”                             }                         ]                     }                 }             }         ]     } }

删除告警

1.接口概览

URI /VIID/DispositionNotifications
方法 查询字符串 消息体 返回结果
DELETE 键IDList,值为用英文半角分号”,”分隔的字符串 无 <ResponseStatusList>
备注  

2. 请求参数

IDList=<DispositionNotificationID>,<DispositionNotificationID>。

3.返回结果

         结构参考C.25,字段定义参考A.26。

4.示例

URI /VIID/DispositionNotifications
请求方法 DELETE
请求头 参见请求参数
请求体 ?IDList=003301020002022017121416234045581, 303301020002022017121417234045582
响应体 {     “ResponseStatusListObject”: {         “ResponseStatusObject”: [             {                 “RequestURL”: “http://localhost:8080/VIID/DispositionNotifications”,                 “StatusCode”: 0,                 “StatusString”: “正常”,                 “LocalTime”: “20171223101737”             },             {                 “RequestURL”: “http://localhost:8080/VIID/DispositionNotifications”,                 “StatusCode”: 0,                 “StatusString”: “正常”,                 “LocalTime”: “20171223101737”             }         ]     } }
作者 east
Java 11月 8,2020

GAT1400视图库订阅通知

订阅、通知流程(必读)

订阅-通知是视图库接口最核心的业务,也是大华和友商使用最频繁的一个功能。本节将描述完整的一个订阅-通知流程。

上下级概念

订阅通知过程本质是数据转移,例如A想通过视图库获得B的机动车数据,那么A就是上级、B就是下级;假如A想通过B间接获得C的机动车数据,那么A就是B的上级,B是C的上级,这个过程为跨级订阅/通知。

订阅-通知

订阅-通知流程见图2:

图2 订阅-通知流程

Step1:订阅者(上级)向被订阅者(下级)发送HTTP POST请求/VIID/Subscribes。

Step2:被订阅者(下级)将订阅成功与否的响应消息返回给订阅者(上级)。

订阅成功后,被订阅者(下级)如果有订阅信息,便会进行通知任务。

Step3:被订阅者(下级)向订阅者(上级)发送HTTP POST请求/VIID/SubscribeNotifications。

Step4:订阅者(上级)返回响应消息。

Step5:被订阅者(下级)接收到Step4订阅者(上级)正确返回结果才会再重复Step3,4的操作,如此循环。

取消订阅

如果订阅者想取消订阅,流程如图3:

图3 取消订阅流程

Step1:订阅者(上级)可以向被订阅者(下级)发送HTTP PUT请求/VIID/Subscribes/<ID>,写入订阅取消单位、订阅取消人、取消时间、取消原因。

Step2:被订阅者(下级)将取消订阅成功与否的响应消息返回给订阅者(上级)。

Step3:取消订阅成功后对应的通知流程将终止。

级联订阅

订阅相关接口

批量订阅

1.接口概览

URI /VIID/Subscribes
方法 查询字符串 消息体 返回结果
POST 无 <SubscribeList> <ResponseStatusList>
备注  

2.消息体特征参数

消息体结构参考C.19,字段定义参考A.19 。

3.返回结果

         结构参考C.25,字段定义参考A.26。

4.示例

URI /VIID/Subscribes
请求方法 POST
请求头 参见请求参数
请求体 {     “SubscribeListObject”: {         “SubscribeObject”: [             {                 “SubscribeID”: “330101020001032017113010580006371”,                 “ApplicantName”: “admin”,                 “ApplicantOrg”: “11111”,                 “BeginTime”: “20171201000000”,                 “EndTime”: “20191230000000”,                 “OperateType”: “0”,                 “Reason”: “测试”,                 “ReceiveAddr”: “http://172.6.3.107:80/VIID/SubscribeNotifications”,                 “ResourceURI”: “00330102015030000004”,                 “SubscribeDetail”: “13”,                 “Title”: “过车”             }         ]     } }
响应体 {     “ResponseStatusListObject”: {         “ResponseStatusObject”: [             {                 “RequestURL”: “http://localhost:8080/VIID/Subscribes”,                 “StatusCode”: 0,                 “StatusString”: “正常”,                 “Id”: “330101020001032017113010580006371”,                 “LocalTime”: “20171220204451”             }         ]     } }

订阅任务查询

1.接口概览

URI /VIID/Subscribes
方法 查询字符串 消息体 返回结果
GET Subscribes属性键-值对 无 <SubscribeList>
备注  

2.查询字符串

查询指令为Subscribes属性键-值对,特征属性定义参考A.19 。

3.返回结果

         结构参考C.19,字段定义参考A.19。

4.示例

URI /VIID/Subscribes
请求方法 GET
请求头 参见请求参数
查询参数 ?SubscribeID=330101020001032017113010580006371 &ApplicantName=admin &ApplicantOrg=11111 &BeginTime=20171201000000 &EndTime=20191230000000&…
响应体 {     “SubscribeListObject”: {         “SubscribeObject”: [             {                 “SubscribeID”: “330101020001032017113010580006371”,                 “ApplicantName”: “admin”,                 “ApplicantOrg”: “11111”,                 “BeginTime”: “20171201000000”,                 “EndTime”: “20191230000000”,                 “OperateType”: “0”,                 “Reason”: “测试”,                 “ReceiveAddr”: “http://172.6.3.107:80/VIID/SubscribeNotifications”,                 “ResourceURI”: “00330102015030000004”,                 “SubscribeDetail”: “13”,                 “Title”: “过车”             }         ]     } }

订阅任务修改

1.接口概览

URI /VIID/Subscribes
方法 查询字符串 消息体 返回结果
PUT 无 <SubscribeList> <ResponseStatusList>
备注 消息体中SubscribeID必填,否则操作无效

2.消息体特征参数

消息体结构参考C.19,字段定义参考A.19 。

3.返回结果

         结构参考C.25,字段定义参考A.26。

4.示例

URI /VIID/Subscribes
请求方法 PUT
请求头 参见请求参数
请求体 {     “SubscribeListObject”: {         “SubscribeObject”: [             {                 “SubscribeID”: “330101020001032017113010580006371”,                 “ApplicantName”: “admin”,                 “ApplicantOrg”: “11111”,                 “BeginTime”: “20171201000000”,                 “EndTime”: “20191230000000”,                 “OperateType”: “0”,                 “Reason”: “上下级汇聚”,                 “ReceiveAddr”: “http://172.6.3.107:80/VIID/SubscribeNotifications”,                 “ResourceURI”: “00330102015030000004”,                 “SubscribeDetail”: “13”,                 “Title”: “过车测试”             }         ]     } }
响应体 {     “ResponseStatusListObject”: {         “ResponseStatusObject”: [             {                 “RequestURL”: “http://localhost:8080/VIID/Subscribes”,                 “StatusCode”: 0,                 “StatusString”: “正常”,                 “Id”: “330101020001032017113010580006371”,                 “LocalTime”: “20171220204451”             }         ]     } }

订阅任务删除

1.接口概览

URI /VIID/Subscribes
方法 请求参数 消息体 返回结果
DELETE 键为IDList,值为用英文半角分号”,”分隔的字符串 无 <ResponseStatusList>
备注  

2.请求参数

IDList=<SubscribeID>,<SubscribeID>。

3.返回结果

         结构参考C.25,字段定义参考A.26。

4.示例

URI /VIID/Subscribes
请求方法 DELETE
请求头 参见请求参数
请求参数 ?IDList=330101020001032017113010580006371,330101020001032017113010580006372
响应体 {     “ResponseStatusListObject”: {         “ResponseStatusObject”: [             {                 “RequestURL”: “http://localhost:8080/VIID/Subscribes”,                 “StatusCode”: 0,                 “StatusString”: “正常”,                 “Id”: “330101020001032017113010580006371”,                 “LocalTime”: “20171220204451”             },             {                 “RequestURL”: “http://localhost:8080/VIID/Subscribes”,                 “StatusCode”: 0,                 “StatusString”: “正常”,                 “Id”: “330101020001032017113010580006372”,                 “LocalTime”: “20171220204451”             }         ]     } }

取消订阅

1.接口概览

URI /VIID/Subscribes/<ID>
方法 请求参数 消息体 返回结果
PUT 无 <Subscribe> <ResponseStatus>
备注 PUT更新Subscribe写入订阅取消单位、订阅取消人、取消时间、取消原因。

2.消息体特征参数

订阅对象中的取消单位、订阅取消人、取消时间、取消原因,字段定义参考A.19。

3.返回结果

         结构参考C.25,字段定义参考A.26。

4.示例

URI /VIID/Subscribes/330101020001032017113010580006371
请求方法 PUT
请求头 参见请求参数
消息体 {     “SubscribeObject”: {         “SubscribeCancelOrg”: “省公安厅”,         “SubscribeCancelPerson”: “admin”,         “CancelTime”: “20171201000000”,         “CancelReason”: “服务到期”     } }
响应体 {     “ResponseStatusObject”: {         “RequestURL”: “http://localhost:8080/VIID/Subscribes/330101020001032017113010580006371”,         “StatusCode”: 0,         “StatusString”: “正常”,         “Id”: “330101020001032017113010580006371”,         “LocalTime”: “20171220204451”     } }

通知相关接口

订阅通知

1.接口概览

URI /VIID/SubscribeNotifications
方法 查询字符串 消息体 返回结果
POST 无 <SubscribeNotificationList> <ResponseStatusList>
备注  

2.消息体特征参数

消息体结构参考C.20,字段定义参考A.20。

3.返回结果

         结构参考C.25,字段定义参考A.26。

4.示例

URI /VIID/SubscribeNotifications
请求方法 POST
请求头 参见请求参数
请求体 {     “SubscribeNotificationListObject”: {         “SubscribeNotificationObject”: [             {                 “NotificationID”: “650100010000042017040112010100001”,                 “Title”: “通知主题”,                 “SubscribeID”: “650100010000032017040112010100001”,                 “TriggerTime”: “20171102101205”,                 “InfoIDs”: “650100000013200000010120170330120000000010100001”,                 “DeviceList”: {                     “APEObject”: [                         {                             “Name”: “这是一个采集设备”,                             “Port”: 8888,                             “Password”: “p@ssword”,                             “Model”: “这是采集设备的型号”,                             “ApeID”: “65010000001190000001”,                             “MonitorAreaDesc”: “监控区域说明”,                             “IPAddr”: “192.168.1.1”,                             “IPV6Addr”: “fe80::69fd:1871:b9ba:24e7%13”,                             “Longitude”: 56.654321,                             “Latitude”: 56.123456,                             “PlaceCode”: “650100”,                             “OrgCode”: “650100010000”,                             “CapDirection”: 1,                             “MonitorDirect”: “1”,                             “IsOnline”: “1”,                             “OwnerApsID”: “65010000001200000001”,                             “UserId”: “Administrator”,                             “Place”: “新疆乌鲁木齐”                         }                     ]                 }             }         ]     } }
响应体 {     “ResponseStatusListObject”: {         “ResponseStatusObject”: [{                 “RequestURL”: “http://localhost:8080/VIID/SubscribeNotifications”,                 “StatusCode”: 0,                 “StatusString”: “正常”,                 “Id”: “330101020001032017113010580006371”,                 “LocalTime”: “20171220204451”             }         ]} }

通知查询

1.接口概览

URI /VIID/SubscribeNotifications
方法 查询字符串 消息体 返回结果
GET SubscribeNotifaication属性键-值对 无 <SubscribeNotificationList>
备注  

2.查询字符串

查询指令为SubscribeNotifications属性键-值对,特征属性定义参考A.20。

3.返回结果

         结构参考C.20,字段定义参考A.20。

4.示例

URI /VIID/SubscribeNotifications
请求方法 GET
请求头 参见请求参数
查询参数 ?NotificationID=650100010000042017040112010100001 &Title=通知主题&…
响应体 {     “SubscribeNotificationListObject”: {         “SubscribeNotificationObject”: [             {                 “NotificationID”: “650100010000042017040112010100001”,                 “Title”: “通知主题”,                 “SubscribeID”: “650100010000032017040112010100001”,                 “TriggerTime”: “20171102101205”,                 “InfoIDs”: “650100000013200000010120170330120000000010100001”,                 “DeviceList”: {                     “APEObject”: [                         {                             “Name”: “这是一个采集设备”,                             “Port”: 8888,                             “Password”: “p@ssword”,                             “Model”: “这是采集设备的型号”,                             “ApeID”: “65010000001190000001”,                             “MonitorAreaDesc”: “监控区域说明”,                             “IPAddr”: “192.168.1.1”,                             “IPV6Addr”: “fe80::69fd:1871:b9ba:24e7%13”,                             “Longitude”: 56.654321,                             “Latitude”: 56.123456,                             “PlaceCode”: “650100”,                             “OrgCode”: “650100010000”,                             “CapDirection”: 1,                             “MonitorDirect”: “1”,                             “IsOnline”: “1”,                             “OwnerApsID”: “65010000001200000001”,                             “UserId”: “Administrator”,                             “Place”: “新疆乌鲁木齐”                         }                     ]                 }             }         ]     } }

通知删除

1.接口概览

URI /VIID/SubscribeNotifications
方法 请求参数 消息体 返回结果
DELETE 键为IDList,值为用英文半角分号”,”分隔的字符串 无 <ResponseStatusList>
备注  

2.请求参数

IDList=<NotificationID>,<NotificationID>。

3.返回结果

         结构参考C.20,字段定义参考A.20。

4.示例

URI /VIID/SubscribeNotifications
请求方法 DELETE
请求头 参见请求参数
请求参数 ?IDList=650100010000042017040112010100001,650100010000042017040112010100002
响应体 {     “ResponseStatusListObject”: {         “ResponseStatusObject”: [             {                 “RequestURL”: “http://localhost:8080/VIID/SubscribeNotifications”,                 “StatusCode”: 0,                 “StatusString”: “正常”,                 “Id”: “650100010000042017040112010100001”,                 “LocalTime”: “20171220204451”             },             {                 “RequestURL”: “http://localhost:8080/VIID/SubscribeNotifications”,                 “StatusCode”: 0,                 “StatusString”: “正常”,                 “Id”: “650100010000042017040112010100002”,                 “LocalTime”: “20171220204451”             }         ]     } }

C.19 订阅对象

//订阅对象

<complexType name=”Subscribe”>

<sequence>

<element name=”SubscribeID” type=”BusinessObjectIdType”/>

<element name=”Title” type=”string” />

<element name=” SubscribeDetail” type=” SubscribeDetailType”/>

<element name=” ResourceURI” type=” string”/>

<element name=”ApplicantName” type=”NameType” />

<element name=”ApplicantOrg” type=”OrgType” />

<element name=”BeginTime” type=”dateTime” />

<element name=”EndTime” type=”dateTime” />

<element name=”ReceiveAddr” type=”string” />

<element name=”OperateType” type=”int” use=”required”/>

<element name=”SubscribeStatus” type=”int” />

<element name=”Reason” type=”string”/>

<element name=”SubscribeCancelOrg” type=”OrgType”/>

<element name=”SubscribeCancelPerson” type=”string”/>

<element name=”CancelTime” type=”dateTime”/>

<element name=”CancelReason” type=”string”/>

</sequence>

</complexType>

//订阅对象列表

<complexType name=”SubscribeList”>

<sequence>

<element name=”SubscribeObject” type=”Subscribe” minOccurs=”0″ />

</sequence>

</complexType>

C.20 通知对象

//通知对象

<complexType name=”SubscribeNotification”>

<sequence>

<element name=”NotificationID” type=”BusinessObjectIdType” use=”required”/>

<element name=”SubscribeID” type=”BusinessObjectIdType” use=”required”/>

<element name=”Title” type=”string” use=”required”/>

<element name=”TriggerTime” type=”dateTime” use=”required”/>

<element name=”InfoIDs” type=”string” use=”required”/>

<element name=”CaseObjectList” type=”CaseList”/>

<element name=”TollgateObjectList” type=”TollgateList”/>

<element name=”LaneObjectList” type=”LaneList”/>

<element name=”DeviceList” type=”APEList”/>

<element name=”DeviceStatusList” type=”APEStatusList”/>

<element name=”APSObjectList” type=”APSList”/>

<element name=”APSStatusObjectList” type=”APSStatusList”/>

<element name=”PersonObjectList” type=”PersonList”/>

<element name=”MotorVehicleObjectList” type=”MotorVehicleList”/>

<element name=”NonMotorVehicleObjectList” type=”NonMotorVehicleList”/>

<element name=”ThingObjectList” type=”ThingList”/>

<element name=”SceneObjectList” type=”SceneList”/>

</sequence>

</complexType>

//通知对象列表

<complexType name=”SubscribeNotificationList”>

<sequence>

<element    name=”SubscribeNotificationObject”    type=”SubscribeNotification” minOccurs=”0″ />

</sequence>

</complexType>


作者 east

上一 1 … 4 5 6 下一个

关注公众号“大模型全栈程序员”回复“小程序”获取1000个小程序打包源码。回复”chatgpt”获取免注册可用chatgpt。回复“大数据”获取多本大数据电子书

标签

AIGC AI创作 bert chatgpt github GPT-3 gpt3 GTP-3 hive mysql O2O tensorflow UI控件 不含后台 交流 共享经济 出行 图像 地图定位 外卖 多媒体 娱乐 小程序 布局 带后台完整项目 开源项目 搜索 支付 效率 教育 日历 机器学习 深度学习 物流 用户系统 电商 画图 画布(canvas) 社交 签到 联网 读书 资讯 阅读 预订

官方QQ群

小程序开发群:74052405

大数据开发群: 952493060

近期文章

  • 详解Python当中的pip常用命令
  • AUTOSAR如何在多个供应商交付的配置中避免ARXML不兼容?
  • C++thread pool(线程池)设计应关注哪些扩展性问题?
  • 各类MCAL(Microcontroller Abstraction Layer)如何与AUTOSAR工具链解耦?
  • 如何设计AUTOSAR中的“域控制器”以支持未来扩展?
  • C++ 中避免悬挂引用的企业策略有哪些?
  • 嵌入式电机:如何在低速和高负载状态下保持FOC(Field-Oriented Control)算法的电流控制稳定?
  • C++如何在插件式架构中使用反射实现模块隔离?
  • C++如何追踪内存泄漏(valgrind/ASan等)并定位到业务代码?
  • C++大型系统中如何组织头文件和依赖树?

文章归档

  • 2025年6月
  • 2025年5月
  • 2025年4月
  • 2025年3月
  • 2025年2月
  • 2025年1月
  • 2024年12月
  • 2024年11月
  • 2024年10月
  • 2024年9月
  • 2024年8月
  • 2024年7月
  • 2024年6月
  • 2024年5月
  • 2024年4月
  • 2024年3月
  • 2023年11月
  • 2023年10月
  • 2023年9月
  • 2023年8月
  • 2023年7月
  • 2023年6月
  • 2023年5月
  • 2023年4月
  • 2023年3月
  • 2023年1月
  • 2022年11月
  • 2022年10月
  • 2022年9月
  • 2022年8月
  • 2022年7月
  • 2022年6月
  • 2022年5月
  • 2022年4月
  • 2022年3月
  • 2022年2月
  • 2022年1月
  • 2021年12月
  • 2021年11月
  • 2021年9月
  • 2021年8月
  • 2021年7月
  • 2021年6月
  • 2021年5月
  • 2021年4月
  • 2021年3月
  • 2021年2月
  • 2021年1月
  • 2020年12月
  • 2020年11月
  • 2020年10月
  • 2020年9月
  • 2020年8月
  • 2020年7月
  • 2020年6月
  • 2020年5月
  • 2020年4月
  • 2020年3月
  • 2020年2月
  • 2020年1月
  • 2019年7月
  • 2019年6月
  • 2019年5月
  • 2019年4月
  • 2019年3月
  • 2019年2月
  • 2019年1月
  • 2018年12月
  • 2018年7月
  • 2018年6月

分类目录

  • Android (73)
  • bug清单 (79)
  • C++ (34)
  • Fuchsia (15)
  • php (4)
  • python (43)
  • sklearn (1)
  • 云计算 (20)
  • 人工智能 (61)
    • chatgpt (21)
      • 提示词 (6)
    • Keras (1)
    • Tensorflow (3)
    • 大模型 (1)
    • 智能体 (4)
    • 深度学习 (14)
  • 储能 (44)
  • 前端 (4)
  • 大数据开发 (488)
    • CDH (6)
    • datax (4)
    • doris (30)
    • Elasticsearch (15)
    • Flink (78)
    • flume (7)
    • Hadoop (19)
    • Hbase (23)
    • Hive (40)
    • Impala (2)
    • Java (71)
    • Kafka (10)
    • neo4j (5)
    • shardingsphere (6)
    • solr (5)
    • Spark (99)
    • spring (11)
    • 数据仓库 (9)
    • 数据挖掘 (7)
    • 海豚调度器 (10)
    • 运维 (34)
      • Docker (3)
  • 小游戏代码 (1)
  • 小程序代码 (139)
    • O2O (16)
    • UI控件 (5)
    • 互联网类 (23)
    • 企业类 (6)
    • 地图定位 (9)
    • 多媒体 (6)
    • 工具类 (25)
    • 电商类 (22)
    • 社交 (7)
    • 行业软件 (7)
    • 资讯读书 (11)
  • 嵌入式 (70)
    • autosar (63)
    • RTOS (1)
    • 总线 (1)
  • 开发博客 (16)
    • Harmony (9)
  • 技术架构 (6)
  • 数据库 (32)
    • mongodb (1)
    • mysql (13)
    • pgsql (2)
    • redis (1)
    • tdengine (4)
  • 未分类 (6)
  • 程序员网赚 (20)
    • 广告联盟 (3)
    • 私域流量 (5)
    • 自媒体 (5)
  • 量化投资 (4)
  • 面试 (14)

功能

  • 登录
  • 文章RSS
  • 评论RSS
  • WordPress.org

All Rights Reserved by Gitweixin.本站收集网友上传代码, 如有侵犯版权,请发邮件联系yiyuyos@gmail.com删除.