You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Open-IM-Server/internal/api/third.go

58 lines
1.3 KiB

2 years ago
package api
import (
"OpenIM/internal/api/a2r"
"OpenIM/pkg/common/config"
2 years ago
"OpenIM/pkg/discoveryregistry"
2 years ago
"OpenIM/pkg/proto/third"
"context"
2 years ago
2 years ago
"github.com/gin-gonic/gin"
)
var _ context.Context // 解决goland编辑器bug
2 years ago
func NewThird(c discoveryregistry.SvcDiscoveryRegistry) *Third {
return &Third{c: c}
2 years ago
}
type Third struct {
2 years ago
c discoveryregistry.SvcDiscoveryRegistry
2 years ago
}
func (o *Third) client() (third.ThirdClient, error) {
2 years ago
conn, err := o.c.GetConn(config.Config.RpcRegisterName.OpenImThirdName)
2 years ago
if err != nil {
return nil, err
}
return third.NewThirdClient(conn), nil
}
func (o *Third) ApplyPut(c *gin.Context) {
a2r.Call(third.ThirdClient.ApplyPut, o.client, c)
}
func (o *Third) GetPut(c *gin.Context) {
a2r.Call(third.ThirdClient.GetPut, o.client, c)
}
func (o *Third) ConfirmPut(c *gin.Context) {
a2r.Call(third.ThirdClient.ConfirmPut, o.client, c)
}
func (o *Third) GetSignalInvitationInfo(c *gin.Context) {
a2r.Call(third.ThirdClient.GetSignalInvitationInfo, o.client, c)
}
func (o *Third) GetSignalInvitationInfoStartApp(c *gin.Context) {
a2r.Call(third.ThirdClient.GetSignalInvitationInfoStartApp, o.client, c)
}
func (o *Third) FcmUpdateToken(c *gin.Context) {
a2r.Call(third.ThirdClient.FcmUpdateToken, o.client, c)
}
func (o *Third) SetAppBadge(c *gin.Context) {
a2r.Call(third.ThirdClient.SetAppBadge, o.client, c)
}