- 云开发如何做服务端的缓存
各位大神,请教个问题思路,微信小程序利用云开发,如何做到把从第三方请求来的数据缓存起来,不用每次都请求第三方接口?比如向第三方接口平台获取天气数据,平台是有总的访问次数的,小程序云开发服务端做到每天请求一次就可以了,这个思路如何实现?写到文件里还是存到云服务端的表里? 比如这样的第三方接口:https://www.juhe.cn/docs/api/id/39 返回的是json格式: { "resultcode": "200", "reason": "查询成功!", "result": { "sk": { /*当前实况天气*/ "temp": "21", /*当前温度*/ "wind_direction": "西风", /*当前风向*/ "wind_strength": "2级", /*当前风力*/ "humidity": "4%", /*当前湿度*/ "time": "14:25" /*更新时间*/ }, "today": { "city": "天津", "date_y": "2014年03月21日", "week": "星期五", "temperature": "8℃~20℃", /*今日温度*/ "weather": "晴转霾", /*今日天气*/ "weather_id": { /*天气唯一标识*/ "fa": "00", /*天气标识00:晴*/ "fb": "53" /*天气标识53:霾 如果fa不等于fb,说明是组合天气*/ }, "wind": "西南风微风", "dressing_index": "较冷", /*穿衣指数*/ "dressing_advice": "建议着大衣、呢外套加毛衣、卫衣等服装。", /*穿衣建议*/ "uv_index": "中等", /*紫外线强度*/ "comfort_index": "",/*舒适度指数*/ "wash_index": "较适宜", /*洗车指数*/ "travel_index": "适宜", /*旅游指数*/ "exercise_index": "较适宜", /*晨练指数*/ "drying_index": ""/*干燥指数*/ }, "future": [ /*未来几天天气*/ { "temperature": "28℃~36℃", "weather": "晴转多云", "weather_id": { "fa": "00", "fb": "01" }, "wind": "南风3-4级", "week": "星期一", "date": "20140804" }, { "temperature": "28℃~36℃", "weather": "晴转多云", "weather_id": { "fa": "00", "fb": "01" }, "wind": "东南风3-4级", "week": "星期二", "date": "20140805" }, { "temperature": "27℃~35℃", "weather": "晴转多云", "weather_id": { "fa": "00", "fb": "01" }, "wind": "东南风3-4级", "week": "星期三", "date": "20140806" }, { "temperature": "27℃~34℃", "weather": "多云", "weather_id": { "fa": "01", "fb": "01" }, "wind": "东南风3-4级", "week": "星期四", "date": "20140807" }, { "temperature": "27℃~33℃", "weather": "多云", "weather_id": { "fa": "01", "fb": "01" }, "wind": "东北风4-5级", "week": "星期五", "date": "20140808" }, { "temperature": "26℃~33℃", "weather": "多云", "weather_id": { "fa": "01", "fb": "01" }, "wind": "北风4-5级", "week": "星期六", "date": "20140809" }, { "temperature": "26℃~33℃", "weather": "多云", "weather_id": { "fa": "01", "fb": "01" }, "wind": "北风4-5级", "week": "星期日", "date": "20140810" } ] }, "error_code": 0}
2018-12-29 - 利用云开发如何A用户如何向B用户发送模板消息?
上次请教如何利用云开发发送模板消息,在大神们的帮助下,已经可以发送模板消息到本人的微信了。https://developers.weixin.qq.com/community/develop/doc/000ee2811e8c40514bd7518fb56400?jumpto=comment&commentid=000e0ac6914548e14dd77da195bc 但是现在有个需求,就是管理员审核后希望把模板消息发送到对应的用户上,也就是用户A操作完,发送消息提醒到用户B的微信上,如何利用云开发实现整个场景?
2018-12-20 - 用云函数怎么实现模板消息
现在用小程序云开发需要用到模板消息,研究了模板消息需要用客户端获取tocken,再获取模板消息。 利用云开发如何实现模板消息
2018-12-18