优化项目机构和服务端协程控制逻辑

This commit is contained in:
2025-02-25 14:48:50 +08:00
parent 83fd749d50
commit 7f23e2741f
21 changed files with 732 additions and 440 deletions

21
server/pkg/resp/resp.go Normal file
View File

@@ -0,0 +1,21 @@
package resp
type Data struct {
Error bool
Cause string
Data interface{}
}
func Done(data interface{}) *Data {
return &Data{
Error: false,
Data: data,
}
}
func Fail(cause string) *Data {
return &Data{
Error: true,
Cause: cause,
}
}