
import 'package:azlistview/azlistview.dart';
import 'package:lpinyin/lpinyin.dart';

class WorkerItem extends ISuspensionBean{

  String userId;
  String userRole;
  String name;
  String avatarUrl;

	WorkerItem.fromJsonMap(Map<String, dynamic> map):
		userId = map["userId"],
		userRole = map["userRole"],
		name = map["name"],
		avatarUrl = map["avatarUrl"];

	Map<String, dynamic> toJson() {
		final Map<String, dynamic> data = new Map<String, dynamic>();
		data['userId'] = userId;
		data['userRole'] = userRole;
		data['name'] = name;
		data['avatarUrl'] = avatarUrl;
		return data;
	}

	@override
	String getSuspensionTag() {
		String py = PinyinHelper.getShortPinyin(name).toUpperCase();
		return py.substring(0,1);
	}
}


