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.
40 lines
778 B
40 lines
778 B
package dao |
|
|
|
import ( |
|
"context" |
|
accrpc "go-common/app/service/main/account/rpc/client" |
|
|
|
"go-common/app/interface/live/web-room/conf" |
|
"go-common/app/service/live/xuser/api/grpc/v1" |
|
) |
|
|
|
// Dao dao |
|
type Dao struct { |
|
c *conf.Config |
|
RoomAdminAPI v1.RoomAdminClient |
|
acc *accrpc.Service3 |
|
} |
|
|
|
// New init mysql db |
|
func New(c *conf.Config) (dao *Dao) { |
|
roomAdminClient, err := v1.NewXuserRoomAdminClient(conf.Conf.XRoomAdmin) |
|
if err != nil { |
|
panic(err) |
|
} |
|
dao = &Dao{ |
|
c: c, |
|
RoomAdminAPI: roomAdminClient, |
|
acc: accrpc.New3(c.AccountRPC), |
|
} |
|
return |
|
} |
|
|
|
// Close close the resource. |
|
func (d *Dao) Close() { |
|
} |
|
|
|
// Ping dao ping |
|
func (d *Dao) Ping(c context.Context) error { |
|
// TODO: if you need use mc,redis, please add |
|
return nil |
|
}
|
|
|