2023-04-14 17:33:22 +08:00
|
|
|
package plugin
|
|
|
|
|
|
|
|
import (
|
2023-05-04 15:40:00 +08:00
|
|
|
"github.com/answerdev/answer/internal/base/constant"
|
2023-04-14 17:33:22 +08:00
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Agent interface {
|
|
|
|
Base
|
|
|
|
RegisterUnAuthRouter(r *gin.RouterGroup)
|
|
|
|
RegisterAuthUserRouter(r *gin.RouterGroup)
|
|
|
|
RegisterAuthAdminRouter(r *gin.RouterGroup)
|
|
|
|
}
|
|
|
|
|
|
|
|
var (
|
|
|
|
CallAgent,
|
|
|
|
registerAgent = MakePlugin[Agent](true)
|
|
|
|
)
|
2023-05-04 15:40:00 +08:00
|
|
|
|
|
|
|
// SiteURL The site url is the domain address of the current site. e.g. http://localhost:8080
|
|
|
|
// When some Agent plugins want to redirect to the origin site, it can use this function to get the site url.
|
|
|
|
func SiteURL() string {
|
|
|
|
return constant.DefaultSiteURL
|
|
|
|
}
|