This commit is contained in:
zhouwentao 2025-12-19 07:58:21 +08:00
parent 1682838d37
commit 77440dc935
5 changed files with 30 additions and 2 deletions

View File

@ -1,3 +1,6 @@
{
"kiroAgent.configureMCP": "Disabled"
"kiroAgent.configureMCP": "Disabled",
"cSpell.words": [
"Cognitio"
]
}

23
Task4.md Normal file
View File

@ -0,0 +1,23 @@
我需要写一个接口用来保存用户的成绩信息。POST格式。
请求体:
```json
{
"CognitioPolyclinic": "文理分科",
"SubjectList": [
"科目1","科目2","科目3"
],
"ProfessionalCategory": "专业方向",
"ProfessionalCategoryChildren": ["专业子级方向1", "专业子级方向2", "专业子级方向3"],
"ProfessionalCategoryChildrenScore": {
"专业子级方向1": "专业子级方向1成绩分",
"专业子级方向2": "专业子级方向2成绩分",
"专业子级方向3": "专业子级方向3成绩分",
},
"ProfessionalScore": "专业成绩分",
"CulturalScore": "文化成绩分",
"EnglishScore": "英语成绩分",
"ChineseScore": "语文成绩分",
"Province": "省份",
}
```
帮我写一个接口用来保存用户的成绩信息。POST格式。同时校验这些参数是否有效这些都是必传值不能为空。CognitioPolyclinic=文科/理科。SubjectList只能包含"地理"、"政治"、"历史"、"化学"、"生物"有且只能传两个值关于成绩的值只能0-300。然后你写个插入到yx_user_score表的方法。

View File

@ -11,7 +11,7 @@ var AppConfig = &appConfig{
},
// 安全配置
Security: SecurityConfig{
Enable: true, // 是否启用安全校验
Enable: false, // 是否启用安全校验
HeaderKey: "X-App-Sign", // 请求头校验字段
SecretKey: "yts@2025#secure", // 签名密钥
},

View File

@ -24,6 +24,7 @@ var whiteList = []string{
"/api/auth/login",
"/api/auth/register",
"/swagger/",
"/swagger/index.html",
}
// AuthMiddleware 登录鉴权中间件

View File

@ -86,6 +86,7 @@ func generateSign(timestamp, secretKey string) string {
// 安全校验白名单
var securityWhitelist = []string{
"/swagger/",
"/swagger/index.html",
}
func isSecurityWhitelist(path string) bool {