Event retention (#23)

Signed-off-by: link <a624669980@163.com>
This commit is contained in:
link
2022-11-30 12:16:11 +08:00
committed by GitHub
parent b41ab1ecce
commit dab1fdd6be
15 changed files with 601 additions and 35 deletions
+20
View File
@@ -0,0 +1,20 @@
package v2
import (
"net/http"
codegen "github.com/IceWhaleTech/CasaOS-UserService/codegen/user-service"
"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)
}
+9
View File
@@ -0,0 +1,9 @@
package v2
import codegen "github.com/IceWhaleTech/CasaOS-UserService/codegen/user-service"
type UserService struct{}
func NewUserService() codegen.ServerInterface {
return &UserService{}
}