bearer token;idea中jar包冲突;mysql order by 字符串时间字段;library version报错

1、bearer token

一般获取token,通过body的x-www-form-urlencoded传入参数即可,在此不过多叙述,主要说明bearer token的传入,在java中如何编写,在postman中输入的地方如下:

public synchronized void getList(){
        String token = getToken();
        HttpHeaders httpHeaders = new HttpHeaders();
        httpHeaders.setContentType(MediaType.APPLICATION_JSON);
//        httpHeaders.add("Content-type", "application/json");  +"?pageNo=1&pageSize=20"
       //设置bearer token 参数
         httpHeaders.setBearerAuth(token);
        try{
            MultiValueMap<String, String> params = new LinkedMultiValueMap<>();
            params.add("pageNo","1");
            params.add("pageSize","20");
            String result = getRequest(getList+"?pageNo=1&pageSize=20", params, httpHeaders);
            JSONObject jsonObject = JSONUtil.parseObj(result);
            Integer code = jsonObject.getInt("code");
            //如果返回正常
            if(code == 0){
                //数据处理
            }
            else {
                log.info("查询车辆进出记录信息 失败!"+jsonObject.toString());
            }
        }catch (Exception e){
            log.info("查询车辆进出记录信息 请求异常"+e.getMessage(),e);
            throw new RuntimeException(e.getMessage());
        }
    }
 
private String getRequest(String url, MultiValueMap<String, String> params, HttpHeaders headers){

        RestTemplate client = new RestTemplate(new HttpComponentsClientHttpRequestFactory());

        HttpMethod method = HttpMethod.GET;
//        headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
        HttpEntity<MultiValueMap<String, String>> requestEntity = new HttpEntity<>(params, headers);
        ResponseEntity<String> response = client.exchange(url, method, requestEntity, String.class);
        return response.getBody();
    }       
    

2、数据库的字符集和排序规则

1、utf8

  UTF-8是MySQL中最常用的字符集,它支持多语言字符集,包括中文、英文、日文等。

  utf8是MySQL数据库中的一种字符集,只支持三字节的UTF8字符,MySQL中字符串的长度代表的是字符数,比如 CHAR(100) Mysql 会保留 300字节长度。

2、utf8mb4

  utf8mb4也是MySQL数据库中的一种字符集,支持四字节的长度的UTF8字符,是utf8的超集。支持emoji的编码支持。

2.1、utf8mb4_bin

  区分大小写,将字符串中的每个字符用二进制数据编译存储,区分大小写,m 和 M 在字符判断中会被区别对待,同时可以存储二进制内容。

2.2、utf8mb4_general_ci

  不区分大小写,ci 是 case insensitive 的 简写,即 大小写不敏感,m 和 M 在字符判断中会被当成一样的。

2.3、utf8mb4_unicode_ci

  校对规则仅部分支持Uncode校对规则算法,部分字符不支持,同时utf8mb4_unicode_ci不能完全支持组合的记号。

3、GBK

  GBK是一种中文字符集,它是在GB2312的基础上扩展而来,能够表示中国大陆所有汉字。GBK在MySQL中也被广泛使用,尤其是在处理中文数据时。

排序方式的命名规则为:字符集名字_语言_后缀,后缀详情:

  _ci:不区分大小写的排序方式。

  _cs:区分大小写的排序方式。

  _bin:二进制排序方式,大小比较将根据字符编码。

3、mysql order by 字符串时间字段

order by STR_TO_DATE(a.time,'%Y-%m-%d %H:%i:%s')、

4、library version报错

可能是数据同步时数值被修改了(act_ge_property里面的值)

在jeeplus项目中,要修改两个表:act_ge_property 和 act_id_property

act_id_property:value 修改为报错信息-library version is '6.5.0.1' 中的 6.5.0.1

act_ge_property :修改schema.version的数值,同理如上,原本所有数据参考如下:

INSERT INTO `act_ge_property` VALUES ('cfg.execution-related-entities-count', 'true', 1);

INSERT INTO `act_ge_property` VALUES ('cfg.task-related-entities-count', 'true', 1);

INSERT INTO `act_ge_property` VALUES ('common.schema.version', '6.5.0.1', 1);

INSERT INTO `act_ge_property` VALUES ('entitylink.schema.version', '6.5.0.1', 1);

INSERT INTO `act_ge_property` VALUES ('eventsubscription.schema.version', '6.5.0.1', 1);

INSERT INTO `act_ge_property` VALUES ('identitylink.schema.version', '6.5.0.1', 1);

INSERT INTO `act_ge_property` VALUES ('job.schema.version', '6.5.0.1', 1);

INSERT INTO `act_ge_property` VALUES ('next.dbid', '1', 1);

INSERT INTO `act_ge_property` VALUES ('schema.history', 'create(6.5.0.1)', 1);

INSERT INTO `act_ge_property` VALUES ('schema.version', '6.5.0.1', 1);

INSERT INTO `act_ge_property` VALUES ('task.schema.version', '6.5.0.1', 1);

INSERT INTO `act_ge_property` VALUES ('variable.schema.version', '6.5.0.1', 1);

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值