1234567891011121314151617181920212223242526272829303132333435363738 |
- package h5
- import (
- "context"
- "gd_management/errors"
- "gd_management/apis"
- "gd_management/common.in/utils"
- // "fmt"
- "github.com/astaxie/beego/orm"
- "go.uber.org/zap"
- )
- func serviceGetH5Api(req *apis.ManagementH5ServiceGetH5ApiListReq, reply *apis.ManagementH5ServiceGetH5ApiListReply) error {
- o := orm.NewOrm()
- sql := "select id, name, host, router, is_enable, create_time, update_time from t_gd_h5_api where id in(select h5_api_id from t_gd_h5_service_api_relation where h5_service_id=? )"
- _, err := o.Raw(sql, req.H5ServiceId).QueryRows(&reply.H5ApiList)
- if err != nil {
- if err == orm.ErrNoRows {
- return nil
- }
- return errors.DataBaseError
- }
- return nil
- }
- func ManagementH5ServiceGetH5ApiList(ctx context.Context, req *apis.ManagementH5ServiceGetH5ApiListReq, reply *apis.ManagementH5ServiceGetH5ApiListReply) (err error) {
- err = serviceGetH5Api(req, reply)
- if err != nil {
- l.Error("func",
- zap.String("call", "ManagementH5ServiceGetH5ApiList"),
- zap.String("args", utils.MarshalJsonString(req)),
- zap.String("error", err.Error()))
- }
- l.Debug(utils.MarshalJsonString(req, reply))
- return
- }
|