mirror of
https://github.com/luscis/openlan.git
synced 2025-09-29 05:42:07 +08:00
23 lines
435 B
Go
Executable File
23 lines
435 B
Go
Executable File
package api
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/gorilla/mux"
|
|
"github.com/luscis/openlan/pkg/cache"
|
|
"github.com/luscis/openlan/pkg/schema"
|
|
)
|
|
|
|
type Version struct {
|
|
}
|
|
|
|
func (l Version) Router(router *mux.Router) {
|
|
router.HandleFunc("/api/version", l.List).Methods("GET")
|
|
}
|
|
|
|
func (l Version) List(w http.ResponseWriter, r *http.Request) {
|
|
ver := schema.NewVersionSchema()
|
|
ver.Expire = cache.User.ExpireTime()
|
|
ResponseJson(w, ver)
|
|
}
|