学习地址1:https://pan.baidu.com/s/1fB4G2FiLKFb3cTzeQnvOhQ 提取码:zhap 学习地址2:https://share.weiyun.com/mfnRJBo6 密码:ybk95y
WPF(Windows Presentation Foundation)是微软推出的基于Windows 的用户界面框架,属于.NET Framework 3.0的一部分。它提供了统一的编程模型、语言和框架,真正做到了分离界面设计人员与开发人员的工作;同时它提供了全新的多媒体交互用户图形界面。
WPF(Windows Presentation Foundation)是由微软开发的桌面应用程序框架,用于创建现代化、高度交互和具有视觉吸引力的用户界面。它是 .NET Framework 的一部分,提供了一种基于 XAML(Extensible Application Markup Language)语言的声明性编程模型,可以很容易地创建动态、灵活的用户界面,并且可以与其他 .NET 技术无缝集成。WPF 还具有强大的数据绑定和可重用性,使开发人员可以更快地构建和维护应用程序。WPF 也支持硬件加速和高分辨率显示,为用户带来更好的体验。
WPF 和 Winform 的区别# WPF(Windows Presentation Foundation)和 WinForms(Windows Forms)都是用于创建 Windows 桌面应用程序的框架,但它们有一些重要的区别:
编程模型:WPF 是基于 XAML 的声明性编程模型,它可以很容易地创建动态、灵活的用户界面,支持动画和高级视觉效果。而 WinForms 则是基于传统的命令式编程模型,需要在代码中手动设置每个控件的属性和事件处理程序。 数据绑定:WPF 有一个强大的数据绑定系统,可以将 UI 元素和数据源相互绑定,使应用程序更容易管理和更新数据。WinForms 也支持数据绑定,但不如 WPF 灵活。 可重用性:WPF 支持样式和模板,使 UI 元素可以轻松地重用和自定义,这大大简化了应用程序的开发和维护。WinForms 则需要手动创建每个 UI 元素,不太容易重用。 矢量图形和分辨率:WPF 使用矢量图形,可在高分辨率屏幕上呈现清晰的图像,而 WinForms 使用像素图形,可能在高分辨率屏幕上显示模糊或失真。
首先我们新建一个订单索引,我们将订单中的多个商品以数组的形式存到订单这个索引中的goods字段中
PUT order { "settings": { "number_of_shards": 1, "number_of_replicas": 0 }, "mappings": { "properties": { "id":{ "type": "keyword", "doc_values": false, "similarity": "boolean", "norms": false }, "ctime":{ "type": "long" }, "pay":{ "type": "double" } } } } 我们搜索商品数量为2,且商品标题为iphone的商品,按照我们的预期来看,应该搜不到这个商品,我们执行看看 GET order/_search { "query": { "bool": { "must": [ { "term": { "goods.num": { "value": 2 } } },{ "match_phrase": { "goods.name": "iphone" } } ] } } } 对于ES的 _id其实不一定是唯一的,我们可以通过下面的例子来验证 PUT test_index { "settings": { "number_of_shards": 10 } }
没有指定routing,默认使用ES _id 作为文档的routing
POST test_index/_doc/1 { "name":"测试文档1" }
指定routing=2
POST test_index/_doc/1?routing=2 { "name":"测试文档2" }
指定routing=3
POST test_index/_doc/1?routing=3 { "name":"测试文档3" } 我们通过test集群来充当查询集群,也就是本地集群的角色,则需要在test集群上配置test2集群的信息,当然,也可以使用单独的集群来做查询集群,需要对其他需要查询的集群进行配置。 PUT _cluster/settings { "persistent" : { "cluster" : { "remote" : { "test2" : { "mode" : "sniff", "transport.compress": true, "skip_unavailable": true, "transport.ping_schedule": "60s", "seeds" : [ "127.0.0.1:9302" ] } } } } } 需要注意yml文件的层级关系,我的完整配置文件如下:
my global config
global: scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute. evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
scrape_timeout is set to the global default (10s).
Alertmanager configuration
my global config
global: scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute. evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
scrape_timeout is set to the global default (10s).
Alertmanager configuration
alerting: - targets: # - alertmanager:9093
Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
- "first_rules.yml"
- "second_rules.yml"
A scrape configuration containing exactly one endpoint to scrape:
Here it's Prometheus itself.
scrape_configs:
The job name is added as a label job=<job_name>
to any timeseries scraped from this config.
job_name: "prometheus"
metrics_path defaults to '/metrics'
scheme defaults to 'http'.
static_configs:
- targets: ["localhost:9090"]
job_name: "es_test"
static_configs:- targets: ['192.168.1.86:9114'] 由于开发者接口不做用户登录态的校验,我们通过参数加签的方式使用系统下发的ak,sk来对接口进行鉴权。 devOrderController := dev.OrderController{} //开发者api devApiv1 := r.Group("/dev/v1").Use(middleware.Auth()) { devApiv1.GET("/orders/user/:uid", devOrderController.GetUserOrders) }