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.
30 lines
516 B
30 lines
516 B
package rpc |
|
|
|
import ( |
|
"context" |
|
|
|
"go-common/app/service/main/antispam/model" |
|
"go-common/library/net/rpc" |
|
) |
|
|
|
const ( |
|
_appid = "antispam.service" |
|
) |
|
|
|
// Client . |
|
type Client struct { |
|
*rpc.Client2 |
|
} |
|
|
|
// NewClient . |
|
func NewClient(c *rpc.ClientConfig) *Client { |
|
s := &Client{} |
|
s.Client2 = rpc.NewDiscoveryCli(_appid, c) |
|
return s |
|
} |
|
|
|
// Filter . |
|
func (cli *Client) Filter(ctx context.Context, arg *model.Suspicious) (res *model.SuspiciousResp, err error) { |
|
err = cli.Call(ctx, "Filter.Check", arg, &res) |
|
return |
|
}
|
|
|