按照Jmix文档中关于自定义控制器的写法:
package com.gense.ips.controller;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/orders")
public class RestTest {
@GetMapping("/calculateTotalAmount")
public ResponseEntity<Integer> calculateTotalAmount() {
return ResponseEntity
.status(HttpStatus.OK)
.header(HttpHeaders.CACHE_CONTROL, "max-age=31536000")
.body(10);
}
}
访问时返回403错误:
没有使用自定义控制保护。