diff --git a/api/main.proto b/api/main.proto index 83b6cea..62b8b6d 100644 --- a/api/main.proto +++ b/api/main.proto @@ -457,10 +457,11 @@ message Scenario { optional string description = 3; optional string image = 4; Story story = 5; - User author = 6; - google.protobuf.Timestamp updated_at = 7; - google.protobuf.Timestamp created_at = 8; - google.protobuf.Timestamp published_at = 9; + string status = 6; + User author = 7; + google.protobuf.Timestamp updated_at = 8; + google.protobuf.Timestamp created_at = 9; + google.protobuf.Timestamp published_at = 10; } message Story { diff --git a/bin/evening_detective_server b/bin/evening_detective_server index 8d4933c..b0c990c 100755 Binary files a/bin/evening_detective_server and b/bin/evening_detective_server differ diff --git a/cmd/evening_detective_server/main.swagger.json b/cmd/evening_detective_server/main.swagger.json index 3d37168..d8d1295 100644 --- a/cmd/evening_detective_server/main.swagger.json +++ b/cmd/evening_detective_server/main.swagger.json @@ -1236,6 +1236,9 @@ "story": { "$ref": "#/definitions/evening_detective_serverStory" }, + "status": { + "type": "string" + }, "author": { "$ref": "#/definitions/evening_detective_serverUser" }, diff --git a/internal/app/story_mapper.go b/internal/app/story_mapper.go index 3ad1d00..67a4c65 100644 --- a/internal/app/story_mapper.go +++ b/internal/app/story_mapper.go @@ -29,6 +29,7 @@ func mapScenario(o *scenarios_service.Scenario) *proto.Scenario { Image: o.Image, Story: mapStory(o.Story), Author: mapUser(o.Author), + Status: o.Status, UpdatedAt: timestamppb.New(o.UpdatedAt), CreatedAt: timestamppb.New(o.CreatedAt), PublishedAt: publishedAt, diff --git a/proto/main.pb.go b/proto/main.pb.go index bf91974..79137b0 100644 --- a/proto/main.pb.go +++ b/proto/main.pb.go @@ -1656,10 +1656,11 @@ type Scenario struct { Description *string `protobuf:"bytes,3,opt,name=description,proto3,oneof" json:"description,omitempty"` Image *string `protobuf:"bytes,4,opt,name=image,proto3,oneof" json:"image,omitempty"` Story *Story `protobuf:"bytes,5,opt,name=story,proto3" json:"story,omitempty"` - Author *User `protobuf:"bytes,6,opt,name=author,proto3" json:"author,omitempty"` - UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - PublishedAt *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=published_at,json=publishedAt,proto3" json:"published_at,omitempty"` + Status string `protobuf:"bytes,6,opt,name=status,proto3" json:"status,omitempty"` + Author *User `protobuf:"bytes,7,opt,name=author,proto3" json:"author,omitempty"` + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + PublishedAt *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=published_at,json=publishedAt,proto3" json:"published_at,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -1729,6 +1730,13 @@ func (x *Scenario) GetStory() *Story { return nil } +func (x *Scenario) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + func (x *Scenario) GetAuthor() *User { if x != nil { return x.Author @@ -2822,19 +2830,21 @@ const file_main_proto_rawDesc = "" + "\x02id\x18\x01 \x01(\x05R\x02id\"l\n" + "\x0eGetScenarioRsp\x12\x14\n" + "\x05error\x18\x01 \x01(\tR\x05error\x12D\n" + - "\bscenario\x18\x02 \x01(\v2(.crabs.evening_detective_server.ScenarioR\bscenario\"\xba\x03\n" + + "\bscenario\x18\x02 \x01(\v2(.crabs.evening_detective_server.ScenarioR\bscenario\"\xd2\x03\n" + "\bScenario\x12\x0e\n" + "\x02id\x18\x01 \x01(\x05R\x02id\x12\x12\n" + "\x04name\x18\x02 \x01(\tR\x04name\x12%\n" + "\vdescription\x18\x03 \x01(\tH\x00R\vdescription\x88\x01\x01\x12\x19\n" + "\x05image\x18\x04 \x01(\tH\x01R\x05image\x88\x01\x01\x12;\n" + - "\x05story\x18\x05 \x01(\v2%.crabs.evening_detective_server.StoryR\x05story\x12<\n" + - "\x06author\x18\x06 \x01(\v2$.crabs.evening_detective_server.UserR\x06author\x129\n" + + "\x05story\x18\x05 \x01(\v2%.crabs.evening_detective_server.StoryR\x05story\x12\x16\n" + + "\x06status\x18\x06 \x01(\tR\x06status\x12<\n" + + "\x06author\x18\a \x01(\v2$.crabs.evening_detective_server.UserR\x06author\x129\n" + "\n" + - "updated_at\x18\a \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAt\x129\n" + + "updated_at\x18\b \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAt\x129\n" + "\n" + - "created_at\x18\b \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x12=\n" + - "\fpublished_at\x18\t \x01(\v2\x1a.google.protobuf.TimestampR\vpublishedAtB\x0e\n" + + "created_at\x18\t \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x12=\n" + + "\fpublished_at\x18\n" + + " \x01(\v2\x1a.google.protobuf.TimestampR\vpublishedAtB\x0e\n" + "\f_descriptionB\b\n" + "\x06_image\"F\n" + "\x05Story\x12=\n" +