Landed the topic list page (no topics yet, so appearances are deceiving)

This commit is contained in:
2025-10-28 16:32:05 -06:00
parent 86540e00b1
commit 086954f7b0
9 changed files with 443 additions and 5 deletions
+14
View File
@@ -50,6 +50,7 @@ type AmContext interface {
RC() int
OutputType() string
Parameter(string) string
QueryParamInt(string, int) int
RemoteIP() string
ReplaceUser(*database.User)
SaveSession() error
@@ -241,6 +242,19 @@ func (c *amContext) Parameter(name string) string {
return rc
}
// QueryParamInt returns the value of a query parameter as an integer, with a default.
func (c *amContext) QueryParamInt(name string, defval int) int {
s := c.echoContext.QueryParam(name)
if s == "" {
return defval
}
rc, err := strconv.Atoi(s)
if err != nil {
return defval
}
return rc
}
// RemoteIP returns the remote IP address.
func (c *amContext) RemoteIP() string {
return c.echoContext.RealIP()