|
@@ -3,6 +3,7 @@ package space.anyi.serve.controller;
|
|
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import jakarta.validation.Valid;
|
|
import jakarta.validation.Valid;
|
|
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
@@ -38,7 +39,7 @@ public class MetaController {
|
|
|
Meta meta = metaService.getMeta(Meta.WEBSITE_META_KEY);
|
|
Meta meta = metaService.getMeta(Meta.WEBSITE_META_KEY);
|
|
|
return Response.ok(meta.getValue());
|
|
return Response.ok(meta.getValue());
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ @PreAuthorize("hasAnyRole('ROLE_admin')")
|
|
|
@PostMapping("updateWebsiteMeta")
|
|
@PostMapping("updateWebsiteMeta")
|
|
|
public Response updateWebsiteMeta(@Valid @RequestBody WebsiteMetaDto websiteMetaDto){
|
|
public Response updateWebsiteMeta(@Valid @RequestBody WebsiteMetaDto websiteMetaDto){
|
|
|
Meta meta = new Meta();
|
|
Meta meta = new Meta();
|