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.
33 lines
660 B
33 lines
660 B
package videoup |
|
|
|
import ( |
|
"go-common/app/admin/main/mcn/conf" |
|
"go-common/app/service/main/videoup/model/archive" |
|
bm "go-common/library/net/http/blademaster" |
|
) |
|
|
|
const ( |
|
_typeURL = "/videoup/types" |
|
) |
|
|
|
// Dao . |
|
type Dao struct { |
|
c *conf.Config |
|
client *bm.Client |
|
videTypeURL string |
|
videoUpTypeCache map[int]archive.Type |
|
} |
|
|
|
// New new a Dao and return. |
|
func New(c *conf.Config) (d *Dao) { |
|
d = &Dao{ |
|
c: c, |
|
// http client |
|
client: bm.NewClient(c.HTTPClient), |
|
videTypeURL: c.Host.Videoup + _typeURL, |
|
videoUpTypeCache: make(map[int]archive.Type), |
|
} |
|
d.refreshUpType() |
|
go d.refreshUpTypeAsync() |
|
return |
|
}
|
|
|