初始化项目

This commit is contained in:
2025-12-10 15:41:52 +08:00
parent 339dd97f66
commit 232009bbc2
25 changed files with 419 additions and 467 deletions

View File

@@ -61,3 +61,10 @@ type GetCIDHistoryRes struct {
Page int `json:"page"` // 当前页
Size int `json:"size"` // 每页数量
}
// TenantInfo 租户信息
type TenantInfo struct {
Id string `json:"id"` // 租户ID
Name string `json:"name"` // 租户名称
Level string `json:"level"` // 租户级别
}

View File

@@ -13,7 +13,7 @@ type ReportGenerateReq struct {
// 报表生成响应
type ReportGenerateResp struct {
ReportID int64 `json:"report_id"`
ReportID string `json:"report_id"`
ReportType string `json:"report_type"`
ReportDate string `json:"report_date"`
Data interface{} `json:"data"`

View File

@@ -6,12 +6,11 @@ import (
// AdSource 广告源实体
type AdSource struct {
Id int64 `json:"id"` // 主键ID
Id string `json:"id"` // 主键ID
CreatedAt time.Time `json:"createdAt"` // 创建时间
UpdatedAt time.Time `json:"updatedAt"` // 更新时间
Creator string `json:"creator"` // 创建者
Updater string `json:"updater"` // 更新者
TenantId int64 `json:"tenantId"` // 租户ID
IsDeleted bool `json:"isDeleted"` // 是否删除
// 基本信息

View File

@@ -6,13 +6,12 @@ import (
// Application 应用实体
type Application struct {
Id int64 `json:"id"` // 主键ID
CreatedAt time.Time `json:"createdAt"` // 创建时间
UpdatedAt time.Time `json:"updatedAt"` // 更新时间
Creator string `json:"creator"` // 创建者
Updater string `json:"updater"` // 更新者
TenantId int64 `json:"tenantId"` // 租户ID
IsDeleted bool `json:"isDeleted"` // 是否删除
Id string `json:"_id,omitempty" bson:"_id,omitempty"` // 主键ID
CreatedAt time.Time `json:"createdAt"` // 创建时间
UpdatedAt time.Time `json:"updatedAt"` // 更新时间
Creator string `json:"creator"` // 创建者
Updater string `json:"updater"` // 更新者
IsDeleted bool `json:"isDeleted"` // 是否删除
// 应用信息
Name string `json:"name"` // 应用名称

View File

@@ -8,13 +8,12 @@ const CidRequestCollection = "cid_request"
// CidRequest CID请求实体
type CidRequest struct {
do.MongoBaseDO `bson:",inline"` // 嵌入基础字段Id, Creator, CreatedAt, Updater, UpdatedAt, TenantId, IsDeleted
do.MongoBaseDO `bson:",inline"` // 嵌入基础字段Id, Creator, CreatedAt, Updater, UpdatedAt, IsDeleted
// 请求信息
RequestID string `bson:"requestId" json:"requestId"` // 请求唯一ID
SessionID string `bson:"sessionId" json:"sessionId"` // 会话ID
UserID string `bson:"userId" json:"userId"` // 用户ID
TenantID string `bson:"tenantId" json:"tenantId"` // 租户ID
IPAddress string `bson:"ipAddress" json:"ipAddress"` // IP地址
UserAgent string `bson:"userAgent" json:"userAgent"` // 用户代理
Referer string `bson:"referer" json:"referer"` // 来源页面

View File

@@ -6,16 +6,16 @@ import (
// StatReport 统计报表实体
type StatReport struct {
Id int64 `json:"id"` // 主键ID
CreatedAt time.Time `json:"createdAt"` // 创建时间
UpdatedAt time.Time `json:"updatedAt"` // 更新时间
Creator string `json:"creator"` // 创建者
Updater string `json:"updater"` // 更新者
TenantId int64 `json:"tenantId"` // 租户ID
IsDeleted bool `json:"isDeleted"` // 是否删除
Id string `json:"_id,omitempty" bson:"_id,omitempty"` // 主键ID
CreatedAt time.Time `json:"createdAt"` // 创建时间
UpdatedAt time.Time `json:"updatedAt"` // 更新时间
Creator string `json:"creator"` // 创建者
Updater string `json:"updater"` // 更新者
IsDeleted bool `json:"isDeleted"` // 是否删除
// 报表基本信息
AppID int64 `json:"appId"` // 应用ID (0表示所有应用)
TenantId int64 `json:"tenantId"` // 租户ID
AppID string `json:"appId"` // 应用ID (空字符串表示所有应用)
ReportType string `json:"reportType"` // 报表类型daily, weekly, monthly, quarterly, yearly
ReportDate time.Time `json:"reportDate"` // 报表日期
GeneratedAt time.Time `json:"generatedAt"` // 生成时间

View File

@@ -9,7 +9,6 @@ type Strategy struct {
Id int64 `json:"id" orm:"id,primary"` // ID
Name string `json:"name" orm:"name"` // 策略名称
Description string `json:"description" orm:"description"` // 描述
TenantLevel string `json:"tenant_level" orm:"tenant_level"` // 适用租户级别
MinConversion float64 `json:"min_conversion" orm:"min_conversion"` // 最低转化率
MaxConversion float64 `json:"max_conversion" orm:"max_conversion"` // 最高转化率
SourceWeights string `json:"source_weights" orm:"source_weights"` // 广告源权重 (JSON格式)

View File

@@ -1,39 +0,0 @@
package entity
import (
"gitee.com/red-future---jilin-g/common/do"
)
const TenantCollection = "tenant"
// Tenant 租户实体
type Tenant struct {
do.MongoBaseDO `bson:",inline"`
// 租户信息
Name string `bson:"name" json:"name"` // 租户名称
Code string `bson:"code" json:"code"` // 租户编码
Description string `bson:"description" json:"description"` // 租户描述
Logo string `bson:"logo" json:"logo"` // 租户Logo
Domain string `bson:"domain" json:"domain"` // 租户域名
// 联系信息
ContactName string `bson:"contactName" json:"contactName"` // 联系人姓名
ContactPhone string `bson:"contactPhone" json:"contactPhone"` // 联系电话
ContactEmail string `bson:"contactEmail" json:"contactEmail"` // 联系邮箱
// 状态信息
Status string `bson:"status" json:"status"` // 状态active, inactive, suspended
PackageType string `bson:"packageType" json:"packageType"` // 套餐类型basic, standard, premium
ExpireTime int64 `bson:"expireTime" json:"expireTime"` // 套餐到期时间
// 限制信息
MaxApps int64 `bson:"maxApps" json:"maxApps"` // 最大应用数
MaxUsers int64 `bson:"maxUsers" json:"maxUsers"` // 最大用户数
MaxRequestPerDay int64 `bson:"maxRequestPerDay" json:"maxRequestPerDay"` // 每日最大请求数
// 配置信息
Config map[string]interface{} `bson:"config" json:"config"` // 租户配置
Remark string `bson:"remark" json:"remark"` // 备注
}

View File

@@ -1,9 +0,0 @@
package types
// Tenant 租户信息类型
type Tenant struct {
Id int64 `json:"id"` // 租户ID
Name string `json:"name"` // 租户名称
Level string `json:"level"` // 租户级别: basic, standard, premium
Status string `json:"status"` // 状态: active, inactive
}