func (c *CommandController) Put(ctx iris.Context) interface{} {

	command := &types.Command{}
	err := ctx.ReadJSON(command)

	if err != nil {
		ctx.Application().Logger().Error(err)
		return iris.StatusBadRequest
	}

	_, err = c.Service.Create(command)

	if err == nil {
		return command
	}

	ctx.Application().Logger().Error(err)

	return iris.StatusInternalServerError
}
// Put create a new command
Put create a new command
// Put create a new command
func (c *CommandController) Put(ctx iris.Context) interface{} {
	command := &types.Command{}
	err := ctx.ReadJSON(command)
	if err != nil {
		ctx.Application().Logger().Error(err)
		return iris.StatusBadRequest
	}
	_, err = c.Service.Create(command)
	if err == nil {
		return command
	}
	ctx.Application().Logger().Error(err)
	return iris.StatusInternalServerError
}
func ( c * CommandController ) Put ( ctx iris . Context ) interface { } { command := & types . Command { } err := ctx . ReadJSON ( command ) if err != nil { ctx . Application ( ) . Logger ( ) . Error ( err ) return iris . StatusBadRequest } _ , err = c . Service . Create ( command ) if err == nil { return command } ctx . Application ( ) . Logger ( ) . Error ( err ) return iris . StatusInternalServerError }
Put create a new command
Put create a new command