-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
33 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,6 @@ | |
/swagger | ||
app | ||
beego-members-api | ||
mem-230.memprof | ||
*.memprof | ||
*.pprof | ||
*.tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package controllers | ||
|
||
type DefaultSuccessResponse struct { | ||
// TODO: enumをサポートしたらenumに変更する | ||
Message string `json:"message" required:"true" example:"success" description:"result status"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,13 +19,8 @@ func (c *LoginController) URLMapping() { | |
} | ||
|
||
type LoginRequest struct { | ||
Email string `json:"email" required:"true" example:"[email protected]"` | ||
Pasword string `json:"password" required:"true" example:"password"` | ||
} | ||
|
||
type LoginResponse struct { | ||
// TODO: enumをサポートしたらenumに変更する | ||
Message string `json:"message" required:"true" example:"success" description:"result status"` | ||
Email string `orm:"size(128)" json:"email" example:"[email protected]"` | ||
Password string `orm:"size(128)" json:"password" example:"password"` | ||
} | ||
|
||
// NOTE: exampleの出し分けが出来ないので別にしています。 | ||
|
@@ -54,7 +49,7 @@ func (c *LoginController) Login() { | |
// パスワード照合 | 間違ったら403 | ||
|
||
// set_cookie | ||
mes := LoginResponse{Message: "success"} | ||
mes := DefaultSuccessResponse{Message: "success"} | ||
c.Data["json"] = mes | ||
c.ServeJSON() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,9 +19,9 @@ type ProfileRequest struct { | |
Age int64 `json:"age" required:"true" example:"0"` | ||
} | ||
type UserCreateRequest struct { | ||
Email string `json:"email" required:"true" example:"[email protected]"` | ||
Password string `json:"password" required:"true" example:"password"` | ||
Profile ProfileRequest `json:"profile" required:"true"` | ||
LoginRequest | ||
models.UserInfoBody | ||
Profile models.ProfileBody `json:"profile" required:"true"` | ||
} | ||
|
||
// URLMapping ... | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters