初始化项目
This commit is contained in:
157
model/dto/application_dto.go
Normal file
157
model/dto/application_dto.go
Normal file
@@ -0,0 +1,157 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// CreateApplicationReq 创建应用请求
|
||||
type CreateApplicationReq struct {
|
||||
g.Meta `path:"createApplication" method:"post" summary:"创建应用"`
|
||||
|
||||
TenantID int64 `json:"tenantId" v:"required#租户ID不能为空"`
|
||||
Name string `json:"name" v:"required#应用名称不能为空"`
|
||||
Code string `json:"code" v:"required#应用编码不能为空"`
|
||||
Description string `json:"description"`
|
||||
Platform string `json:"platform" v:"required#平台不能为空|in:web,h5,android,ios#平台类型错误"`
|
||||
PackageName string `json:"packageName"`
|
||||
AppStoreURL string `json:"appStoreUrl"`
|
||||
Categories []string `json:"categories"`
|
||||
Tags []string `json:"tags"`
|
||||
AdTypes []string `json:"adTypes"`
|
||||
CallbackURL string `json:"callbackUrl"`
|
||||
}
|
||||
|
||||
// CreateApplicationRes 创建应用响应
|
||||
type CreateApplicationRes struct {
|
||||
ID int64 `json:"id"`
|
||||
AppKey string `json:"appKey"`
|
||||
AppSecret string `json:"appSecret"`
|
||||
}
|
||||
|
||||
// UpdateApplicationReq 更新应用请求
|
||||
type UpdateApplicationReq struct {
|
||||
g.Meta `path:"updateApplication" method:"put" summary:"更新应用"`
|
||||
|
||||
ID int64 `json:"id" v:"required#应用ID不能为空"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
Platform string `json:"platform" v:"in:web,h5,android,ios#平台类型错误"`
|
||||
PackageName string `json:"packageName"`
|
||||
AppStoreURL string `json:"appStoreUrl"`
|
||||
Categories []string `json:"categories"`
|
||||
Tags []string `json:"tags"`
|
||||
AdTypes []string `json:"adTypes"`
|
||||
CallbackURL string `json:"callbackUrl"`
|
||||
}
|
||||
|
||||
// UpdateApplicationRes 更新应用响应
|
||||
type UpdateApplicationRes struct {
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
|
||||
// GetApplicationReq 获取应用请求
|
||||
type GetApplicationReq struct {
|
||||
g.Meta `path:"getApplication" method:"get" summary:"获取应用信息"`
|
||||
|
||||
ID int64 `json:"id" v:"required#应用ID不能为空"`
|
||||
}
|
||||
|
||||
// GetApplicationRes 获取应用响应
|
||||
type GetApplicationRes struct {
|
||||
ID int64 `json:"id"`
|
||||
TenantID int64 `json:"tenantId"`
|
||||
Name string `json:"name"`
|
||||
Code string `json:"code"`
|
||||
Description string `json:"description"`
|
||||
Platform string `json:"platform"`
|
||||
PackageName string `json:"packageName"`
|
||||
AppStoreURL string `json:"appStoreUrl"`
|
||||
Categories []string `json:"categories"`
|
||||
Tags []string `json:"tags"`
|
||||
AdTypes []string `json:"adTypes"`
|
||||
Status string `json:"status"`
|
||||
AppKey string `json:"appKey"`
|
||||
CallbackURL string `json:"callbackUrl"`
|
||||
CreatedAt int64 `json:"createdAt"`
|
||||
UpdatedAt int64 `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// ListApplicationsReq 获取应用列表请求
|
||||
type ListApplicationsReq struct {
|
||||
g.Meta `path:"listApplications" method:"get" summary:"获取应用列表"`
|
||||
|
||||
TenantID int64 `json:"tenantId" v:"required#租户ID不能为空"`
|
||||
Platform string `json:"platform"`
|
||||
Status string `json:"status"`
|
||||
Page int `json:"page" d:"1"`
|
||||
Size int `json:"size" d:"20"`
|
||||
}
|
||||
|
||||
// ListApplicationsRes 获取应用列表响应
|
||||
type ListApplicationsRes struct {
|
||||
List []ApplicationItem `json:"list"`
|
||||
Total int64 `json:"total"`
|
||||
Page int `json:"page"`
|
||||
Size int `json:"size"`
|
||||
}
|
||||
|
||||
// ApplicationItem 应用列表项
|
||||
type ApplicationItem struct {
|
||||
ID int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Code string `json:"code"`
|
||||
Description string `json:"description"`
|
||||
Platform string `json:"platform"`
|
||||
PackageName string `json:"packageName"`
|
||||
Categories []string `json:"categories"`
|
||||
Tags []string `json:"tags"`
|
||||
AdTypes []string `json:"adTypes"`
|
||||
Status string `json:"status"`
|
||||
DailyRequests int64 `json:"dailyRequests"`
|
||||
MonthlyRequests int64 `json:"monthlyRequests"`
|
||||
CreatedAt int64 `json:"createdAt"`
|
||||
}
|
||||
|
||||
// ResetAPIKeysReq 重置API密钥请求
|
||||
type ResetAPIKeysReq struct {
|
||||
g.Meta `path:"/applications-reset-keys" method:"post" summary:"重置API密钥"`
|
||||
|
||||
ID int64 `json:"id" v:"required#应用ID不能为空"`
|
||||
}
|
||||
|
||||
// ResetAPIKeysRes 重置API密钥响应
|
||||
type ResetAPIKeysRes struct {
|
||||
AppKey string `json:"appKey"`
|
||||
AppSecret string `json:"appSecret"`
|
||||
}
|
||||
|
||||
// ValidateApplicationReq 验证应用请求
|
||||
type ValidateApplicationReq struct {
|
||||
g.Meta `path:"/applications-validate" method:"post" summary:"验证应用权限"`
|
||||
|
||||
AppKey string `json:"appKey" v:"required#应用密钥不能为空"`
|
||||
AppSecret string `json:"appSecret" v:"required#应用密钥不能为空"`
|
||||
}
|
||||
|
||||
// ValidateApplicationRes 验证应用响应
|
||||
type ValidateApplicationRes struct {
|
||||
Valid bool `json:"valid"`
|
||||
AppID int64 `json:"appId"`
|
||||
AppName string `json:"appName"`
|
||||
TenantID int64 `json:"tenantId"`
|
||||
TenantName string `json:"tenantName"`
|
||||
Platform string `json:"platform"`
|
||||
AdTypes []string `json:"adTypes"`
|
||||
}
|
||||
|
||||
// DeleteApplicationReq 删除应用请求
|
||||
type DeleteApplicationReq struct {
|
||||
g.Meta `path:"/applications" method:"delete" summary:"删除应用"`
|
||||
|
||||
ID int64 `json:"id" v:"required#应用ID不能为空"`
|
||||
}
|
||||
|
||||
// DeleteApplicationRes 删除应用响应
|
||||
type DeleteApplicationRes struct {
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
Reference in New Issue
Block a user