feat(v1): unify API response, validation, exception handling and tests
This commit is contained in:
@@ -6,7 +6,6 @@ import com.example.demo.aop.RateLimited;
|
||||
import com.example.demo.event.UserEventPublisher;
|
||||
import com.example.demo.model.User;
|
||||
import com.example.demo.service.UserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
@@ -20,17 +19,20 @@ import java.util.Map;
|
||||
@RequestMapping("/aop")
|
||||
public class AopEventController {
|
||||
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
private final UserService userService;
|
||||
private final UserEventPublisher eventPublisher;
|
||||
private final PerformanceAspect performanceAspect;
|
||||
private final RateLimitAspect rateLimitAspect;
|
||||
|
||||
@Autowired
|
||||
private UserEventPublisher eventPublisher;
|
||||
|
||||
@Autowired
|
||||
private PerformanceAspect performanceAspect;
|
||||
|
||||
@Autowired
|
||||
private RateLimitAspect rateLimitAspect;
|
||||
public AopEventController(UserService userService,
|
||||
UserEventPublisher eventPublisher,
|
||||
PerformanceAspect performanceAspect,
|
||||
RateLimitAspect rateLimitAspect) {
|
||||
this.userService = userService;
|
||||
this.eventPublisher = eventPublisher;
|
||||
this.performanceAspect = performanceAspect;
|
||||
this.rateLimitAspect = rateLimitAspect;
|
||||
}
|
||||
|
||||
/**
|
||||
* 学习首页
|
||||
|
||||
Reference in New Issue
Block a user