fix: rebuild MES as compilable go-zero+ent backend (renamed bj_power_mes), restore 3 workstation projects from pristine original, align naming; all Go projects go build clean
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
package tool
|
||||
|
||||
// extractWorkpieceType 从参数中提取工件类型 ID
|
||||
func extractWorkpieceType(params map[string]any) int {
|
||||
return extractIntParam(params, "workpieceType")
|
||||
}
|
||||
|
||||
// extractIntParam 从参数 map 中提取 int 类型值,支持 int/float64 转换
|
||||
func extractIntParam(params map[string]any, key string) int {
|
||||
if v, ok := params[key]; ok {
|
||||
if n, ok := v.(int); ok {
|
||||
return n
|
||||
}
|
||||
if f, ok := v.(float64); ok {
|
||||
return int(f)
|
||||
}
|
||||
}
|
||||
return 0
|
||||
}
|
||||
Reference in New Issue
Block a user