You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
441 B
19 lines
441 B
package handlers
|
|
|
|
import (
|
|
"mazeratsgen/internal/dice"
|
|
"mazeratsgen/internal/tables"
|
|
"net/http"
|
|
"time"
|
|
)
|
|
|
|
// @Summary Generate a spell
|
|
// @Tags magic
|
|
// @Produce application/json, text/plain
|
|
// @Method GET
|
|
// @Router /api/generate/spell [get]
|
|
// @Success 200
|
|
func GenSpell(w http.ResponseWriter, r *http.Request) {
|
|
t := tables.MagicTable{Roller: dice.NewRoller(time.Now().UnixNano())}
|
|
WriteResponse(w, r, t.Generate(), t.Template())
|
|
}
|
|
|