Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Q
qk_backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
quanku
qk_backend
Commits
366f28cd
Commit
366f28cd
authored
Oct 09, 2023
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
注释
parent
8f975e21
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
68 additions
and
3 deletions
+68
-3
ch-admin-api/src/main/java/com/wwdz/ch/admin/impl/ItemServiceImpl.java
...src/main/java/com/wwdz/ch/admin/impl/ItemServiceImpl.java
+4
-0
ch-core/src/main/resources/application-dev.yml
ch-core/src/main/resources/application-dev.yml
+5
-1
ch-core/src/main/resources/application-prod.yml
ch-core/src/main/resources/application-prod.yml
+4
-1
ch-wx-api/src/main/java/com/wwdz/ch/wx/api/ChatApi.java
ch-wx-api/src/main/java/com/wwdz/ch/wx/api/ChatApi.java
+31
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/ItemServiceImpl.java
...pi/src/main/java/com/wwdz/ch/wx/impl/ItemServiceImpl.java
+1
-1
ch-wx-api/src/test/java/com/wwdz/ch/wx/api/ChatApiTest.java
ch-wx-api/src/test/java/com/wwdz/ch/wx/api/ChatApiTest.java
+23
-0
No files found.
ch-admin-api/src/main/java/com/wwdz/ch/admin/impl/ItemServiceImpl.java
View file @
366f28cd
...
@@ -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
{
...
...
ch-core/src/main/resources/application-dev.yml
View file @
366f28cd
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
ch-core/src/main/resources/application-prod.yml
View file @
366f28cd
...
@@ -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
ch-wx-api/src/main/java/com/wwdz/ch/wx/api/ChatApi.java
0 → 100644
View file @
366f28cd
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
;
}
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/ItemServiceImpl.java
View file @
366f28cd
...
@@ -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
);
...
...
ch-wx-api/src/test/java/com/wwdz/ch/wx/api/ChatApiTest.java
0 → 100644
View file @
366f28cd
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment