drew 6 năm trước cách đây
mục cha
commit
ee47956732

+ 5 - 5
app/src/main/java/com/ht/gate/ApiService.java

@@ -13,14 +13,14 @@ import retrofit2.http.Path;
 import retrofit2.http.Query;
 
 public interface ApiService {
-    @POST("meeting/service-api/crmnew/bind-device/{deviceId}")
-    Call<Room> bindDevice(@Path("deviceId") String deviceId);
+    @POST("getBindDeviceDataByDeviceId")
+    Call<Room> bindDevice(@Body GetDeviceBody body);
 
-    @POST("meeting/service-api/crmnew/find-room-meetings")
+    @POST("getRoomMeetingsData")
     Call<List<RoomMeetings>> roomMeetings(@Body QueryMeetingBody body);
 
-//    @POST("employee-center/EmpService/queryEmpInfoByEmpId")
-    @POST("http://168.63.65.40:8090/employee-center/EmpService/queryEmpInfoByEmpId")
+    //    @POST("employee-center/EmpService/queryEmpInfoByEmpId")
+    @POST("getEmpInfoData")
     Call<EmpInfo> getEmpInfo(@Query("empId") String empId);
 
 }

+ 1 - 1
app/src/main/java/com/ht/gate/DoorService.java

@@ -112,7 +112,7 @@ public class DoorService extends Service {
             new Thread(() -> {
                 try {
                     Room room = Room.fromBase64(sharedPreferences.getString(Constants.PREF_ROOM_INFO, null));
-                    String spaceId = sharedPreferences.getString(room.getRoomNo(), "");
+                    String spaceId = room.getDeviceCode();
                     byte[] data = spaceId.getBytes();
                     Log.d(TAG, "UDP发送消息:" + spaceId);
                     DatagramPacket packet = new DatagramPacket(data, data.length, serverAddress, port);

+ 17 - 0
app/src/main/java/com/ht/gate/GetDeviceBody.java

@@ -0,0 +1,17 @@
+package com.ht.gate;
+
+public class GetDeviceBody {
+    private String deviceId;
+
+    public GetDeviceBody(String deviceId) {
+        this.deviceId = deviceId;
+    }
+
+    public String getDeviceId() {
+        return deviceId;
+    }
+
+    public void setDeviceId(String deviceId) {
+        this.deviceId = deviceId;
+    }
+}

+ 2 - 2
app/src/main/java/com/ht/gate/LoginActivity.java

@@ -48,7 +48,7 @@ public class LoginActivity extends AppCompatActivity {
         setContentView(R.layout.activity_login);
         ButterKnife.bind(this);
         if (MyApplication.roomInfo != null) {
-           // et.setText(MyApplication.roomInfo.getDeviceCode());
+            // et.setText(MyApplication.roomInfo.getDeviceCode());
         }
         unlockView.setUnlockListener(() -> {
             unlockView.setVisibility(View.GONE);
@@ -94,7 +94,7 @@ public class LoginActivity extends AppCompatActivity {
                             break;
                         }
                         RetrofitManager.getInstance().getRetrofit().create(ApiService.class)
-                                .bindDevice(et.getText().toString()).enqueue(new Callback<Room>() {
+                                .bindDevice(new GetDeviceBody(et.getText().toString())).enqueue(new Callback<Room>() {
                             @Override
                             public void onResponse(@NonNull Call<Room> call, @NonNull Response<Room> response) {
 

+ 2 - 2
app/src/main/java/com/ht/gate/RetrofitManager.java

@@ -12,8 +12,8 @@ import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
 import retrofit2.converter.gson.GsonConverterFactory;
 
 public class RetrofitManager {
-//    private final String BASE_URL = "http://localhost:8080/";
-    private final String BASE_URL = "http://168.63.118.97:8080/jtxt/";
+    //    private final String BASE_URL = "http://localhost:8080/";
+    private final String BASE_URL = "http://screen.crm.htsc:30000/";
     private static RetrofitManager sInstance;
     private Retrofit mRetrofit;
 

+ 1 - 1
app/src/main/java/com/ht/gate/SoundUtil.java

@@ -28,7 +28,7 @@ public class SoundUtil {
         soundPool = builder.build();
         UNLOCK_SUCCESS = soundPool.load(context.getApplicationContext(), R.raw.unlock_success, 1);
         UNLOCK_FAIL = soundPool.load(context.getApplicationContext(), R.raw.unlock_fail, 1);
-        KEYBOARD = soundPool.load(context.getApplicationContext(), R.raw.keyboard, 1);
+        KEYBOARD = soundPool.load(context.getApplicationContext(), R.raw.keyboard_1, 1);
         //异步需要等待加载完成,音频才能播放成功
         soundPool.setOnLoadCompleteListener((soundPool, sampleId, status) -> {
             if (status == 0) {

BIN
app/src/main/res/raw/keyboard_1.wav


BIN
app/src/main/res/raw/unlock_1.wav