feat: 设备编号从 00000001 顺序分配
This commit is contained in:
@@ -95,12 +95,12 @@ type nixAdapter struct {
|
||||
client *nixmsg.Client
|
||||
}
|
||||
|
||||
func (a nixAdapter) CreateEndpoint(ctx context.Context, name string) (string, string, error) {
|
||||
ep, err := a.client.CreateEndpoint(ctx, name)
|
||||
func (a nixAdapter) CreateEndpoint(ctx context.Context, id, name string) (string, error) {
|
||||
ep, err := a.client.CreateEndpoint(ctx, id, name)
|
||||
if err != nil {
|
||||
return "", "", err
|
||||
return "", err
|
||||
}
|
||||
return ep.ID, ep.LoginPassword, nil
|
||||
return ep.LoginPassword, nil
|
||||
}
|
||||
|
||||
func (a nixAdapter) Lookup(ctx context.Context, id string) (bool, bool, error) {
|
||||
@@ -117,8 +117,8 @@ func (a nixAdapter) DeleteEndpoint(ctx context.Context, id string) error {
|
||||
|
||||
type unavailableNix struct{}
|
||||
|
||||
func (unavailableNix) CreateEndpoint(context.Context, string) (string, string, error) {
|
||||
return "", "", errors.New("nixmsg is not configured")
|
||||
func (unavailableNix) CreateEndpoint(context.Context, string, string) (string, error) {
|
||||
return "", errors.New("nixmsg is not configured")
|
||||
}
|
||||
|
||||
func (unavailableNix) Lookup(context.Context, string) (bool, bool, error) {
|
||||
|
||||
Reference in New Issue
Block a user