package impl import ( "context" "gd_admin/apis" "gd_admin/impl/action" "gd_admin/impl/admin" "gd_admin/impl/auth" "gd_admin/impl/dbmodel" "gd_admin/impl/rbac" "gd_admin/common.in/task" "github.com/astaxie/beego/orm" ) // 具体实现 type Rcvr struct { } func (c *Rcvr) AdminLogin(ctx context.Context, req *apis.AdminLoginReq, reply *apis.AdminLoginReply) error { t1 := func() error { return admin.AdminLogin(ctx, req, reply) } return task.Do(ctx, t1) } func (c *Rcvr) AdminRegister(ctx context.Context, req *apis.AdminRegisterReq, reply *apis.AdminRegisterReply) error { t1 := func() error { return admin.AdminRegister(ctx, req, reply) } return task.Do(ctx, t1) } func (c *Rcvr) AdminDelete(ctx context.Context, req *apis.AdminDeleteReq, reply *apis.AdminDeleteReply) error { t1 := func() error { return admin.AdminDelete(ctx, req, reply) } return task.Do(ctx, t1) } func (c *Rcvr) AdminModify(ctx context.Context, req *apis.AdminModifyReq, reply *apis.AdminModifyReply) error { t1 := func() error { return admin.AdminModify(ctx, req, reply) } return task.Do(ctx, t1) } func (c *Rcvr) AdminGetAll(ctx context.Context, req *apis.AdminGetAllReq, reply *apis.AdminGetAllReply) error { t1 := func() error { return admin.AdminGetAll(ctx, req, reply) } return task.Do(ctx, t1) } func (c *Rcvr) GetRbacAccess(ctx context.Context, req *apis.GetAccessReq, reply *apis.GetAccessReply) error { t1 := func() error { return rbac.GetAccess(ctx, req, reply) } return task.Do(ctx, t1) } func (c *Rcvr) GetRbacGroupList(ctx context.Context, req *apis.GetRbacGroupListReq, reply *apis.GetRbacGroupListReply) error { t1 := func() error { return rbac.GetGroupList(ctx, req, reply) } return task.Do(ctx, t1) } func (c *Rcvr) UpdateRbacGroup(ctx context.Context, req *apis.UpdateRbacGroupReq, reply *apis.UpdateRbacGroupReply) error { t1 := func() error { return rbac.UpdateGroup(ctx, req, reply) } return task.Do(ctx, t1) } func (c *Rcvr) DeleteRbacGroup(ctx context.Context, req *apis.DeleteRbacGroupReq, reply *apis.DeleteRbacGroupReply) error { t1 := func() error { return rbac.DeleteGroup(ctx, req, reply) } return task.Do(ctx, t1) } func (c *Rcvr) AddRbacGroup(ctx context.Context, req *apis.AddRbacGroupReq, reply *apis.AddRbacGroupReply) error { t1 := func() error { return rbac.AddGroup(ctx, req, reply) } return task.Do(ctx, t1) } func (c *Rcvr) GetNodeList(ctx context.Context, req *apis.GetNodeListReq, reply *apis.GetNodeListReply) error { t1 := func() error { return rbac.GetList(ctx, req, reply) } return task.Do(ctx, t1) } func (c *Rcvr) UpdateAdminStatus(ctx context.Context, req *apis.UpdateStatusReq, reply *apis.UpdateStatusReply) error { t1 := func() error { return admin.UpdateStatus(ctx, req, reply) } return task.Do(ctx, t1) } func (c *Rcvr) GetInfo(ctx context.Context, req *apis.GetInfoReq, reply *apis.GetInfoReply) error { t1 := func() error { return admin.GetInfo(ctx, req, reply) } return task.Do(ctx, t1) } // AddActionLog 添加用户行为日志 func (c *Rcvr) AddActionLog(ctx context.Context, req *apis.AddActionLogReq, reply *apis.AddActionLogReply) error { t1 := func() error { return action.Add(ctx, req, reply) } return task.Do(ctx, t1) } // GetActionLog 获取用户行为日志 func (c *Rcvr) GetActionLog(ctx context.Context, req *apis.GetLogReq, reply *apis.GetLogReply) error { t1 := func() error { return action.Log(ctx, req, reply) } return task.Do(ctx, t1) } // 获取oss sts授权 func (r *Rcvr) AuthGetOSSInfo(ctx context.Context, req *apis.AuthGetOSSInfoReq, reply *apis.AuthGetOSSInfoReply) (err error) { t1 := func() error { return auth.AuthGetOSSInfo(ctx, req, reply) } return task.Do(ctx, t1) } func RegisterOrmModel() { orm.RegisterModel(new(apis.AdminInfo), new(admin.AdminLoginLog), new(dbmodel.TGdAdminRbacAccess), new(dbmodel.TGdAdminRbacGroup), new(dbmodel.TGdAdminRbacNode), new(dbmodel.Action)) }