新k8s的higress使用

Higress 是一个三合一的云原生 API 网关:

  • 流量网关:负责南北向流量调度、负载均衡、协议转换(如 HTTP/gRPC/WebSocket)、SSL/TLS 终止、动静分离等,可完全替代 Nginx / Nginx Ingress。
  • 微服务网关:深度集成服务发现(支持 Nacos、Consul、Kubernetes Services 等),提供限流、熔断、重试、超时控制、蓝绿发布、灰度发布(基于 Header、Cookie、权重等多维度规则)等服务治理能力,可替代 Spring Cloud Gateway。
  • 安全网关:内置 Web 应用防火墙(WAF),基于 ModSecurity + OWASP CRS 规则集,防御 SQL 注入、XSS、命令注入等常见攻击;同时支持 JWT、OAuth2、Key Auth、OIDC 等统一鉴权机制,实现认证与授权前置化。
  • 插件扩展体系:支持 Go、WASM、Java 等多语言插件,便于定制路由、鉴权、日志、监控等业务逻辑。
  • 云原生友好:原生支持 Kubernetes Ingress / Gateway API,兼容 Nginx Ingress 注解,支持配置热更新、多租户、可观测性(Metrics / Logging / Tracing)集成。

换句话说,Higress 是一个集 流量调度 + 服务治理 + 安全防护 + 统一鉴权 + 发布策略控制 于一体的现代化 API 网关。
在典型的微服务架构中,它可以一站式替代 Nginx(流量入口) + Spring Cloud Gateway(微服务路由) + WAF(Web 安全防护),显著简化架构、降低运维复杂度,并提升性能与安全性。后续可逐步将原有 Nginx 与 Spring Cloud Gateway 组件下线,由 Higress 统一承载南北向流量。

关于蓝绿发布与灰度发布(重点补充)

Higress 完整支持蓝绿发布与灰度发布,具体能力包括:

  • 基于权重的流量切分:例如将 90% 流量路由到 v1,10% 到 v2。
  • 基于请求特征的灰度:根据 Header(如 x-user-id)、Cookie、Query 参数、IP 等条件,将特定用户或请求路由到新版本。
  • 服务版本管理:配合 Kubernetes 的 Service 和 Label,实现版本化路由。
  • 无缝回滚:通过动态配置更新,秒级切换流量比例或关闭灰度。

这些能力通过 Higress 的 路由规则(Route)和虚拟服务(VirtualService)CRD 进行声明式配置,无需修改应用代码。

✅ 支持 API 转 MCP(Model Context Protocol)

Higress 内置 MCP Server 插件,能够无需编写代码,将企业已有的 HTTP/REST API 或数据库服务快速转换为 AI 助手可调用的 MCP 工具,无缝接入如 Dify、阿里百炼、字节 Coze 等 AI Agent 平台 。

核心能力包括:

  • 零代码转换:只需配置路由和后端服务信息(如 API 地址、认证方式),Higress 自动将 OpenAPI(OAS 3.0)描述转换为 MCP 协议接口 。
  • 多协议兼容:支持 MCP 的多个迭代版本(如 2024110520250326),可在同一网关同时处理新旧 MCP 协议请求 。
  • 统一治理:转换后的 MCP 服务自动继承 Higress 的鉴权(JWT/OAuth2)。
  • 生态集成:已落地于金融、地图、电商等多个场景,例如将高德地图地理编码 API、今日投资金融数据 API 转为 MCP 工具,供 AI 自动调用 。
  • 私有 MCP 市场:企业可基于 Higress 构建内部 MCP 工具市场,集中管理所有 AI 可调用的服务 。

💡 典型场景
一个内部用户查询接口 /api/users/{id},原本只能被前端或移动端调用。通过 Higress MCP 能力,AI 助手在对话中即可自动识别“查询用户信息”意图,并直接调用该接口获取结构化数据,无需额外开发适配层。

测试环境higress地址:

控制台:http://172.31.70.156:8001/

网关入口:Welcome to Higress!Welcome to Higre

生产环境higress地址:

控制台:http://172.31.10.44:32561/

网关入口:http://172.31.10.41:32013/和https://172.31.10.41:32518/

用户名admin密码Bzzc@934#

1.添加服务来源

image-20251113111128448

2.查看服务列表

image-20251113111209485

注意,从注册中心拉到的服务ip是k8s集群内部的ip,如果higress是单独部署的,或者是跨集群的,是访问不到的,需要单独开nodeport或者load balancer的网络然后使用固定地址访问而不是注册中心。

3.创建路由

image-20251113112905853

image-20251113112923735

3.1 设置路由插件

image-20251113113013329

路径重写:

image-20251113113028844

类似nginx的路径重写

4.mcp服务器插件配置

当日值班

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
server:
allowTools:
- "get-today-duty-info"
name: "duty-service"
tools:
- args:
- default: "{{ now }}"
description: "签到日期,格式为 yyyy-MM-dd HH:mm:ss,默认为今天"
name: "signDate"
position: "query"
required: true
type: "string"
- default: "-1"
description: "组织机构ID,传-1表示获取全部,必须传-1"
name: "orgId"
position: "query"
required: true
type: "string"
- description: "认证Token"
name: "Authorization"
position: "header"
required: true
type: "string"
description: "获取当日值班列表信息"
name: "get-today-duty-info"
requestTemplate:
headers:
- key: "Authorization"
value: "{{.args.Authorization}}"
method: "GET"
url: "http://172.31.10.113:33001/app/duty/appUserSign/listByOrg?signDate={{.args.signDate}}&orgId={{.args.orgId}}"
responseTemplate:
body: |-
{{- if eq .status "200" }}
## 当日值班信息

{{- range .result }}
### {{ .orgName }} ({{ .code }})
- **组织ID**: {{ .orgId }}
- **当日值班人数**: {{ .todayDutyCount }}
- **部门用户总数**: {{ .orgUserCount }}

{{- if .list }}
#### 值班人员列表:
{{- range .list }}
- **姓名**: {{ .userName }}
- **岗位**: {{ .positionName }}
- **电话**: {{ .phoneNum }}
- **签到状态**: {{ if eq .signYesNo 1 }}已签到{{ else }}未签到{{ end }}
- **岗位类型**: {{ if eq .signPositionType 1 }}正班{{ else if eq .signPositionType 2 }}副班{{ else }}其他{{ end }}
{{- end }}
{{- else }}
> 今日暂无值班人员
{{- end }}

---
{{- end }}
{{- else }}
## 请求失败
- **状态码**: {{.status}}
- **错误信息**: {{.message}}
{{- end }}

mcp服务器插件配置生成的提示词模板

搜索higress的mcp服务器插件配置语法,并模仿如下配置生成一个新配置:

【mcp服务器插件配置】

新配置的功能是获取当日值班的数据,url是http://172.31.70.156:8080/duty-service/app/duty/appUserSign/listByOrg,是get请求,入参有signDate,格式是yyyy-MM-dd HH:mm:ss,默认传今天,还有orgId,组织机构id,默认传-1,就是全部的意思,返回的结果是这样的:

【结果返回实际结果】

对应的接口是这样的:

【接口controller代码】

【出入参实体类】

半小时天气

搜索higress的mcp服务器插件配置语法,并模仿如下配置生成一个新配置:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
server:
allowTools:
- "get-today-duty-info"
name: "duty-service"
tools:
- args:
- default: "{{ now }}"
description: "签到日期,格式为 yyyy-MM-dd HH:mm:ss,默认为今天"
name: "signDate"
position: "query"
required: true
type: "string"
- default: "-1"
description: "组织机构ID,传-1表示获取全部,必须传-1"
name: "orgId"
position: "query"
required: true
type: "string"
- description: "认证Token"
name: "Authorization"
position: "header"
required: true
type: "string"
description: "获取当日值班列表信息"
name: "get-today-duty-info"
requestTemplate:
headers:
- key: "Authorization"
value: "{{.args.Authorization}}"
method: "GET"
url: "http://172.31.10.113:33001/app/duty/appUserSign/listByOrg?signDate={{.args.signDate}}&orgId={{.args.orgId}}"
responseTemplate:
body: |-
{{- if eq .status "200" }}
## 当日值班信息

{{- range .result }}
### {{ .orgName }} ({{ .code }})
- **组织ID**: {{ .orgId }}
- **当日值班人数**: {{ .todayDutyCount }}
- **部门用户总数**: {{ .orgUserCount }}

{{- if .list }}
#### 值班人员列表:
{{- range .list }}
- **姓名**: {{ .userName }}
- **岗位**: {{ .positionName }}
- **电话**: {{ .phoneNum }}
- **签到状态**: {{ if eq .signYesNo 1 }}已签到{{ else }}未签到{{ end }}
- **岗位类型**: {{ if eq .signPositionType 1 }}正班{{ else if eq .signPositionType 2 }}副班{{ else }}其他{{ end }}
{{- end }}
{{- else }}
> 今日暂无值班人员
{{- end }}

---
{{- end }}
{{- else }}
## 请求失败
- **状态码**: {{.status}}
- **错误信息**: {{.message}}
{{- end }}

新配置的功能是根据机场三字码获取半小时天气的数据,url是http://172.31.70.156:8080/production-service,是post请求,入参有airportCode,是机场的三字码,入参的json格式是这样的:{"entity“: {“airportCode”: “URC”}},返回的结果是这样的:

{
“status”: “200”,
“message”: null,
“result”: {
“visibilityColor”: 0,
“avgWindColor”: 0,
“tempColor”: 0,
“lowTempColor”: 0,
“highTempColor”: 0,
“visibilityColorAlertValue”: null,
“avgWindColorAlertValue”: null,
“tempColorAlertValue”: null,
“winddirectionAlertValue”: null,
“weatherInfoValue”: [
“”
],
“cloudInfoValue”: [
{
“id”: null,
“element”: null,
“describe”: null,
“cloudInfo”: “无重要云”,
“cloudHeight”: null,
“cloudForm”: null
}
],
“trendforecasTinfoValue”: null,
“warning”: [
{
“wid”: 1,
“yellow”: “8”,
“red”: “14”,
“type”: “windspeed”,
“airportCode”: “URC”
},
{
“wid”: 2,
“yellow”: “800”,
“red”: “550”,
“type”: “RVR”,
“airportCode”: “URC”
}
],
“cloudDescribe”: “”,
“cloudPic”: null,
“avgwindspeedColor”: “white”,
“weatherinfo”: null,
“cloudinfo”: “NSC”,
“otime”: “0430”,
“odate”: “20251104”,
“rptcontent”: “METAR ZWWW 040430Z 31004MPS 7000 NSC 08/01 Q1015 NOSIG= “,
“avgwindspeed”: “4”,
“verticalvisibility”: null,
“rwysighttrend”: null,
“rwysightTrendValue”: null,
“cavokflag”: null,
“trendforecastinfo”: null,
“winddirection”: “310”,
“inserttime”: “2025-11-04 04:29:20”,
“reftime”: “2025-11-04 12:30:00”,
“maxwindspeed”: null,
“receivetime”: “04:29”,
“temperature”: “8”,
“dewpointtemperature”: “1”,
“airpressure”: “1015”,
“cloudcount”: “1”,
“autoflag”: null,
“winddirectionchange”: null,
“minvisibility”: “7000”,
“minvisibilitydirection”: null,
“maxvisibility”: null,
“maxvisibilitydirection”: null,
“rwycount”: null,
“rwyid”: null,
“rwysight”: null,
“rwysightchange”: null,
“ncdflag”: null,
“reweathercount”: null,
“reweatherinfo”: null,
“wscount”: null,
“wsinfo”: null,
“seatemperature”: null,
“seastate”: null,
“rwystate”: null,
“trendforecastcount”: null,
“cccc”: “ZWWW”,
“skcflag”: null,
“nscflag”: “1”,
“reportid”: “c20251104043117358TXT0001001”,
“tt”: “SA”,
“aa”: “CI”,
“kk”: “39”,
“headdate”: “20251104”,
“headtime”: “0430”,
“bbb”: null,
“obcc”: “ZWWW”,
“weathercount”: null
},
“callback”: null
}

相关的代码是这样的:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
package com.xjcares.common.dto.weather;

import com.xjcares.common.vo.security.WeatherColorVo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

/**
* 天气小时报文
*
* @author root
*/
@Getter
@Setter
public class WeatherSASP extends WeatherColorVo {
/**
* '公报ID+报告顺序号(23 位+3 位) ',
*/
@ApiModelProperty(value = "'公报ID+报告顺序号(23 位+3 位) ")
private String REPORTID;
/**
* '接收时间(取自文件属性)',
*/
private String RECEIVETIME;
/**
* '入库时间(入库时获取系统时间)',
*/
private String INSERTTIME;
/**
* T '报文类别SA or SP (根据报头判定)',
*/
private String TT;
/**
* T '区域代码, 来自报头中的AA ',
*/
private String AA;
/**
* T '公报编号, 来自报头中的KK ',
*/
private String KK;
/**
* N 转发报日期文件名的年月(YYYYMM)+ 报头中的日(DD)经过比较计算后得到。
*/
private String HEADDATE;
/**
* 转发报时间来自报头的时分(HHMM)
*/
private String HEADTIME;
/**
* 通信发布中心代码
*/
private String CCCC;
/**
* Y 更正/修订标识,来自于报头(AAx、CCx、RRx)
*/
private String BBB;
/**
* 航站代码,来自报告的CCCC
*/
private String OBCC;
/**
* '观测日期(年月日) 根据报告中CCCC 后面的YYGGggZ 中的日(YY)和文件名的日期比较计算得'
*/
private String ODATE;
/**
* '观测时间(时分)指观测时间YYGGgg 中的GGgg ,例如0100 ,表示实况的观测时间为01 时00 分'
*/
private String OTIME;

/**
* 自动报告标识符,报告中若有AUTO ,则为1,否则为0
*/
private String AUTOFLAG;
/**
* '风向,来自报告中的ddd or VRB,如果为VRB,则存储为-2,如果为///, 则存储为-1 '
*/
private String WINDDIRECTION;
/**
* '平均风速,来自报告中的ff, 如果为///,则存储为-1'
*/
private String AVGWINDSPEED;

/**
* 没有不显示 '最大风速(阵风),来自报告中的fmfm 如果为///,则存储为-1 '
*/
private String MAXWINDSPEED;

/**
* 没有不显示 '重大风向变化,来自报告中的dndndnVdxdxdx ,风向变化起点,风向变化终点,以V 分隔',
*/
private String WINDDIRECTIONCHANGE;
/**
* 最小能见度,来自报告中的VVVV, 如果为////,则存储为-1 ',
*/
private String MINVISIBILITY;
/**
* '最小能见度方向,来自报告中的DV,方向不明则存储为//或者NDV ',
*/
private String MINVISIBILITYDIRECTION;
/**
* 最大能见度,来自报告中的VXVXVXVX, 如果为////,则存储为-1 ',
*/
private String MAXVISIBILITY;
/**
* '最大能见度的方向,来自报告中的DV, 方向不明则存储为//或者NDV ',
*/
private String MAXVISIBILITYDIRECTION;
/**
* '跑道条数,报告中无对应字段,需要计算得出。',
*/
private String RWYCOUNT;

/**
* 跑道信息 '跑道编号, 来自报告中的DRDR,各跑道编号以“&” 分隔,如果跑道编号不明则用///表示。如果报告中跑道编号带L 或R 或C,则L、R、C 也要存储。',
*/
private String RWYID;
/**
* '跑道视程, 来自报告中的VRVRVRVR 各跑道视程以“&”分隔,如果跑道视程不明则用//// 表示',
*/
private String RWYSIGHT;
/**
* '跑道视程的变化,来自报告中的VRVRVRVR 各跑道视程变化以“&”分隔,如果跑道视程变化不明则用//// 表示,VRVRVRVR 用4 位数字表示',
*/
private String RWYSIGHTCHANGE;
/**
* '跑道视程值的趋势,来自报告中的i 。各跑道视程值的趋势以“&”分隔,如果趋势不明,则用/表示,如果无趋势则用空字符串表示',
*/
private String RWYSIGHTTREND;

/**
* '是否无重要天气现象,来自报告中的CAVOK ,若无重要天气现象则填入1,此时最小能见度设定为9999,否则为0 ',
*/
private String CAVOKFLAG;
/**
* '现在天气的组数',
*/
private String WEATHERCOUNT;
/**
* '现在天气, 来自报告中的w''w'' ,各组天气以“&”分隔',
*/
private String WEATHERINFO;
/**
* '云组的个数',
*/
private String CLOUDCOUNT;
/**
* '云量云高云状,各组用“&” 分隔,云量云高云状之间用:分隔,如果云状不明,则用/// 表示,如果云状不存在,则用空字符串表示',
*/
private String CLOUDINFO;
/**
* '垂直能见度,如果不明则用-1 表示',
*/
private String VERTICALVISIBILITY;
/**
* '晴空,来自报告中的SKC, 报告中有SKC,则填入1,否则填入0 ',
*/
private String SKCFLAG;
/**
* '无重要云, 来自报告中的NSC,报告中有SKC,则填入1,否则填入0 ',
*/
private String NSCFLAG;
/**
* '无云,来自报告中的NCD, 报告中有SKC,则填入1,否则填入0 ',
*/
private String NCDFLAG;
/**
* '气温,来自报告中的T''T'' ',
*/
private String TEMPERATURE;
/**
* '露点温度, 来自报告中的T''dT''d ',
*/
private String DEWPOINTTEMPERATURE;
/**
* 气压值,来自报告中的PHPHPHPH, 以百帕为单位, 气压不明则用-1 表示'
*/
private String AIRPRESSURE;
/**
* 近时天气的组数
*/
private String REWEATHERCOUNT;
/**
* '近时天气,来自报告中RE w''w'' 的w''w'' ,各组天气以“&”分隔',
*/
private String REWEATHERINFO;
/**
* '风切变组数',
*/
private String WSCOUNT;

/**
* 没有不显示 '风切变,来自报告中的WS, 各组以“&”分隔',
*/
private String WSINFO;
/**
* '海面温度,来自报告中的WT''T''/Sn 中的T''T'' ',
*/
private String SEATEMPERATURE;
/**
* '海的状况, 来自报告中的WT''T''/Sn 中的n '
*/
private String SEASTATE;
/**
* '跑道状况,来自报告中的┌ D1PD2R DRDR │ or └ CLRDXX 包括跑道编号,跑道堆积物,跑道污染的范围,跑道堆积物深度,跑道摩擦系数。如果SNOCLO,则直接保存SNOCLO ',
*/
private String RWYSTATE;
/**
* '趋势预报组数'
*/
private String TRENDFORECASTCOUNT;
/**
* '趋势预报, 来自报告中的BECMG 或TEMPO,各预报以“&”分隔',
*/
private String TRENDFORECASTINFO;
/**
* 资料参照时间取自报告表对应记录的RefTime
*/
private String REFTIME;

/**
* '资料参照时间取自报告表对应记录的RefTime', rpt01_cac b表原报文信息
*/
private String RPTCONTENT;
/**
* 天气现象描述信息
*/
private List<String> weatherInfoValue;
/**
* 云要素描述信息
*/
private List<WeatherChangeInfoVO> cloudInfoValue;
/**
* 趋势变化情况描述
*/
private List<String> trendforecasTinfoValue;
/**
* 跑道视成趋势
*/
private String RWYSightTrendValue;

/**
* 预警值 (包装查询机场得所有预警值)
*/
private List<WeatherWarning> warning;

/**
* 云信息
*/
private String cloudDescribe;

/**
* 天气图标值
*/
private String cloudPic;

/**
* 平均风速背景色 orange;reed; white
*/
private String avgwindspeedColor;

}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
package com.xjcares.common.dto.weather;

/**
* Create by JYH 2018/3/27 11:06
* 包装天气变化信息
* app_weather_cloud_info
* app_weather_phenomenon_info
* @author JYH
*/
public class WeatherChangeInfoVO {

private Integer id;

/**
* 天气值
*/
private String element;

/**
* 天气值解释信息
*/
private String describe;

/**
* 云描述
*/
private String cloudInfo;

/**
* 云高
*/
private Integer cloudHeight;

/**
* 云状
*/
private String cloudForm;

public Integer getId() {
return id;
}

public void setId(Integer id) {
this.id = id;
}

public String getElement() {
return element;
}

public void setElement(String element) {
this.element = element;
}

public String getDescribe() {
return describe;
}

public void setDescribe(String describe) {
this.describe = describe;
}

public String getCloudInfo() {
return cloudInfo;
}

public void setCloudInfo(String cloudInfo) {
this.cloudInfo = cloudInfo;
}

public Integer getCloudHeight() {
return cloudHeight;
}

public void setCloudHeight(Integer cloudHeight) {
this.cloudHeight = cloudHeight;
}

public String getCloudForm() {
return cloudForm;
}

public void setCloudForm(String cloudForm) {
this.cloudForm = cloudForm;
}
}

结束

配置结果

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
server:
allowTools:
- "get-airport-weather"
name: "weather-service"
tools:
- args:
- description: "机场三字码,例如URC、PEK、PVG"
name: "airportCode"
position: "body"
required: true
type: "string"
- description: "认证Token"
name: "Authorization"
position: "header"
required: true
type: "string"
description: "获取机场半小时天气数据"
name: "get-airport-weather"
requestTemplate:
body: |
{
"entity": {
"airportCode": "{{.args.airportCode}}"
}
}
headers:
- key: "Content-Type"
value: "application/json"
- key: "Authorization"
value: "{{.args.Authorization}}"
method: "POST"
url: "http://production-service/production-service/app/production/weather/getWeatherPredictionByHour"
responseTemplate:
body: "{{- if eq .status \"200\" }}\n## {{ .result.cccc }} 机场半小时天气报告\n\n**观测时间\
**: {{ .result.odate }} {{ .result.otime }} UTC \n**接收时间**: {{ .result.receivetime\
\ }} \n**报告ID**: {{ .result.reportid }}\n\n### 基本气象要素\n- **风向**: {{ .result.winddirection\
\ }}°\n- **平均风速**: {{ .result.avgwindspeed }} m/s ({{ .result.avgwindspeedColor\
\ }})\n- **气温**: {{ .result.temperature }}°C\n- **露点温度**: {{ .result.dewpointtemperature\
\ }}°C\n- **气压**: {{ .result.airpressure }} hPa\n- **能见度**: {{ .result.minvisibility\
\ }} 米\n\n### 云况信息\n{{- if eq .result.nscflag \"1\" }}\n- **云况**: 无重要云 (NSC)\n\
{{- else }}\n{{- if .result.cloudInfoValue }}\n{{- range .result.cloudInfoValue\
\ }}\n{{- if .cloudInfo }}\n- **{{ .cloudInfo }}**\n {{- if .cloudHeight }},\
云高: {{ .cloudHeight }} 米{{ end }}\n {{- if .cloudForm }},云状: {{ .cloudForm\
\ }}{{ end }}\n{{- end }}\n{{- end }}\n{{- end }}\n{{- end }}\n\n### 跑道视程\n\
{{- if .result.rwysight }}\n- **跑道视程**: {{ .result.rwysight }} 米\n{{- if .result.rwysightchange\
\ }}\n - **变化趋势**: {{ .result.rwysightchange }}\n{{- end }}\n{{- else }}\n\
- **跑道视程**: 无数据\n{{- end }}\n\n### 天气现象\n{{- if .result.weatherInfoValue }}\n\
{{- range .result.weatherInfoValue }}\n{{- if . }}\n- **天气现象**: {{ . }}\n{{-\
\ end }}\n{{- end }}\n{{- end }}\n\n### 预警信息\n{{- if .result.warning }}\n{{-\
\ range .result.warning }}\n{{- if eq .type \"windspeed\" }}\n- **风速预警**: 黄色\
阈值 {{ .yellow }} m/s,红色阈值 {{ .red }} m/s\n{{- else if eq .type \"RVR\" }}\n\
- **跑道视程预警**: 黄色阈值 {{ .yellow }} 米,红色阈值 {{ .red }} 米\n{{- else }}\n- **{{ .type\
\ }}预警**: 黄色阈值 {{ .yellow }},红色阈值 {{ .red }}\n{{- end }}\n{{- end }}\n{{- else\
\ }}\n> 无预警信息\n{{- end }}\n\n### 原始报文\n```\n{{ .result.rptcontent }}\n```\n\n\
---\n{{- else }}\n## 请求失败\n- **状态码**: {{.status}}\n- **错误信息**: {{.message}}\n\
{{- end }}"

24小时天气

搜索higress的mcp服务器插件配置语法,并模仿如下配置生成一个新配置:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
server:
allowTools:
- "get-airport-weather"
name: "weather-service"
tools:
- args:
- description: "机场三字码,例如URC、PEK、PVG"
name: "airportCode"
position: "body"
required: true
type: "string"
- description: "认证Token"
name: "Authorization"
position: "header"
required: true
type: "string"
description: "获取机场半小时天气数据"
name: "get-airport-weather"
requestTemplate:
body: |
{
"entity": {
"airportCode": "{{.args.airportCode}}"
}
}
headers:
- key: "Content-Type"
value: "application/json"
- key: "Authorization"
value: "{{.args.Authorization}}"
method: "POST"
url: "http://production-service/production-service/app/production/weather/getWeatherPredictionByHour"
responseTemplate:
body: "{{- if eq .status \"200\" }}\n## {{ .result.cccc }} 机场半小时天气报告\n\n**观测时间\
**: {{ .result.odate }} {{ .result.otime }} UTC \n**接收时间**: {{ .result.receivetime\
\ }} \n**报告ID**: {{ .result.reportid }}\n\n### 基本气象要素\n- **风向**: {{ .result.winddirection\
\ }}°\n- **平均风速**: {{ .result.avgwindspeed }} m/s ({{ .result.avgwindspeedColor\
\ }})\n- **气温**: {{ .result.temperature }}°C\n- **露点温度**: {{ .result.dewpointtemperature\
\ }}°C\n- **气压**: {{ .result.airpressure }} hPa\n- **能见度**: {{ .result.minvisibility\
\ }} 米\n\n### 云况信息\n{{- if eq .result.nscflag \"1\" }}\n- **云况**: 无重要云 (NSC)\n\
{{- else }}\n{{- if .result.cloudInfoValue }}\n{{- range .result.cloudInfoValue\
\ }}\n{{- if .cloudInfo }}\n- **{{ .cloudInfo }}**\n {{- if .cloudHeight }},\
云高: {{ .cloudHeight }} 米{{ end }}\n {{- if .cloudForm }},云状: {{ .cloudForm\
\ }}{{ end }}\n{{- end }}\n{{- end }}\n{{- end }}\n{{- end }}\n\n### 跑道视程\n\
{{- if .result.rwysight }}\n- **跑道视程**: {{ .result.rwysight }} 米\n{{- if .result.rwysightchange\
\ }}\n - **变化趋势**: {{ .result.rwysightchange }}\n{{- end }}\n{{- else }}\n\
- **跑道视程**: 无数据\n{{- end }}\n\n### 天气现象\n{{- if .result.weatherInfoValue }}\n\
{{- range .result.weatherInfoValue }}\n{{- if . }}\n- **天气现象**: {{ . }}\n{{-\
\ end }}\n{{- end }}\n{{- end }}\n\n### 预警信息\n{{- if .result.warning }}\n{{-\
\ range .result.warning }}\n{{- if eq .type \"windspeed\" }}\n- **风速预警**: 黄色\
阈值 {{ .yellow }} m/s,红色阈值 {{ .red }} m/s\n{{- else if eq .type \"RVR\" }}\n\
- **跑道视程预警**: 黄色阈值 {{ .yellow }} 米,红色阈值 {{ .red }} 米\n{{- else }}\n- **{{ .type\
\ }}预警**: 黄色阈值 {{ .yellow }},红色阈值 {{ .red }}\n{{- end }}\n{{- end }}\n{{- else\
\ }}\n> 无预警信息\n{{- end }}\n\n### 原始报文\n```\n{{ .result.rptcontent }}\n```\n\n\
---\n{{- else }}\n## 请求失败\n- **状态码**: {{.status}}\n- **错误信息**: {{.message}}\n\
{{- end }}"

新配置的功能是获取9小时或者24小时天气数据,url是http://172.31.70.156:8080/production-service/app/production/weather/getWeatherPrediction,是POST请求,入参有airportCode,是机场三字码,timeInterval,天气类型(FC 9小时; FT 24小时),入参json是这样的:{“entity”: {“airportCode”: “URC”, “timeInterval”: “FT”}}。返回的结果是这样的:

{
“status”: “200”,
“message”: null,
“result”: {
“visibilityColor”: 0,
“avgWindColor”: 0,
“tempColor”: 0,
“lowTempColor”: 0,
“highTempColor”: 0,
“visibilityColorAlertValue”: null,
“avgWindColorAlertValue”: null,
“tempColorAlertValue”: null,
“winddirectionAlertValue”: null,
“phenomenonDescribe”: “无数据”,
“cloudDescribe”: “无重要云”,
“temperatureMap”: {
“min”: “11-06 02时,最低温度为01℃”,
“max”: “11-04 20时,最高温度为09℃”
},
“changeInfoMap”: {
“becmgInfo”: [
“2025-11-04 21时到04日22时
预期变化: 风向:180 风速:03 “,
“2025-11-05 07时到05日08时
预期变化: 风向:340 风速:04 最大风速:09 能见度:2500 小雨 多云 阴天 “,
“2025-11-05 12时到05日13时
预期变化: 小雨加雪 “,
“2025-11-05 16时到05日17时
预期变化: 小雪 “,
“2025-11-05 17时到05日18时
预期变化: 能见度:0800 雪 多云 阴天 “
]
},
“warning”: [
{
“wid”: 1,
“yellow”: “8”,
“red”: “14”,
“type”: “windspeed”,
“airportCode”: “URC”
},
{
“wid”: 2,
“yellow”: “800”,
“red”: “550”,
“type”: “RVR”,
“airportCode”: “URC”
}
],
“yellowSpeed”: null,
“redSpeed”: null,
“yellowRVR”: null,
“redRVR”: null,
“maxwindspeedcolor”: null,
“windspeedcolor”: “white”,
“temperatureMax”: null,
“temperatureMin”: null,
“cloudPic”: null,
“weatherinfo”: null,
“cloudinfo”: “NSC”,
“cavok”: null,
“otime”: “0902”,
“odate”: “20251104”,
“becmginfo”: “BECMG 0413/0414 18003MPS&BECMG 0423/0424 34004G09MPS 2500 -RA BKN006 OVC020&BECMG 0504/0505 -RASN&BECMG 0508/0509 -SN&BECMG 0509/0510 0800 SN BKN002 OVC011”,
“tempoinfo”: null,
“rptcontent”: “TAF ZWWW 040902Z 0412/0518 36003MPS 6000 NSC TX09/0412Z TN06/0423Z TN01/0518Z BECMG 0413/0414 18003MPS BECMG 0423/0424 34004G09MPS 2500 -RA BKN006 OVC020 BECMG 0504/0505 -RASN BECMG 0508/0509 -SN BECMG 0509/0510 0800 SN BKN002 OVC011= “,
“verticalvisibility”: null,
“winddirection”: “360”,
“inserttime”: “2025-11-04 09:10:05”,
“reftime”: “2025-11-04 17:02:00”,
“vtime”: “(有效期:2025-11-04 20:00:00\t\t2025-11-06 02:00:00)”,
“maxwindspeed”: null,
“windspeed”: “3”,
“receivetime”: “2025-11-04 09:10:04”,
“temperature”: “ TX09/0412Z TN06/0423Z TN01/0518Z”,
“cloudcount”: “1”,
“cccc”: “ZWWW”,
“skcflag”: null,
“nscflag”: “1”,
“becmgcount”: “5”,
“tempocount”: null,
“fmcount”: null,
“fminfo”: null,
“probcount”: null,
“probinfo”: null,
“rptstate”: 0,
“reportid”: “c20251104091201373TXT0028001”,
“tt”: “FT”,
“aa”: “CI”,
“kk”: “39”,
“headdate”: “20251104”,
“headtime”: “0902”,
“bbb”: null,
“obcc”: “ZWWW”,
“forecastperiod”: “2025110412/2025110518”,
“levelvisibility”: “6000”,
“nswflag”: null,
“weathercount”: null
},
“callback”: null
}

相关的代码是这样的:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
package com.xjcares.common.dto.weather;

import com.xjcares.common.vo.security.WeatherColorVo;
import io.swagger.annotations.ApiModelProperty;

import java.util.List;
import java.util.Map;

/**
* 获取天气预报(timeInterval FC 9小时 FT 24小时)
* 表ele01_fcft字段
*
* @author root
*/
public class WeatherPrediction extends WeatherColorVo {
/**
* 公报id
*/
@ApiModelProperty(value = "公报id")
private String REPORTID;

/**
* 发布中心代码
*/
@ApiModelProperty(value = "发布中心代码")
private String CCCC;

/**
* 收到时间
*/
@ApiModelProperty(value = "收到时间")
private String RECEIVETIME;

/**
* 入库时间
*/
@ApiModelProperty(value = "入库时间")
private String INSERTTIME;

/**
* 公报报类
*/
@ApiModelProperty(value = "公报报类")
private String TT;

/**
* 国家代码
*/
@ApiModelProperty(value = "国家代码")
private String AA;

/**
* 区域标识码
*/
@ApiModelProperty(value = "区域标识码")
private String KK;

/**
* 转发报日期
*/
@ApiModelProperty(value = "转发报日期")
private String HEADDATE;

/**
* 转发报时间
*/
@ApiModelProperty(value = "转发报时间")
private String HEADTIME;

/**
* 修订更正标识码
*/
@ApiModelProperty(value = "修订更正标识码")
private String BBB;

/**
* 航站码
*/
private String OBCC;

/**
* 资料采集的年月日,报文首行
*/
private String ODATE;

/**
* 资料采集的时分,来字报文首行
*/
private String OTIME;

/**
* 预报时段
*/
private String FORECASTPERIOD;

/**
* 风向
*/
private String WINDDIRECTION;

/**
* 风速
*/
private String WINDSPEED;

/**
* 最大风速,没有值不显示
*/
private String MAXWINDSPEED;

/**
* 无CAVOK 为0,有CAVOK 为1
*/
private String CAVOK;

/**
* 水平能见度
*/
private String LEVELVISIBILITY;

/**
* 无重要天气无NSW 为0,有NSW 为1
*/
private String NSWFLAG;

/**
* 重要天气现象组数
*/
private String WEATHERCOUNT;

/**
* 重要天气现象
*/
private String WEATHERINFO;

/**
* 碧空(无SKC 为0,有SKC 为1)
*/
private String SKCFLAG;

/**
* 无重要云(无NSC 为0,有NSC 为1)
*/
private String NSCFLAG;

/**
* 云要素数目i,与CloudInfo 有关
*/
private String CLOUDCOUNT;

/**
* 云要素
*/
private String CLOUDINFO;

/**
* VVnnn 中的nnn ,垂直能见度(VV///记-1)
*/
private String VERTICALVISIBILITY;

/**
* 温度要素(按实际报文存放)TX32/20 TN20/11Z 或T32/02 T26/10
*/
private String TEMPERATURE;

/**
* BECMG 变化组天气数目i,与BECMGInfo 有关
*/
private String BECMGCOUNT;
/**
* BECMG 变化组之间以“&”分割,变化组内部要素以“:” 分割,缺字段填空格如:时段1:风1:能见度1:天气1:云1&...&时段i:风i ): 天气i:云i,i 为变化组要素个数,由BECMGCount 描述
*/
private String BECMGINFO;

/**
* TEMPO 变化组天气数目i,与TEMPOInfo 有关
*/
private String TEMPOCOUNT;

/**
* TEMPO 变化组之间以“&”分割。不分解,存原文
*/
private String TEMPOINFO;

/**
* FM 变化组天气数目i,与FMInfo 有关
*/
private String FMCOUNT;

/**
* FM 变化组之间以“&”分割。不分解,存原文
*/
private String FMINFO;

/**
* PROB 变化组天气数目i ,与PROBInfo 有关
*/
private String PROBCOUNT;

/**
* PROB 变化组之间以“&”分割。不分解,存原文
*/
private String PROBINFO;

/**
* 资料参照时间取自报告表对应记录的RefTime
*/
@ApiModelProperty(value = "发布时间")
private String REFTIME;

/**
* 表rpt01_cac 私有字段 有效时间
*/
@ApiModelProperty(value = "有效时间")
private String VTIME;

/**
* 报告内容
*/
@ApiModelProperty(value = "报告内容,一长串内容")
private String RPTCONTENT;

/**
* 状态标示
*/
@ApiModelProperty(value = "状态标示")
private double RPTSTATE;

/**
* 用于包装天气现象描述信息
* 天气
*/
private String phenomenonDescribe;

/**
* 云信息
*/
private String cloudDescribe;

/**
* 最低最高温度信息
*/
private Map<String, String> temperatureMap;

/**
* 天气变化信息
*/
private Map<String, String[]> changeInfoMap;

/**
* 预警值 (包装查询机场得所有预警值)
*/
private List<WeatherWarning> warning;

//---------------------------------------------------------设置前台使用值---------------------------------------------
private Integer yellowSpeed;
private Integer redSpeed;
private Integer yellowRVR;
private Integer redRVR;

/**
* 最大风速背景色 orange;reed; white
*/
private String maxwindspeedcolor;

/**
* 风速背景色 orange;reed; white
*/
private String windspeedcolor;

/**
* 最高温度
*/
private String temperatureMax;

/**
* 最低温度
*/
private String temperatureMin;
/**
* 天气图标值
*/
private String cloudPic;


public String getCloudPic() {
return cloudPic;
}

public void setCloudPic(String cloudPic) {
this.cloudPic = cloudPic;
}

public String getTemperatureMax() {
return temperatureMax;
}

public void setTemperatureMax(String temperatureMax) {
this.temperatureMax = temperatureMax;
}

public String getTemperatureMin() {
return temperatureMin;
}

public void setTemperatureMin(String temperatureMin) {
this.temperatureMin = temperatureMin;
}

public String getWindspeedcolor() {
return windspeedcolor;
}

public void setWindspeedcolor(String windspeedcolor) {
this.windspeedcolor = windspeedcolor;
}

public String getMaxwindspeedcolor() {
return maxwindspeedcolor;
}

public void setMaxwindspeedcolor(String maxwindspeedcolor) {
this.maxwindspeedcolor = maxwindspeedcolor;
}

public Integer getYellowSpeed() {
return yellowSpeed;
}

public void setYellowSpeed(Integer yellowSpeed) {
this.yellowSpeed = yellowSpeed;
}

public Integer getRedSpeed() {
return redSpeed;
}

public void setRedSpeed(Integer redSpeed) {
this.redSpeed = redSpeed;
}

public Integer getYellowRVR() {
return yellowRVR;
}

public void setYellowRVR(Integer yellowRVR) {
this.yellowRVR = yellowRVR;
}

public Integer getRedRVR() {
return redRVR;
}

public void setRedRVR(Integer redRVR) {
this.redRVR = redRVR;
}

public Map<String, String[]> getChangeInfoMap() {
return changeInfoMap;
}

public void setChangeInfoMap(Map<String, String[]> changeInfoMap) {
this.changeInfoMap = changeInfoMap;
}

public Map<String, String> getTemperatureMap() {
return temperatureMap;
}

public void setTemperatureMap(Map<String, String> temperatureMap) {
this.temperatureMap = temperatureMap;
}

public String getPhenomenonDescribe() {
return phenomenonDescribe;
}

public void setPhenomenonDescribe(String phenomenonDescribe) {
this.phenomenonDescribe = phenomenonDescribe;
}

public String getCloudDescribe() {
return cloudDescribe;
}

public void setCloudDescribe(String cloudDescribe) {
this.cloudDescribe = cloudDescribe;
}

public String getREPORTID() {
return REPORTID;
}

public void setREPORTID(String REPORTID) {
this.REPORTID = REPORTID;
}

public String getCCCC() {
return CCCC;
}

public void setCCCC(String CCCC) {
this.CCCC = CCCC;
}

public String getRECEIVETIME() {
return RECEIVETIME;
}

public void setRECEIVETIME(String RECEIVETIME) {
this.RECEIVETIME = RECEIVETIME;
}

public String getINSERTTIME() {
return INSERTTIME;
}

public void setINSERTTIME(String INSERTTIME) {
this.INSERTTIME = INSERTTIME;
}

public String getTT() {
return TT;
}

public void setTT(String TT) {
this.TT = TT;
}

public String getAA() {
return AA;
}

public void setAA(String AA) {
this.AA = AA;
}

public String getKK() {
return KK;
}

public void setKK(String KK) {
this.KK = KK;
}

public String getHEADDATE() {
return HEADDATE;
}

public void setHEADDATE(String HEADDATE) {
this.HEADDATE = HEADDATE;
}

public String getHEADTIME() {
return HEADTIME;
}

public void setHEADTIME(String HEADTIME) {
this.HEADTIME = HEADTIME;
}

public String getBBB() {
return BBB;
}

public void setBBB(String BBB) {
this.BBB = BBB;
}

public String getOBCC() {
return OBCC;
}

public void setOBCC(String OBCC) {
this.OBCC = OBCC;
}

public String getODATE() {
return ODATE;
}

public void setODATE(String ODATE) {
this.ODATE = ODATE;
}

public String getOTIME() {
return OTIME;
}

public void setOTIME(String OTIME) {
this.OTIME = OTIME;
}

public String getFORECASTPERIOD() {
return FORECASTPERIOD;
}

public void setFORECASTPERIOD(String FORECASTPERIOD) {
this.FORECASTPERIOD = FORECASTPERIOD;
}

public String getWINDDIRECTION() {
return WINDDIRECTION;
}

public void setWINDDIRECTION(String WINDDIRECTION) {
this.WINDDIRECTION = WINDDIRECTION;
}

public String getWINDSPEED() {
return WINDSPEED;
}

public void setWINDSPEED(String WINDSPEED) {
this.WINDSPEED = WINDSPEED;
}

public String getMAXWINDSPEED() {
return MAXWINDSPEED;
}

public void setMAXWINDSPEED(String MAXWINDSPEED) {
this.MAXWINDSPEED = MAXWINDSPEED;
}

public String getCAVOK() {
return CAVOK;
}

public void setCAVOK(String CAVOK) {
this.CAVOK = CAVOK;
}

public String getLEVELVISIBILITY() {
return LEVELVISIBILITY;
}

public void setLEVELVISIBILITY(String LEVELVISIBILITY) {
this.LEVELVISIBILITY = LEVELVISIBILITY;
}

public String getNSWFLAG() {
return NSWFLAG;
}

public void setNSWFLAG(String NSWFLAG) {
this.NSWFLAG = NSWFLAG;
}

public String getWEATHERCOUNT() {
return WEATHERCOUNT;
}

public void setWEATHERCOUNT(String WEATHERCOUNT) {
this.WEATHERCOUNT = WEATHERCOUNT;
}

public String getWEATHERINFO() {
return WEATHERINFO;
}

public void setWEATHERINFO(String WEATHERINFO) {
this.WEATHERINFO = WEATHERINFO;
}

public String getSKCFLAG() {
return SKCFLAG;
}

public void setSKCFLAG(String SKCFLAG) {
this.SKCFLAG = SKCFLAG;
}

public String getNSCFLAG() {
return NSCFLAG;
}

public void setNSCFLAG(String NSCFLAG) {
this.NSCFLAG = NSCFLAG;
}

public String getCLOUDCOUNT() {
return CLOUDCOUNT;
}

public void setCLOUDCOUNT(String CLOUDCOUNT) {
this.CLOUDCOUNT = CLOUDCOUNT;
}

public String getCLOUDINFO() {
return CLOUDINFO;
}

public void setCLOUDINFO(String CLOUDINFO) {
this.CLOUDINFO = CLOUDINFO;
}

public String getVERTICALVISIBILITY() {
return VERTICALVISIBILITY;
}

public void setVERTICALVISIBILITY(String VERTICALVISIBILITY) {
this.VERTICALVISIBILITY = VERTICALVISIBILITY;
}

public String getTEMPERATURE() {
return TEMPERATURE;
}

public void setTEMPERATURE(String TEMPERATURE) {
this.TEMPERATURE = TEMPERATURE;
}

public String getBECMGCOUNT() {
return BECMGCOUNT;
}

public void setBECMGCOUNT(String BECMGCOUNT) {
this.BECMGCOUNT = BECMGCOUNT;
}

public String getBECMGINFO() {
return BECMGINFO;
}

public void setBECMGINFO(String BECMGINFO) {
this.BECMGINFO = BECMGINFO;
}

public String getTEMPOCOUNT() {
return TEMPOCOUNT;
}

public void setTEMPOCOUNT(String TEMPOCOUNT) {
this.TEMPOCOUNT = TEMPOCOUNT;
}

public String getTEMPOINFO() {
return TEMPOINFO;
}

public void setTEMPOINFO(String TEMPOINFO) {
this.TEMPOINFO = TEMPOINFO;
}

public String getFMCOUNT() {
return FMCOUNT;
}

public void setFMCOUNT(String FMCOUNT) {
this.FMCOUNT = FMCOUNT;
}

public String getFMINFO() {
return FMINFO;
}

public void setFMINFO(String FMINFO) {
this.FMINFO = FMINFO;
}

public String getPROBCOUNT() {
return PROBCOUNT;
}

public void setPROBCOUNT(String PROBCOUNT) {
this.PROBCOUNT = PROBCOUNT;
}

public String getPROBINFO() {
return PROBINFO;
}

public void setPROBINFO(String PROBINFO) {
this.PROBINFO = PROBINFO;
}

public String getREFTIME() {
return REFTIME;
}

public void setREFTIME(String REFTIME) {
this.REFTIME = REFTIME;
}

public String getVTIME() {
return VTIME;
}

public void setVTIME(String VTIME) {
this.VTIME = VTIME;
}

public String getRPTCONTENT() {
return RPTCONTENT;
}

public void setRPTCONTENT(String RPTCONTENT) {
this.RPTCONTENT = RPTCONTENT;
}

public double getRPTSTATE() {
return RPTSTATE;
}

public void setRPTSTATE(double RPTSTATE) {
this.RPTSTATE = RPTSTATE;
}

public List<WeatherWarning> getWarning() {
return warning;
}

public void setWarning(List<WeatherWarning> warning) {
this.warning = warning;
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
package com.xjcares.common.vo.security;

import lombok.Data;

import javax.persistence.Transient;
import java.util.List;

/**
* 能见度和温度的颜色
*/
@Data
public class WeatherColorVo {
@Transient
private int visibilityColor;
@Transient
private int avgWindColor;
/**
* 小时报中的温度警报 0正常 1橙色
*/
@Transient
private int tempColor;
/**
* 九小时天气中 的低温预警 0正常 1橙色
*/
@Transient
private int lowTempColor;
/**
* 九小时天气中 的高温预警 0正常 1橙色
*/
@Transient
private int highTempColor;


/**
* 小时报中的能见度警报颜色对应区间
*/
@Transient
private WeatherColorAlertValue visibilityColorAlertValue;
/**
* 小时报中的平均风速警报颜色对应区间
*/
@Transient
private WeatherColorAlertValue avgWindColorAlertValue;
/**
* 小时报中的温度警报颜色对应区间
*/
@Transient
private WeatherColorAlertValue tempColorAlertValue;

/**
* 风向风速悬浮窗提示
*/
@Transient
private WeatherColorAlertValue winddirectionAlertValue;

@Data
public static class WeatherColorAlertValue{
/**
* 数值区间
*/
private String alertValue;

/**
* 区间对应颜色
*/
private String color;

/**
* 区间对应颜色对应的数字
*/
private Integer colorId;

}

public enum TempColorEnum {

NORMAL(0,"普通"),
ORANGE(1,"橙色");
/**
* 颜色id
*/
private Integer id;
/**
* 颜色名称
*/
private String color;


TempColorEnum(Integer id, String color) {
this.id = id;
this.color = color;
}

public Integer getId() {
return id;
}

public String getColor() {
return color;
}
}


/**
* 通用颜色枚举类 1-蓝色 2-黄色 3-橙色 4-红色 5-E类
*/
public enum CommonColorEnum {

BLUE(1,"蓝色"),
YELLOW(2,"黄色"),
ORANGE(3,"橙色"),
RED(4,"红色"),
E_COLOR(5,"E类");
/**
* 颜色id
*/
private Integer id;
/**
* 颜色名称
*/
private String color;


CommonColorEnum(Integer id, String color) {
this.id = id;
this.color = color;
}

public Integer getId() {
return id;
}

public String getColor() {
return color;
}

public static CommonColorEnum getById(int type) {
for (CommonColorEnum e : CommonColorEnum.values()) {
if (type == e.getId()) {
return e;
}
}
return BLUE;
}
}
}

结束