Avatar
0
Vu Luong Anh Pundit
Vì sao EzyPlugin không cần có phương thức getUserManager()?
Em thấy beanContextBuilder của plugin không cần add singleton userManager:
EzyBeanContextBuilder beanContextBuilder = EzyBeanContext.builder()
  .addSingleton("pluginContext", context)
  .addSingleton("marshaller", marshaller)
  .addSingleton("unmarshaller", unmarshaller)
  .addSingleton("executorService", executorService)
  .addSingleton("zoneContext", context.getParent())
  addSingleton("serverContext", context.getParent().getParent()) 
  .addSingleton("pluginResponseFactory", pluginResponseFactory);

Vì sao plugin lại không cần userManager vậy ạ? (Em thấy vẫn phải login mới access được plugin)

  • Answer
Remain: 5
1 Answer
Avatar
dungtv Pundit
dungtv Pundit
Bởi vì plugin sinh ra không phải để quản lý user em ạ, nó cũng giống kiểu wordpress này:

  1. theme: là đển hiện thị, tương tác với người dùng
  2. plugin: là để can thiệp vào những tác vụ bên trong, ví dụ kiểm tra upload file, hightlight code, can thiệp vào dữ liệu kiểu middleware

Thì thằng ezyfox-server cũng vậy em ạ, mình sẽ sử dụng plugin cho những nghiệp vụ không cần quản lý user để nó làm nghiệp vụ chính là middleware hay chạy các task vụ ngầm, tuy nhiên nếu có game hay cái gì đó mà không cần quản lý user thì mình có thể cho nó gọi đến plugin được

  • 1
  • Reply