ChatGptAccountService.java 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. package com.cyksj.service.chatgpt;
  2. import com.cyksj.model.entity.Account;
  3. import com.cyksj.model.entity.ChatgptSession;
  4. import com.cyksj.model.entity.ChatgptUser;
  5. import com.cyksj.model.request.gpt.ConversationRequest;
  6. import com.cyksj.model.response.ConversationLimitResponse;
  7. import com.cyksj.model.views.ChatGptUserView;
  8. import com.cyksj.model.views.ChatgptCarInfoView;
  9. import java.time.LocalDateTime;
  10. import java.util.Set;
  11. /**
  12. * @author chan
  13. * @date 2024/3/19 11:01
  14. */
  15. public interface ChatGptAccountService {
  16. String addAccount(Account account);
  17. void upAccount(Account account);
  18. String getLoginUrl(Long userId, Long relationId);
  19. String getCarLoginUrl(Long userId, Long relationId, String carId);
  20. ChatgptUser findByUserTokenAndExpireTimeAfter(String userToken, LocalDateTime now);
  21. /**
  22. * 对话限制
  23. * @param userToken 用户token
  24. * @param model 对话模型
  25. * @return 是否限制
  26. */
  27. ConversationLimitResponse conversationLimit(String userToken, String model, String carId, ChatgptUser user, Boolean isCar);
  28. void saveConversationRecord(String userToken, ConversationRequest conversationRequest);
  29. /**
  30. * 获取对话次数
  31. * @param userToken 用户token
  32. * @param limitTime 限制时间
  33. * @return
  34. */
  35. Long getConversationCount(String userToken, Long limitTime);
  36. ChatgptSession checkSession(String carId);
  37. Boolean checkCarAccount(long userId, Long relationId);
  38. ChatgptUser getCarChatGptUser(long userId, Long relationId);
  39. Set<ChatgptCarInfoView> getCarInfoList(String userToken);
  40. ChatGptUserView getUserInfo(long userId, Long relationId);
  41. void genTitleSync(String messageId, String carid, String userToken);
  42. /**
  43. * oai 触发车队限制
  44. */
  45. void carLimited(String carId, String userToken, Integer expTime);
  46. /**
  47. * 获取GPT session
  48. */
  49. String getGptSession(String account, String password);
  50. }