Replace "register" with "sign up".

This commit is contained in:
Yang Luo
2021-04-27 22:47:44 +08:00
parent 3793029491
commit 7a0ed4ebaf
13 changed files with 33 additions and 33 deletions

View File

@ -54,13 +54,13 @@ type Response struct {
Data interface{} `json:"data"`
}
// @Title Register
// @Description register a new user
// @Param username formData string true "The username to register"
// @Title Signup
// @Description sign up a new user
// @Param username formData string true "The username to sign up"
// @Param password formData string true "The password"
// @Success 200 {object} controllers.Response The Response object
// @router /register [post]
func (c *ApiController) Register() {
// @router /signup [post]
func (c *ApiController) Signup() {
var resp Response
if c.GetSessionUser() != "" {
@ -76,7 +76,7 @@ func (c *ApiController) Register() {
panic(err)
}
msg := object.CheckUserRegister(form.Username, form.Password)
msg := object.CheckUserSignup(form.Username, form.Password)
if msg != "" {
resp = Response{Status: "error", Msg: msg, Data: ""}
} else {
@ -94,7 +94,7 @@ func (c *ApiController) Register() {
//c.SetSessionUser(user)
util.LogInfo(c.Ctx, "API: [%s] is registered as new user", user)
util.LogInfo(c.Ctx, "API: [%s] is signed up as new user", user)
resp = Response{Status: "ok", Msg: "", Data: user}
}
@ -143,7 +143,7 @@ func (c *ApiController) GetAccount() {
}
// @Title UploadAvatar
// @Description register a new user
// @Description upload avatar
// @Param avatarfile formData string true "The base64 encode of avatarfile"
// @Param password formData string true "The password"
// @Success 200 {object} controllers.Response The Response object

View File

@ -174,12 +174,12 @@ func (c *ApiController) Login() {
//}
if !application.EnableSignUp {
resp = &Response{Status: "error", Msg: fmt.Sprintf("The account for provider: %s and username: %s does not exist and is not allowed to register as new account, please contact your IT support", provider.Type, userInfo.Username)}
resp = &Response{Status: "error", Msg: fmt.Sprintf("The account for provider: %s and username: %s does not exist and is not allowed to sign up as new account, please contact your IT support", provider.Type, userInfo.Username)}
c.Data["json"] = resp
c.ServeJSON()
return
} else {
resp = &Response{Status: "error", Msg: fmt.Sprintf("The account for provider: %s and username: %s does not exist, please register an account first", provider.Type, userInfo.Username)}
resp = &Response{Status: "error", Msg: fmt.Sprintf("The account for provider: %s and username: %s does not exist, please create an account first", provider.Type, userInfo.Username)}
c.Data["json"] = resp
c.ServeJSON()
return