github.com/machinefi/w3bstream@v1.6.5-rc9.0.20240426031326-b8c7c4876e72/cmd/srv-applet-mgr/apis/operator/get.go (about) 1 package operator 2 3 import ( 4 "context" 5 6 "github.com/machinefi/w3bstream/cmd/srv-applet-mgr/apis/middleware" 7 "github.com/machinefi/w3bstream/pkg/depends/kit/httptransport/httpx" 8 "github.com/machinefi/w3bstream/pkg/modules/operator" 9 ) 10 11 type ListOperator struct { 12 httpx.MethodGet 13 operator.ListReq 14 } 15 16 func (r *ListOperator) Path() string { return "/datalist" } 17 18 func (r *ListOperator) Output(ctx context.Context) (interface{}, error) { 19 ca := middleware.MustCurrentAccountFromContext(ctx) 20 r.ListReq.AccountID = ca.AccountID 21 22 return operator.ListDetail(ctx, &r.ListReq) 23 }