1234567891011121314151617181920212223242526272829303132333435363738394041 |
- // Copyright 2019 getensh.com. All rights reserved.
- // Use of this source code is governed by getensh.com.
- package data_api
- import (
- "context"
- "gd_management/apis"
- "encoding/json"
- "fmt"
- "gd_management/errors"
- "gd_management/common.in/jsonrpc2"
- "gd_management/common.in/utils"
- "go.uber.org/zap"
- )
- func GetDataComboFree(ctx context.Context, req *apis.GetDataComboFreeReq, reply *apis.GetDataComboFreeReply) (err error) {
- // 捕获各个task中的异常并返回给调用者
- defer func() {
- if r := recover(); r != nil {
- err = fmt.Errorf("%+v", r)
- e := &jsonrpc2.Error{}
- if er := json.Unmarshal([]byte(err.Error()), e); er != nil {
- l.Error("err",
- zap.String("system_err", err.Error()),
- zap.Stack("stacktrace"))
- }
- }
- }()
- if req.QueryTypeId <= 0 {
- l.Error("argument",
- zap.String("call", "check"),
- zap.String("fields", utils.MarshalJsonString(req)))
- return errors.ArgsError
- }
- return nil
- }
|