|
|
@ -1,5 +1,7 @@ |
|
|
|
package app.controllers.bot; |
|
|
|
|
|
|
|
import app.annotations.enums.AuthMethod; |
|
|
|
import app.annotations.interfaces.CheckWebAccess; |
|
|
|
import app.entities.db.Annonce; |
|
|
|
import app.repositories.AnnonceRepository; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
@ -17,6 +19,7 @@ public class DiscordNewsController { |
|
|
|
private AnnonceRepository annonceRepository; |
|
|
|
|
|
|
|
@PostMapping("/news") |
|
|
|
@CheckWebAccess(auth_method = AuthMethod.SECRET_KEY) |
|
|
|
public ResponseEntity createNews(@RequestBody Annonce annonce) { |
|
|
|
annonce.setId(null); |
|
|
|
annonceRepository.save(annonce); |
|
|
|