You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
784 B
34 lines
784 B
package dao |
|
|
|
import ( |
|
"context" |
|
|
|
"go-common/app/job/main/dm2/model" |
|
"go-common/library/log" |
|
"go-common/library/net/metadata" |
|
) |
|
|
|
const ( |
|
_bnjLiveConfig = "/activity/v0/bainian/config" |
|
) |
|
|
|
func (d *Dao) bnjConfigURI() string { |
|
return d.conf.Host.APILive + _bnjLiveConfig |
|
} |
|
|
|
// BnjConfig . |
|
func (d *Dao) BnjConfig(c context.Context) (bnjConfig *model.BnjLiveConfig, err error) { |
|
var ( |
|
res struct { |
|
Code int64 `json:"code"` |
|
Message string `json:"message"` |
|
Data *model.BnjLiveConfig `json:"data"` |
|
} |
|
) |
|
if err = d.httpCli.Get(c, d.bnjConfigURI(), metadata.String(c, metadata.RemoteIP), nil, &res); err != nil { |
|
log.Error("bnjLiveConfig BnjConfig(url:%v) error(%v)", d.bnjConfigURI(), err) |
|
return |
|
} |
|
bnjConfig = res.Data |
|
return |
|
}
|
|
|