AiSession.java 653 B

1234567891011121314151617181920212223242526272829
  1. package io.github.qifan777.knowledge.ai.session;
  2. import io.github.qifan777.knowledge.ai.message.AiMessage;
  3. import io.github.qifan777.knowledge.infrastructure.jimmer.BaseEntity;
  4. import org.babyfish.jimmer.sql.Entity;
  5. import org.babyfish.jimmer.sql.OneToMany;
  6. import org.babyfish.jimmer.sql.OrderedProp;
  7. import java.util.List;
  8. /**
  9. * 会话
  10. */
  11. @Entity
  12. public interface AiSession extends BaseEntity {
  13. /**
  14. * 会话名称
  15. */
  16. String name();
  17. /**
  18. * 一对多关联消息,按创建时间升序
  19. */
  20. @OneToMany(mappedBy = "session", orderedProps = @OrderedProp(value = "createdTime"))
  21. List<AiMessage> messages();
  22. }