public interface IUserController {
UserVo login(String telephone, String password);
}
public class UserController implements IUserController {
@Override
public UserVo login(String telephone, String password) {
...
}
}
public class UserControllerProxy implements IUserController {
private UserController userController;
public UserControllerProxy(UserController userController) {
this.userController = userController;
}
@Override
public UserVo login(String telephone, String password) {
// do something
// 委托
UserVo userVo = userController.login(telephone, password);
// do something
return userVo;
}
}