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.
33 lines
687 B
33 lines
687 B
package assist |
|
|
|
import ( |
|
"context" |
|
|
|
"go-common/app/interface/main/app-intl/conf" |
|
"go-common/app/service/main/assist/model/assist" |
|
assistrpc "go-common/app/service/main/assist/rpc/client" |
|
|
|
"github.com/pkg/errors" |
|
) |
|
|
|
// Dao is assist dao |
|
type Dao struct { |
|
assistRPC *assistrpc.Service |
|
} |
|
|
|
// New initial assist dao |
|
func New(c *conf.Config) (d *Dao) { |
|
d = &Dao{ |
|
assistRPC: assistrpc.New(c.AssistRPC), |
|
} |
|
return |
|
} |
|
|
|
// Assist get assists data from api. |
|
func (d *Dao) Assist(c context.Context, upMid int64) (asss []int64, err error) { |
|
arg := &assist.ArgAssists{Mid: upMid} |
|
if asss, err = d.assistRPC.AssistIDs(c, arg); err != nil { |
|
err = errors.Wrapf(err, "%v", arg) |
|
} |
|
return |
|
}
|
|
|