|
@@ -1,12 +1,10 @@
|
|
|
package rpc
|
|
|
|
|
|
import (
|
|
|
- "app.yhyue.com/moapp/jyMarketing/rpc/activityclient"
|
|
|
"app.yhyue.com/moapp/jyPoints/rpc/integral"
|
|
|
"app.yhyue.com/moapp/jyPoints/rpc/integralclient"
|
|
|
"app.yhyue.com/moapp/jybase/date"
|
|
|
"app.yhyue.com/moapp/jybase/go-logger/logger"
|
|
|
- "context"
|
|
|
"fmt"
|
|
|
"github.com/gogf/gf/v2/os/gcfg"
|
|
|
"github.com/gogf/gf/v2/os/gctx"
|
|
@@ -17,7 +15,6 @@ import (
|
|
|
)
|
|
|
|
|
|
var zrpcClient zrpc.Client
|
|
|
-var activeLib activityclient.Activity
|
|
|
|
|
|
func init() {
|
|
|
var err error
|
|
@@ -30,15 +27,6 @@ func init() {
|
|
|
if err != nil {
|
|
|
log.Fatalln(err)
|
|
|
}
|
|
|
-
|
|
|
- client := zrpc.MustNewClient(zrpc.RpcClientConf{
|
|
|
- Etcd: discov.EtcdConf{
|
|
|
- Hosts: gcfg.Instance().MustGet(gctx.New(), "etcd.activeServer.integral.address", nil).Strings(),
|
|
|
- Key: gcfg.Instance().MustGet(gctx.New(), "etcd.activeServer.integral.key", nil).String(),
|
|
|
- },
|
|
|
- })
|
|
|
- // defer client.Conn().Close()
|
|
|
- activeLib = activityclient.NewActivity(client)
|
|
|
}
|
|
|
|
|
|
// IntegralHarvest 积分奖励发放
|
|
@@ -63,15 +51,3 @@ func IntegralHarvest(userId string, pNum, pType, dateStamp int64) error {
|
|
|
return fmt.Errorf(fmt.Sprintf("%+v", req), "增加", pNum, "积分失败", "Code", resp.Code, "Message", resp.Message)
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-type UserLottery struct{}
|
|
|
-
|
|
|
-var UserHarvest *UserLottery
|
|
|
-
|
|
|
-func (this *UserLottery) HarvestFunc(activeReq activityclient.Request) (resp activityclient.ActivityLotteryResp) {
|
|
|
- _resp, err := activeLib.UserLottery(context.Background(), &activeReq)
|
|
|
- if err != nil {
|
|
|
- log.Println("UserHarvest error:", err)
|
|
|
- }
|
|
|
- return *_resp
|
|
|
-}
|