Files
Mycontent/soul-api/internal/model/open_platform.go
Alex-larget d4399a5d7a chore: update project index and meeting notes for March 31, 2026
- Added new entries for meetings discussing the integration of the "超级个体" and "@" lists across various project components.
- Updated the last modified date to March 31, 2026, in multiple project index files.
- Enhanced the read page functionality to include user phone number in navigation to other mini-programs.
- Documented changes in the sync log for assistant-doc-sync regarding the meeting outcomes.
2026-03-31 18:10:02 +08:00

34 lines
1.7 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package model
import "time"
// OpenPlatformApiKey 开放平台 API Key仅存哈希创建时一次性返回明文
type OpenPlatformApiKey struct {
ID uint `gorm:"primaryKey" json:"id"`
Name string `gorm:"size:120;not null;default:''" json:"name"`
KeyPrefix string `gorm:"size:48;not null;column:key_prefix" json:"keyPrefix"`
KeyHash string `gorm:"size:64;not null;column:key_hash" json:"-"`
RevokedAt *time.Time `gorm:"column:revoked_at" json:"revokedAt,omitempty"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
func (OpenPlatformApiKey) TableName() string { return "open_platform_api_keys" }
// OpenPlatformApiLog 开放平台请求明细(由网关/中间件写入;管理端查询)
type OpenPlatformApiLog struct {
ID uint `gorm:"primaryKey" json:"id"`
ApiKeyID uint `gorm:"not null;index;column:api_key_id" json:"apiKeyId"`
KeyPrefix string `gorm:"size:48;default:'';column:key_prefix" json:"keyPrefix"`
Method string `gorm:"size:16;default:''" json:"method"`
Path string `gorm:"size:512;default:''" json:"path"`
StatusCode int `gorm:"column:status_code" json:"statusCode"`
ClientIP string `gorm:"size:64;default:'';column:client_ip" json:"clientIp"`
DurationMs int `gorm:"column:duration_ms" json:"durationMs"`
RequestBody string `gorm:"type:text;column:request_body" json:"requestBody"`
ResponseBody string `gorm:"type:text;column:response_body" json:"responseBody"`
CreatedAt time.Time `gorm:"index" json:"createdAt"`
}
func (OpenPlatformApiLog) TableName() string { return "open_platform_api_logs" }