This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let data = { | |
imei: 'dummyimei', | |
}; | |
let url = URI.CHECK_IN(); | |
post(url, {data: data}, | |
res => handleResponse(res), | |
err => handleError(err)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const post = (url, body, successCallback, failureCallback) => { | |
let requestOptions = { | |
method: 'POST', | |
body: body, | |
}; | |
call(url, requestOptions, successCallback, failureCallback); | |
}; | |
export const get = (url, successCallback, failureCallback) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//class in application.jar | |
@SpringBootApplication | |
@ComponentScan(basePackages= "com.plugin") //scan classes in package com.plugin in plugin.jar | |
public class Application { | |
public static void main(String[] args) { | |
SpringApplication.run(Application.class, args); | |
} | |
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private BufferedImage getOverly(String logo) throws IOException { | |
ClassPathResource resource = new ClassPathResource(logo); | |
BufferedImage bufferedImage = ImageIO.read(resource.getInputStream()); | |
int width = bufferedImage.getWidth(); | |
int height = bufferedImage.getHeight(); | |
int newWidth = WIDTH/6; | |
int newHeight = HEIGHT/6; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private byte[] generateQrImage(String content) throws WriterException, IOException { | |
// Create new configuration that specifies the error correction | |
Map<EncodeHintType, ErrorCorrectionLevel> hints = new HashMap<>(); | |
hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.M); | |
// Create a qr code with the url as content and a size of WxH px | |
BitMatrix bitMatrix = new QRCodeWriter().encode(content, BarcodeFormat.QR_CODE, WIDTH, HEIGHT, hints); | |
// Load QR image | |
BufferedImage qrImage = MatrixToImageWriter.toBufferedImage(bitMatrix, new MatrixToImageConfig(BLACK, WHITE)); |