|
|
@@ -70,11 +70,11 @@ public class ClaudeCodeController {
|
|
|
* 用户创建API KEY
|
|
|
*/
|
|
|
@PostMapping("/create/apiKeys")
|
|
|
- public Result<String> createApiKeys(@RequestBody @Validated ClaudeCodeApiKeysReq req) throws Exception {
|
|
|
+ public ClaudeCodeResp createApiKeys(@RequestBody @Validated ClaudeCodeApiKeysReq req) throws Exception {
|
|
|
long userId = StpUserUtil.getLoginIdAsLong();
|
|
|
req.setUserId(userId);
|
|
|
- claudeCodeService.createApiKeys(req);
|
|
|
- return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
+ ClaudeCodeResp resp = claudeCodeService.createApiKeys(req);
|
|
|
+ return resp;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -132,10 +132,10 @@ public class ClaudeCodeController {
|
|
|
* - `type` (string, optional): 积分类型过滤
|
|
|
*/
|
|
|
@GetMapping("/get/user/points/detail")
|
|
|
- public Result<ClaudeCodePointsHistoryResp> getUserPointsDetail(@RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "10") Integer limit, String type) throws Exception {
|
|
|
+ public ClaudeCodePointsHistoryResp getUserPointsDetail(@RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "10") Integer limit, String type) throws Exception {
|
|
|
long userId = StpUserUtil.getLoginIdAsLong();
|
|
|
ClaudeCodePointsHistoryResp resp = claudeCodeService.getUserPointsDetail(userId, type, page, limit);
|
|
|
- return GatewayResponse.SUCCESS.newBuilder().toResult(resp);
|
|
|
+ return resp;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -143,10 +143,10 @@ public class ClaudeCodeController {
|
|
|
* 返回 当前订阅/余额卡片 + 今日汇总 + 今日请求列表
|
|
|
*/
|
|
|
@GetMapping("/get/dashboard")
|
|
|
- public Result<ClaudeCodeResp> getUserDashboard() throws Exception {
|
|
|
+ public ClaudeCodeResp getUserDashboard() throws Exception {
|
|
|
long userId = StpUserUtil.getLoginIdAsLong();
|
|
|
ClaudeCodeResp resp = claudeCodeService.getUserDashboard(userId);
|
|
|
- return GatewayResponse.SUCCESS.newBuilder().toResult(resp);
|
|
|
+ return resp;
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -155,10 +155,10 @@ public class ClaudeCodeController {
|
|
|
* 单独返回余额卡片数据
|
|
|
*/
|
|
|
@GetMapping("/get/balance")
|
|
|
- public Result<ClaudeCodeResp> getUserBalance() throws Exception {
|
|
|
+ public ClaudeCodeResp getUserBalance() throws Exception {
|
|
|
long userId = StpUserUtil.getLoginIdAsLong();
|
|
|
ClaudeCodeResp resp = claudeCodeService.getUserBalance(userId);
|
|
|
- return GatewayResponse.SUCCESS.newBuilder().toResult(resp);
|
|
|
+ return resp;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -172,10 +172,10 @@ public class ClaudeCodeController {
|
|
|
* - `type` (string, optional): 明细类型过滤,`consume|purchase|recovery|refund|reward|adjustment|all`,默认 `all`
|
|
|
*/
|
|
|
@GetMapping("/get/credits/analytics")
|
|
|
- public Result<ClaudeCodeResp> getCreditsAnalytics(String start, String end, @RequestParam(defaultValue = "Asia/Shanghai") String tz, @RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "10") Integer limit, String order, String type) throws Exception {
|
|
|
+ public ClaudeCodeResp getCreditsAnalytics(String start, String end, @RequestParam(defaultValue = "Asia/Shanghai") String tz, @RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "10") Integer limit, String order, String type) throws Exception {
|
|
|
long userId = StpUserUtil.getLoginIdAsLong();
|
|
|
ClaudeCodeResp resp = claudeCodeService.getCreditsAnalytics(userId, start, end, tz, page, limit, order, type);
|
|
|
- return GatewayResponse.SUCCESS.newBuilder().toResult(resp);
|
|
|
+ return resp;
|
|
|
}
|
|
|
|
|
|
//================================================Claude Code OAuth接口============================================================
|