- 新增统计控制器、服务层与数据访问层,提供按天统计接口 - 在 worker 处理任务时原子累加请求计数(仅实际调用模型时计数) - 更新数据库表结构,添加 asynch_model_stat 表及索引 - 更新文档说明统计功能的使用方式与统计口径
21 lines
370 B
Go
21 lines
370 B
Go
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)
|
|
}
|
|
|