generated from VLADIMIR/template
add images
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package link
|
||||
|
||||
type ILinkService interface {
|
||||
GetTeamClientLink(host string, name string, password string) string
|
||||
GetTeamClientLink(name string, password string) string
|
||||
GetImageLink(name string) string
|
||||
}
|
||||
|
||||
@@ -5,12 +5,20 @@ import (
|
||||
"net/url"
|
||||
)
|
||||
|
||||
type service struct{}
|
||||
|
||||
func NewLinkService() ILinkService {
|
||||
return &service{}
|
||||
type service struct {
|
||||
host string
|
||||
}
|
||||
|
||||
func (s *service) GetTeamClientLink(host string, name string, password string) string {
|
||||
return fmt.Sprintf("%s?name=%s&password=%s", host, url.PathEscape(name), password)
|
||||
func NewLinkService(host string) ILinkService {
|
||||
return &service{
|
||||
host: host,
|
||||
}
|
||||
}
|
||||
|
||||
func (s *service) GetTeamClientLink(name string, password string) string {
|
||||
return fmt.Sprintf("%s?name=%s&password=%s", s.host, url.PathEscape(name), password)
|
||||
}
|
||||
|
||||
func (s *service) GetImageLink(name string) string {
|
||||
return fmt.Sprintf("%s/%s", s.host, name)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user