feat(ECR-012–016): 合规、题库、时辰刷新、头像、MBTI OEJTS 与埋点
落地输入合规、探索题库、报告日/时辰刷新、账号头像、OEJTS 量表,并补齐 H5 埋点与 Admin 漏斗;同步 ESS 工件、切至自建 Git、清理 GitHub Actions。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -3,7 +3,6 @@ package companion
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
@@ -12,6 +11,7 @@ import (
|
||||
core "github.com/yuxingu/digital-psychology/apps/api/internal/companion"
|
||||
"github.com/yuxingu/digital-psychology/apps/api/internal/model"
|
||||
"github.com/yuxingu/digital-psychology/apps/api/internal/repository"
|
||||
"github.com/yuxingu/digital-psychology/apps/api/internal/textsafe"
|
||||
)
|
||||
|
||||
// Service exposes solar terms and moods.
|
||||
@@ -37,11 +37,15 @@ func (s *Service) SaveMood(ctx context.Context, userID uuid.UUID, in SaveMoodInp
|
||||
return nil, errors.New("score must be 1-5")
|
||||
}
|
||||
if in.Note != nil {
|
||||
n := strings.TrimSpace(*in.Note)
|
||||
if len([]rune(n)) > 200 {
|
||||
return nil, errors.New("note too long")
|
||||
n, err := textsafe.Check(textsafe.Note, *in.Note)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if n == "" {
|
||||
in.Note = nil
|
||||
} else {
|
||||
in.Note = &n
|
||||
}
|
||||
in.Note = &n
|
||||
}
|
||||
day := time.Now()
|
||||
if in.Day != nil {
|
||||
|
||||
Reference in New Issue
Block a user