Browse Source

update api get crop detail

master
daivph 5 years ago
parent
commit
78aba2427a
3 changed files with 5 additions and 6 deletions
  1. +3
    -4
      lib/custom_model/CropPlot.dart
  2. +1
    -1
      lib/data/api/rest_client.dart
  3. +1
    -1
      lib/data/api/rest_client.g.dart

+ 3
- 4
lib/custom_model/CropPlot.dart View File

tbCropDTO = json['tbCropDTO'] != null tbCropDTO = json['tbCropDTO'] != null
? new TbCropDTO.fromJson(json['tbCropDTO']) ? new TbCropDTO.fromJson(json['tbCropDTO'])
: null; : null;
if (json['activityTimeline'] != null) {
if (json['activities'] != null) {
activities = new List<Activities>(); activities = new List<Activities>();
json['activityTimeline'].forEach((v) {
json['activities'].forEach((v) {
activities.add(new Activities.fromJson(v)); activities.add(new Activities.fromJson(v));
}); });
} }
data['tbCropDTO'] = this.tbCropDTO.toJson(); data['tbCropDTO'] = this.tbCropDTO.toJson();
} }
if (this.activities != null) { if (this.activities != null) {
data['activityTimeline'] =
this.activities.map((v) => v.toJson()).toList();
data['activities'] = this.activities.map((v) => v.toJson()).toList();
} }
data['sowingDate'] = this.sowingDate; data['sowingDate'] = this.sowingDate;
data['soakSeedsTime'] = this.soakSeedsTime; data['soakSeedsTime'] = this.soakSeedsTime;

+ 1
- 1
lib/data/api/rest_client.dart View File



//Crop //Crop
@GET( @GET(
"/api/tb-crops-detail/{cropId}?page={page}&size={size}&sort=executeDate,DESC")
"/api/tb-crops-detail-for-app/{cropId}?page={page}&size={size}&sort=executeDate,DESC")
Future<CropPlot> getCropDetail(@Path() int cropId, Future<CropPlot> getCropDetail(@Path() int cropId,
{@Path() int page = 0, @Path() int size = 20}); {@Path() int page = 0, @Path() int size = 20});



+ 1
- 1
lib/data/api/rest_client.g.dart View File

queryParameters.removeWhere((k, v) => v == null); queryParameters.removeWhere((k, v) => v == null);
final _data = <String, dynamic>{}; final _data = <String, dynamic>{};
final Response<Map<String, dynamic>> _result = await _dio.request( final Response<Map<String, dynamic>> _result = await _dio.request(
'/api/tb-crops-detail/$cropId?page=$page&size=$size&sort=executeDate,DESC',
'/api/tb-crops-detail-for-app/$cropId?page=$page&size=$size&sort=executeDate,DESC',
queryParameters: queryParameters, queryParameters: queryParameters,
options: RequestOptions( options: RequestOptions(
method: 'GET', method: 'GET',

Loading…
Cancel
Save