mirror of
https://github.com/vx3r/wg-gen-web.git
synced 2025-09-11 12:24:27 +00:00
logo, send email
This commit is contained in:
16
api/api.go
16
api/api.go
@ -20,6 +20,7 @@ func ApplyRoutes(r *gin.Engine) {
|
||||
client.DELETE("/:id", deleteClient)
|
||||
client.GET("", readClients)
|
||||
client.GET("/:id/config", configClient)
|
||||
client.GET("/:id/email", emailClient)
|
||||
}
|
||||
|
||||
server := r.Group("/api/v1.0/server")
|
||||
@ -149,6 +150,21 @@ func configClient(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
func emailClient(c *gin.Context) {
|
||||
id := c.Param("id")
|
||||
|
||||
err := repository.EmailClient(id)
|
||||
if err != nil {
|
||||
log.WithFields(log.Fields{
|
||||
"err": err,
|
||||
}).Error("failed to send email to client")
|
||||
c.AbortWithStatus(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
c.JSON(http.StatusOK, gin.H{})
|
||||
}
|
||||
|
||||
func readServer(c *gin.Context) {
|
||||
client, err := repository.ReadServer()
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user