feat: 新增仅计算半年均价接口

This commit is contained in:
han0
2025-06-05 18:31:06 +08:00
parent cf954a0a43
commit 179a14f26b
3 changed files with 7 additions and 5 deletions

View File

@@ -21,6 +21,7 @@ public interface DataToolApi {
@GET("/data/collect")
Call<NcHttpResponse<String>> collect(
@Query(value = "year") Integer year,
@Query(value = "month") Integer month
@Query(value = "month") Integer month,
@Query(value = "only_avg") Integer onlyAvg
);
}

View File

@@ -32,8 +32,8 @@ public class DataToolService implements ApiService<DataToolApi> {
return response;
}
public NcHttpResponse<String> collect (Integer year, Integer month) throws Exception {
var call = this.api.collect(year, month);
public NcHttpResponse<String> collect (Integer year, Integer month, Integer onlyAvg) throws Exception {
var call = this.api.collect(year, month, onlyAvg);
var response = this.getResponse(call).body();
return response;
}

View File

@@ -158,9 +158,10 @@ public class PricePublishController {
@GetMapping("/collect")
public HttpResponse collect(
@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 {
var result = dataToolService.collect(year, month);
var result = dataToolService.collect(year, month, onlyAvg);
return FuHttpResponse.Builder().dataResponse(result).build();
}
}