Giter Club home page Giter Club logo

Comments (7)

darkSystemCode avatar darkSystemCode commented on July 2, 2024
  1. 我目前的问题和缺陷#1423一致,我可以通过turms-gateway的userRepository对用户做一个简单的存储,但是在用户建立好友关系的请求中,因为缺少userVersion的数据,导致无法查找好友邀请关系数据,详细代码为
    Snipaste_2024-04-24_17-50-47
  2. 所以,请问作者有什么好的方案提供到我访问userVersion?

from turms.

JamesChenX avatar JamesChenX commented on July 2, 2024

I will add a new RPC method that can call any methods in peer servers this weekend.
After that, you can use the code like:

getContext().getBean(RpcService.class).request("userService", "createUser", ...)

in your plugin.

I will @ you and give a complete example when I publish it.

from turms.

JamesChenX avatar JamesChenX commented on July 2, 2024

You can use the following code in your plugins for turms-gateway to request turms-service to create a user currently:

getContext().getBean(RpcService.class)
                .requestResponse(new CreateUserRequest(...))
                .subscribe(userId -> {
                    LOGGER.info("Created user {}", userId);
                });

The previous proposal has been rejected mainly because Turms internal APIs change frequently, and it will make the plugins that call Turms server-internal APIs break frequently even if the plugin compiles successfully.

from turms.

darkSystemCode avatar darkSystemCode commented on July 2, 2024

@JamesChenX 请问,新增的RPCService没有暴露userVersion的接口吧,目前我在最新的代码是没有找到这个接口,即使我可以在turms-gateway添加用户,但是由于我缺少userVersion的数据,好友查询数据无法通过接口查询,其他使用到userVersion的接口依旧这个问题。

from turms.

JamesChenX avatar JamesChenX commented on July 2, 2024

getContext().getBean(RpcService.class) requestResponse(new CreateUserRequest(...)) will not only create the user record, but also the user version record, which is used to provide a solution for your first requirement UserAuthenticator插件验证时写入用户到user表,但是我无法写入userVersion数据

由于我缺少userVersion的数据,好友查询数据无法通过接口查询,其他使用到userVersion的接口依旧这个问题。

The business logic should be implemented in turms-service instead of turms-gateway. turms-gateway is designed not to be business-aware, and should not need to know find friends, etc.

from turms.

darkSystemCode avatar darkSystemCode commented on July 2, 2024

我使用UserAuthenticator插件接入第三方用户到turms,以致于我必须在插件写入用户,这样turms拥有了这个用户数据,然后我通过turms-service接口发起用户好友请求,由于我在plugin写入用户时缺少userVersion数据,无法查询到我发起的好友请求,致使我无法完成好友认证功能。

from turms.

darkSystemCode avatar darkSystemCode commented on July 2, 2024

我知道turms-gateway不需要具备业务,但是turms-service是具备业务的,我在turms-servic只有用户数据,没有userVersion的dateTime数据(如上面截图红框所示),好多业务接口都无法查询到数据。

from turms.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.