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
4fdcf7ac
authored
Oct 20, 2026
by
renyizhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分页参数校验
parent
1b4c2ba4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
computility-module-apihub/computility-module-apihub-biz/src/main/java/com/luhu/computility/module/apihub/controller/app/AppAiLogController.java
+6
-2
computility-module-apihub/computility-module-apihub-biz/src/main/java/com/luhu/computility/module/apihub/controller/app/aimodel/AppAiModelController.java
+6
-2
No files found.
computility-module-apihub/computility-module-apihub-biz/src/main/java/com/luhu/computility/module/apihub/controller/app/AppAiLogController.java
View file @
4fdcf7ac
...
@@ -7,17 +7,21 @@ import com.luhu.computility.module.apihub.service.newapi.NewApiClient;
...
@@ -7,17 +7,21 @@ import com.luhu.computility.module.apihub.service.newapi.NewApiClient;
import
com.luhu.computility.module.member.dal.dataobject.user.MemberUserDO
;
import
com.luhu.computility.module.member.dal.dataobject.user.MemberUserDO
;
import
com.luhu.computility.module.member.service.user.MemberUserService
;
import
com.luhu.computility.module.member.service.user.MemberUserService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
javax.validation.constraints.Max
;
import
javax.validation.constraints.Min
;
import
java.util.Map
;
import
java.util.Map
;
@Slf4j
@Slf4j
@RestController
@RestController
@RequestMapping
(
"/app/ai-log"
)
@RequestMapping
(
"/app/ai-log"
)
@Validated
public
class
AppAiLogController
{
public
class
AppAiLogController
{
@Resource
@Resource
...
@@ -89,8 +93,8 @@ public class AppAiLogController {
...
@@ -89,8 +93,8 @@ public class AppAiLogController {
*/
*/
@GetMapping
(
"/self"
)
@GetMapping
(
"/self"
)
public
CommonResult
<
Map
<
String
,
Object
>>
getSelfLog
(
public
CommonResult
<
Map
<
String
,
Object
>>
getSelfLog
(
@RequestParam
(
defaultValue
=
"1"
)
Integer
p
,
@RequestParam
(
defaultValue
=
"1"
)
@Min
(
value
=
1
,
message
=
"页码 p 最小值为 1"
)
Integer
p
,
@RequestParam
(
defaultValue
=
"10"
)
Integer
page_size
,
@RequestParam
(
defaultValue
=
"10"
)
@Min
(
value
=
1
,
message
=
"每页条数 page_size 最小值为 1"
)
@Max
(
value
=
100
,
message
=
"每页条数 page_size 最大值为 100"
)
Integer
page_size
,
@RequestParam
(
defaultValue
=
"0"
)
Integer
type
,
@RequestParam
(
defaultValue
=
"0"
)
Integer
type
,
@RequestParam
(
required
=
false
)
String
model_name
,
@RequestParam
(
required
=
false
)
String
model_name
,
@RequestParam
(
required
=
false
)
Long
start_timestamp
,
@RequestParam
(
required
=
false
)
Long
start_timestamp
,
...
...
computility-module-apihub/computility-module-apihub-biz/src/main/java/com/luhu/computility/module/apihub/controller/app/aimodel/AppAiModelController.java
View file @
4fdcf7ac
...
@@ -13,12 +13,15 @@ import com.luhu.computility.module.member.service.user.MemberUserService;
...
@@ -13,12 +13,15 @@ import com.luhu.computility.module.member.service.user.MemberUserService;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
javax.validation.constraints.Max
;
import
javax.validation.constraints.Min
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.math.RoundingMode
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
...
@@ -33,6 +36,7 @@ import java.util.Map;
...
@@ -33,6 +36,7 @@ import java.util.Map;
@RestController
@RestController
@RequestMapping
(
"/app/ai"
)
@RequestMapping
(
"/app/ai"
)
@Tag
(
name
=
"APP端 - AI模型与定价"
)
@Tag
(
name
=
"APP端 - AI模型与定价"
)
@Validated
public
class
AppAiModelController
{
public
class
AppAiModelController
{
/**
/**
...
@@ -68,8 +72,8 @@ public class AppAiModelController {
...
@@ -68,8 +72,8 @@ public class AppAiModelController {
*/
*/
@GetMapping
(
"/models"
)
@GetMapping
(
"/models"
)
@Operation
(
summary
=
"获取 New API 模型列表(带元数据和图标)"
)
@Operation
(
summary
=
"获取 New API 模型列表(带元数据和图标)"
)
public
CommonResult
<
List
<
AppModelVO
>>
getModels
(
@RequestParam
(
defaultValue
=
"
0
"
)
Integer
page
,
public
CommonResult
<
List
<
AppModelVO
>>
getModels
(
@RequestParam
(
defaultValue
=
"
1"
)
@Min
(
value
=
1
,
message
=
"页码 page 最小值为 1
"
)
Integer
page
,
@RequestParam
(
defaultValue
=
"100"
)
Integer
pageSize
)
{
@RequestParam
(
defaultValue
=
"100"
)
@Min
(
value
=
1
,
message
=
"每页条数 pageSize 最小值为 1"
)
@Max
(
value
=
100
,
message
=
"每页条数 pageSize 最大值为 100"
)
Integer
pageSize
)
{
NewApiResponse
<
Map
<
String
,
Object
>>
resp
=
newApiClient
.
getModels
(
page
,
pageSize
);
NewApiResponse
<
Map
<
String
,
Object
>>
resp
=
newApiClient
.
getModels
(
page
,
pageSize
);
if
(
resp
.
getSuccess
()
==
null
||
!
resp
.
getSuccess
()
||
resp
.
getData
()
==
null
)
{
if
(
resp
.
getSuccess
()
==
null
||
!
resp
.
getSuccess
()
||
resp
.
getData
()
==
null
)
{
log
.
error
(
"[getModels] 调用 New API 失败:{}"
,
resp
.
getMessage
());
log
.
error
(
"[getModels] 调用 New API 失败:{}"
,
resp
.
getMessage
());
...
...
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