mostly functionnal, poorly tested

This commit is contained in:
ycc
2023-03-08 16:48:36 +01:00
parent f23ceea934
commit 24fd211a43
12 changed files with 370 additions and 835 deletions

View File

@@ -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()
}