feat: wecom curd

This commit is contained in:
zzw
2026-08-31 11:10:15 +08:00
parent 53d203ee14
commit d618ac32b0
37 changed files with 2707 additions and 33 deletions
+38
View File
@@ -0,0 +1,38 @@
package logic
import (
"lone-services/pkg/utils"
wecom "lone-services/rpc/wecom/pb"
jsoniter "github.com/json-iterator/go"
)
func okResponse(data any) *wecom.Response {
buf, _ := jsoniter.Marshal(data)
return &wecom.Response{
Code: utils.Ok.Code,
Msg: utils.Ok.Msg,
Data: string(buf),
}
}
func failResponse(status utils.Status) *wecom.Response {
return &wecom.Response{
Code: status.Code,
Msg: status.Msg,
}
}
func outResponse(status utils.Status, msg string) *wecom.Response {
return &wecom.Response{
Code: status.Code,
Msg: msg,
}
}
func failWecomHTTP() *wecom.Response {
return &wecom.Response{
Code: int32(utils.ErrorWecomHttpError.GetCode()),
Msg: utils.ErrorWecomHttpError.GetMsg(),
}
}