2022-11-30 11:16:11 +07:00
|
|
|
package v2
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
|
2022-11-30 12:07:36 +07:00
|
|
|
codegen "github.com/IceWhaleTech/CasaOS-UserService/codegen/user_service"
|
2022-11-30 11:16:11 +07:00
|
|
|
"github.com/IceWhaleTech/CasaOS-UserService/service"
|
|
|
|
"github.com/labstack/echo/v4"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (s *UserService) DeleteEvent(ctx echo.Context, params codegen.EventUuid) error {
|
|
|
|
m := service.MyService.Event().GetEventByUUID(params.String())
|
|
|
|
service.MyService.Event().DeleteEvent(params.String())
|
|
|
|
return ctx.JSON(http.StatusOK, m)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *UserService) GetEvents(ctx echo.Context, params codegen.GetEventsParams) error {
|
|
|
|
list := service.MyService.Event().GetEvents()
|
|
|
|
return ctx.JSON(http.StatusOK, list)
|
|
|
|
}
|
2022-12-03 05:14:57 +07:00
|
|
|
|
2022-12-01 16:17:44 +07:00
|
|
|
func (s *UserService) DeleteEventBySerial(ctx echo.Context, serial codegen.Serial) error {
|
|
|
|
service.MyService.Event().DeleteEventBySerial(serial)
|
|
|
|
return ctx.JSON(http.StatusOK, serial)
|
|
|
|
}
|