Skip to content

feat: create itinerary persistence#19

Open
DqChen77 wants to merge 1 commit intodevelopfrom
feat-persistence
Open

feat: create itinerary persistence#19
DqChen77 wants to merge 1 commit intodevelopfrom
feat-persistence

Conversation

@DqChen77
Copy link
Collaborator

No description provided.

@DqChen77 DqChen77 requested a review from SenyuXie February 25, 2026 09:01
Copy link
Collaborator

@SenyuXie SenyuXie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

整体上没啥问题,可以看看有没有相关的库能做pb和内部BaseModel的转换的,类似于Java中的MapStruct,这样converter会好写一点

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里其实不需要这个gitignore,前端的lib/grpc/generated在trip-next-frontend里面.gitignore了,libs/tripsphere在各个python服务里面的libs/tripsphere下面.gitignore掉

)


def _parse_date(date_str: str) -> date_pb2.Date:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

像这种time date 啥的,我们在Python服务/Agent内部的BaseModel的字段尽量用类型更强的Datetime或者别的标准库类型,不用str了这样类型信息更强一点

@@ -0,0 +1,83 @@
"""Convert Pydantic itinerary models to protobuf messages for gRPC persistence."""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

google.protobuf官方有一个MessageToDict的工具方法好像,用这个不知道可不可以简化一点converters/mappers的代码?(性能开销目前不重要)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants