backend

package
v0.0.0-...-a3f729a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2024 License: GPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const FlushingInterval = time.Minute

Variables

This section is empty.

Functions

func ValidateCreateDevice

func ValidateCreateDevice(req *pb.CreateDeviceRequest) error

func ValidateDeleteDevice

func ValidateDeleteDevice(req *pb.DeleteDeviceRequest) error

Types

type CampusServer

type CampusServer struct {
	pb.UnimplementedCampusServer
	// contains filtered or unexported fields
}

func New

func New(db *gorm.DB) *CampusServer

func (*CampusServer) CreateCanteenRating

CreateCanteenRating RPC Endpoint Allows to store a new cafeteria Rating. If one of the parameters is invalid, an error will be returned. Otherwise, the rating will be saved. All rating tags which were given with the new rating are stored if they are valid tags, if at least one tag was invalid, an error is returned, all valid ratings tags will be stored nevertheless. Either the german or the english name can be returned to successfully store tags

func (*CampusServer) CreateDevice

func (*CampusServer) CreateDishRating

func (s *CampusServer) CreateDishRating(ctx context.Context, input *pb.CreateDishRatingRequest) (*pb.CreateDishRatingReply, error)

CreateDishRating RPC Endpoint Allows to store a new dish Rating. If one of the parameters is invalid, an error will be returned. Otherwise, the rating will be saved. The ratingNumber will be saved for each corresponding DishNameTag. All rating tags which were given with the new rating are stored if they are valid tags, if at least one tag was invalid, an error is returned, all valid ratings tags will be stored nevertheless. Either the german or the english name can be returned to successfully store tags

func (*CampusServer) CreateFeedback

func (s *CampusServer) CreateFeedback(stream pb.Campus_CreateFeedbackServer) error

CreateFeedback accepts a stream of feedback messages from the client and stores them in the database/file system.

func (*CampusServer) DeleteDevice

func (*CampusServer) GetAvailableCafeteriaTags

GetAvailableCafeteriaTags RPC Endpoint Returns all valid Tags to quickly rate dishes in english and german

func (*CampusServer) GetCafeterias

GetCafeterias RPC endpoint Returns all cafeterias with meta information which are available in the eat-api

func (*CampusServer) GetCanteenHeadCount

GetCanteenHeadCount RPC Endpoint

func (*CampusServer) GetDishRatings

func (s *CampusServer) GetDishRatings(ctx context.Context, input *pb.GetDishRatingsRequest) (*pb.GetDishRatingsReply, error)

func (*CampusServer) GetUpdateNote

func (*CampusServer) ListAvailableDishTags

ListAvailableDishTags RPC Endpoint Returns all valid Tags to quickly rate dishes in english and german with the corresponding Id

func (*CampusServer) ListCanteenRatings

ListCanteenRatings RPC Endpoint Allows to query ratings for a specific cafeteria. It returns the average rating, max/min rating as well as a number of actual ratings and the average ratings for all cafeteria rating tags which were used to rate this cafeteria. The parameter limit defines how many actual ratings should be returned. The optional parameters from and to can define an interval in which the queried ratings have been stored. If these aren't specified, the newest ratings will be returned as the default

func (*CampusServer) ListDishes

func (s *CampusServer) ListDishes(ctx context.Context, req *pb.ListDishesRequest) (*pb.ListDishesReply, error)

func (*CampusServer) ListMovies

func (s *CampusServer) ListMovies(ctx context.Context, req *pb.ListMoviesRequest) (*pb.ListMoviesReply, error)

func (*CampusServer) ListNameTags

ListNameTags RPC Endpoint Returns all valid Tags to quickly rate dishes in english and german with the corresponding Id

func (*CampusServer) ListNews

func (s *CampusServer) ListNews(ctx context.Context, req *pb.ListNewsRequest) (*pb.ListNewsReply, error)

func (*CampusServer) ListNewsAlerts

func (*CampusServer) ListNewsSources

func (*CampusServer) RunDeviceFlusher

func (s *CampusServer) RunDeviceFlusher() error

type ModelType

type ModelType int
const (
	DISH      ModelType = 1
	CAFETERIA ModelType = 2
	NAME      ModelType = 3
)

Used to differentiate between the type of the model for different queries to reduce duplicated code.

Directories

Path Synopsis
Package migration contains functions related to database changes and executes them
Package migration contains functions related to database changes and executes them

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL