Package com.bytedesk.ai.statistic_token
Class StatisticTokenRestController
java.lang.Object
com.bytedesk.core.base.BaseRestController<StatisticTokenRequest,StatisticTokenRestService>
com.bytedesk.ai.statistic_token.StatisticTokenRestController
@RestController
@RequestMapping("/api/v1/ai/statistic/token")
@Description("AI Token Statistics Controller - AI token usage statistics and analytics APIs")
public class StatisticTokenRestController
extends BaseRestController<StatisticTokenRequest,StatisticTokenRestService>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<?>
create
(StatisticTokenRequest request) 通用的create实现 减少子类重复代码org.springframework.http.ResponseEntity<?>
delete
(StatisticTokenRequest request) 通用的delete实现 减少子类重复代码export
(StatisticTokenRequest request, jakarta.servlet.http.HttpServletResponse response) exportorg.springframework.http.ResponseEntity<?>
getHourlyTokenStatistics
(String orgUid, String date) Get hourly AI token statistics for a specific organization and date Returns token usage data organized by hour (0-23) for the entire dayorg.springframework.http.ResponseEntity<?>
getHourlyTokenStatisticsByModelType
(String orgUid, String date, String aiModelType) Get hourly AI token statistics for a specific organization, date and AI model typeorg.springframework.http.ResponseEntity<?>
getHourlyTokenStatisticsByProvider
(String orgUid, String date, String aiProvider) Get hourly AI token statistics for a specific organization, date and AI providerorg.springframework.http.ResponseEntity<?>
queryByOrg
(StatisticTokenRequest request) 通用的queryByOrg实现 减少子类重复代码org.springframework.http.ResponseEntity<?>
queryByUid
(StatisticTokenRequest request) 通用的queryByUid实现 减少子类重复代码org.springframework.http.ResponseEntity<?>
queryByUser
(StatisticTokenRequest request) 通用的queryByUser实现 减少子类重复代码org.springframework.http.ResponseEntity<?>
update
(StatisticTokenRequest request) 通用的update实现 减少子类重复代码Methods inherited from class com.bytedesk.core.base.BaseRestController
deleteByOrgUid, exportTemplate, getService
-
Field Details
-
statisticTokenRestService
-
-
Constructor Details
-
StatisticTokenRestController
public StatisticTokenRestController()
-
-
Method Details
-
queryByOrg
@ActionAnnotation(title="Token", action="\u7ec4\u7ec7\u67e5\u8be2", description="query statistic_token by org") public org.springframework.http.ResponseEntity<?> queryByOrg(StatisticTokenRequest request) Description copied from class:BaseRestController
通用的queryByOrg实现 减少子类重复代码- Overrides:
queryByOrg
in classBaseRestController<StatisticTokenRequest,
StatisticTokenRestService>
-
queryByUser
@ActionAnnotation(title="Token", action="\u7528\u6237\u67e5\u8be2", description="query statistic_token by user") public org.springframework.http.ResponseEntity<?> queryByUser(StatisticTokenRequest request) Description copied from class:BaseRestController
通用的queryByUser实现 减少子类重复代码- Overrides:
queryByUser
in classBaseRestController<StatisticTokenRequest,
StatisticTokenRestService>
-
queryByUid
@ActionAnnotation(title="Token", action="\u67e5\u8be2\u8be6\u60c5", description="query statistic_token by uid") public org.springframework.http.ResponseEntity<?> queryByUid(StatisticTokenRequest request) Description copied from class:BaseRestController
通用的queryByUid实现 减少子类重复代码- Overrides:
queryByUid
in classBaseRestController<StatisticTokenRequest,
StatisticTokenRestService>
-
create
@ActionAnnotation(title="Token", action="\u65b0\u5efa", description="create statistic_token") public org.springframework.http.ResponseEntity<?> create(StatisticTokenRequest request) Description copied from class:BaseRestController
通用的create实现 减少子类重复代码- Overrides:
create
in classBaseRestController<StatisticTokenRequest,
StatisticTokenRestService>
-
update
@ActionAnnotation(title="Token", action="\u66f4\u65b0", description="update statistic_token") public org.springframework.http.ResponseEntity<?> update(StatisticTokenRequest request) Description copied from class:BaseRestController
通用的update实现 减少子类重复代码- Overrides:
update
in classBaseRestController<StatisticTokenRequest,
StatisticTokenRestService>
-
delete
@ActionAnnotation(title="Token", action="\u5220\u9664", description="delete statistic_token") public org.springframework.http.ResponseEntity<?> delete(StatisticTokenRequest request) Description copied from class:BaseRestController
通用的delete实现 减少子类重复代码- Overrides:
delete
in classBaseRestController<StatisticTokenRequest,
StatisticTokenRestService>
-
export
@ActionAnnotation(title="Token", action="\u5bfc\u51fa", description="export statistic_token") @GetMapping("/export") public Object export(StatisticTokenRequest request, jakarta.servlet.http.HttpServletResponse response) Description copied from class:BaseRestController
export- Overrides:
export
in classBaseRestController<StatisticTokenRequest,
StatisticTokenRestService> - Parameters:
request
- role- Returns:
- json
-
getHourlyTokenStatistics
@ActionAnnotation(title="AI Token\u7edf\u8ba1", action="\u6309\u5c0f\u65f6\u67e5\u8be2", description="query hourly AI token statistics by org and date") @GetMapping("/hourly") public org.springframework.http.ResponseEntity<?> getHourlyTokenStatistics(@RequestParam String orgUid, @RequestParam String date) Get hourly AI token statistics for a specific organization and date Returns token usage data organized by hour (0-23) for the entire day -
getHourlyTokenStatisticsByProvider
@ActionAnnotation(title="AI Token\u7edf\u8ba1", action="\u6309\u5c0f\u65f6\u548c\u63d0\u4f9b\u5546\u67e5\u8be2", description="query hourly AI token statistics by org, date and provider") @GetMapping("/hourly/provider") public org.springframework.http.ResponseEntity<?> getHourlyTokenStatisticsByProvider(@RequestParam String orgUid, @RequestParam String date, @RequestParam String aiProvider) Get hourly AI token statistics for a specific organization, date and AI provider -
getHourlyTokenStatisticsByModelType
@ActionAnnotation(title="AI Token\u7edf\u8ba1", action="\u6309\u5c0f\u65f6\u548c\u6a21\u578b\u67e5\u8be2", description="query hourly AI token statistics by org, date and model type") @GetMapping("/hourly/model") public org.springframework.http.ResponseEntity<?> getHourlyTokenStatisticsByModelType(@RequestParam String orgUid, @RequestParam String date, @RequestParam String aiModelType) Get hourly AI token statistics for a specific organization, date and AI model type
-