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:
jackyu66git
2026-08-13 01:27:58 +08:00
co-authored by Cursor
parent 13860bf1ef
commit 89756f65b4
227 changed files with 7405 additions and 1407 deletions
+42
View File
@@ -40,3 +40,45 @@ func EmotionLabels() map[string]string {
"C": "行动调节型",
}
}
// ScoreMBTI tallies E/I · S/N · T/F · J/P and returns a 4-letter type code + Chinese label.
func ScoreMBTI(answers map[string]string) (typeCode, label string) {
count := func(a, b string) (na, nb int) {
for _, v := range answers {
switch v {
case a:
na++
case b:
nb++
}
}
return
}
pick := func(a, b string, na, nb int) string {
if nb > na {
return b
}
return a
}
e, i := count("E", "I")
s, n := count("S", "N")
t, f := count("T", "F")
j, p := count("J", "P")
code := pick("E", "I", e, i) + pick("S", "N", s, n) + pick("T", "F", t, f) + pick("J", "P", j, p)
return code, MBTILabel(code)
}
// MBTILabel maps 4-letter exploration code to a lexicon-safe Chinese label.
func MBTILabel(code string) string {
if l, ok := mbtiLabels[code]; ok {
return l
}
return "平衡探索型"
}
var mbtiLabels = map[string]string{
"INTJ": "战略建构者", "INTP": "概念探路者", "ENTJ": "目标推动者", "ENTP": "灵感挑战者",
"INFJ": "愿景洞察者", "INFP": "价值守护者", "ENFJ": "共鸣召集者", "ENFP": "热情启发者",
"ISTJ": "稳健执行者", "ISFJ": "细致守护者", "ESTJ": "秩序统筹者", "ESFJ": "温暖协调者",
"ISTP": "务实拆解者", "ISFP": "感受体验者", "ESTP": "当下行动者", "ESFP": "活力分享者",
}