mirror of
https://github.com/phishingclub/phishingclub.git
synced 2026-08-20 09:27:15 +02:00
Initial open source release
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/phishingclub/phishingclub/service"
|
||||
)
|
||||
|
||||
// Version is a controller
|
||||
type Version struct {
|
||||
Common
|
||||
versionService *service.Version
|
||||
}
|
||||
|
||||
// Get application version
|
||||
func (c *Version) Get(g *gin.Context) {
|
||||
// handle session
|
||||
session, _, ok := c.handleSession(g)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
version, err := c.versionService.Get(g.Request.Context(), session)
|
||||
if ok := handleServerError(g, c.Response, err); !ok {
|
||||
return
|
||||
}
|
||||
c.Response.OK(g, version)
|
||||
}
|
||||
Reference in New Issue
Block a user