优化ai userid和markdown
This commit is contained in:
@@ -13,15 +13,9 @@ class DeviceRepositoryImpl implements DeviceRepository {
|
||||
DeviceRepositoryImpl(this._deviceHttpDatasource);
|
||||
|
||||
@override
|
||||
Future<Either<DeviceFailure, int>> bindDevice(
|
||||
String deviceId,
|
||||
String deviceAlias,
|
||||
) async {
|
||||
Future<Either<DeviceFailure, int>> bindDevice(String deviceId, String deviceAlias) async {
|
||||
try {
|
||||
var result = await _deviceHttpDatasource.bindDevice(
|
||||
deviceId,
|
||||
deviceAlias,
|
||||
);
|
||||
var result = await _deviceHttpDatasource.bindDevice(deviceId, deviceAlias);
|
||||
return Right(result);
|
||||
} on DioException catch (e) {
|
||||
final String serverMessage = e.response?.data['msg'] ?? "网络连接异常";
|
||||
@@ -33,9 +27,7 @@ class DeviceRepositoryImpl implements DeviceRepository {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Either<DeviceFailure, List<DeviceEntity>>> getUserDevice(
|
||||
String username,
|
||||
) async {
|
||||
Future<Either<DeviceFailure, List<DeviceEntity>>> getUserDevice(String username) async {
|
||||
try {
|
||||
var result = await _deviceHttpDatasource.getUserDevices(username);
|
||||
return Right(result);
|
||||
@@ -61,6 +53,7 @@ class DeviceRepositoryImpl implements DeviceRepository {
|
||||
return Left(DeviceFailure(cleanMessage));
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Either<DeviceFailure, int>> updateDeviceName(String deviceId, String deviceName) async {
|
||||
try {
|
||||
@@ -76,10 +69,7 @@ class DeviceRepositoryImpl implements DeviceRepository {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Either<DeviceFailure, int>> switchDevice(
|
||||
String platform,
|
||||
String deviceId,
|
||||
) async {
|
||||
Future<Either<DeviceFailure, int>> switchDevice(String platform, String deviceId) async {
|
||||
try {
|
||||
var result = await _deviceHttpDatasource.switchDevice(platform, deviceId);
|
||||
return Right(result);
|
||||
@@ -91,9 +81,10 @@ class DeviceRepositoryImpl implements DeviceRepository {
|
||||
return Left(DeviceFailure(cleanMessage));
|
||||
}
|
||||
}
|
||||
// TODO: implement switchDevice 实现获取设备的列表
|
||||
|
||||
// TODO: implement switchDevice 实现获取设备的列表
|
||||
@override
|
||||
Future<Either<DeviceFailure, DeviceLocationEntity>>getDeviceLocation(String username) async {
|
||||
Future<Either<DeviceFailure, DeviceLocationEntity>> getDeviceLocation(String username) async {
|
||||
// TODO: implement getDeviceLocation
|
||||
var result = await _deviceHttpDatasource.getDeviceLocation(username);
|
||||
return Right(result);
|
||||
|
||||
Reference in New Issue
Block a user