22 lines
515 B
Go
22 lines
515 B
Go
package controllers
|
|
|
|
import (
|
|
"regexp"
|
|
|
|
beego "github.com/beego/beego/v2/server/web"
|
|
)
|
|
|
|
func jsonErr(c *beego.Controller, httpStatus, bizCode int, msg string) {
|
|
c.Ctx.Output.SetStatus(httpStatus)
|
|
c.Data["json"] = map[string]interface{}{"code": bizCode, "msg": msg}
|
|
_ = c.ServeJSON()
|
|
}
|
|
|
|
type domainPoolPayload struct {
|
|
ID uint64 `json:"id"`
|
|
MainDomain string `json:"main_domain"`
|
|
Status int8 `json:"status"`
|
|
}
|
|
|
|
var subDomainRe = regexp.MustCompile(`^[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]$`)
|