Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YeeAmosFireAutoSysRoot
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
station
YeeAmosFireAutoSysRoot
Commits
c83330f9
Commit
c83330f9
authored
Jun 22, 2020
by
maoying
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改获取天气预报接口
parent
8166302b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
WeatherController.java
...ejoin/amos/fas/business/controller/WeatherController.java
+6
-2
application.properties
...ireAutoSysStart/src/main/resources/application.properties
+3
-0
No files found.
YeeAmosFireAutoSysService/src/main/java/com/yeejoin/amos/fas/business/controller/WeatherController.java
View file @
c83330f9
...
@@ -7,13 +7,13 @@ import java.net.URLConnection;
...
@@ -7,13 +7,13 @@ import java.net.URLConnection;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.itextpdf.text.pdf.PdfStructTreeController.returnType
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponse
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
import
com.yeejoin.amos.fas.core.util.CommonResponseUtil
;
...
@@ -25,6 +25,10 @@ import io.swagger.annotations.ApiOperation;
...
@@ -25,6 +25,10 @@ import io.swagger.annotations.ApiOperation;
@Api
(
tags
=
"天气api"
)
@Api
(
tags
=
"天气api"
)
public
class
WeatherController
extends
BaseController
{
public
class
WeatherController
extends
BaseController
{
@Value
(
"${param.weather.url}"
)
private
String
weatherUrl
;
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"天气查询"
,
notes
=
"天气查询"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"天气查询"
,
notes
=
"天气查询"
)
@GetMapping
(
"/{address}"
)
@GetMapping
(
"/{address}"
)
public
CommonResponse
getWeather
(
@PathVariable
(
"address"
)
String
address
)
{
public
CommonResponse
getWeather
(
@PathVariable
(
"address"
)
String
address
)
{
...
@@ -32,7 +36,7 @@ public class WeatherController extends BaseController {
...
@@ -32,7 +36,7 @@ public class WeatherController extends BaseController {
String
result
=
""
;
String
result
=
""
;
BufferedReader
in
=
null
;
BufferedReader
in
=
null
;
try
{
try
{
String
urlNameString
=
"http://t.weather.sojson.com/api/weather/city/"
+
address
;
String
urlNameString
=
weatherUrl
+
address
;
URL
realUrl
=
new
URL
(
urlNameString
);
URL
realUrl
=
new
URL
(
urlNameString
);
// 打开和URL之间的连接
// 打开和URL之间的连接
...
...
YeeAmosFireAutoSysStart/src/main/resources/application.properties
View file @
c83330f9
...
@@ -49,5 +49,8 @@ linux.img.path = /
...
@@ -49,5 +49,8 @@ linux.img.path = /
param.safetyIndexChange.cron
=
0 0 2 * * ?
param.safetyIndexChange.cron
=
0 0 2 * * ?
#获取天气地址
param.weather.url
=
http://t.weather.sojson.com/api/weather/city/
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment