扫描二维码入场逻辑

This commit is contained in:
2023-09-05 09:27:00 +08:00
parent f0ef32ffc6
commit 52aa9659a2
41 changed files with 1562 additions and 492 deletions

View File

@@ -1,6 +1,15 @@
package com.sv.service;
import com.sv.barcode.ClientConfig;
import com.sv.barcode.ListenKeyFrame;
import com.sv.netty.ClientThread;
import com.sv.netty.config.NettyConstant;
import com.sv.netty.utils.JsonUtils;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
/**
* 启动socker和websocket服务
@@ -10,9 +19,41 @@ import com.sv.netty.ClientThread;
*/
public class ClientService {
public static void main(String[] args) {
public static void main(String[] args) throws IOException, InterruptedException {
File file = new File("/home/venue/client/venue.conf");
// File file = new File("/Users/limqhz/home/venue/client/venue.conf");
FileReader fileReader = new FileReader(file);
BufferedReader bufferedReader = new BufferedReader(fileReader);
String line = bufferedReader.readLine();
if (line != null) {
ClientConfig decode = JsonUtils.decode(line, ClientConfig.class);
System.setProperty(NettyConstant.VENUE_SERVER_IP,decode.getServerIp());
System.setProperty(NettyConstant.VENUE_SERVER_PORT,decode.getServerPort());
System.setProperty(NettyConstant.VENUE_CLIENT_SN,decode.getClientSN());
System.setProperty(NettyConstant.VENUE_CLIENT_VID,decode.getClientVid());
}
bufferedReader.close();
fileReader.close();
ClientThread instance = ClientThread.getInstance();
instance.start();
Thread.sleep(3000);
ListenKeyFrame listenKeyFrame = new ListenKeyFrame();
listenKeyFrame.newFrame(1);
Thread.sleep(3000);
listenKeyFrame.close();
ListenKeyFrame listenKeyFrame1 = new ListenKeyFrame();
listenKeyFrame1.newFrame(2);
Thread.sleep(3000);
listenKeyFrame1.close();
ListenKeyFrame listenKeyFrame2 = new ListenKeyFrame();
listenKeyFrame2.newFrame(3);
Thread.sleep(3000);
listenKeyFrame2.close();
ListenKeyFrame listenKeyFrame3 = new ListenKeyFrame();
listenKeyFrame3.newFrame(4);
}
}