spring-graphql SalaryService 源码
spring-graphql SalaryService 代码
文件路径:/samples/webmvc-http-security/src/main/java/io/spring/sample/graphql/SalaryService.java
package io.spring.sample.graphql;
import java.math.BigDecimal;
import org.springframework.security.access.annotation.Secured;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Component;
@Component
public class SalaryService {
@PreAuthorize("hasRole('ADMIN')")
public BigDecimal getSalaryForEmployee(Employee employee) {
return new BigDecimal("42");
}
@Secured({ "ROLE_HR" })
public void updateSalary(String employeeId, BigDecimal newSalary) {
}
}
相关信息
相关文章
spring-graphql EmployeeService 源码
spring-graphql SalaryController 源码
0
赞
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦