liuxiulin hace 4 semanas
padre
commit
2556f28605
Se han modificado 2 ficheros con 11 adiciones y 8 borrados
  1. 1 0
      pkg/rpcs/task.go
  2. 10 8
      services/scene-service/internal/service/scene.go

+ 1 - 0
pkg/rpcs/task.go

@@ -17,6 +17,7 @@ type ReplySubmitTask ReplyEmptyResult
 type ArgsSubmitSceneAction struct {
 	Id         string `json:"id"`
 	Name       string `json:"name"`
+	Desc       string `json:"desc"`
 	Status     int    `json:"status"`
 	Action     string `json:"action"`
 	SceneType  string `json:"scene_type"`

+ 10 - 8
services/scene-service/internal/service/scene.go

@@ -9,17 +9,18 @@ import (
 	"sparrow/pkg/rpcs"
 	"sparrow/pkg/server"
 	service2 "sparrow/services/scene-service/internal/service/manager"
+	"time"
 )
 
 type SceneInfo struct {
-	Id        string `json:"id"`
-	Name      string `json:"name"`
-	Desc      string `json:"desc"`
-	Status    int    `json:"status"`
-	SceneType string `json:"scene_type"`
-	Config    string `json:"config"`
-	Action    string `json:"action"`
-	Time      string `json:"time"`
+	Id        string    `json:"id"`
+	Name      string    `json:"name"`
+	Desc      string    `json:"desc"`
+	Status    int       `json:"status"`
+	SceneType string    `json:"scene_type"`
+	Config    string    `json:"config"`
+	Action    string    `json:"action"`
+	Time      time.Time `json:"time"`
 }
 
 type SceneService struct {
@@ -67,6 +68,7 @@ func (m *SceneService) SubmitAction(args rpcs.ArgsSubmitSceneAction, reply *rpcs
 		Id:        args.Id,
 		Name:      args.Name,
 		Status:    args.Status,
+		Desc:      args.Desc,
 		SceneType: args.SceneType,
 		Config:    args.Config,
 		Action:    args.Action,