| Version | Description | Date | Remarks |
|---|---|---|---|
| V1.0.0 | Initial version | 2025-04-30 | |
| V2.0.0 | 1. Added specific logic for screen designation, removed screen selection logic. 2. Added complete presets and relative presets. 3. Added interface module protocol. 4. Added layer module protocol. 5. Added gallery module protocol. 6. Screen section 4.1/Preset section 6.1 adapt to devices below version 1.7.0. 7. Screen section 4.2/ Preset section 6.2 adapt to devices version 1.7.0 and above. | 2025-07-28 | Device range (P10, P20, Q8) |
| V2.0.1 | 1. Added the supported device model P80. | 2025-10-14 | Supported devices (P10, P20, Q8,P80) |
URL: http://ip:port/pixelhue/v1/node/open-detail
Method:get
Query:
{
"nodeId": 1
}
Response:
{
"code": 0,
"message": "ok",
"data": {
"sn": "1231231042541226",
"startTime": "1718282915976" }
}var Secret = []byte("whatasecret") //The client obtains the service start time as the key by calling the newly added node information interface from the UServer.
// JWT expiration time, set according to the actual environment
const expiration = 2 * time.Minute
type Claims struct {
// Custom fields can include username, user ID, user role, etc.
SN string
// jwt.StandardClaims includes the officially defined fields
jwt.StandardClaims
}
func GetToken(SN string) (string, error) {
// Create declaration
a := &Claims{
SN: (sn value returned by the open-detail interface),
StandardClaims: jwt.StandardClaims{
ExpiresAt: time.Now().Add(expiration).Unix(), // Expiration time
IssuedAt: time.Now().Unix(), // Issuance time
Issuer: "gin-jwt-demo", // Issuer
Id: "", // Select this as needed, in some implementations, this ID is controlled to determine whether it is still valid based on black/white list.
NotBefore: 0, // Start time in effect
Subject: "", // Subject
},
}
// Create a signature object using the specified hash method
tt := jwt.NewWithClaims(jwt.SigningMethodHS256, a)
return tt.SignedString(Secret)
}| Error Code | Field | Description |
|---|---|---|
| 0 | success | Success |
| Non-0 | failed | Failure |