Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
0c57ff2f
authored
Sep 15, 2025
by
lijinqi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完成客户端获取appid和secret的接口
parent
fd2d3871
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
104 additions
and
1 deletions
+104
-1
computility-module-apihub/computility-module-apihub-biz/src/main/java/com/luhu/computility/module/apihub/controller/app/appcredential/AppAppCredentialController.java
+57
-0
computility-module-apihub/computility-module-apihub-biz/src/main/java/com/luhu/computility/module/apihub/controller/app/appcredential/vo/AppAppCredentialRespVO.java
+26
-0
computility-module-apihub/computility-module-apihub-biz/src/main/java/com/luhu/computility/module/apihub/dal/mysql/appcredential/AppCredentialMapper.java
+6
-0
computility-module-apihub/computility-module-apihub-biz/src/main/java/com/luhu/computility/module/apihub/service/appcredential/AppCredentialService.java
+9
-1
computility-module-apihub/computility-module-apihub-biz/src/main/java/com/luhu/computility/module/apihub/service/appcredential/AppCredentialServiceImpl.java
+6
-0
No files found.
computility-module-apihub/computility-module-apihub-biz/src/main/java/com/luhu/computility/module/apihub/controller/app/appcredential/AppAppCredentialController.java
0 → 100644
View file @
0c57ff2f
package
com
.
luhu
.
computility
.
module
.
apihub
.
controller
.
app
.
appcredential
;
import
com.luhu.computility.framework.apilog.core.annotation.ApiAccessLog
;
import
com.luhu.computility.framework.common.pojo.CommonResult
;
import
com.luhu.computility.framework.common.pojo.PageParam
;
import
com.luhu.computility.framework.common.pojo.PageResult
;
import
com.luhu.computility.framework.common.util.object.BeanUtils
;
import
com.luhu.computility.framework.excel.core.util.ExcelUtils
;
import
com.luhu.computility.framework.security.core.util.SecurityFrameworkUtils
;
import
com.luhu.computility.module.apihub.controller.app.appcredential.vo.AppAppCredentialRespVO
;
import
com.luhu.computility.module.apihub.dal.dataobject.appcredential.AppCredentialDO
;
import
com.luhu.computility.module.apihub.service.appcredential.AppCredentialService
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.Parameter
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.validation.Valid
;
import
java.io.IOException
;
import
java.util.List
;
import
static
com
.
luhu
.
computility
.
framework
.
apilog
.
core
.
enums
.
OperateTypeEnum
.
EXPORT
;
import
static
com
.
luhu
.
computility
.
framework
.
common
.
pojo
.
CommonResult
.
success
;
@Tag
(
name
=
"用户端 - 用户密钥信息"
)
@RestController
@RequestMapping
(
"/apihub/app-credential"
)
@Validated
public
class
AppAppCredentialController
{
@Resource
private
AppCredentialService
appCredentialService
;
@GetMapping
(
"/get"
)
@Operation
(
summary
=
"获得用户密钥信息"
)
@Parameter
(
name
=
"id"
,
description
=
"编号"
,
required
=
true
,
example
=
"1024"
)
public
CommonResult
<
AppAppCredentialRespVO
>
getAppCredential
()
{
AppCredentialDO
appCredential
=
appCredentialService
.
selectOneByUserId
(
SecurityFrameworkUtils
.
getLoginUserId
());
return
success
(
BeanUtils
.
toBean
(
appCredential
,
AppAppCredentialRespVO
.
class
));
}
}
\ No newline at end of file
computility-module-apihub/computility-module-apihub-biz/src/main/java/com/luhu/computility/module/apihub/controller/app/appcredential/vo/AppAppCredentialRespVO.java
0 → 100644
View file @
0c57ff2f
package
com
.
luhu
.
computility
.
module
.
apihub
.
controller
.
app
.
appcredential
.
vo
;
import
com.alibaba.excel.annotation.ExcelIgnoreUnannotated
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
java.time.LocalDateTime
;
@Schema
(
description
=
"用户端 - 用户密钥信息 Response VO"
)
@Data
@ExcelIgnoreUnannotated
public
class
AppAppCredentialRespVO
{
@Schema
(
description
=
"应用ID,唯一"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
,
example
=
"23068"
)
@ExcelProperty
(
"应用ID,唯一"
)
private
String
appId
;
@Schema
(
description
=
"AES加密后的应用密钥"
,
requiredMode
=
Schema
.
RequiredMode
.
REQUIRED
)
@ExcelProperty
(
"AES加密后的应用密钥"
)
private
String
appSecret
;
}
\ No newline at end of file
computility-module-apihub/computility-module-apihub-biz/src/main/java/com/luhu/computility/module/apihub/dal/mysql/appcredential/AppCredentialMapper.java
View file @
0c57ff2f
...
@@ -36,6 +36,12 @@ public interface AppCredentialMapper extends BaseMapperX<AppCredentialDO> {
...
@@ -36,6 +36,12 @@ public interface AppCredentialMapper extends BaseMapperX<AppCredentialDO> {
}
}
default
AppCredentialDO
selectOneByUserId
(
Long
userId
)
{
return
selectOne
(
new
LambdaQueryWrapperX
<
AppCredentialDO
>()
.
eqIfPresent
(
AppCredentialDO:
:
getUserId
,
userId
));
}
default
AppCredentialRespDTO
selectOpenByAppId
(
String
appId
)
{
default
AppCredentialRespDTO
selectOpenByAppId
(
String
appId
)
{
AppCredentialDO
appCredentialDO
=
selectOne
(
new
LambdaQueryWrapperX
<
AppCredentialDO
>()
AppCredentialDO
appCredentialDO
=
selectOne
(
new
LambdaQueryWrapperX
<
AppCredentialDO
>()
.
eqIfPresent
(
AppCredentialDO:
:
getAppId
,
appId
));
.
eqIfPresent
(
AppCredentialDO:
:
getAppId
,
appId
));
...
...
computility-module-apihub/computility-module-apihub-biz/src/main/java/com/luhu/computility/module/apihub/service/appcredential/AppCredentialService.java
View file @
0c57ff2f
...
@@ -61,11 +61,18 @@ public interface AppCredentialService {
...
@@ -61,11 +61,18 @@ public interface AppCredentialService {
/**
/**
* 获得用户密钥信息
*
根据appId
获得用户密钥信息
*
*
* @param appId 编号
* @param appId 编号
* @return 用户密钥信息
* @return 用户密钥信息
*/
*/
AppCredentialDO
getAppSecretByAppid
(
String
appId
);
AppCredentialDO
getAppSecretByAppid
(
String
appId
);
/**
* 获得用户密钥信息
*
* @param userId 编号
* @return 用户密钥信息
*/
AppCredentialDO
selectOneByUserId
(
Long
userId
);
}
}
\ No newline at end of file
computility-module-apihub/computility-module-apihub-biz/src/main/java/com/luhu/computility/module/apihub/service/appcredential/AppCredentialServiceImpl.java
View file @
0c57ff2f
...
@@ -85,5 +85,10 @@ public class AppCredentialServiceImpl implements AppCredentialService {
...
@@ -85,5 +85,10 @@ public class AppCredentialServiceImpl implements AppCredentialService {
}
}
@Override
public
AppCredentialDO
selectOneByUserId
(
Long
userId
)
{
return
appCredentialMapper
.
selectOneByUserId
(
userId
);
}
}
}
\ 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