|
|
@@ -62,9 +62,11 @@ public class CmsGptCarController {
|
|
|
public Result<String> updateMirrorCarSession(@RequestBody ChatgptSession chatgptSession) {
|
|
|
Long id = chatgptSession.getId();
|
|
|
ChatgptSession dbChatSession = chatgptSessionMapper.selectById(id);
|
|
|
- if (!ObjectUtil.equal(dbChatSession.getEmail(), chatgptSession.getEmail()) || !ObjectUtil.equal(dbChatSession.getPassword(), chatgptSession.getPassword())) {
|
|
|
- String gptSession = chatGptAccountService.getGptSession(dbChatSession.getEmail(), dbChatSession.getPassword());
|
|
|
- chatgptSession.setOfficialSession(gptSession);
|
|
|
+ if (StrUtil.equals(chatgptSession.getOfficialSession(), dbChatSession.getOfficialSession())) {
|
|
|
+ if (!ObjectUtil.equal(dbChatSession.getEmail(), chatgptSession.getEmail()) || !ObjectUtil.equal(dbChatSession.getPassword(), chatgptSession.getPassword())) {
|
|
|
+ String gptSession = chatGptAccountService.getGptSession(dbChatSession.getEmail(), dbChatSession.getPassword());
|
|
|
+ chatgptSession.setOfficialSession(gptSession);
|
|
|
+ }
|
|
|
}
|
|
|
Integer selectCount = chatgptSessionMapper.selectCount(Wrappers.lambdaQuery(ChatgptSession.class)
|
|
|
.and(e -> e.eq(ChatgptSession::getEmail, chatgptSession.getEmail())
|