Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
poc-api
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
poc
poc-api
Commits
9ed0c9c0
Commit
9ed0c9c0
authored
Dec 30, 2024
by
alex yao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:api配置重置
parent
5f4d7788
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
41 additions
and
1 deletion
+41
-1
BizAgentApplicationApiProfileService.java
...ication/service/BizAgentApplicationApiProfileService.java
+2
-0
BizAgentApplicationApiProfileServiceImpl.java
...ervice/impl/BizAgentApplicationApiProfileServiceImpl.java
+8
-0
AgentApplicationService.java
.../cn/com/poc/expose/aggregate/AgentApplicationService.java
+8
-0
AgentApplicationServiceImpl.java
...oc/expose/aggregate/impl/AgentApplicationServiceImpl.java
+6
-1
AgentApplicationRest.java
...ain/java/cn/com/poc/expose/rest/AgentApplicationRest.java
+7
-0
AgentApplicationRestImpl.java
...cn/com/poc/expose/rest/impl/AgentApplicationRestImpl.java
+10
-0
No files found.
src/main/java/cn/com/poc/agent_application/service/BizAgentApplicationApiProfileService.java
View file @
9ed0c9c0
...
...
@@ -12,6 +12,8 @@ public interface BizAgentApplicationApiProfileService extends BaseService {
BizAgentApplicationApiProfileEntity
initProfile
(
Long
memberId
);
BizAgentApplicationApiProfileEntity
resetProfile
(
Long
memberId
)
throws
Exception
;
BizAgentApplicationApiProfileEntity
getByKeyAndSecret
(
String
key
,
String
secret
);
List
<
BizAgentApplicationApiProfileEntity
>
findByExample
(
BizAgentApplicationApiProfileEntity
example
,
PagingInfo
pagingInfo
)
throws
Exception
;
...
...
src/main/java/cn/com/poc/agent_application/service/impl/BizAgentApplicationApiProfileServiceImpl.java
View file @
9ed0c9c0
...
...
@@ -57,6 +57,14 @@ public class BizAgentApplicationApiProfileServiceImpl extends BaseServiceImpl
return
entity
;
}
@Override
public
synchronized
BizAgentApplicationApiProfileEntity
resetProfile
(
Long
memberId
)
throws
Exception
{
BizAgentApplicationApiProfileEntity
entity
=
this
.
getByMemberId
(
memberId
);
entity
.
setApiKey
(
snowflakeGenerator
.
next
().
toString
());
entity
.
setApiSecret
(
UUIDTool
.
getUUID
());
return
this
.
update
(
entity
);
}
@Override
public
BizAgentApplicationApiProfileEntity
getByKeyAndSecret
(
String
key
,
String
secret
)
{
BizAgentApplicationApiProfileModel
model
=
new
BizAgentApplicationApiProfileModel
();
...
...
src/main/java/cn/com/poc/expose/aggregate/AgentApplicationService.java
View file @
9ed0c9c0
...
...
@@ -76,4 +76,12 @@ public interface AgentApplicationService {
*/
BizAgentApplicationApiProfileEntity
getApiProfile
(
Long
memberId
);
/**
* 重置应用的API配置
*
* @param memberId 用户ID
* @return 应用API配置
*/
BizAgentApplicationApiProfileEntity
resetApiProfile
(
Long
memberId
)
throws
Exception
;
}
src/main/java/cn/com/poc/expose/aggregate/impl/AgentApplicationServiceImpl.java
View file @
9ed0c9c0
...
...
@@ -188,7 +188,7 @@ public class AgentApplicationServiceImpl implements AgentApplicationService {
if
(
StringUtils
.
isBlank
(
channel
))
{
channel
=
DataAnalyzeChannelEnum
.
link_share
.
getChannel
();
}
dataAnalyzeReportService
.
dataReport
(
agentId
,
DataAnalyzeChannelEnum
.
valueOf
(
channel
),
userBaseEntity
.
getUserId
(),
pointDeductionNum
);
dataAnalyzeReportService
.
dataReport
(
agentId
,
DataAnalyzeChannelEnum
.
valueOf
(
channel
),
userBaseEntity
.
getUserId
(),
pointDeductionNum
);
}
catch
(
Exception
e
)
{
memberEquityService
.
rollbackPoint
(
reduceSn
);
throw
new
BusinessException
(
e
.
getMessage
());
...
...
@@ -354,6 +354,11 @@ public class AgentApplicationServiceImpl implements AgentApplicationService {
return
agentApplicationApiProfileEntity
;
}
@Override
public
BizAgentApplicationApiProfileEntity
resetApiProfile
(
Long
memberId
)
throws
Exception
{
return
bizAgentApplicationApiProfileService
.
resetProfile
(
memberId
);
}
private
void
createCNQuestion
()
{
Message
message
=
new
Message
();
message
.
setRole
(
LLMRoleEnum
.
USER
.
getRole
());
...
...
src/main/java/cn/com/poc/expose/rest/AgentApplicationRest.java
View file @
9ed0c9c0
...
...
@@ -108,4 +108,11 @@ public interface AgentApplicationRest extends BaseRest {
* @return 应用API配置
*/
AgentApplicationApiProfileDto
getApiProfile
();
/**
* 重置应用的API配置
*
* @return 应用API配置
*/
AgentApplicationApiProfileDto
resetApiProfile
()
throws
Exception
;
}
src/main/java/cn/com/poc/expose/rest/impl/AgentApplicationRestImpl.java
View file @
9ed0c9c0
...
...
@@ -269,4 +269,14 @@ public class AgentApplicationRestImpl implements AgentApplicationRest {
result
.
setApiSecret
(
apiProfileEntity
.
getApiSecret
());
return
result
;
}
@Override
public
AgentApplicationApiProfileDto
resetApiProfile
()
throws
Exception
{
UserBaseEntity
userBaseEntity
=
BlContext
.
getCurrentUser
();
BizAgentApplicationApiProfileEntity
apiProfileEntity
=
agentApplicationService
.
resetApiProfile
(
userBaseEntity
.
getUserId
());
AgentApplicationApiProfileDto
result
=
new
AgentApplicationApiProfileDto
();
result
.
setApiKey
(
apiProfileEntity
.
getApiKey
());
result
.
setApiSecret
(
apiProfileEntity
.
getApiSecret
());
return
result
;
}
}
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