Files
iot-dc3/dc3-api/dc3-api-manager
Vickey 476799e513 refactor(api): rename gRPC SelectBy* RPCs to GetBy*/ListBy*
Apply the new naming convention to .proto contracts so the verb on
each RPC reflects the cardinality of its result:

  - get*  for single-record returns (RPCs returning a single DTO)
  - list* for multi-record returns (RPCs returning a Page or List DTO)

23 RPCs renamed across 9 .proto files. Returns-single -> Get*:
  user.proto                 SelectById        -> GetById
  user_login.proto           SelectByName      -> GetByName
  tenant.proto               SelectByCode      -> GetByCode
  driver_device.proto        SelectById        -> GetById
  driver_point.proto         SelectById        -> GetById
  manager_point.proto        SelectById        -> GetById
  manager_device.proto       SelectByDeviceId  -> GetByDeviceId
  manager_driver.proto       SelectByDriverId  -> GetByDriverId
  manager_driver.proto       SelectByDeviceId  -> GetByDeviceId
  manager_profile.proto      SelectByProfileId -> GetByProfileId

Returns-multi -> List*:
  driver_device.proto        SelectByPage         -> ListByPage
  driver_point.proto         SelectByPage         -> ListByPage
  manager_device.proto       SelectByPage         -> ListByPage
  manager_device.proto       SelectByDriverId     -> ListByDriverId
  manager_device.proto       SelectByProfileId    -> ListByProfileId
  manager_device.proto       SelectByDeviceIds    -> ListByDeviceIds
  manager_driver.proto       SelectByPage         -> ListByPage
  manager_driver.proto       SelectByDriverIds    -> ListByDriverIds
  manager_point.proto        SelectByPage         -> ListByPage
  manager_point.proto        SelectByIds          -> ListByIds
  manager_profile.proto      SelectByPage         -> ListByPage
  manager_profile.proto      SelectByProfileIds   -> ListByProfileIds
  manager_profile.proto      SelectByDeviceId     -> ListByDeviceId

This is a wire-level breaking change: gRPC clients and servers must
upgrade in lockstep. Server impls, facade clients, and Java callers
are aligned in subsequent commits.
2026-05-18 19:19:40 +08:00
..

DC3 API Manager

Overview

dc3-api-manager provides gRPC service definitions for the Manager Center in the IoT DC3 platform. It defines the interfaces used by the Data service and other consumers to query driver, device, and point metadata from the Manager Center.

Module Information

  • Group ID: io.github.pnoker
  • Artifact ID: dc3-api-manager
  • Version: 2026.5.18
  • Package: io.github.pnoker.api.center.manager

Proto Definitions

manager_driver.proto

Defines driver-related RPC calls from the manager perspective.

Service: DriverApi

  • SelectByDeviceId - Query driver information by device ID
  • SelectByServiceName - Query driver information by service name

Key Messages:

  • GrpcDriverQuery - Driver query by device ID
  • GrpcServiceNameQuery - Driver query by service name
  • GrpcRDriverDTO - Response wrapper containing driver information
  • GrpcDriverDTO - Driver data structure (service name, driver type, host, etc.)

manager_device.proto

Defines device-related RPC calls from the manager perspective.

Service: DeviceApi

  • SelectById - Query device information by device ID

Key Messages:

  • GrpcDeviceQuery - Device query by device ID
  • GrpcRDeviceDTO - Response wrapper containing device information

manager_point.proto

Defines point-related RPC calls from the manager perspective.

Service: PointApi

  • SelectById - Query point information by point ID

Key Messages:

  • GrpcPointQuery - Point query by point ID
  • GrpcRPointDTO - Response wrapper containing point information

manager_query.proto / manager_query_page.proto

Shared query and paginated query structures for manager RPC calls.

Dependencies

This module depends on common proto definitions:

  • api/common/entity.proto - Common entity definitions
  • api/common/page.proto - Pagination support
  • api/common/r.proto - Common response wrapper

Usage

1. Add Dependency


<dependency>
    <groupId>io.github.pnoker</groupId>
    <artifactId>dc3-api-manager</artifactId>
    <version>2026.5.18</version>
</dependency>

2. Inject gRPC Client


@GrpcClient(ManagerConstant.SERVICE_NAME)
private DriverApiGrpc.DriverApiBlockingStub driverApiBlockingStub;

@GrpcClient(ManagerConstant.SERVICE_NAME)
private PointApiGrpc.PointApiBlockingStub pointApiBlockingStub;

3. Query Driver by Device

GrpcDeviceQuery query = GrpcDeviceQuery.newBuilder()
        .setDeviceId(deviceId)
        .build();
GrpcRDriverDTO response = driverApiBlockingStub.selectByDeviceId(query);
if(response.

getResult().

getOk()){
String serviceName = response.getData().getServiceName();
}

Integration Points

  • Used by dc3-common-data to resolve the target driver service name before publishing RabbitMQ commands
  • Used by dc3-common-data to look up point metadata for data queries

Build Instructions

# Build the module (run from repo root)
mvn -s .mvn/settings.xml clean package

# Install to local repository
mvn -s .mvn/settings.xml clean install

# Build this module only
mvn -s ../../.mvn/settings.xml clean package
  • dc3-api-driver - Driver-side gRPC API for driver registration and config sync
  • dc3-common-data - Consumes this API to resolve driver/point metadata
  • dc3-common-manager - Implements this API as @GrpcService server

License

Copyright 2016-present the IoT DC3 original author or authors.

Licensed under the GNU Affero General Public License v3.0 (AGPL 3.0)