spring-graphql SalaryService 源码

  • 2022-08-16
  • 浏览 (581)

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 源码目录

相关文章

spring-graphql Employee 源码

spring-graphql EmployeeService 源码

spring-graphql SalaryController 源码

spring-graphql SalaryInput 源码

spring-graphql SampleApplication 源码

spring-graphql SecurityConfig 源码

0  赞