0
0
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:
vx3r
2020-02-03 16:19:24 +09:00
parent c9fb3c2e29
commit dcb0769edb
18 changed files with 372 additions and 22 deletions

View File

@ -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 {