All Projects → mindawei → Weather

mindawei / Weather

一个天气查询服务:爬取数据、Web服务、小程序展示

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Weather

Myuploader Backend
单文件上传,多文件上传,大文件上传,断点续传,文件秒传,图片上传
Stars: ✭ 177 (+284.78%)
Mutual labels:  spring-boot, maven
Blog Tutorials
⭐️ Codebase for the tutorials on my blog about Java, Spring Boot, AWS, Kotlin and Testing
Stars: ✭ 257 (+458.7%)
Mutual labels:  spring-boot, maven
Jhipster4 Demo
Blog demo app with JHipster 4
Stars: ✭ 180 (+291.3%)
Mutual labels:  spring-boot, maven
Fame
A blog power by spring-boot and vue
Stars: ✭ 162 (+252.17%)
Mutual labels:  spring-boot, maven
Ms Backend Boilerplates
Boilerplate for Your Server Side(Backend) Application, Java | Spring(Boot, Cloud) | Node.js(Express, Koa, Egg) | Go | Python | DevOps 💫 服务端项目模板
Stars: ✭ 394 (+756.52%)
Mutual labels:  spring-boot, maven
My Blog
🌴A simple & beautiful blogging system implemented with spring-boot & thymeleaf & mybatis My Blog 是由 SpringBoot + Mybatis + Thymeleaf 等技术实现的 Java 博客系统,页面美观、功能齐全、部署简单及完善的代码,一定会给使用者无与伦比的体验
Stars: ✭ 2,400 (+5117.39%)
Mutual labels:  spring-boot, maven
Javastud
Official, Main: This is Core/Advance java example series project. It help to learn java step by step using pdf tutorial provided here and corresponding demo project for the eclipse. Tag: Java Student, Java Stud, Stud Java, StudJava, Java Teachers, Studs Quick Start Guide, Studs Java, Object Oriented Programming, Core Java, Java SE, Java EE, Java Enterprise Edition, Java Blog, Java Articles, Java Web, JSP, Servlet, Maven, Spring, Hibernate, Spring-boot, Spring MVC Web, Angular JS, Angular 2, Java Security, Java CRUD, Java Login Example, File Handling, Multi threading, exception handling, Collection classes, Swing, Database, Date Time, Joda Time, JPA.
Stars: ✭ 220 (+378.26%)
Mutual labels:  spring-boot, maven
Ibase4j
Spring,SpringBoot 2.0,SpringMVC,Mybatis,mybatis-plus,motan/dubbo分布式,Redis缓存,Shiro权限管理,Spring-Session单点登录,Quartz分布式集群调度,Restful服务,QQ/微信登录,App token登录,微信/支付宝支付;日期转换、数据类型转换、序列化、汉字转拼音、身份证号码验证、数字转人民币、发送短信、发送邮件、加密解密、图片处理、excel导入导出、FTP/SFTP/fastDFS上传下载、二维码、XML读写、高精度计算、系统配置工具类等等。
Stars: ✭ 1,548 (+3265.22%)
Mutual labels:  spring-boot, maven
Trampoline
Admin Spring Boot Locally
Stars: ✭ 325 (+606.52%)
Mutual labels:  spring-boot, maven
Hope Boot
🌱 Hope-Boot 一款现代化的脚手架项目
Stars: ✭ 3,241 (+6945.65%)
Mutual labels:  spring-boot, maven
Javadevjournal
Source code for the tutorials published on the Javadevjournal site.
Stars: ✭ 141 (+206.52%)
Mutual labels:  spring-boot, maven
Cookbook
🎉🎉🎉JAVA高级架构师技术栈==任何技能通过 “刻意练习” 都可以达到融会贯通的境界,就像烹饪一样,这里有一份JAVA开发技术手册,只需要增加自己练习的次数。🏃🏃🏃
Stars: ✭ 428 (+830.43%)
Mutual labels:  spring-boot, maven
Spring Boot Quick
🌿 基于springboot的快速学习示例,整合自己遇到的开源框架,如:rabbitmq(延迟队列)、Kafka、jpa、redies、oauth2、swagger、jsp、docker、spring-batch、异常处理、日志输出、多模块开发、多环境打包、缓存cache、爬虫、jwt、GraphQL、dubbo、zookeeper和Async等等📌
Stars: ✭ 1,819 (+3854.35%)
Mutual labels:  spring-boot, maven
Spring Jms
Spring JMS Tutorials
Stars: ✭ 42 (-8.7%)
Mutual labels:  spring-boot, maven
Nimrod
Nimrod - 基于 Spring Boot 构建 的 Java Web 平台企业级单体应用快速开发框架,适合中小型项目的应用和开发。所采用的技术栈包括 Spring Boot、Spring、Spring Web MVC、MyBatis、Thymeleaf 等,遵守阿里巴巴 Java 开发规约,帮助养成良好的编码习惯。整体采用 RBAC ( Role-Based Access Control ,基于角色的访问控制),具有严格的权限控制模块,支持系统与模块分离开发。最后希望这个项目能够对你有所帮助。Nimrod 开发交流群:547252502(QQ 群)
Stars: ✭ 125 (+171.74%)
Mutual labels:  spring-boot, maven
Telegrambots
Java library to create bots using Telegram Bots API
Stars: ✭ 2,728 (+5830.43%)
Mutual labels:  spring-boot, maven
Hsweb Payment
基于hsweb的开源聚合支付系统,多商户,多渠道,多配置.
Stars: ✭ 112 (+143.48%)
Mutual labels:  spring-boot, maven
Spring Cloud Build
Common build concerns, shared plugin configuration, etc. for Spring Cloud modules
Stars: ✭ 114 (+147.83%)
Mutual labels:  spring-boot, maven
Ueboot
springboot2.2、spring-data-jpa、iView4、Vue2 、代码生成器、shiro权限管理、前后端分离、java后台管理系统快速开发框架,通过该框架可以在分钟级别内完成单表的前后端增删改查功能。脚手架工程: https://github.com/ueboot/ueboot-starter ,基于这个工程可以直接开发
Stars: ✭ 270 (+486.96%)
Mutual labels:  spring-boot, maven
Shop
spring cloud最佳实践项目实例,使用了spring cloud全家桶,TCC事务管理,EDA事务最终一致性等技术的下单示例
Stars: ✭ 418 (+808.7%)
Mutual labels:  spring-boot, maven

前置说明

  1. /doc 文件夹中包含项目截图和以下将要描述的文档(PDF文档 )。
  2. weather-web 项目: 天气Web服务。
  3. weather-weixin 项目:查询天气微信小程序(微信扫描下图可以查看)。

查询天气小程序

  1. 项目中一些关键Key已经去除,开发者可以自行添加,如有问题可以留言或者邮件联系。
  2. 欢迎 fork 和 star ~

天气服务说明文档

1背景

1.1意义

  设计该服务,主要有以下几个原因:

  1. 目前的一些天气API(高德、百度等)都只有3天的预报,不能提供长期预报。
  2. 第三方API有调用次数限制、认证情况比较麻烦。

1.2不足

  该服务存在以下缺陷:

  1. 依赖第三方网站,第三方网站的网页结构变化后需要重新修改代码。
  2. 第三方服务器崩溃或者提供反爬技术的话,该服务失效。

1.3 声明

  本服务只是为了学习交流使用。

2服务结构

  如果开发者需要基于该服务项目进行开发的话,需要了解该服务的一些结构。该服务(weather-web项目)的总体结构如下图所示。

  其中,淡粉色部分表示支持查询的接口,淡紫色部分表示第三方的接口或网站,淡绿色部分是项目中主要的几个类。使用该服务,需要注意一下几个方面:

  1. 如果是按经纬度查询,则需要利用第三方API(腾讯的API)将经纬度转换为对应的城市名称。
  2. 因为最后是根据查询城市的拼音找到解析数据的网页的,所以需要事先爬取城市名称和拼音的关系,最后统一转换为按拼音查询。
  3. 为了减少频繁爬取第三方数据,该服务按天粒度进行更新,每次查询的时候会比对天气日期,如果过期才会重新爬取,否则则会返回缓存中的数据。 为了服务的快速,服务所有数据都在内存中,并没有落盘。

3服务接口

3.1访问接口

  访问接口如下表所示,接口中中文部分表示需要提供的参数。开发者在部署服务后,最终的访问接口是:协议(http 或 https)+ 主机地址 + 接口。

功能 接口
按经纬度进行查询 /weather/?latitude=纬度&longitude=经度
按城市名称中文(或拼音)进行查询 /weather/城市名称或拼音

开放测试接口https://weather.mindawei.cn/weather/

以杭州为例:

3.2返回结果

  返回的结果是Json格式,包含30天天气基本情况,具体如下所示:


{
    "queryName": "泰州",  // 查询的城市名字,如果无数据返回空
    "date": "2018-01-06",  // 第一天数据日期,缓存可以判断是否过期
    "weatherItems": [     // 天气情况数组,30天
        {
            "date": "01月06日",      // 日期
            "dayKind": "今天",        // 星期几,前三天是今天明天后天 
            "weather": "雪",           // 天气描述
            "weatherImg": "b15.png",   // 天气用什么图片表示
            "minTemperature": "-6",    // 最低温度 
            "maxTemperature": "4",     // 最高温度
            "wind": "东北风 3级"     // 风力描述
        },
        ...
    ]
}

4基于该服务的小程序

  基于该服务可以构建一些天气查询应用。为了演示该服务,写了一个小程序。下面几幅图就是小程序项目(weather-weixin)的演示效果图。小程序启动时可以根据经纬度给出一个当前位置的天气情况,之后可以根据查询关键字更新数据。

5项目实际部署

5.1运行Web服务

  1. 如果要支持经纬度查询,则需要配置WeatherWebConfig.txt中的腾讯地图API KEY。
  2. 由于小程序使用https,所以如果要运行小程序,则需要将域名指向Web服务主机,申请证书,并配置src/main/resources下的application.properties文件。

5.2运行小程序

  1. project.config.json中填入你申请的appid。
  2. pages\index\index.js内容中开头部分的baseUrl替换成:Web服务地址的部署地址+”weather/”。
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].