server

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCampaignHandler

func CreateCampaignHandler(c *gin.Context)

func GetUserPointsHistoryHandler

func GetUserPointsHistoryHandler(c *gin.Context)

func GetUserTaskStatusHandler

func GetUserTaskStatusHandler(c *gin.Context)

func ProcessSharePoolTicker

func ProcessSharePoolTicker()

func StartServer

func StartServer()

Types

type CampaignResp

type CampaignResp struct {
	CampaignID  int              `json:"campaignId"`
	Name        string           `json:"name"`
	PoolAddress string           `json:"poolAddress"`
	StartTime   int64            `json:"startTime"`
	EndTime     int64            `json:"endTime"`
	Tasks       []TaskStatusResp `json:"tasks"`
}

type CreateCampaignReq

type CreateCampaignReq struct {
	Name                string  `json:"name" binding:"required"`
	PoolAddress         string  `json:"poolAddress" binding:"required"`
	StartAt             int64   `json:"startAt" binding:"required"`
	OnboardingReward    float64 `json:"onboardingReward" binding:"required"`
	OnboardingThreshold float64 `json:"onboardingThreshold" binding:"required"`
	PointPool           float64 `json:"pointPool" binding:"required"`
	Schedule            string  `json:"schedule" binding:"required"`
	Round               int64   `json:"round" binding:"required"`
}

type GetUserPointsHistoryResp

type GetUserPointsHistoryResp struct {
	PointsHistory []PointsHistoryResp `json:"pointsHistory"`
	Total         float64             `json:"total"`
}

type GetUserTaskStatusResp

type GetUserTaskStatusResp struct {
	Campaigns []CampaignResp `json:"campaigns"`
}

type PointsHistoryResp

type PointsHistoryResp struct {
	CampaignID   int       `json:"campaignId"`
	CampaignName string    `json:"campaignName"`
	PoolAddress  string    `json:"poolAddress"`
	TaskID       int       `json:"taskId"`
	TaskType     string    `json:"taskType"`
	Description  string    `json:"description"`
	Points       float64   `json:"points"`
	Timestamp    time.Time `json:"timestamp"`
}

type TaskStatusResp

type TaskStatusResp struct {
	TaskID      int     `json:"taskId"`
	Type        string  `json:"type"`
	Description string  `json:"description"`
	Completed   bool    `json:"completed"`
	Amount      float64 `json:"amount"`
	Points      float64 `json:"points"`
	StartTime   int64   `json:"startTime"`
	EndTime     int64   `json:"endTime"`
}

Jump to

Keyboard shortcuts

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