backend

package
v0.0.0-...-15abd4f Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: GPL-3.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const CacheKeyAllNewsSources = "all_news_sources"
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 canteen 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) 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) ListAvailableCanteenTags

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

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 canteen. It returns the average rating, max/min rating as well as a number of actual ratings and the average ratings for all canteen rating tags which were used to rate this canteen. 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) ListCanteens

ListCanteens RPC endpoint Returns all canteens with meta information which are available in the eat-api. The id is the eat-api canteen_id (e.g. "mensa-garching").

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) ListStudentClub

ListStudentClub is deprecated in favour of ListStudentGroup

func (*CampusServer) ListStudentGroup

func (*CampusServer) RunDeviceFlusher

func (s *CampusServer) RunDeviceFlusher() error

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
⌂ 换网址