dao

package
v0.0.0-...-ae0d72a Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: Apache-2.0, MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AdsPlatformPC  = 1
	AdsPlatformAPP = 2

	AdsTypeBanner = 1
	AdsTypeNotice = 2
)
View Source
const (
	AssetTransferTypeDownload = "download"
	AssetTransferTypeUpload   = "upload"

	AssetTransferStateCreated = 0
	AssetTransferStateSuccess = 1
	AssetTransferStateFailure = 2
)
View Source
const (
	BugStateWaiting = 1
	BugStateDone    = 2
)
View Source
const (
	FullNodeInfoKeyExpiration = 0
	FullNodeInfoKey           = "TITAN::FULL_NODE_INFO"
)
View Source
const (
	EligibleTopOnlineTimePercent = 10
	IncentiveRewardPercent       = 10
)

Variables

View Source
var (
	// DB reference to database
	DB, QDB *sqlx.DB
	// RedisCache  redis caching instance
	RedisCache *redis.Client
)
View Source
var (
	TenantStateActive   = "active"
	TenantStateInactive = "inactive"
)
View Source
var ErrNoRow = fmt.Errorf("no matching row found")
View Source
var (
	GEOLocationKeyPrefix = "TITAN::GEO"
)

Functions

func AcmeAdd

func AcmeAdd(ctx context.Context, acme *model.Acme) error

func AcmeRecord

func AcmeRecord(ctx context.Context) (*model.Acme, error)

func AcquireLock

func AcquireLock(rdb *redis.Client, lockKey string, lockValue string, expiration time.Duration) (bool, error)

尝试获取分布式锁

func AddAppVersion

func AddAppVersion(ctx context.Context, appVer *model.AppVersion) error

func AddAssetAndUpdateSize

func AddAssetAndUpdateSize(ctx context.Context, asset *model.UserAsset, areaIDs []string, syncArea string) error

AddAssetAndUpdateSize 添加文件信息并修改使用的storage存储空间

func AddAssetGroupVisitCount

func AddAssetGroupVisitCount(ctx context.Context, userID string, id int) error

AddAssetGroupVisitCount 增加文件组分享次数

func AddAssetHourStorages

func AddAssetHourStorages(ctx context.Context, ahss []model.AssetStorageHour) error

AddAssetHourStorages 批量存储文件小时数据

func AddAssets

func AddAssets(ctx context.Context, assets []*model.Asset) error

func AddDataCollection

func AddDataCollection(ctx context.Context, dc *model.DataCollection) error

func AddFilStorages

func AddFilStorages(ctx context.Context, storages []*model.FilStorage) error

func AddIPFSRecords

func AddIPFSRecords(ctx context.Context, irs []model.SyncIPFSRecord) error

AddIPFSRecords 添加ipfs同步记录

func AddKOL

func AddKOL(ctx context.Context, kol *model.KOL) error

func AddKOLLevelConfig

func AddKOLLevelConfig(ctx context.Context, levelConf *model.KOLLevelConfig) error

func AddLoginLog

func AddLoginLog(ctx context.Context, log *model.LoginLog) error

func AddNewReferralCode

func AddNewReferralCode(ctx context.Context, referralCode *model.ReferralCode) error

func AddOperationLog

func AddOperationLog(ctx context.Context, log *model.OperationLog) error

func AddSignature

func AddSignature(ctx context.Context, signature *model.Signature) error

func AddStorageProvider

func AddStorageProvider(ctx context.Context, sp *model.StorageProvider) error

func AddSubscription

func AddSubscription(ctx context.Context, subscription *model.Subscription) error

func AddTempAssetDownloadCount

func AddTempAssetDownloadCount(ctx context.Context, hash string) error

AddTempAssetDownloadCount 增加临时文件的下载次数

func AddTempAssetShareCount

func AddTempAssetShareCount(ctx context.Context, hash string, size ...int64) error

AddTempAssetShareCount 增加临时文件的分享信息

func AddUserAssetMap

func AddUserAssetMap(ctx context.Context, userID, hash string) error

AddUserAssetMap 增加用户文件映射表

func AddUserSecret

func AddUserSecret(ctx context.Context, userSecret *model.UserSecret) error

func AddVisitCount

func AddVisitCount(ctx context.Context, hash string, user_id string) error

AddVisitCount 增加文件访问次数

func AdsAddCtx

func AdsAddCtx(ctx context.Context, ads *model.Ads) error

func AdsDelCtx

func AdsDelCtx(ctx context.Context, id int64) error

func AdsFindOne

func AdsFindOne(ctx context.Context, id int64) (*model.Ads, error)

func AdsListPageCtx

func AdsListPageCtx(ctx context.Context, page, size int, sb squirrel.SelectBuilder) ([]*model.Ads, int64, error)

func AdsUpdateCtx

func AdsUpdateCtx(ctx context.Context, ads *model.Ads) error

func AllAssets

func AllAssets(ctx context.Context) ([]*model.Asset, error)

func AllUsers

func AllUsers(ctx context.Context) ([]*model.User, error)

func BugUpdateCtx

func BugUpdateCtx(ctx context.Context, b *model.Bug) error

func BugsAddCtx

func BugsAddCtx(ctx context.Context, b *model.Bug) error

func BugsCountByBuilderCtx

func BugsCountByBuilderCtx(ctx context.Context, cb squirrel.SelectBuilder) (int64, error)

func BugsListPageCtx

func BugsListPageCtx(ctx context.Context, page, size int, sb squirrel.SelectBuilder, sel string) ([]*model.Bug, int64, error)

func BulkAddDeviceInfo

func BulkAddDeviceInfo(ctx context.Context, deviceInfos []*model.DeviceInfo) error

func BulkInsertOrUpdateDeviceStatus

func BulkInsertOrUpdateDeviceStatus(ctx context.Context, deviceInfos []*model.DeviceInfo) error

func BulkUpdateDeviceInfo

func BulkUpdateDeviceInfo(ctx context.Context, deviceInfos []*model.DeviceInfo) error

func BulkUpdateUserL1Reward

func BulkUpdateUserL1Reward(ctx context.Context, rewards []*model.UserL1Reward) error

func BulkUpdateUserReferralReward

func BulkUpdateUserReferralReward(ctx context.Context, users []*model.User) error

func BulkUpdateUserReward

func BulkUpdateUserReward(ctx context.Context, users []*model.User) error

func BulkUpdateUserRewardDetails

func BulkUpdateUserRewardDetails(ctx context.Context, logs []*model.UserRewardDetail) error

func BulkUpsertDeviceInfo

func BulkUpsertDeviceInfo(ctx context.Context, deviceInfos []*model.DeviceInfo) error

func BulkUpsertDeviceInfoDaily

func BulkUpsertDeviceInfoDaily(ctx context.Context, dailyInfos []*model.DeviceInfoDaily) error

func BulkUpsertDeviceInfoHours

func BulkUpsertDeviceInfoHours(ctx context.Context, hourInfos []*model.DeviceInfoHour) error

func BulkUpsertStorageHours

func BulkUpsertStorageHours(ctx context.Context, userInfos []*model.UserInfo) error

func CacheFullNodeInfo

func CacheFullNodeInfo(ctx context.Context, fullNodeInfo *model.FullNodeInfo) error

func CacheIPLocation

func CacheIPLocation(ctx context.Context, location *model.Location, lang model.Language) error

func CacheMapInfo

func CacheMapInfo(ctx context.Context, mapInfo []*MapInfo, lang model.Language) error

func CheckAssetByMd5AndAreaExists

func CheckAssetByMd5AndAreaExists(ctx context.Context, md5, areaID string) (string, bool, error)

CheckAssetByMd5AndAreaExists 判断文件是否已经存在

func CheckAssetHashIsExist

func CheckAssetHashIsExist(ctx context.Context, hash string) bool

CheckAssetHashIsExist 判断文件hash是否存在

func CheckAssetIsSyncByAreaID

func CheckAssetIsSyncByAreaID(ctx context.Context, hash, areaID string) bool

CheckAssetIsSyncByAreaID 判断

func CheckIsNodeOwner

func CheckIsNodeOwner(ctx context.Context, uid, nodeID string) (int64, error)

CheckIsNodeOwner 校验是否为节点拥有者

func CheckUserAseetNeedDel

func CheckUserAseetNeedDel(ctx context.Context, hash, uid string, areaID []string) ([]string, bool, error)

CheckUserAseetNeedDel 判断文件是否需要删除

func CheckUserAssetIsInAreaID

func CheckUserAssetIsInAreaID(ctx context.Context, userID, hash, areaID string) (bool, error)

CheckUserAssetIsInAreaID 判断用户文件是否存在于指定区域

func CheckUserAssetIsOnly

func CheckUserAssetIsOnly(ctx context.Context, hash, areaID string) (bool, error)

CheckUserAssetIsOnly 判断用户文件是否为唯一存在的

func ContactIPLocation

func ContactIPLocation(loc model.Location, lang model.Language) string

func CountAssets

func CountAssets(ctx context.Context) (int64, error)

func CountFilStorage

func CountFilStorage(ctx context.Context, cid string) (int64, error)

func CountPageViewByEvent

func CountPageViewByEvent(ctx context.Context, event model.DataCollectionEvent, code string, option QueryOption) (ipCount, pvCount int64, err error)

func CountReferralUsersByCode

func CountReferralUsersByCode(ctx context.Context, code string, option QueryOption) (referralUsers, referralNodes int64, err error)
func CreateLink(ctx context.Context, link *model.Link) error

func CreateUser

func CreateUser(ctx context.Context, user *model.User) error

func DelAssetAndUpdateSize

func DelAssetAndUpdateSize(ctx context.Context, hash, userID string, areaID []string, isNeedDel bool) error

DelAssetAndUpdateSize 删除文件信息并修改使用的storage存储空间

func DeleteAssetGroup

func DeleteAssetGroup(ctx context.Context, uid string, gid int) error

DeleteAssetGroup delete asset group

func DeleteAssetGroupAndUpdateSize

func DeleteAssetGroupAndUpdateSize(ctx context.Context, userID string, gid int) error

DeleteAssetGroupAndUpdateSize 删除文件组并更新用户已使用空间大小

func DeleteKOL

func DeleteKOL(ctx context.Context, userId string) error

func DeleteKOLLevelConfig

func DeleteKOLLevelConfig(ctx context.Context, level int) error

func DeleteOfflineDevice

func DeleteOfflineDevice(ctx context.Context, ids []string, usedID string) error

DeleteOfflineDevice 删除离线设备

func DeleteOuterAssetGroup

func DeleteOuterAssetGroup(ctx context.Context, userID string, gids []int64) error

DeleteOuterAssetGroup 删除指定的文件组,其内部的文件组先不进行删除

func DeleteUserGroupAsset

func DeleteUserGroupAsset(ctx context.Context, userID string, gids []int64) error

DeleteUserGroupAsset 删除用户文件组中的文件

func GenerateDeviceMapInfo

func GenerateDeviceMapInfo(infos []*model.DeviceInfo, lang model.Language, noHideIP ...bool) []map[string]interface{}

func GenerateEligibleOnlineDevices

func GenerateEligibleOnlineDevices(ctx context.Context) error

func GetAdminAddedKolLevel

func GetAdminAddedKolLevel(ctx context.Context) (map[string]int, error)

func GetAllDeviceUserIdFromCache

func GetAllDeviceUserIdFromCache(ctx context.Context, areaId string) (map[string]string, error)

func GetAllKOLLevels

func GetAllKOLLevels(ctx context.Context) (map[string]*model.KOLLevel, error)

func GetAllSignInfo

func GetAllSignInfo() ([]model.SignInfo, error)

func GetAllUserReferrerUserId

func GetAllUserReferrerUserId(ctx context.Context) (map[string]string, error)

func GetAppVersion

func GetAppVersion(ctx context.Context, version string, platform string, lang model.Language) (*model.AppVersion, error)

func GetAreaCnByAreaEn

func GetAreaCnByAreaEn(ctx context.Context, areaEn []string) ([]string, error)

GetAreaCnByAreaEn 通过英文的区域名称获取中文的区域名称

func GetAreaCount

func GetAreaCount(ctx context.Context, deviceIds []string) (int64, error)

func GetAreaEnByAreaCn

func GetAreaEnByAreaCn(ctx context.Context, areaCn []string) ([]string, error)

GetAreaEnByAreaCn 通过中文的区域名称获取英文的区域名称

func GetAreaIDsByHash

func GetAreaIDsByHash(ctx context.Context, hash string) ([]string, error)

GetAreaIDsByHash 通过hash获取areaids

func GetAreaMapByEn

func GetAreaMapByEn(ctx context.Context, areaEn []string) ([]model.AreaMap, error)

GetAreaMapByEn 通过英文获取节点区域列表

func GetAssetByCID

func GetAssetByCID(ctx context.Context, cid string) (*model.Asset, error)

func GetAssetList

func GetAssetList(ctx context.Context, deviceIds []string, lang model.Language, option QueryOption) ([]*model.DeviceInfo, error)

func GetAssetsByEmptyPath

func GetAssetsByEmptyPath(ctx context.Context) ([]*model.Asset, int64, error)

func GetAssetsList

func GetAssetsList(ctx context.Context, cid string, nodeId, areaId string, option QueryOption) (int64, []*model.Asset, error)

func GetAssetsListByCIds

func GetAssetsListByCIds(ctx context.Context, cids []string) ([]*model.Asset, error)

func GetCacheFullNodeInfo

func GetCacheFullNodeInfo(ctx context.Context) (*model.FullNodeInfo, error)

func GetCacheLocation

func GetCacheLocation(ctx context.Context, ip string, lang model.Language) (*model.Location, error)

func GetCityCountByDeviceIds

func GetCityCountByDeviceIds(ctx context.Context, deviceIds []string) (int64, error)

func GetCountryCount

func GetCountryCount(ctx context.Context) (int64, error)

GetCountryCount 获取国家数量

func GetCreditByUn

func GetCreditByUn(ctx context.Context, un string) (int64, error)

GetCreditByUn 获取社区奖励

func GetDeviceDistribution

func GetDeviceDistribution(ctx context.Context, lang model.Language) ([]*model.DeviceDistribution, error)

func GetDeviceInfo

func GetDeviceInfo(ctx context.Context, deviceId string) (*model.DeviceInfo, error)

func GetDeviceInfoByID

func GetDeviceInfoByID(ctx context.Context, deviceID string) (*model.DeviceInfo, error)

func GetDeviceInfoById

func GetDeviceInfoById(ctx context.Context, deviceId string) model.DeviceInfo

func GetDeviceInfoDailyByPage

func GetDeviceInfoDailyByPage(ctx context.Context, cond *model.DeviceInfoDaily, option QueryOption) ([]*model.DeviceInfoDaily, int64, error)

func GetDeviceInfoList

func GetDeviceInfoList(ctx context.Context, cond *model.DeviceInfo, option QueryOption) ([]*model.DeviceInfo, int64, error)

func GetDeviceInfoListByIds

func GetDeviceInfoListByIds(ctx context.Context, deviceIds []string) ([]*model.DeviceInfo, error)

func GetDeviceInfoListByKey

func GetDeviceInfoListByKey(ctx context.Context, cond *model.DeviceInfo, option QueryOption) ([]*model.DeviceInfo, int64, error)

func GetDeviceOnlineIncentiveList

func GetDeviceOnlineIncentiveList(ctx context.Context, deviceId string, option QueryOption) ([]*model.DeviceOnlineIncentive, int64, error)

func GetDeviceProfileFromCache

func GetDeviceProfileFromCache(ctx context.Context, deviceId string) (map[string]string, error)

func GetEdgeConfig

func GetEdgeConfig(ctx context.Context, node string) (*model.EdgeConfig, error)

func GetFullNodeInfoList

func GetFullNodeInfoList(ctx context.Context, cond *model.FullNodeInfo, option QueryOption) ([]*model.FullNodeInfo, int64, error)

func GetHashAreaIDList

func GetHashAreaIDList(ctx context.Context, uid string) (map[string][]string, error)

GetHashAreaIDList 根据用户信息获取区域hash列表

func GetIPFSRecordsByCIDs

func GetIPFSRecordsByCIDs(ctx context.Context, cids []string) ([]model.SyncIPFSRecord, error)

GetIPFSRecordsByCIDs 根据cid获取ipfs记录列表

func GetIPFSRecordsByUsername

func GetIPFSRecordsByUsername(ctx context.Context, un string, page, size int) (int64, []model.SyncIPFSRecord, error)

GetIPFSRecordsByUsername 根据用户名获取ipfs同步记录

func GetIPNodeCount

func GetIPNodeCount(ctx context.Context, ip, areaId string, option QueryOption) (int64, []*model.IPNodeCount, error)

func GetInfoByMinerID

func GetInfoByMinerID(minerID string) (model.SignInfo, error)

func GetInviteCreditByUn

func GetInviteCreditByUn(ctx context.Context, un string) (int64, error)

GetInviteCreditByUn 获取社区邀请奖励

func GetKOLByUserId

func GetKOLByUserId(ctx context.Context, userId string) (*model.KOL, error)

func GetKOLLevelByLevel

func GetKOLLevelByLevel(ctx context.Context, level int) (*model.KOLLevelConfig, error)

func GetKolLevelConfig

func GetKolLevelConfig(ctx context.Context, option QueryOption) ([]*model.KOLLevelConfig, int64, error)

func GetKolList

func GetKolList(ctx context.Context, option QueryOption) ([]*model.KOL, int64, error)

func GetLatestAppVersion

func GetLatestAppVersion(ctx context.Context, platform string, lang model.Language) (model.AppVersion, error)

func GetLatestAsset

func GetLatestAsset(ctx context.Context) (*model.Asset, error)
func GetLink(ctx context.Context, sb squirrel.SelectBuilder) (*model.Link, error)

func GetLocationInfoByIp

func GetLocationInfoByIp(ctx context.Context, ip string, out *model.Location, lang model.Language) error

func GetLoginLocation

func GetLoginLocation(ctx context.Context, userId string) string
func GetLongLink(ctx context.Context, cid string) string

func GetNoExistCIDs

func GetNoExistCIDs(ctx context.Context, uid string, cids []string) ([]string, error)

GetNoExistCIDs 获取用户不存在的cid信息

func GetNodeIPChangedRecords

func GetNodeIPChangedRecords(ctx context.Context, id string, option QueryOption) (int64, []*model.NodeIPHistory, error)

func GetNodeInfos

func GetNodeInfos(ctx context.Context, uid string, page, size uint64) ([]NodeStatus, []NodeStatusInfo, error)

GetNodeInfos 获取用户节点信息

func GetNodeNums

func GetNodeNums(ctx context.Context, usedID string) (int64, int64, int64, int64, error)

GetNodeNums 获取节点总数

func GetNodesInfo

func GetNodesInfo(ctx context.Context, option QueryOption) (int64, []model.NodesInfo, error)

func GetOneAreaIDByAreaID

func GetOneAreaIDByAreaID(ctx context.Context, userID, hash, areaID string) (string, error)

GetOneAreaIDByAreaID 根据给定的areaID模糊获取一个准确的areaid

func GetOneSyncSuccessArea

func GetOneSyncSuccessArea(ctx context.Context, hash string) (string, error)

GetOneSyncSuccessArea 随机获取一个同步完成的区域

func GetOnlineIPCountsFromCache

func GetOnlineIPCountsFromCache(ctx context.Context, ip string) (int64, error)

func GetOnlineNodes

func GetOnlineNodes(ctx context.Context) (int64, error)

GetOnlineNodes 获取在线的节点数量

func GetOnlyAssetsByUIDAndGroupID

func GetOnlyAssetsByUIDAndGroupID(ctx context.Context, userID string, gids []int64) (map[string][]string, error)

GetOnlyAssetsByUIDAndGroupID 获取用户文件组中唯一存在的文件区域映射

func GetPageViewCountDailyStat

func GetPageViewCountDailyStat(ctx context.Context, event model.DataCollectionEvent, code string, option QueryOption) ([]*model.DateValue, error)

func GetPageViewIPCountDailyStat

func GetPageViewIPCountDailyStat(ctx context.Context, event model.DataCollectionEvent, code string, option QueryOption) ([]*model.DateValue, error)

func GetPeakBandwidth

func GetPeakBandwidth(ctx context.Context, userId string) (int64, error)

func GetPlainDeviceInfoByIds

func GetPlainDeviceInfoByIds(ctx context.Context, deviceIds []string) ([]*model.PlainDeviceInfo, error)

func GetQualitiesNodes

func GetQualitiesNodes(ctx context.Context, areaId, nodeId string, option QueryOption) (int64, []*model.QualitiesNode, error)

func GetQueryDataList

func GetQueryDataList(sqlClause string, args ...interface{}) ([]map[string]string, error)

func GetReferralCodeProfileByUserId

func GetReferralCodeProfileByUserId(ctx context.Context, userId string) ([]*model.ReferralCodeProfile, error)

func GetReferralList

func GetReferralList(ctx context.Context, username string, option QueryOption) (int64, []*model.InviteFrensRecord, error)

func GetReferralReward

func GetReferralReward(ctx context.Context, userId, fromUserId string) (*model.UserRewardDetail, error)

func GetSecretKey

func GetSecretKey(ctx context.Context, key string) (*model.UserSecret, error)
func GetShortLink(ctx context.Context, link string) string

func GetSignatureByHash

func GetSignatureByHash(ctx context.Context, hash string) (*model.Signature, error)

func GetSignatureByNodeId

func GetSignatureByNodeId(ctx context.Context, nodeId string) (*model.Signature, error)

func GetStorageProvider

func GetStorageProvider(ctx context.Context, providerID string) (*model.StorageProvider, error)

func GetTempAssetInfo

func GetTempAssetInfo(ctx context.Context, hash string) (*model.TempAsset, error)

GetTempAssetInfo 获取临时文件的信息

func GetTenantByBuilder

func GetTenantByBuilder(ctx context.Context, sb squirrel.SelectBuilder) (*model.Tenant, error)

func GetTest1Nodes

func GetTest1Nodes(ctx context.Context, statusCode int64, page, size uint64) (int64, []model.Test1NodeInfo, error)

GetTest1Nodes 获取test1节点信息

func GetTotalNodeStats

func GetTotalNodeStats(ctx context.Context, areaId string) (*model.TotalNodeStats, error)

func GetTotalUserStats

func GetTotalUserStats(ctx context.Context) (*model.TotalUserStats, error)

func GetUnSyncAreaIDs

func GetUnSyncAreaIDs(ctx context.Context, uid, hash string) ([]string, error)

GetUnSyncAreaIDs 获取未同步的区域

func GetUnSyncIPFSRecords

func GetUnSyncIPFSRecords(ctx context.Context) ([]model.SyncIPFSRecord, error)

GetUnSyncIPFSRecords 获取未同步成功的ipfs文件列表且时间不超过一个小时

func GetUserAsset

func GetUserAsset(ctx context.Context, hash, uid string) (*model.UserAsset, error)

GetUserAsset 获取用户文件信息

func GetUserAssetAreaIDs

func GetUserAssetAreaIDs(ctx context.Context, hash, uid string) ([]string, error)

GetUserAssetAreaIDs 获取用户文件的调度器区域

func GetUserAssetByBuilder

func GetUserAssetByBuilder(ctx context.Context, sb squirrel.SelectBuilder) (*model.UserAsset, error)

func GetUserAssetByHash

func GetUserAssetByHash(ctx context.Context, hash string) (*model.UserAsset, error)

GetUserAssetByHash 获取最先上传文件的用户

func GetUserAssetCount

func GetUserAssetCount(ctx context.Context, hash string) (int64, error)

GetUserAssetCount 获取上传文件的用户数量

func GetUserAssetNotAreaIDs

func GetUserAssetNotAreaIDs(ctx context.Context, hash, uid string, areaID []string) ([]string, error)

GetUserAssetNotAreaIDs 返回不存在的area_id

func GetUserByBuilder

func GetUserByBuilder(ctx context.Context, sb squirrel.SelectBuilder) (*model.User, error)

func GetUserByRefCode

func GetUserByRefCode(ctx context.Context, refCode string) (*model.User, error)

func GetUserByUsername

func GetUserByUsername(ctx context.Context, username string) (*model.User, error)

func GetUserGroupByParent

func GetUserGroupByParent(ctx context.Context, userID string, pids []int64) ([]int64, error)

GetUserGroupByParent 通过父级id获取其第一层的子级id

func GetUserIds

func GetUserIds(ctx context.Context) ([]string, error)

func GetUserIncome

func GetUserIncome(cond *model.DeviceInfo, option QueryOption) (map[string]map[string]interface{}, error)

func GetUserL1Reward

func GetUserL1Reward(ctx context.Context, userId string) (*model.UserL1Reward, error)

func GetUserReferCodes

func GetUserReferCodes(ctx context.Context, userId string) ([]*model.ReferralCode, error)

func GetUserReferralCounter

func GetUserReferralCounter(ctx context.Context, userId string) (*model.ReferralCounter, error)

func GetUserReferralReward

func GetUserReferralReward(ctx context.Context, option QueryOption) ([]*model.UserReferralRecord, int64, error)

func GetUserReferrerNodesDailyStat

func GetUserReferrerNodesDailyStat(ctx context.Context, code string, option QueryOption) ([]*model.DateValue, error)

func GetUserReferrerUsersDailyStat

func GetUserReferrerUsersDailyStat(ctx context.Context, code string, option QueryOption) ([]*model.DateValue, error)

func GetUserRewardDetailsByUserID

func GetUserRewardDetailsByUserID(ctx context.Context, userId string) ([]*model.UserRewardDetail, error)

func GetVisitCount

func GetVisitCount(ctx context.Context, hash, user_id string) (int64, error)

func GetWorkerdNodes

func GetWorkerdNodes(ctx context.Context, areaId, nodeId string, option QueryOption) (int64, []*model.WorkerdNode, error)

func Init

func Init(cfg *config.Config) error

func InsertOrUpdateAssetTransferLog

func InsertOrUpdateAssetTransferLog(ctx context.Context, log *model.AssetTransferLog) error

func IsGeneratedOnlineIncentive

func IsGeneratedOnlineIncentive(ctx context.Context, date time.Time) (bool, error)

func ListAssetTransferDetail

func ListAssetTransferDetail(ctx context.Context, sb squirrel.SelectBuilder) ([]*model.AssetTransferLog, error)

func ListBannersCtx

func ListBannersCtx(ctx context.Context, platform int64, lang string) ([]*model.Ads, error)

func ListFilStorages

func ListFilStorages(ctx context.Context, path string, option QueryOption) ([]*model.FilStorage, int64, error)

func ListLoginLog

func ListLoginLog(ctx context.Context, option QueryOption) ([]*model.LoginLog, int64, error)

func ListNoticesCtx

func ListNoticesCtx(ctx context.Context, platform int64, lang string) ([]*model.Ads, error)

func ListOperationLog

func ListOperationLog(ctx context.Context, option QueryOption) ([]*model.OperationLog, int64, error)

func LoadAllUserReferralReward

func LoadAllUserReferralReward(ctx context.Context, option QueryOption) ([]*model.UserReferralRecord, error)

func MoveAssetGroup

func MoveAssetGroup(ctx context.Context, userID string, groupID, targetGroupID int) error

MoveAssetGroup move a asset group

func MoveBackDeletedDevice

func MoveBackDeletedDevice(ctx context.Context, ids []string, usedID string) error

MoveBackDeletedDevice 移回删除的设备

func NewLogTrace

func NewLogTrace(ctx context.Context, uid string, transferType string, area string) (string, error)

func OnlineIPCounts

func OnlineIPCounts(ctx context.Context) (map[string]interface{}, error)

func QueryMaxDeviceDailyInfo

func QueryMaxDeviceDailyInfo(ctx context.Context, deviceIds []string, start, end string) (map[string]*model.DeviceInfoDaily, error)

func ReleaseLock

func ReleaseLock(rdb *redis.Client, lockKey string, lockValue string) error

释放锁

func ReplaceSignInfo

func ReplaceSignInfo(info *model.SignInfo) error

func ResetPassword

func ResetPassword(ctx context.Context, passHash, username string) error

func SetDeviceProfileFromCache

func SetDeviceProfileFromCache(ctx context.Context, deviceId string, data map[string]string) error

func SetDeviceUserIdToCache

func SetDeviceUserIdToCache(ctx context.Context, deviceId, userId, areaId string) error

func SetEdgeConfig

func SetEdgeConfig(ctx context.Context, cfg *model.EdgeConfig) error

func SetMultipleDeviceUserIdToCache

func SetMultipleDeviceUserIdToCache(ctx context.Context, areaId string, keyVal map[string]string) error

func SetOnlineIPCountsToCache

func SetOnlineIPCountsToCache(ctx context.Context, data map[string]interface{}) error

func SumAllUsersReward

func SumAllUsersReward(ctx context.Context, eligibleOnlineMinutes int) ([]*model.UserReward, error)

func SumDeviceDailyBeforeDate

func SumDeviceDailyBeforeDate(ctx context.Context, deviceIds []string, end string) (map[string]*model.DeviceInfoDaily, error)

func SumFilStorage

func SumFilStorage(ctx context.Context) (int64, error)

func SumFullNodeInfoFromDeviceInfo

func SumFullNodeInfoFromDeviceInfo(ctx context.Context) (*model.FullNodeInfo, error)

func SumSystemInfo

func SumSystemInfo(ctx context.Context) (*model.SystemInfo, error)

func TranslateIPLocation

func TranslateIPLocation(ctx context.Context, info *model.DeviceInfo, lang model.Language)

func UpdateAppVersion

func UpdateAppVersion(ctx context.Context, appVer *model.AppVersion) error

func UpdateAssetBackupResult

func UpdateAssetBackupResult(ctx context.Context, cid string, backupResult int) error

func UpdateAssetCid

func UpdateAssetCid(ctx context.Context, hash, cid string) error

UpdateAssetCid 更新文件的cid信息

func UpdateAssetGroup

func UpdateAssetGroup(ctx context.Context, userID, hash string, groupID int) error

UpdateAssetGroup update user asset group

func UpdateAssetGroupName

func UpdateAssetGroupName(ctx context.Context, uid, rename string, groupID int) error

UpdateAssetGroupName update user asset group name

func UpdateAssetName

func UpdateAssetName(ctx context.Context, newName, uid, hash string) error

UpdateAssetName 更新用户文件名

func UpdateAssetPath

func UpdateAssetPath(ctx context.Context, cid string, path string) error

func UpdateAssetShareStatus

func UpdateAssetShareStatus(ctx context.Context, hash, userID string) error

UpdateAssetShareStatus 修改文件分享状态

func UpdateDeviceInfoDailyUser

func UpdateDeviceInfoDailyUser(ctx context.Context, deviceId, userId string) error

func UpdateDeviceName

func UpdateDeviceName(ctx context.Context, deviceInfo *model.DeviceInfo) error

func UpdateGroupShareStatus

func UpdateGroupShareStatus(ctx context.Context, userID string, groupID int64) error

UpdateGroupShareStatus 修改文件组分享状态

func UpdateIPFSRecordStatus

func UpdateIPFSRecordStatus(ctx context.Context, cids []string, areaID string) error

UpdateIPFSRecordStatus 更新ipfs文件同步状态

func UpdateKOL

func UpdateKOL(ctx context.Context, kol *model.KOL) error

func UpdateKOLLevel

func UpdateKOLLevel(ctx context.Context, kolUserId string, level int) error

func UpdateKOLLevelConfig

func UpdateKOLLevelConfig(ctx context.Context, levelConf *model.KOLLevelConfig) error

func UpdateLinkPassAndExpiration

func UpdateLinkPassAndExpiration(ctx context.Context, link *model.Link) error

func UpdateNodeOperationStatus

func UpdateNodeOperationStatus(ctx context.Context, uid, nodeID string, operation int64, hours ...int) error

UpdateNodeOperationStatus 修改节点操作状态

func UpdateSignature

func UpdateSignature(ctx context.Context, signature, nodeId, areaId, hash string) error

func UpdateSyncAssetAreas

func UpdateSyncAssetAreas(ctx context.Context, areaID string, hashs []string) error

func UpdateTest1DeviceName

func UpdateTest1DeviceName(ctx context.Context, id, name string) error

UpdateTest1DeviceName 编辑节点设备备注

func UpdateUnSyncAreaIDs

func UpdateUnSyncAreaIDs(ctx context.Context, uid, hash string, aids []string) error

UpdateUnSyncAreaIDs 更新未同步的区域

func UpdateUserAPIKeys

func UpdateUserAPIKeys(ctx context.Context, id int64, buf []byte) error

UpdateUserAPIKeys 更新用户密钥

func UpdateUserAsset

func UpdateUserAsset(ctx context.Context, asset *model.UserAsset) error

func UpdateUserDeviceInfo

func UpdateUserDeviceInfo(ctx context.Context, deviceInfo *model.DeviceInfo) error

func UpdateUserTotalSize

func UpdateUserTotalSize(ctx context.Context, un string, ts int64) error

func UpdateUserWalletAddress

func UpdateUserWalletAddress(ctx context.Context, username, address string) error

func UpsertFullNodeInfo

func UpsertFullNodeInfo(ctx context.Context, fullNodeInfo *model.FullNodeInfo) error

func UpsertKOLs

func UpsertKOLs(ctx context.Context, kols []*model.KOL) error

func UpsertLocationInfo

func UpsertLocationInfo(ctx context.Context, out *model.Location, lang model.Language) error

func UpsertSystemInfo

func UpsertSystemInfo(ctx context.Context, systemInfo *model.SystemInfo) error

func UserAssetAreaIDs

func UserAssetAreaIDs(ctx context.Context, uid, hash string) ([]string, error)

UserAssetAreaIDs 获取用户文件的区域id

Types

type ActiveInfoOut

type ActiveInfoOut struct {
	DeviceId     string `db:"device_id" json:"device_id"`
	ActiveStatus string `db:"active_status" json:"active_status"`
	Secret       string `db:"secret" json:"secret"`
}

type AssetCIDInfo

type AssetCIDInfo struct {
	CID  string `db:"cid"`
	Hash string `db:"hash"`
}

AssetCIDInfo 文件cid信息

type AssetGroup

type AssetGroup struct {
	ID          int64     `db:"id"`
	UserID      string    `db:"user_id"`
	Name        string    `db:"name"`
	Parent      int64     `db:"parent"`
	AssetCount  int64     `db:"asset_count"`
	AssetSize   int64     `db:"asset_size"`
	CreatedTime time.Time `db:"created_time"`
	ShareStatus int64     `db:"share_status"`
	VistitCount int64     `db:"visit_count"`
}

AssetGroup user asset group

func CreateAssetGroup

func CreateAssetGroup(ctx context.Context, uid, name string, parent int) (*AssetGroup, error)

CreateAssetGroup 创建文件夹

func GetUserAssetGroupInfo

func GetUserAssetGroupInfo(ctx context.Context, uid string, gid int) (*AssetGroup, error)

GetUserAssetGroupInfo

type CacheStatistics

type CacheStatistics struct {
	Date       string  `json:"date" db:"date"`
	BlockCount float64 `json:"block_count" db:"block_count"`
}

func GetCacheInfoDaysList

func GetCacheInfoDaysList(ctx context.Context, where string, option QueryOption) ([]*CacheStatistics, error)

func GetCacheInfoHourList

func GetCacheInfoHourList(ctx context.Context, where string, option QueryOption) ([]*CacheStatistics, error)

func QueryCacheDaily

func QueryCacheDaily(deviceID, startTime, endTime string) []*CacheStatistics

func QueryCacheHour

func QueryCacheHour(deviceID, startTime, endTime string) []*CacheStatistics

type ComprehensiveStats

type ComprehensiveStats struct {
	TotalDownloads   int     `db:"total_downloads" json:"total_downloads"`
	TotalUploads     int     `db:"total_uploads" json:"total_uploads"`
	DownloadSuccess  int     `db:"download_success" json:"download_success"`
	UploadSuccess    int     `db:"upload_success" json:"upload_success"`
	DownloadFailure  int     `db:"download_failure" json:"download_failure"`
	UploadFailure    int     `db:"upload_failure" json:"upload_failure"`
	DownloadSize     int     `db:"download_size" json:"download_size"`
	UploadSize       int     `db:"upload_size" json:"upload_size"`
	DownloadAvgSpeed float64 `db:"download_avg_speed" json:"download_avg_speed"`
	UploadAvgSpeed   float64 `db:"upload_avg_speed" json:"upload_avg_speed"`
}

func GetComprehensiveStatsInPeriod

func GetComprehensiveStatsInPeriod(ctx context.Context, start, end int64, area string) (*ComprehensiveStats, error)

获取所有统计数据

func GetComprehensiveStatsInPeriodByUser

func GetComprehensiveStatsInPeriodByUser(ctx context.Context, start, end int64, username string) (*ComprehensiveStats, error)

获取用户的统计

type ComprehensiveStatsWithDay

type ComprehensiveStatsWithDay struct {
	*ComprehensiveStats
	Day string `db:"day" json:"day"`
}

func GetComprehensiveStatsInPeriodByUserGroupByDay

func GetComprehensiveStatsInPeriodByUserGroupByDay(ctx context.Context, start, end int64, username string) ([]*ComprehensiveStatsWithDay, error)

type DashBoardInfo

type DashBoardInfo struct {
	Date           int64  `db:"hour" json:"-"`
	DateStr        string `db:"-" json:"date"`
	DownloadCount  int64  `db:"download_count" json:"DownloadCount"`
	PeakBandwidth  int64  `db:"peak_bandwidth" json:"PeakBandwidth"`
	TotalBandwidth int64  `db:"total_traffic" json:"TotalBandwidth"`
}

DashBoardInfo 仪表盘数据信息

func GetUserDashboardInfos

func GetUserDashboardInfos(ctx context.Context, uid string, ts time.Time) ([]DashBoardInfo, error)

GetUserDashboardInfos 通过用户id获取最近24小时的信息

type DeviceStatistics

type DeviceStatistics struct {
	Date              string  `json:"date" db:"date"`
	NatRatio          float64 `json:"nat_ratio" db:"nat_ratio"`
	DiskUsage         float64 `json:"disk_usage" db:"disk_usage"`
	DiskSpace         float64 `json:"disk_space" db:"disk_space"`
	Latency           float64 `json:"latency" db:"latency"`
	PkgLossRatio      float64 `json:"pkg_loss_ratio" db:"pkg_loss_ratio"`
	Income            float64 `json:"income" db:"income"`
	OnlineTime        float64 `json:"online_time" db:"online_time"`
	BandwidthUp       float64 `db:"bandwidth_up" json:"bandwidth_up"`
	BandwidthDown     float64 `db:"bandwidth_down" json:"bandwidth_down"`
	UpstreamTraffic   float64 `json:"upstream_traffic" db:"upstream_traffic"`
	DownstreamTraffic float64 `json:"downstream_traffic" db:"downstream_traffic"`
	RetrievalCount    float64 `json:"retrieval_count" db:"retrieval_count"`
	BlockCount        float64 `json:"block_count" db:"block_count"`
	NodeCount         float64 `json:"node_count" db:"node_count"`
}

func GetDeviceInfoDailyList

func GetDeviceInfoDailyList(ctx context.Context, cond *model.DeviceInfoDaily, option QueryOption) ([]*DeviceStatistics, error)

func GetDeviceInfoDailyListAppendDays

func GetDeviceInfoDailyListAppendDays(ctx context.Context, cond *model.DeviceInfoDaily, option QueryOption) ([]*DeviceStatistics, error)

func GetDeviceInfoHourList

func GetDeviceInfoHourList(ctx context.Context, cond *model.DeviceInfoHour, option QueryOption) ([]*DeviceStatistics, error)

func GetLatestDeviceStat

func GetLatestDeviceStat(ctx context.Context, deviceId string, start string) (DeviceStatistics, error)

func GetNodesInfoDailyList

func GetNodesInfoDailyList(ctx context.Context, cond *model.DeviceInfoDaily, option QueryOption) ([]*DeviceStatistics, error)

type FullNodeDaysInfo

type FullNodeDaysInfo struct {
	Date                     string  `json:"date" db:"date"`
	TotalNodeCount           int64   `db:"total_node_count" json:"total_node_count"`
	OnlineNodeCount          int64   `db:"online_node_count" json:"online_node_count"`
	SPNodeCount              int64   `db:"sp_node_count" json:"sp_node_count"`
	L1NodeCount              int64   `db:"l1_count" json:"l1_count"`
	OnlineL1NodeCount        int64   `db:"online_l1_count" json:"online_l1_count"`
	L2NodeCount              int64   `db:"l2_count" json:"l2_count"`
	OnlineL2NodeCount        int64   `db:"online_l2_count" json:"online_l2_count"`
	TUpstreamFileCount       int64   `db:"t_upstream_file_count" json:"t_upstream_file_count"`
	TotalStorage             float64 `db:"total_storage" json:"total_storage"`
	StorageUsed              float64 `db:"storage_used" json:"storage_used"`
	TotalUpstreamBandwidth   float64 `db:"total_upstream_bandwidth" json:"total_upstream_bandwidth"`
	TotalDownstreamBandwidth float64 `db:"total_downstream_bandwidth" json:"total_downstream_bandwidth"`
}

func GetNodesDaysList

func GetNodesDaysList(ctx context.Context, option QueryOption) ([]*FullNodeDaysInfo, error)

func QueryNodesDailyInfo

func QueryNodesDailyInfo(startTime, endTime string) []*FullNodeDaysInfo

type KVMap

type KVMap struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

KVMap 键值映射

type ListAssetGroupRsp

type ListAssetGroupRsp struct {
	Total       int64         `json:"total"`
	AssetGroups []*AssetGroup `json:"infos"`
}

ListAssetGroupRsp list asset group records

func ListAssetGroupForUser

func ListAssetGroupForUser(ctx context.Context, uid string, parent, limit, offset int) (*ListAssetGroupRsp, error)

ListAssetGroupForUser 根据用户获取对应的文件夹信息

type MapInfo

type MapInfo struct {
	Name     string    `json:"name"`
	NodeType string    `json:"nodeType"`
	Ip       string    `json:"ip"`
	Value    []float64 `json:"value"`
}

func GetDeviceMapInfo

func GetDeviceMapInfo(ctx context.Context, lang model.Language, deviceId string) ([]*MapInfo, error)

func GetMapInfoFromCache

func GetMapInfoFromCache(ctx context.Context, lang model.Language) ([]*MapInfo, error)

type NodeStatus

type NodeStatus struct {
	Status int64 `db:"status"` // 1-在线 2-故障 3-离线 11-已退出
	Num    int64 `db:"num"`
}

NodeStatus 节点状态数量

type NodeStatusInfo

type NodeStatusInfo struct {
	Name     string `db:"device_name" json:"name"`
	AreaID   string `db:"area_id" json:"area_id"`
	DeviceID string `db:"device_id" json:"node_id"`
	Status   int64  `db:"status" json:"status"` // 1-在线 2-故障 3-离线 11-已退出
	ExpTime  int64  `db:"deactive_time" json:"exp_time"`
}

NodeStatusInfo 节点状态信息

type OnlyUserGroupAsset

type OnlyUserGroupAsset struct {
	CID    string `db:"cid"`
	Num    int64  `db:"num"`
	AreaID string `db:"area_id"`
}

OnlyUserGroupAsset 唯一存在的用户组文件

type QueryOption

type QueryOption struct {
	Page       int            `json:"page"`
	PageSize   int            `json:"page_size"`
	Order      string         `json:"order"`
	OrderField string         `json:"order_field"`
	StartTime  string         `json:"start_time"`
	EndTime    string         `json:"end_time" `
	UserID     string         `json:"user_id"`
	NotBound   string         `json:"not_bound"`
	Lang       model.Language `json:"-"`
}

func OptionHandle

func OptionHandle(startTime, endTime string) QueryOption

type StatsLimitUser

type StatsLimitUser struct {
	ID            int64  `db:"id" json:"id"`
	Uuid          string `db:"uuid" json:"uuid"`
	Username      string `db:"username" json:"username"`
	UserEmail     string `db:"user_email" json:"user_email"`
	WalletAddress string `db:"wallet_address" json:"wallet_address"`
	TenantID      string `db:"tenant_id" json:"tenant_id"`
}

func ListUserByBuilder

func ListUserByBuilder(ctx context.Context, page, size int64, sb squirrel.SelectBuilder) ([]*StatsLimitUser, int64, error)

type SubAssetDetail

type SubAssetDetail struct {
	Cid       string `db:"cid"`
	TotalSize int64  `db:"total_size"`
}

SubAssetDetail 部分用户文件信息

type UserAndQuest

type UserAndQuest struct {
	ID                     int64     `db:"id" json:"id"`
	Uuid                   string    `db:"uuid" json:"uuid"`
	Avatar                 string    `db:"avatar" json:"avatar"`
	Username               string    `db:"username" json:"username"`
	PassHash               string    `db:"pass_hash" json:"-"`
	UserEmail              string    `db:"user_email" json:"user_email"`
	WalletAddress          string    `db:"wallet_address" json:"wallet_address"`
	Role                   int32     `db:"role" json:"role"`
	AllocateStorage        int       `db:"allocate_storage" json:"allocate_storage"`
	ProjectId              int64     `db:"project_id"`
	Referrer               string    `db:"referrer" json:"referrer"`
	ReferrerUserId         string    `db:"referrer_user_id" json:"-"`
	ReferralCode           string    `db:"referral_code" json:"referral_code"`
	Reward                 float64   `db:"reward" json:"reward"`
	ReferralReward         float64   `db:"referral_reward" json:"referral_reward"`
	ClosedTestReward       float64   `db:"closed_test_reward" json:"closed_test_reward"`
	HuygensReward          float64   `db:"huygens_reward" json:"huygens_reward"`
	HuygensReferralReward  float64   `db:"huygens_referral_reward" json:"huygens_referral_reward"`
	HerschelReward         float64   `db:"herschel_reward" json:"herschel_reward"`
	HerschelReferralReward float64   `db:"herschel_referral_reward" json:"herschel_referral_reward"`
	CassiniReward          float64   `db:"cassini_reward" json:"cassini_reward"`
	CassiniReferralReward  float64   `db:"cassini_referral_reward" json:"cassini_referral_reward"`
	DeviceCount            int64     `db:"device_count" json:"device_count"`
	CreatedAt              time.Time `db:"created_at" json:"created_at"`
	HerschelCredits        int64     `json:"herschel_credits" db:"-"`
	HerschelInviteCredits  int64     `json:"herschel_invite_credits" db:"-"`
	CassiniCredits         int64     `json:"cassini_credits" db:"-"`
	CassiniInviteCredits   int64     `json:"cassini_invite_credits" db:"-"`
	OnlineIncentiveReward  float64   `json:"online_incentive_reward" db:"-"`
	UpdatedAt              time.Time `db:"updated_at" json:"-"`
	DeletedAt              time.Time `db:"deleted_at" json:"-"`
}

type UserAssetDetail

type UserAssetDetail struct {
	UserID      string    `db:"user_id"`
	Hash        string    `db:"hash"`
	Cid         string    `db:"cid"`
	AreaIDs     []string  `db:"-" json:"area_ids"`
	AreaIDMaps  []KVMap   `db:"-" json:"area_maps"`
	AssetName   string    `db:"asset_name"`
	AssetType   string    `db:"asset_type"`
	ShareStatus int64     `db:"share_status"`
	Expiration  time.Time `db:"expiration"`
	CreatedTime time.Time `db:"created_time"`
	TotalSize   int64     `db:"total_size"`
	Password    string    `db:"password"`
	GroupID     int64     `db:"group_id"`
	VisitCount  int64     `db:"visit_count"`
}

UserAssetDetail 用户表详情

func GetUserAssetDetail

func GetUserAssetDetail(ctx context.Context, hash, uid string) (*UserAssetDetail, error)

GetUserAssetDetail 获取用户文件信息

func ListAssets

func ListAssets(ctx context.Context, uid string, limit, offset, groupID int) (int64, []*UserAssetDetail, error)

ListAssets 获取对应文件夹的文件列表

type UserDeviceProfile

type UserDeviceProfile struct {
	CumulativeProfit float64 `json:"cumulative_profit" db:"cumulative_profit"`
	YesterdayProfit  float64 `json:"yesterday_profit" db:"yesterday_profit"`
	TodayProfit      float64 `json:"today_profit" db:"today_profit"`
	SevenDaysProfit  float64 `json:"seven_days_profit" db:"seven_days_profit"`
	MonthProfit      float64 `json:"month_profit" db:"month_profit"`
	NodeType         *int    `json:"node_type" db:"node_type"`
	TotalNum         int64   `json:"total_num" db:"total_num"`
	OnlineNum        int64   `json:"online_num" db:"online_num"`
	OfflineNum       int64   `json:"offline_num" db:"offline_num"`
	AbnormalNum      int64   `json:"abnormal_num" db:"abnormal_num"`
	TotalBandwidth   float64 `json:"total_bandwidth" db:"total_bandwidth"`
}

func CountUserDeviceInfo

func CountUserDeviceInfo(ctx context.Context, userID string) (*UserDeviceProfile, error)

type UserInfoRes

type UserInfoRes struct {
	Date           string `json:"date" db:"date"`
	TotalBandwidth int64  `db:"total_bandwidth"`
	PeakBandwidth  int64  `db:"peak_bandwidth"`
	DownloadCount  int64  `db:"download_count"`
}

func GetStorageInfoDaysList

func GetStorageInfoDaysList(ctx context.Context, userId string, option QueryOption) ([]*UserInfoRes, error)

func GetStorageInfoHourList

func GetStorageInfoHourList(ctx context.Context, userId string, option QueryOption) ([]*UserInfoRes, error)

type UserStorageFlowInfo

type UserStorageFlowInfo struct {
	TotalTraffic  int64 `db:"total_traffic"`
	PeakBandwidth int64 `db:"peak_bandwidth"`
}

UserStorageFlowInfo 用户存储流量信息

func GetUserStorageFlowInfo

func GetUserStorageFlowInfo(ctx context.Context, uid string) (*UserStorageFlowInfo, error)

GetUserStorageFlowInfo 获取用户存储流量信息

Jump to

Keyboard shortcuts

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