如何使用网址中的查询参数在改造2中获取数据?

时间:2018-06-28 05:39:00

标签: android retrofit2

我有一个网址,例如www.fetchdata123.com/myservice.php?CityId=5 并希望使用

获取有关CityId行为的数据
@GET("my_service.php?")
 Call<List<Employees>> GetEmployees(@Query("CityId")  String CityId);

如何使用特定的CityId获取员工数据。

1 个答案:

答案 0 :(得分:1)

您需要额外的 @Query ,这样更改代码

?

在使用@ViewChild('scrollElement') scrollableContainer: ElementRef; onScroll(value){ this.scrollableContainer.nativeElement.scrollLeft = this.scrollableContainer.nativeElement.scrollLeft + value; } 时,会自动附加 <div class="outerContainer"> <div #scrollElement class="scrollableContainer"> <!-- yourScrollableContent --> </div> </div> <button (click)="onScroll(-10)" label="left"></button> <button (click)="onScroll(+10)" label="right"></button>