feat: 设备编号从 00000001 顺序分配

This commit is contained in:
Nixevol
2026-10-12 08:54:17 +08:00
parent 775599174b
commit c334dbc040
8 changed files with 119 additions and 29 deletions
+6 -6
View File
@@ -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) {