Comments (2)
你好,请问一下,我该如何在plugin-demo项目中正确的引用turms-service依赖的userService,供在Handler中使用?是否有demo,如果有可以提供一个链接吗?
Your usage is correct, so you don't need to change your code.
For example, we also use messageService = context.getBean(MessageService.class);
to get the MessageService
in im.turms.plugin.rasa.RasaResponser#setUp
in turms-plugin-rasa
.
These official plugins are good examples.
在上面的图片中,我通过继承start函数赋值userService回报错
In simple words, using im.turms.gateway.domain.session.service.UserService
should fix your problem.
Details:
The problems usually happen when you load a plugin into the wrong server.
For your case, im.turms.gateway.infra.plugin.extension.UserAuthenticator
is an extension point for turms-gateway (because turms-gateway is responsible for authentication and authorization), while im.turms.service.domain.user.service.UserService
is a class of turms-service, so the following error is thrown, which is reasonable.:
caused by: java.lang.ClassNotFoundException: Could not find the class (im.turms.service.domain.user.service.UserService) of Turms. This may happen if the plugin descriptor specifies a wrong server type, or the class has been removed by Turms】`
btw, I suggest you only import turms-service
or turms-gateway
in the pom.xml
of your plugins if your plugins will only be loaded in turms-service or turms-gateway so you won't have the chance to use wrong classes.
from turms.
好的,感谢!
from turms.
Related Issues (20)
- Migrate to Java as the template engine HOT 1
- 好友之间在线状态的查询实现
- 聊天室turms-service对外提供http接口如何设置超时时间? HOT 2
- 业务交互 HOT 5
- turms-service的进程 fd一直增加,一天就到了4万,socket大量未关闭 目前同时在线人数最多2000 HOT 2
- Support RAG
- Unify the logic to respond with status codes when the target resource doesn't exist
- Remove controllers registered by a plugin automatically when the plugin is stopped
- Run it with idea,can't start it HOT 2
- Update legacy docs HOT 1
- 压测 HOT 1
- 方案选择的思考 HOT 1
- Question:ack设计的问题 HOT 1
- Provide a WebSocket endpoint for admin APIs
- Add a property to enable notifying other nodes to clear the group member cache if a member is added or removed
- Unify usages of the factory method name `of` and `from` HOT 1
- Support creating records (e.g. users) in batch atomically
- Support continuing creating/updating remaining records if failed to create/update the previous records
- 怎么拓展业务信息,如群组标签等等 HOT 7
- Support getting the trace ID for admin APIs from the user-defined HTTP header
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from turms.