feat(stat): 添加模型请求按天统计功能
- 新增统计控制器、服务层与数据访问层,提供按天统计接口 - 在 worker 处理任务时原子累加请求计数(仅实际调用模型时计数) - 更新数据库表结构,添加 asynch_model_stat 表及索引 - 更新文档说明统计功能的使用方式与统计口径
This commit is contained in:
20
controller/stat_controller.go
Normal file
20
controller/stat_controller.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"model-asynch/model/dto"
|
||||
"model-asynch/service"
|
||||
)
|
||||
|
||||
type stat struct{}
|
||||
|
||||
// Stat 统计控制器
|
||||
var Stat = new(stat)
|
||||
|
||||
// ListModelStat 统计列表
|
||||
func (c *stat) ListModelStat(ctx context.Context, req *dto.ListModelStatReq) (res *dto.ListModelStatRes, err error) {
|
||||
ctx = ensureUser(ctx)
|
||||
return service.Stat.List(ctx, req)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user