kr.co.hanwha.hifive.data.source

## Class MemberDataRepository

- java.lang.Object
- - kr.co.hanwha.hifive.data.source.MemberDataRepository

- All Implemented Interfaces:
    BaseDataSource, MemberDataSource

      public class MemberDataRepository
      extends java.lang.Object
      implements MemberDataSource

  Created by sanghoonkwon on 2018. 1. 11..

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private static MemberDataRepository` | `sInstance`
    `private static LoginData` | `sLoginData`
    `private static UpdateData` | `sUpdateData`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MemberDataRepository()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `checkProjectId(int project_id)` 내가 속한 프로젝트인지 확인
    `void` | `clearData()` Clear data
    `static void` | `destroyInstance()`
    `void` | `doAccountLogin(android.content.Context context, java.lang.String login, java.lang.String password, HanwhaNetworkCallback<LoginData> callback)` 계정 로그인
    `void` | `doSimpleLogin(android.content.Context context, java.lang.String login_id, java.lang.String authcode, HanwhaNetworkCallback callback)` 간편 로그인
    `void` | `doSuccessLogin(android.content.Context context, LoginData response, HanwhaNetworkCallback<LoginData> callback)` 로그인 성공 후 처리 -> 기기등록
    `java.util.ArrayList<ProjectInfoData>` | `getCaptainProjectInfo()` 캡틴인 프로젝트 정보
    `java.lang.String` | `getEncryptionMemberId()` 암호화된 멤버 고유번호
    `static MemberDataRepository` | `getInstance()`
    `static java.lang.String` | `getLastVersion()`
    `LoginData` | `getLoginData()`
    `int` | `getMemberId()` 멤버 고유 번호
    `java.lang.String` | `getMemberName()` 멤버 이름
    `java.util.ArrayList<java.lang.Integer>` | `getMyProjectList()` 내가 속한 프로젝트 ID 목록
    `void` | `getNotificationStatus(android.content.Context context, HanwhaNetworkCallback<CrudDataRoot> callback)`
    `static UpdateData` | `getUpdateData()`
    `static java.lang.String` | `getUpdateUrl()`
    `boolean` | `isCaptain()` 소속된 프로젝트중 캡틴인 프로젝트가 있는지 확인
    `boolean` | `isMember(int member_id)` 멤버 아이디 비교
    `void` | `setNotificationStatus(android.content.Context context, boolean onoff, HanwhaNetworkCallback<CrudDataRoot> callback)`
    `static void` | `setUpdateData(UpdateData updateData)`
    `void` | `updateAuthcode(android.content.Context context, java.lang.String authcode, HanwhaNetworkCallback callback)` 간편 로그인 설정
    `void` | `updateDeviceToken(android.content.Context context, java.lang.String token, java.lang.String device_uid, HanwhaNetworkCallback callback)` 토큰 등록

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### sInstance

          private static MemberDataRepository sInstance

    - #### sUpdateData

          private static UpdateData sUpdateData

    - #### sLoginData

          private static LoginData sLoginData

  - ### Constructor Detail

    - #### MemberDataRepository

          public MemberDataRepository()

  - ### Method Detail

    - #### getInstance

          public static MemberDataRepository getInstance()

    - #### destroyInstance

          public static void destroyInstance()

    - #### clearData

          public void clearData()

      Description copied from interface: `BaseDataSource`
      Clear data
      Specified by:
        `clearData` in interface `BaseDataSource`

    - #### getLoginData

          public LoginData getLoginData()

    - #### getUpdateData

          public static UpdateData getUpdateData()

    - #### setUpdateData

          public static void setUpdateData(UpdateData updateData)

    - #### getLastVersion

          public static java.lang.String getLastVersion()

    - #### getUpdateUrl

          public static java.lang.String getUpdateUrl()

    - #### isMember

          public boolean isMember(int member_id)

      Description copied from interface: `MemberDataSource`
      멤버 아이디 비교
      Specified by:
        `isMember` in interface `MemberDataSource`
      Parameters:
        `member_id` - 멤버 고유 번호
      Returns:
        Boolean

    - #### getMemberId

          public int getMemberId()

      Description copied from interface: `MemberDataSource`
      멤버 고유 번호
      Specified by:
        `getMemberId` in interface `MemberDataSource`
      Returns:
        Integer

    - #### getMemberName

          public java.lang.String getMemberName()

      Description copied from interface: `MemberDataSource`
      멤버 이름
      Specified by:
        `getMemberName` in interface `MemberDataSource`
      Returns:
        String

    - #### getEncryptionMemberId

          public java.lang.String getEncryptionMemberId()

      Description copied from interface: `MemberDataSource`
      암호화된 멤버 고유번호
      Specified by:
        `getEncryptionMemberId` in interface `MemberDataSource`
      Returns:
        String

    - #### isCaptain

          public boolean isCaptain()

      Description copied from interface: `MemberDataSource`
      소속된 프로젝트중 캡틴인 프로젝트가 있는지 확인
      Specified by:
        `isCaptain` in interface `MemberDataSource`
      Returns:
        Boolean

    - #### getCaptainProjectInfo

          public java.util.ArrayList<ProjectInfoData> getCaptainProjectInfo()

      Description copied from interface: `MemberDataSource`
      캡틴인 프로젝트 정보
      Specified by:
        `getCaptainProjectInfo` in interface `MemberDataSource`
      Returns:
        Array

    - #### checkProjectId

          public boolean checkProjectId(@NonNull
                                        int project_id)

      Description copied from interface: `MemberDataSource`
      내가 속한 프로젝트인지 확인
      Specified by:
        `checkProjectId` in interface `MemberDataSource`
      Parameters:
        `project_id` - 프로젝트 ID
      Returns:
        Boolean

    - #### getMyProjectList

          public java.util.ArrayList<java.lang.Integer> getMyProjectList()

      Description copied from interface: `MemberDataSource`
      내가 속한 프로젝트 ID 목록
      Specified by:
        `getMyProjectList` in interface `MemberDataSource`
      Returns:
        ArrayList

    - #### doAccountLogin

          public void doAccountLogin(@NonNull
                                     android.content.Context context,
                                     @NonNull
                                     java.lang.String login,
                                     @NonNull
                                     java.lang.String password,
                                     @NonNull
                                     HanwhaNetworkCallback<LoginData> callback)

      Description copied from interface: `MemberDataSource`
      계정 로그인
      Specified by:
        `doAccountLogin` in interface `MemberDataSource`
      Parameters:
        `context` - Context
        `login` - 멤버계정
        `password` - 패스워드
        `callback` - 콜백

    - #### doSimpleLogin

          public void doSimpleLogin(@NonNull
                                    android.content.Context context,
                                    @NonNull
                                    java.lang.String login_id,
                                    @NonNull
                                    java.lang.String authcode,
                                    @NonNull
                                    HanwhaNetworkCallback callback)

      Description copied from interface: `MemberDataSource`
      간편 로그인
      Specified by:
        `doSimpleLogin` in interface `MemberDataSource`
      Parameters:
        `context` - Context
        `login_id` - 로그인 ID
        `authcode` - 간편 로그인 패스워드
        `callback` - 콜백

    - #### doSuccessLogin

          public void doSuccessLogin(@NonNull
                                     android.content.Context context,
                                     @Nullable
                                     LoginData response,
                                     @NonNull
                                     HanwhaNetworkCallback<LoginData> callback)

      Description copied from interface: `MemberDataSource`
      로그인 성공 후 처리 -> 기기등록
      Specified by:
        `doSuccessLogin` in interface `MemberDataSource`
      Parameters:
        `context` - Context
        `response` - LoginData
        `callback` - 콜백

    - #### updateDeviceToken

          public void updateDeviceToken(@NonNull
                                        android.content.Context context,
                                        @NonNull
                                        java.lang.String token,
                                        @NonNull
                                        java.lang.String device_uid,
                                        @NonNull
                                        HanwhaNetworkCallback callback)

      Description copied from interface: `MemberDataSource`
      토큰 등록
      Specified by:
        `updateDeviceToken` in interface `MemberDataSource`
      Parameters:
        `context` - Context
        `token` - 푸쉬 토큰
        `device_uid` - 디바이스 UUID
        `callback` - 콜백

    - #### updateAuthcode

          public void updateAuthcode(@NonNull
                                     android.content.Context context,
                                     @NonNull
                                     java.lang.String authcode,
                                     @NonNull
                                     HanwhaNetworkCallback callback)

      Description copied from interface: `MemberDataSource`
      간편 로그인 설정
      Specified by:
        `updateAuthcode` in interface `MemberDataSource`
      Parameters:
        `context` - Context
        `authcode` - 간편 로그인 비밀번호(6자리 숫자)
        `callback` - 콜백

    - #### getNotificationStatus

          public void getNotificationStatus(@NonNull
                                            android.content.Context context,
                                            @NonNull
                                            HanwhaNetworkCallback<CrudDataRoot> callback)

      Specified by:
        `getNotificationStatus` in interface `MemberDataSource`
      Parameters:
        `context` - Context
        `callback` - 콜백

    - #### setNotificationStatus

          public void setNotificationStatus(@NonNull
                                            android.content.Context context,
                                            @NonNull
                                            boolean onoff,
                                            @NonNull
                                            HanwhaNetworkCallback<CrudDataRoot> callback)

      Specified by:
        `setNotificationStatus` in interface `MemberDataSource`
      Parameters:
        `context` - Context
        `onoff` - 알림 On / Off
        `callback` - 콜백