feat: 新增仅计算半年均价接口
This commit is contained in:
@@ -21,6 +21,7 @@ public interface DataToolApi {
|
|||||||
@GET("/data/collect")
|
@GET("/data/collect")
|
||||||
Call<NcHttpResponse<String>> collect(
|
Call<NcHttpResponse<String>> collect(
|
||||||
@Query(value = "year") Integer year,
|
@Query(value = "year") Integer year,
|
||||||
@Query(value = "month") Integer month
|
@Query(value = "month") Integer month,
|
||||||
|
@Query(value = "only_avg") Integer onlyAvg
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@@ -32,8 +32,8 @@ public class DataToolService implements ApiService<DataToolApi> {
|
|||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
public NcHttpResponse<String> collect (Integer year, Integer month) throws Exception {
|
public NcHttpResponse<String> collect (Integer year, Integer month, Integer onlyAvg) throws Exception {
|
||||||
var call = this.api.collect(year, month);
|
var call = this.api.collect(year, month, onlyAvg);
|
||||||
var response = this.getResponse(call).body();
|
var response = this.getResponse(call).body();
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
@@ -158,9 +158,10 @@ public class PricePublishController {
|
|||||||
@GetMapping("/collect")
|
@GetMapping("/collect")
|
||||||
public HttpResponse collect(
|
public HttpResponse collect(
|
||||||
@ApiParam("年份") @RequestParam("year") Integer year,
|
@ApiParam("年份") @RequestParam("year") Integer year,
|
||||||
@ApiParam("月份") @RequestParam(value = "month") Integer month
|
@ApiParam("月份") @RequestParam(value = "month") Integer month,
|
||||||
|
@ApiParam("仅计算半年均价") @RequestParam(value = "onlyAvg") Integer onlyAvg
|
||||||
) throws Exception {
|
) throws Exception {
|
||||||
var result = dataToolService.collect(year, month);
|
var result = dataToolService.collect(year, month, onlyAvg);
|
||||||
return FuHttpResponse.Builder().dataResponse(result).build();
|
return FuHttpResponse.Builder().dataResponse(result).build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user