Merge branch 'company_server' of https://gitee.com/doc_wei01/skyeye into company_server

This commit is contained in:
wst 2024-11-06 21:01:15 +08:00
commit 80fadef99c
5 changed files with 24 additions and 37 deletions

View file

@ -60,12 +60,4 @@ public class SparkListener extends SparkConsoleListener {
}
}
/**
* 获取完整版答案
* */
public StringBuilder getStringBuilder(){
return stringBuilder;
}
}

View file

@ -50,7 +50,7 @@ public class ChatController {
@ApiImplicitParam(id = "ids", name = "ids", value = "主键id列表多个id用逗号分隔", required = "required")})
@RequestMapping("/post/ChatController/deleteChatMessageByIds")
public void deleteChatMessageByIds(InputObject inputObject, OutputObject outputObject) {
chatService.deleteById(inputObject, outputObject);
chatService.deleteByIds(inputObject, outputObject);
}

View file

@ -3,7 +3,6 @@ package com.skyeye.chat.service.impl;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.alibaba.dashscope.aigc.generation.Generation;
@ -41,12 +40,10 @@ import com.skyeye.role.service.RoleService;
import com.skyeye.websocket.AiMessageWebSocket;
import io.github.briqt.spark4j.SparkClient;
import io.github.briqt.spark4j.constant.SparkApiVersion;
import io.github.briqt.spark4j.listener.SparkConsoleListener;
import io.github.briqt.spark4j.model.SparkMessage;
import io.github.briqt.spark4j.model.request.SparkRequest;
import io.github.briqt.spark4j.model.response.SparkResponse;
import io.github.briqt.spark4j.model.response.SparkResponseUsage;
import io.github.briqt.spark4j.model.response.SparkTextUsage;
import io.reactivex.Flowable;
import okhttp3.WebSocket;
import org.springframework.beans.factory.annotation.Autowired;
@ -55,8 +52,6 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.concurrent.Executor;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* @ClassName: ChatServiceImpl
@ -109,19 +104,16 @@ public class ChatServiceImpl extends SkyeyeBusinessServiceImpl<ChatDao, Chat> im
chat.setMessage(content);
chat.setPlatform(platform);
chat.setApiKeyId(apiKeyId);
String id ="";
String id =createEntity(chat, userId);
switch (aiModel) {
case YI_YAN:
id = createEntity(chat, userId);
QianFanResponse(content, userId, apiKeyId, id);
break;
case XUN_FEI:
id = createEntity(chat, userId);
XunFeiResponse(content,userId,apiKeyId,id);
break;
case TONG_YI:
try {
id = createEntity(chat, userId);
TongYiResponse(content,userId,apiKeyId,id);
break;
} catch (Exception e) {
@ -360,33 +352,18 @@ public class ChatServiceImpl extends SkyeyeBusinessServiceImpl<ChatDao, Chat> im
chat.setApiKeyMation(aiApiKey);
}
outputObject.setBeans(chatList);
outputObject.settotal(page.size());
outputObject.settotal(page.getTotal());
}
@Override
public void deleteAllByApiKeyId(InputObject inputObject, OutputObject outputObject) {
Map<String, Object> params = inputObject.getParams();
String apiKeyId = params.get("apiKeyId").toString();
String userId = InputObject.getLogParamsStatic().get("id").toString();
QueryWrapper<Chat> queryWrapper = new QueryWrapper<>();
queryWrapper.eq(MybatisPlusUtil.toColumns(Chat::getApiKeyId), apiKeyId);
List<Chat> chatList = list(queryWrapper);
for (Chat chat : chatList) {
removeById(chat.getId());
}
}
@Override
public void deleteById(InputObject inputObject, OutputObject outputObject) {
Map<String, Object> params = inputObject.getParams();
String idsStr = params.get("ids").toString();
if (idsStr == null || idsStr.isEmpty()) {
throw new CustomException("错误操作");
}
List<String> ids = Stream.of(idsStr.split(","))
.map(String::trim)
.collect(Collectors.toList());
deleteById(ids);
queryWrapper.eq(MybatisPlusUtil.toColumns(Chat::getCreateId), userId);
remove(queryWrapper);
}
}

View file

@ -79,6 +79,14 @@ public class ShopStoreController {
shopStoreService.queryStoreListByParams(inputObject, outputObject);
}
@ApiOperation(id = "queryStorePageListByParams", value = "商城分页获取门店列表信息", method = "POST", allUse = "0")
@ApiImplicitParams(classBean = CommonPageInfo.class, value = {
@ApiImplicitParam(id = "enabled", name = "enabled", value = "状态", required = "required,num", defaultValue = "1")})
@RequestMapping("/post/ShopStoreController/queryStorePageListByParams")
public void queryStorePageListByParams(InputObject inputObject, OutputObject outputObject) {
shopStoreService.queryPageList(inputObject, outputObject);
}
@ApiOperation(id = "queryStoreOnlineById", value = "根据门店ID获取门店设置的线上预约信息(已结合当前登陆用户)", method = "GET", allUse = "2")
@ApiImplicitParams({
@ApiImplicitParam(id = "id", name = "id", value = "主键id", required = "required")})

View file

@ -11,6 +11,7 @@ import com.skyeye.annotation.service.SkyeyeService;
import com.skyeye.base.business.service.impl.SkyeyeBusinessServiceImpl;
import com.skyeye.common.client.ExecuteFeignClient;
import com.skyeye.common.constans.CommonConstants;
import com.skyeye.common.entity.search.CommonPageInfo;
import com.skyeye.common.enumeration.WhetherEnum;
import com.skyeye.common.object.InputObject;
import com.skyeye.common.object.OutputObject;
@ -51,6 +52,15 @@ public class ShopStoreServiceImpl extends SkyeyeBusinessServiceImpl<ShopStoreDao
@Autowired
private IShopMaterialNormsRest iShopMaterialNormsRest;
@Override
public QueryWrapper<ShopStore> getQueryWrapper(CommonPageInfo commonPageInfo) {
QueryWrapper<ShopStore> queryWrapper = super.getQueryWrapper(commonPageInfo);
if (commonPageInfo.getEnabled() != null) {
queryWrapper.eq(MybatisPlusUtil.toColumns(ShopStore::getEnabled), commonPageInfo.getEnabled());
}
return queryWrapper;
}
@Override
public List<Map<String, Object>> queryPageDataList(InputObject inputObject) {
List<Map<String, Object>> beans = super.queryPageDataList(inputObject);