mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2026-11-08 03:47:36 +00:00
パッケージ名のミスを修正, DI実装
This commit is contained in:
10 files changed
+24
-18
No files matched your search
@@ -0,0 +1,21 @@
|
||||
package one.nem.lacerta.data.impl;
|
||||
|
||||
import one.nem.lacerta.data.repository.DeviceMeta;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
public class DeviceMetaImpl implements DeviceMeta{
|
||||
|
||||
@Inject
|
||||
public DeviceMetaImpl() {
|
||||
}
|
||||
|
||||
public String getDeviceId() {
|
||||
return "device_id"; // DEBUG
|
||||
}
|
||||
|
||||
public String getDeviceApiLevel() {
|
||||
return "device_api_level"; // DEBUG
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package one.nem.lacerta.data.module;
|
||||
|
||||
import one.nem.lacerta.data.impl.DeviceMetaImpl;
|
||||
import one.nem.lacerta.data.repository.DeviceMeta;
|
||||
|
||||
import dagger.Binds;
|
||||
import dagger.Module;
|
||||
import dagger.hilt.InstallIn;
|
||||
// Singleton
|
||||
import dagger.hilt.components.SingletonComponent;
|
||||
|
||||
@Module
|
||||
@InstallIn(SingletonComponent.class)
|
||||
abstract class DeviceMetaModule {
|
||||
|
||||
@Binds
|
||||
public abstract DeviceMeta bindDeviceMeta(DeviceMetaImpl deviceMetaImpl);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package one.nem.lacerta.data.repository;
|
||||
|
||||
public interface DeviceMeta {
|
||||
String getDeviceId();
|
||||
String getDeviceApiLevel();
|
||||
}
|
||||
Reference in new issue
Block a user