(维修/清洁模式)自定义请求支持变量传递以及支持根据HTTP API自定义处理内容显示 #39

Closed
opened 2024-12-19 14:05:16 +08:00 by liangyuanpeng · 6 comments

例如 siteName wcName, 等都可以从URL中获取到的值

529e4bdaf0c97671c1509261997714d

image

例如 siteName wcName, 等都可以从URL中获取到的值 ![529e4bdaf0c97671c1509261997714d](/attachments/4ea60656-d27e-4732-8f97-df37d0616bed) ![image](/attachments/7070ce5f-2ad9-4ca2-9d48-04202ca3d4cd)
jeff was assigned by liangyuanpeng 2024-12-19 14:05:16 +08:00
Author
Owner
https://smartoilets.net/simplepage/twsc/4a/male?profile=cleaner 用于设置维修(清洁)模式
Author
Owner

image

![image](/attachments/b9bfebbe-025a-4358-91df-22f9c336434c)
Author
Owner

同时前端页面的显示条件需要根据这个接口返回的某个字段来判断显示具体的内容.

维修模式时需要显示 清洁中.... 正常模式则显示空闲数据, 看下这个该如何规范.

相关的 HTTP API 为 https://smartoilets.net/openapi/api/wc/info/wcStatus?siteName=twsc&wcName=4A&roomType=male

可以做一个简单的验证,确认好命名规范后先发出来, 这边同步修改SVG

https://gitea.yunhorn.com/smartoilets-front/projects/attachments/b0349cac-230e-4b9e-8e76-594f3172ff27

同时前端页面的显示条件需要根据这个接口返回的某个字段来判断显示具体的内容. 维修模式时需要显示 清洁中.... 正常模式则显示空闲数据, 看下这个该如何规范. 相关的 HTTP API 为 https://smartoilets.net/openapi/api/wc/info/wcStatus?siteName=twsc&wcName=4A&roomType=male 可以做一个简单的验证,确认好命名规范后先发出来, 这边同步修改SVG https://gitea.yunhorn.com/smartoilets-front/projects/attachments/b0349cac-230e-4b9e-8e76-594f3172ff27
liangyuanpeng changed title from 自定义请求支持变量传递 to 自定义请求支持变量传递以及支持根据HTTP API自定义处理内容显示 2024-12-20 17:35:42 +08:00
liangyuanpeng added the
kind/feature
label 2024-12-20 17:35:46 +08:00
Owner

image

處理好了, 可以驗證一下,目前添加了 siteName, roomType, wcName , deviceId, 這些變量, 其餘變量可通過增加 url query params 來來提供變量以及對應的值,比如 https://x.com?a=abc

此时 在 payload 中声明 {{a}}, 则会自动替换成 abc

![image](/attachments/aa30ded6-4f48-412a-b550-1be327b40016) 處理好了, 可以驗證一下,目前添加了 siteName, roomType, wcName , deviceId, 這些變量, 其餘變量可通過增加 url query params 來來提供變量以及對應的值,比如 https://x.com?a=abc 此时 在 payload 中声明 {{a}}, 则会自动替换成 abc
jeff added the
done-waiting-confirmed
label 2024-12-22 01:36:10 +08:00
Author
Owner

同时前端页面的显示条件需要根据这个接口返回的某个字段来判断显示具体的内容.

维修模式时需要显示 清洁中.... 正常模式则显示空闲数据, 看下这个该如何规范.

具体来说就是这个页面 https://smartoilets.net/simplepage/PWH/F2/male 需要去查询https://smartoilets.net/openapi/api/wc/info/wcStatus?siteName=PWH&wcName=F2&roomType=male 接口,然后根据接口的结果来决定是显示黄色这块还是显示空闲数据,这里也是需要变量的方式命名规范的方式 来做,也就是这个URL 应该是SVG里面命名定义的,而不是前端写死的.

这个该issue的第二个内容, 目前似乎只做了第一个内容.

> 同时前端页面的显示条件需要根据这个接口返回的某个字段来判断显示具体的内容. > 维修模式时需要显示 清洁中.... 正常模式则显示空闲数据, 看下这个该如何规范. 具体来说就是这个页面 https://smartoilets.net/simplepage/PWH/F2/male 需要去查询https://smartoilets.net/openapi/api/wc/info/wcStatus?siteName=PWH&wcName=F2&roomType=male 接口,然后根据接口的结果来决定是显示黄色这块还是显示空闲数据,这里也是需要变量的方式命名规范的方式 来做,也就是这个URL 应该是SVG里面命名定义的,而不是前端写死的. 这个该issue的第二个内容, 目前似乎只做了第一个内容.
jeff was unassigned by liangyuanpeng 2024-12-24 11:19:51 +08:00
liangyuanpeng changed title from 自定义请求支持变量传递以及支持根据HTTP API自定义处理内容显示 to (维修/清洁模式)自定义请求支持变量传递以及支持根据HTTP API自定义处理内容显示 2024-12-25 09:14:28 +08:00
liangyuanpeng removed the
done-waiting-confirmed
label 2024-12-25 14:11:55 +08:00
Owner

已經支持 http 請求命名, 命名規範詳情可以參考文檔。
舉例請求 https://smartoilets.net/openapi/api/wc/info/wcStatus?siteName=PWH&wcName=F2&roomType=male
返回值為
{
"msg": "success",
"timestamp": 1735378109679,
"data": {
"siteName": "PWH",
"wcName": "F2",
"roomType": "male",
"isRepair": false
}
}

当 isRepair 为 true时才显示, 则明明为: STS__CONDITION_RENDER://smartoilets.net/openapi/api/wc/info/wcStatus?siteName={{siteName}}&wcName={{wcName}}&roomType={{roomType}}:data.isRepair:true

已經支持 http 請求命名, 命名規範詳情可以參考文檔。 舉例請求 https://smartoilets.net/openapi/api/wc/info/wcStatus?siteName=PWH&wcName=F2&roomType=male 返回值為 { "msg": "success", "timestamp": 1735378109679, "data": { "siteName": "PWH", "wcName": "F2", "roomType": "male", "isRepair": false } } 当 isRepair 为 true时才显示, 则明明为: `STS__CONDITION_RENDER://smartoilets.net/openapi/api/wc/info/wcStatus?siteName={{siteName}}&wcName={{wcName}}&roomType={{roomType}}:data.isRepair:true`
jeff added the
done-waiting-confirmed
label 2024-12-28 18:21:17 +08:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: smartoilets-front/projects#39
No description provided.