mostly functionnal, poorly tested
This commit is contained in:
@@ -15,14 +15,18 @@ type IdentityController struct {
|
||||
// @Title CreateIdentity
|
||||
// @Description create identitys
|
||||
// @Param body body models.Identity true "body for identity content"
|
||||
// @Success 200 {int} models.Identity.Id
|
||||
// @Success 200 {result} "ok" or error
|
||||
// @Failure 403 body is empty
|
||||
// @router / [post]
|
||||
func (u *IdentityController) Post() {
|
||||
var identity models.Identity
|
||||
json.Unmarshal(u.Ctx.Input.RequestBody, &identity)
|
||||
id := models.UpdateIdentity(&identity)
|
||||
u.Data["json"] = id
|
||||
err := models.UpdateIdentity(&identity)
|
||||
if err != nil {
|
||||
u.Data["json"] = err.Error()
|
||||
} else {
|
||||
u.Data["json"] = "ok"
|
||||
}
|
||||
u.ServeJSON()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user