Добавлен сервис и контроллер для QR кода
This commit is contained in:
parent
b20455cb7b
commit
61b23d9afb
@ -0,0 +1,23 @@
|
||||
package com.example.onomatopoeiaback.controller;
|
||||
|
||||
import com.example.onomatopoeiaback.domain.qrcode.QrCode;
|
||||
import com.example.onomatopoeiaback.service.QrCodeService;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/qr_code")
|
||||
public class QrCodeController {
|
||||
final
|
||||
QrCodeService qrCodeService;
|
||||
|
||||
public QrCodeController(QrCodeService qrCodeService) {
|
||||
this.qrCodeService = qrCodeService;
|
||||
}
|
||||
|
||||
public ResponseEntity<QrCode> createQrCode(@RequestParam String name) {
|
||||
return ResponseEntity.ok(qrCodeService.createQrCode(name));
|
||||
}
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.example.onomatopoeiaback.service;
|
||||
|
||||
import com.example.onomatopoeiaback.domain.qrcode.QrCode;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class QrCodeService {
|
||||
public QrCode createQrCode(String name) {
|
||||
QrCode qrCode = new QrCode();
|
||||
qrCode.setName(name);
|
||||
return qrCode;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user