This commit is contained in:
20932067@zju.edu.cn 2021-04-15 19:10:43 +08:00
parent 072c104f24
commit ef63b8f6db
2 changed files with 19 additions and 3 deletions

View File

@ -36,6 +36,22 @@ public class NewsServiceController {
}
}
@PassToken
@GetMapping("/get")
private Result<List<News>> List(News news) {
try {
ServerResult<List<News>> serverResult = newsService.getNewsList(news);
if (serverResult.isStart()) {
return new Result<>(true, serverResult.getData());
} else {
return new Result<>(false, -1, serverResult.getMsg());
}
} catch (RuntimeException e) {
return new Result<>(false, -1, e.getMessage());
}
}
@PassToken
@GetMapping(value = "/{id}")
private Result<News> getNews(@PathVariable("id") Long id) {

View File

@ -10,7 +10,7 @@ alibaba.cloud.secret-key=****
# 应用服务 WEB 访问端口
server.port=8083
server.servlet.context-path=/api
logging.level.root=debug
logging.level.root=error
# Actuator Web 访问端口
management.server.port=8081
@ -24,9 +24,9 @@ spring.servlet.multipart.maxRequestSize=200MB
# 数据库dataSource
jdbc.driver=8zQIdS8RzOBmd4qRctgYdYM/fdvrjnIJHyQH1bD/jNs=
#服务器本地127.0.0.1
jdbc.urls=jdbc:mysql://127.0.0.1:3306/mall?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
jdbc.url=jdbc:mysql://127.0.0.1:3306/mall?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
#azure
jdbc.url=jdbc:mysql://40.83.126.15:3306/mall?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
jdbc.urls=jdbc:mysql://40.83.126.15:3306/mall?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
#服务器ip
jdbc.username=mall
jdbc.password=dr4ap4dbnyCMZTcr