add images

This commit is contained in:
2026-03-14 17:01:11 +07:00
parent ae82f8e0d9
commit 3a30123096
10 changed files with 65 additions and 32 deletions
+2 -1
View File
@@ -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
}
+14 -6
View File
@@ -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)
}