Files
smartmate/backend/shared/ports/course.go
Losita fd327f845b Version: 0.9.73.dev.260505
后端:
1.阶段 5 course 服务边界落地
- 新增 cmd/course 独立进程入口,落地 services/course dao/rpc/sv
- 新增 gateway/client/course、shared/contracts/course 和 shared/ports course port
- 将 /api/v1/course/* HTTP 门面切到 course zrpc,gateway 只保留鉴权、限流、幂等、文件读取和响应透传
- 保留 course 迁移期直写 schedule_events / schedules 权限,维持课程导入两个表同事务写入语义
- 为 course parse-image 补 bytes RPC 契约和 gRPC 消息大小配置,兼容课表图片上传
- 补充 course.rpc 示例配置与阶段 5 文档基线、切流点、残留依赖和 smoke 记录
2026-05-05 12:07:31 +08:00

21 lines
838 B
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package ports
import (
"context"
"encoding/json"
coursecontracts "github.com/LoveLosita/smartflow/backend/shared/contracts/course"
)
// CourseCommandClient 是 gateway 调用 course 服务的最小能力集合。
//
// 职责边界:
// 1. 只覆盖当前 `/api/v1/course/*` HTTP 门面需要的能力;
// 2. 不暴露 course DAO也不暴露迁移期直写 schedule 表的实现细节;
// 3. import / parse 的复杂响应以 JSON 透传,避免 gateway 复制业务模型。
type CourseCommandClient interface {
ValidateCourse(ctx context.Context, req coursecontracts.UserCheckCourseRequest) error
ImportCourses(ctx context.Context, req coursecontracts.UserImportCoursesRequest) (json.RawMessage, error)
ParseCourseTableImage(ctx context.Context, req coursecontracts.CourseImageParseRequest) (json.RawMessage, error)
}