services

package
v0.0.0-...-e5b71ba Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddJob

func AddJob(job *model.Job) error

func AddVolunteer

func AddVolunteer(volunteer *model.Volunteer) error

func CheckAuth

func CheckAuth(context *gin.Context, username string, password string) error

func CreateTeam

func CreateTeam(team *model.Team) error

func DeleteJob

func DeleteJob(teamId sql.NullInt64, id uint) (int64, error)

func DeleteTeam

func DeleteTeam(teamID uint) error

func DeleteVolunteer

func DeleteVolunteer(teamID sql.NullInt64, volunteerID uint) error

func ExtractAdminInfo

func ExtractAdminInfo(session sessions.Session) (model.TeamAdmin, error)

func GetJobsNum

func GetJobsNum(teamId sql.NullInt64) (int64, error)

func GetTeamInfo

func GetTeamInfo(teamID uint) (model.Team, error)

func GetVolunteersNum

func GetVolunteersNum(teamID sql.NullInt64, pageSize int) (int64, error)

GetVolunteersNum fetch all tuple's count in the table

func ListTeams

func ListTeams(offset int, pageSize int) ([]model.Team, int64, error)

func ListVolunteers

func ListVolunteers(teamID sql.NullInt64, offset int, pageSize int) ([]model.Volunteer, error)

func SearchVolunteer

func SearchVolunteer(teamID sql.NullInt64, IDNumber string) (model.Volunteer, error)

SearchVolunteer get volunteer data with user id card number

func UpdateJob

func UpdateJob(id uint, job *model.Job) (int64, error)

func UpdateTeam

func UpdateTeam(team *model.Team) error

func UpdateVolunteer

func UpdateVolunteer(teamID sql.NullInt64, volunteerID uint, volunteer *model.Volunteer) error

Types

type Jobs

type Jobs []struct {
	ID        uint      `json:"id"`
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
	Name      string    `json:"name"`
	Content   string    `json:"content"`
	Location  string    `json:"location"`
	TeamID    *int64    `json:"team_id"`
}

func GetAllJobs

func GetAllJobs(offset int, pageSize int) (Jobs, error)

func GetJobs

func GetJobs(teamId sql.NullInt64, offset int, pageSize int) (Jobs, error)

Jump to

Keyboard shortcuts

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