feat(server-go): AI 巡检闭环后端(inspection_records + /inspections 幂等接口)
This commit is contained in:
@@ -64,3 +64,16 @@ func TestBuildImageKey(t *testing.T) {
|
||||
t.Errorf("key 应包含日期与随机部分: %s", key)
|
||||
}
|
||||
}
|
||||
|
||||
func TestBuildObjectKeyPrefix(t *testing.T) {
|
||||
key, ext, err := buildObjectKey("inspections", "a.jpg")
|
||||
if err != nil {
|
||||
t.Fatalf("buildObjectKey 失败: %v", err)
|
||||
}
|
||||
if !strings.HasPrefix(key, "inspections/") {
|
||||
t.Errorf("key 应以 inspections/ 开头: %s", key)
|
||||
}
|
||||
if !strings.HasSuffix(key, ".jpg") || ext != ".jpg" {
|
||||
t.Errorf("key/ext 应以 .jpg 结尾: %s / %s", key, ext)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user