|
@@ -241,3 +241,18 @@ func Fields(obj any, files RequestFiles, names ...any) (json.Map, IErrorArgs) {
|
|
|
}
|
|
|
|
|
|
/////////////////////////////////////////////
|
|
|
+
|
|
|
+func OutFileds(req IRequestIn, obj any, files RequestFiles, names ...any) IRequestOut {
|
|
|
+ m, err := Fields(obj, files, names...)
|
|
|
+ if err != nil {
|
|
|
+ return req.OutError(err)
|
|
|
+ }
|
|
|
+ return req.OutSuccess(m, files)
|
|
|
+}
|
|
|
+
|
|
|
+func OutFieldsReq(req IRequestIn, obj any, files RequestFiles, names ...any) IRequestOut {
|
|
|
+ if len(names) == 0 {
|
|
|
+ names = req.RData().Slice("fields", nil)
|
|
|
+ }
|
|
|
+ return OutFileds(req, obj, files, names...)
|
|
|
+}
|