diff --git a/es/es.html b/es/es.html new file mode 100644 index 0000000..847f8ae --- /dev/null +++ b/es/es.html @@ -0,0 +1,19 @@ + + + Evernote Export + + + + + + + + +
+

https://www.elastic.co/cn/downloads/elasticsearch
是否安装成功:http://localhost:9200
健康检查:http://localhost:9200/_cat/health?v=true
jvm状态:http://localhost:9200/_nodes/stats/jvm
添加内容:
curl -X PUT "http://localhost:9200/customer/_doc/1?pretty" -H 'Content-Type: application/json' -d' {"name": "赵莉贤"}'
查找:
curl -X GET "localhost:9200/customer/_doc/1?pretty"

测试:
下载官网数据:wget https://raw.githubusercontent.com/elastic/elasticsearch/master/docs/src/test/resources/accounts.json
批量上传数据:curl -H "Content-Type: application/json" -X POST "localhost:9200/bank/_bulk?pretty&refresh" --data-binary "@accounts.json"
查看数据:curl "localhost:9200/_cat/indices?v=true"
按顺序查找:
curl -X GET "localhost:9200/bank/_search?pretty" -H 'Content-Type: application/json' -d'
{
  "query": { "match_all": {} },
  "sort": [
    { "account_number": "asc" }
  ]
}
'
curl -X POST "localhost:1112/oauth/token"   -d "grant_type=authorization_code&code=NE325Y&client_id=usermessage-provider&redirect_uri=http://localhost:1112/user/hello&Authorization=Basic dXNlcm1lc3NhZ2UtcHJvdmlkZXI6MTIzNDU2"


curl -X POST "localhost:1112/oauth/token" -H 'Content-Type: application/json' -d '{
"grant_type":"authorization_code",
"code":"NE325Y",
"client_id":"usermessage-provider"
"redirect_uri":"http://localhost:1112/user/hello",
"Authorization":  "Basic dXNlcm1lc3NhZ2UtcHJvdmlkZXI6MTIzNDU2"
}'

usermessage-provider:123456 base64-> dXNlcm1lc3NhZ2UtcHJvdmlkZXI6MTIzNDU2 




curl -X POST "localhost:1113/oauth/token" -d "grant_type=password&username=123&password=123&Authorization=Basic dGVzdDE6dGVzdDExMTE=&scope=all"


curl -X POST "localhost:8080/oauth/token" -d "grant_type=password&username=123&password=123456&Authorization=Basic dGVzdDE6dGVzdDExMTE=&scope=all"

分页查询:
curl -X GET "localhost:9200/bank/_search?pretty" -H 'Content-Type: application/json' -d'
{
  "query": { "match_all": {} },
  "sort": [
    { "account_number": "asc" }
  ],
  "from": 10,
  "size": 10
}
'
根据字段查询,模糊查询,只要包含mill,lane:
curl -X GET "localhost:9200/bank/_search?pretty" -H 'Content-Type: application/json' -d'
{
  "query": { "match": { "address": "mill lane" } }
}
'
按照短语模糊查找:
curl -X GET "localhost:9200/bank/_search?pretty" -H 'Content-Type: application/json' -d'
{
  "query": { "match_phrase": { "address": "mill lane" } }
}
'
多条件查询
curl -X GET "localhost:9200/bank/_search?pretty" -H 'Content-Type: application/json' -d'
{
  "query": {
    "bool": {
      "must": [
        { "match": { "age": "40" } }
      ],
      "must_not": [
        { "match": { "state": "ID" } }
      ]
    }
  }
}
'
过滤:
curl -X GET "localhost:9200/bank/_search?pretty" -H 'Content-Type: application/json' -d'
{
  "query": {
    "bool": {
      "must": { "match_all": {} },
      "filter": {
        "range": {
          "balance": {
            "gte": 20000,
            "lte": 30000
          }
        }
      }
    }
  }
}
'

聚和操作分组:
curl -X GET "localhost:9200/bank/_search?pretty" -H 'Content-Type: application/json' -d'
{
  "size": 0,
  "aggs": {
    "group_by_state": {
      "terms": {
        "field": "state.keyword"
      }
    }
  }
}
'
分组state求平均值balance:
curl -X GET "localhost:9200/bank/_search?pretty" -H 'Content-Type: application/json' -d'
{
  "size": 0,
  "aggs": {
    "group_by_state": {
      "terms": {
        "field": "state.keyword"
      },
      "aggs": {
        "average_balance": {
          "avg": {
            "field": "balance"
          }
        }
      }
    }
  }
}
'
聚合中指定顺序来使用嵌套聚合的结果进行排序
curl -X GET "localhost:9200/bank/_search?pretty" -H 'Content-Type: application/json' -d'
{
  "size": 0,
  "aggs": {
    "group_by_state": {
      "terms": {
        "field": "state.keyword",
        "order": {
          "average_balance": "desc"
        }
      },
      "aggs": {
        "average_balance": {
          "avg": {
            "field": "balance"
          }
        }
      }
    }
  }
}
'
全文查询
curl -X GET "localhost:9200/bank/_search?pretty" -H 'Content-Type: application/json' -d'
{
  "query": {
    "match": {
      "message": {
        "query": "schwartzbuchanan@sybixtex.com"
      }
    }
  }
}
'


+
\ No newline at end of file diff --git a/es/es_files/Image [1].png b/es/es_files/Image [1].png new file mode 100644 index 0000000..cc1c35a Binary files /dev/null and b/es/es_files/Image [1].png differ diff --git a/es/es_files/Image [2].png b/es/es_files/Image [2].png new file mode 100644 index 0000000..e8e7274 Binary files /dev/null and b/es/es_files/Image [2].png differ diff --git a/es/es_files/Image [3].png b/es/es_files/Image [3].png new file mode 100644 index 0000000..8ff3607 Binary files /dev/null and b/es/es_files/Image [3].png differ diff --git a/es/es_files/Image [4].png b/es/es_files/Image [4].png new file mode 100644 index 0000000..3c9601a Binary files /dev/null and b/es/es_files/Image [4].png differ diff --git a/es/es_files/Image [5].png b/es/es_files/Image [5].png new file mode 100644 index 0000000..9fa9d9d Binary files /dev/null and b/es/es_files/Image [5].png differ diff --git a/es/es_files/Image [6].png b/es/es_files/Image [6].png new file mode 100644 index 0000000..45b99d3 Binary files /dev/null and b/es/es_files/Image [6].png differ diff --git a/es/es_files/Image.png b/es/es_files/Image.png new file mode 100644 index 0000000..3a9c465 Binary files /dev/null and b/es/es_files/Image.png differ diff --git a/jvm/JVM简介.md b/jvm/JVM简介.md index adf0aed..2d80b41 100644 --- a/jvm/JVM简介.md +++ b/jvm/JVM简介.md @@ -4,6 +4,8 @@ write once run everywhere ## jvm空间加载运行 +参考jvm规范:https://docs.oracle.com/javase/specs/index.html + ### 空间、运行时数据区 - 线程共享 diff --git a/kafka/kafka.md b/kafka/kafka.md new file mode 100644 index 0000000..58fecdf --- /dev/null +++ b/kafka/kafka.md @@ -0,0 +1 @@ +启动:./kafka-server-start.sh ./../config/server.properties \ No newline at end of file diff --git a/vue/erp-web.md b/vue/erp-web.md new file mode 100644 index 0000000..ed47994 --- /dev/null +++ b/vue/erp-web.md @@ -0,0 +1,36 @@ +目录查看 + +1. node_modules:安装依赖打包 +2. public:图片文件,index.html +3. src: + 1. api:调用接口使用的js文件 + 2. assets:图片文件 + 3. components:vue组件文件页面处理 +4. config:request.js,请求配置token设置。 +5. filters:index.js,时间格式化,变量转换。 +6. router: + 1. index.js,从接口获取路由配置之 + 2. index备份.js:配置路由备份 + 3. permission.js:权限校验是否有token,遍历路由权限校验 + 4. router.config.js:免密登录白名单 +7. store:用户信息和权限处理 + 1. nodules/user.js + 2. getters.js + 3. index.js +8. styles:样式处理 +9. utils:工具类 +10. views + 1. dashboard:页面排版vue + 2. forgetPassowrd:fogetPassword.vue + 3. login:login.vue + 4. register:register.vue + 5. webView:webView.vue +11. App.vue +12. main.js:websocket +13. registerServiceWorker.js:生产环境配置 +14. .env不同环境变量配置 +15. label.config.js +16. package.json:包管理,启动打包 +17. vue.config.js: + +vue-cli-service serve \ No newline at end of file diff --git a/从放弃到入门系列.md b/从放弃到入门系列.md new file mode 100644 index 0000000..8f0280e --- /dev/null +++ b/从放弃到入门系列.md @@ -0,0 +1,19 @@ +1. 制定合理的规范 +2. 全局异常处理 +3. 日志分类 +4. 监控 +5. 解耦 +6. 经历IO必须校验 +7. ~~重要接口,外部接口记录耗时和日志~~ +8. Linux权限 +9. 时序,0 + 1 * 3,0 * 3 + 1 +10. 幂等处理 +11. 没有最好的方案,就用最有效的方案开始做(没有执行力的远见等于空想)。 +12. 重要接口,外部接口记录耗时和日志 +13. 大前端 +14. 幂等≠并发 +15. 逻辑略多:列出所有的情况,写清思路(业务文档,解决方案文档)。 +16. 新增字段必须校验(老数据可能不符合规范) +17. 分治 +18. ~~解决方案文档~~ +19. 修改接口确保之前逻辑不变 \ No newline at end of file diff --git a/从放弃到入门系列.txt b/从放弃到入门系列.txt deleted file mode 100644 index e69de29..0000000