ChatGptAccountService.java 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. String getCarLoginUrlWithToken(String userToken, String carId);
  21. ChatgptUser findByUserTokenAndExpireTimeAfter(String userToken, LocalDateTime now);
  22. /**
  23. * 对话限制
  24. *
  25. * @param userToken 用户token
  26. * @param model 对话模型
  27. * @return 是否限制
  28. */
  29. ConversationLimitResponse conversationLimit(String userToken, String model, String carId, ChatgptUser user, Boolean isCar);
  30. void saveConversationRecord(String userToken, ConversationRequest conversationRequest);
  31. /**
  32. * 获取对话次数
  33. *
  34. * @param userToken 用户token
  35. * @param limitTime 限制时间
  36. * @return
  37. */
  38. Long getConversationCount(String userToken, Long limitTime);
  39. ChatgptSession checkSession(String carId);
  40. Boolean checkCarAccount(long userId, Long relationId);
  41. Boolean checkCarAccountWithToken(String userToken);
  42. ChatgptUser getCarChatGptUser(long userId, Long relationId);
  43. ChatgptUser getCarChatGptUserWithToken(String userToken);
  44. Set<ChatgptCarInfoView> getCarInfoList(String userToken, Integer limit, Boolean isPlus);
  45. ChatGptUserView getUserInfo(long userId, Long relationId);
  46. ChatGptUserView getUserInfoWithToken(String userToken);
  47. void genTitleSync(String messageId, String carid, String userToken);
  48. /**
  49. * oai 触发车队限制
  50. */
  51. void carLimited(String carId, String userToken, Long expTime, Boolean isTeam);
  52. /**
  53. * 获取GPT session
  54. */
  55. String getGptSession(String account, String password);
  56. }