package com.whyc.controller;
|
|
import com.whyc.dto.Response;
|
import com.whyc.service.QRCodeService;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RestController;
|
|
/**
|
* 二维码的识别和生成
|
*/
|
@RestController
|
@RequestMapping("qr")
|
public class QRCodeController{
|
|
@Autowired
|
private QRCodeService service;
|
|
@PostMapping("extract")
|
private Response extract(byte[] data){
|
String res = service.extract(data);
|
return new Response().set(1,res);
|
}
|
|
@PostMapping("extractAndGetData")
|
private Response extractAndGetData(@RequestBody byte[] data){
|
return service.extractAndGetData(data);
|
}
|
|
}
|