修复: 代码审查4个必改项+4个建议改进
- 工单编号改为业务格式 TK-yyMMdd-NNN
- 类型断言加 comma-ok 防 panic
- priority 用指针区分未传/P0
- json.Marshal 错误处理
- 提取 ParseID 公共函数消除重复
- HTTP client 包级别复用
- LIKE 查询特殊字符转义
- interface{} → any
- auth 中间件用 dto.Fail 统一响应
This commit is contained in:
@@ -4,10 +4,10 @@ type Response struct {
|
||||
Success bool `json:"success"`
|
||||
Retcode int `json:"retcode"`
|
||||
Retinfo string `json:"retinfo"`
|
||||
Result interface{} `json:"result,omitempty"`
|
||||
Result any `json:"result,omitempty"`
|
||||
}
|
||||
|
||||
func Success(data interface{}) Response {
|
||||
func Success(data any) Response {
|
||||
return Response{Success: true, Retcode: 0, Retinfo: "", Result: data}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user