Commit 366f28cd authored by shiyu's avatar shiyu

注释

parent 8f975e21
...@@ -9,6 +9,7 @@ import com.wwdz.ch.core.consts.CommonEnum; ...@@ -9,6 +9,7 @@ import com.wwdz.ch.core.consts.CommonEnum;
import com.wwdz.ch.core.consts.ItemStateEnum; import com.wwdz.ch.core.consts.ItemStateEnum;
import com.wwdz.ch.core.storage.QiniuStorage; import com.wwdz.ch.core.storage.QiniuStorage;
import com.wwdz.ch.core.type.Result; import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.core.util.RedisUtils;
import com.wwdz.ch.core.util.StringUtil; import com.wwdz.ch.core.util.StringUtil;
import com.wwdz.ch.db.bean.ItemOfEs; import com.wwdz.ch.db.bean.ItemOfEs;
import com.wwdz.ch.db.dao.CroppingRecordDao; import com.wwdz.ch.db.dao.CroppingRecordDao;
...@@ -58,6 +59,9 @@ public class ItemServiceImpl implements ItemService { ...@@ -58,6 +59,9 @@ public class ItemServiceImpl implements ItemService {
@Autowired @Autowired
ItemEsDao itemEsDao; ItemEsDao itemEsDao;
@Autowired
RedisUtils redisUtils;
@Override @Override
public List<CoinVo> findList(CoinRequestDto coinRequestDto) { public List<CoinVo> findList(CoinRequestDto coinRequestDto) {
try { try {
......
dts: dts:
# 开发者应该设置成自己的wx相关信息 # 开发者应该设置成自己的wx相关信息
# 更换主体要更换id和secret
wx: wx:
app-id: wx5b4409448bf2c72b app-id: wx5b4409448bf2c72b
app-secret: 6fee0d7b2197845fed0a3fe8f5a9bd66 app-secret: 6fee0d7b2197845fed0a3fe8f5a9bd66
...@@ -178,4 +179,7 @@ server: ...@@ -178,4 +179,7 @@ server:
session: session:
timeout: 720 timeout: 720
avatar-url: https://cdn.wanwudezhi.com/static/web-static/image/b888cc6cb9c004dc342f573653e38ebd_690x690.png avatar-url: https://cdn.wanwudezhi.com/static/web-static/image/b888cc6cb9c004dc342f573653e38ebd_690x690.png
\ No newline at end of file
chat:
model-url: http://172.16.122.190:7861/chat
\ No newline at end of file
...@@ -175,4 +175,7 @@ server: ...@@ -175,4 +175,7 @@ server:
session: session:
timeout: 720 timeout: 720
avatar-url: https://cdn.wanwudezhi.com/static/web-static/image/b888cc6cb9c004dc342f573653e38ebd_690x690.png avatar-url: https://cdn.wanwudezhi.com/static/web-static/image/b888cc6cb9c004dc342f573653e38ebd_690x690.png
\ No newline at end of file
chat:
model-url: http://172.16.122.190:7861/chat
\ No newline at end of file
package com.wwdz.ch.wx.api;
import com.wwdz.ch.core.util.OkHttpUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.Map;
@Component
public class ChatApi {
private static final Logger logger = LoggerFactory.getLogger(ChatApi.class);
@Value("${chat.model-url}")
private String chatModelUrl;
public String chatWithModel(String question) {
OkHttpUtil okHttpUtil = OkHttpUtil.builder().url(chatModelUrl);
Map<String, Object> map = new HashMap<>();
map.put("question", question);
map.put("history", null);
okHttpUtil.addParams(map);
okHttpUtil.post(true);
String responseStr = okHttpUtil.async();
logger.info("[chatWithModel] response :{}", responseStr);
return responseStr;
}
}
...@@ -236,7 +236,7 @@ public class ItemServiceImpl implements ItemService { ...@@ -236,7 +236,7 @@ public class ItemServiceImpl implements ItemService {
isDisplay = 2; isDisplay = 2;
} }
} }
//自定义官方用户判断
if (!officialUserIds.contains(dto.getUserId())) { if (!officialUserIds.contains(dto.getUserId())) {
// 查询用户和藏品关联表 // 查询用户和藏品关联表
List<UserItemsRelation> userItemsRelations = userItemsRelationDao.listByUserIds(dto.getUserId(), null); List<UserItemsRelation> userItemsRelations = userItemsRelationDao.listByUserIds(dto.getUserId(), null);
......
package com.wwdz.ch.wx.api;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import static org.junit.Assert.*;
@SpringBootTest
@RunWith(SpringJUnit4ClassRunner.class)
public class ChatApiTest {
@Autowired
ChatApi chatApi;
@Test
public void chatWithModel() {
String question = "刀币的由来";
chatApi.chatWithModel(question);
}
}
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment