2025-04-11 12:15:45 +00:00
|
|
|
|
package bus_models
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"go-admin/app/admin/models"
|
|
|
|
|
"time"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
AESKey = "3ca176c2d9d0273695f48c55c3170e32d204e125ac06c050c94e0fcec01679ed"
|
|
|
|
|
ShowCount = 100 // 前端展示手机号数量
|
|
|
|
|
)
|
|
|
|
|
|
2025-04-23 10:00:14 +00:00
|
|
|
|
// SmsTask 短信下行记录
|
2025-04-11 12:15:45 +00:00
|
|
|
|
type SmsTask struct {
|
|
|
|
|
models.Model
|
|
|
|
|
|
2025-04-18 10:08:14 +00:00
|
|
|
|
CooperativeNumber string `gorm:"column:cooperative_number"` // 合作商编号
|
|
|
|
|
CooperativeName string `gorm:"column:cooperative_name"` // 合作商名称
|
|
|
|
|
BatchID string `gorm:"column:batch_id"` // 批次ID
|
|
|
|
|
ImportID string `gorm:"column:import_id"` // 导入记录ID(UUID,可为空)
|
|
|
|
|
SmsContent string `gorm:"column:sms_content"` // 短信内容
|
|
|
|
|
SmsContentCost int `gorm:"column:sms_content_cost"` // 短信内容消耗条数
|
|
|
|
|
TotalPhoneCount int `gorm:"column:total_phone_count"` // 手机号总数
|
|
|
|
|
TotalSmsCount int `gorm:"column:total_sms_count"` // 短信计费条数(条数 * 手机数)
|
|
|
|
|
Status int `gorm:"column:status"` // 任务状态(0待发送 1发送中 2已完成 3失败 4取消)
|
|
|
|
|
InterceptFailCount int `gorm:"column:intercept_fail_count"` // 拦截失败数量
|
|
|
|
|
ChannelFailCount int `gorm:"column:channel_fail_count"` // 通道失败数量
|
|
|
|
|
ScheduleTime *time.Time `gorm:"schedule_time"` // 计划发送时间(定时时间)
|
2025-04-11 12:15:45 +00:00
|
|
|
|
}
|
|
|
|
|
|
2025-04-23 10:00:14 +00:00
|
|
|
|
// SmsTaskBatch 短信批量任务记录
|
2025-04-11 12:15:45 +00:00
|
|
|
|
type SmsTaskBatch struct {
|
|
|
|
|
models.Model
|
|
|
|
|
|
2025-04-18 10:08:14 +00:00
|
|
|
|
TaskID uint64 `gorm:"column:task_id"` // 关联任务ID
|
|
|
|
|
BatchID string `gorm:"column:batch_id"` // 批次ID
|
|
|
|
|
CooperativeNumber string `gorm:"column:cooperative_number"` // 合作商编号
|
|
|
|
|
CooperativeName string `gorm:"column:cooperative_name"` // 合作商名称
|
|
|
|
|
ImportID string `gorm:"column:import_id"` // 导入记录ID(UUID,可为空)
|
|
|
|
|
Num int `gorm:"column:num"` // 本次批次编号
|
|
|
|
|
PhoneCount int `gorm:"column:phone_count"` // 本批手机号数量
|
|
|
|
|
SmsCount int `gorm:"column:sms_count"` // 本批短信条数
|
|
|
|
|
SmsContent string `gorm:"column:sms_content"` // 短信内容
|
|
|
|
|
Status int `gorm:"column:status"` // 状态(0待发 1发送中 2已完成 3失败 4取消)
|
|
|
|
|
InterceptFailCount int `gorm:"column:intercept_fail_count"` // 拦截失败数量
|
|
|
|
|
ChannelFailCount int `gorm:"column:channel_fail_count"` // 通道发送失败数量
|
|
|
|
|
ScheduleTime *time.Time `gorm:"schedule_time"` // 计划发送时间(定时时间)
|
2025-04-11 12:15:45 +00:00
|
|
|
|
}
|
|
|
|
|
|
2025-04-23 10:00:14 +00:00
|
|
|
|
// SmsSendRecord 短信发送明细
|
2025-04-11 12:15:45 +00:00
|
|
|
|
type SmsSendRecord struct {
|
|
|
|
|
models.Model
|
|
|
|
|
|
2025-04-18 10:08:14 +00:00
|
|
|
|
TaskID uint64 `gorm:"column:task_id"` // 任务ID
|
|
|
|
|
TaskBatchID uint64 `gorm:"column:task_batch_id"` // 批次任务ID
|
|
|
|
|
BatchID string `gorm:"column:batch_id"` // 批次ID
|
|
|
|
|
CooperativeNumber string `gorm:"column:cooperative_number"` // 合作商编号
|
|
|
|
|
CooperativeName string `gorm:"column:cooperative_name"` // 合作商名称
|
|
|
|
|
Phone string `gorm:"column:phone"` // 手机号码
|
|
|
|
|
SmsContent string `gorm:"column:sms_content"` // 发送内容
|
|
|
|
|
ReceiveTime *time.Time `gorm:"column:receive_time"` // 回执时间
|
|
|
|
|
Status int `gorm:"column:status"` // 任务状态(1 已发送 2 发送失败)
|
|
|
|
|
SmsCode string `gorm:"column:sms_code"` // 发送状态码
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// SensitiveWord 敏感词
|
|
|
|
|
type SensitiveWord struct {
|
|
|
|
|
models.Model
|
|
|
|
|
|
|
|
|
|
Word string `json:"word" gorm:"not null;uniqueIndex:uq_word;column:word;comment:敏感词"`
|
|
|
|
|
Category string `json:"category,omitempty" gorm:"column:category;comment:分类"` // Category can be optional.
|
|
|
|
|
Description string `json:"description,omitempty" gorm:"column:description;comment:描述"` // Description can be optional.
|
|
|
|
|
IsEnabled bool `json:"is_enabled" gorm:"default:1;column:is_enabled;comment:是否启用"`
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-23 10:00:14 +00:00
|
|
|
|
// SmsUplinkLog 短信上行记录
|
2025-04-18 10:08:14 +00:00
|
|
|
|
type SmsUplinkLog struct {
|
|
|
|
|
models.Model
|
|
|
|
|
|
|
|
|
|
PhoneNumber string `gorm:"column:phone_number;type:varchar(20);not null" json:"phone_number"` // 手机号
|
|
|
|
|
ReplyContent string `gorm:"column:reply_content;type:text;not null" json:"reply_content"` // 回复内容
|
|
|
|
|
BatchID string `gorm:"column:batch_id;type:varchar(64);not null" json:"batch_id"` // 下行短信批次 ID
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-23 10:00:14 +00:00
|
|
|
|
// SmsSignatureRealname 签名实名制
|
2025-04-18 10:08:14 +00:00
|
|
|
|
type SmsSignatureRealname struct {
|
|
|
|
|
models.Model
|
|
|
|
|
|
|
|
|
|
CooperativeNumber string `gorm:"column:cooperative_number"` // 合作商编号
|
|
|
|
|
CooperativeName string `gorm:"column:cooperative_name"` // 合作商名称
|
|
|
|
|
Signature string `json:"signature"` // 签名
|
|
|
|
|
SignatureSource string `json:"signature_source"` // 签名来源
|
|
|
|
|
CompanyName string `json:"company_name"` // 企业名称
|
|
|
|
|
CompanyCreditCode string `json:"company_credit_code"` // 企业信用代码
|
|
|
|
|
ResponsibleName string `json:"responsible_name"` // 责任人名称
|
|
|
|
|
ResponsibleIDType int `json:"responsible_id_type"` // 责任人证件类型
|
|
|
|
|
ResponsibleIDNumber string `json:"responsible_id_number"` // 责任人证件号
|
|
|
|
|
BusinessType int `json:"business_type"` // 业务类型
|
|
|
|
|
UsageCategory int `json:"usage_category"` // 用途类别
|
|
|
|
|
UsageDetail string `json:"usage_detail"` // 具体用途
|
|
|
|
|
AgentName string `json:"agent_name"` // 经办人名称
|
|
|
|
|
AgentIDType int `json:"agent_id_type"` // 经办人证件类型
|
|
|
|
|
AgentIDNumber string `json:"agent_id_number"` // 经办人证件号
|
|
|
|
|
SmsTemplate string `json:"sms_template"` // 短信模板
|
|
|
|
|
IsActive int `json:"is_active"` // 是否有效(0 无效;1 有效)
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-23 10:00:14 +00:00
|
|
|
|
// SmsContactCategory 通讯录分类
|
|
|
|
|
type SmsContactCategory struct {
|
|
|
|
|
models.Model
|
|
|
|
|
Name string `json:"name" gorm:"type:varchar(100);not null"`
|
|
|
|
|
ParentID uint64 `json:"parent_id" gorm:"default:0"`
|
|
|
|
|
Children []SmsContactCategory `json:"children,omitempty" gorm:"-"`
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-18 10:08:14 +00:00
|
|
|
|
// SmsContact 通讯录
|
|
|
|
|
type SmsContact struct {
|
|
|
|
|
models.Model
|
|
|
|
|
|
2025-04-23 10:00:14 +00:00
|
|
|
|
CategoryID uint64 `json:"category_id" gorm:"default:0"`
|
|
|
|
|
CooperativeNumber string `json:"cooperative_number"` // 合作商编号
|
|
|
|
|
CooperativeName string `json:"cooperative_name"` // 合作商名称
|
2025-04-18 10:08:14 +00:00
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
PhoneNumber string `json:"phone_number"`
|
|
|
|
|
Gender string `json:"gender"`
|
|
|
|
|
Birthday *time.Time `json:"birthday"`
|
|
|
|
|
Company string `json:"company"`
|
|
|
|
|
Address string `json:"address"`
|
|
|
|
|
Remark string `json:"remark"`
|
2025-04-11 12:15:45 +00:00
|
|
|
|
}
|
|
|
|
|
|
2025-04-23 10:00:14 +00:00
|
|
|
|
// SmsPhraseCategory 短语分类
|
|
|
|
|
type SmsPhraseCategory struct {
|
|
|
|
|
models.Model
|
|
|
|
|
Name string `json:"name" gorm:"type:varchar(100);not null"`
|
|
|
|
|
ParentID uint64 `json:"parent_id" gorm:"default:0"`
|
|
|
|
|
Children []SmsPhraseCategory `json:"children,omitempty" gorm:"-"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// SmsPhrase 通讯录-常用短语
|
|
|
|
|
type SmsPhrase struct {
|
|
|
|
|
models.Model
|
|
|
|
|
|
|
|
|
|
Content string `json:"content" gorm:"type:varchar(255);not null"`
|
|
|
|
|
CategoryID uint `json:"category_id" gorm:"default:0"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// SmsCommonNumber 常用号码列表
|
|
|
|
|
type SmsCommonNumber struct {
|
|
|
|
|
models.Model
|
|
|
|
|
|
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
PhoneNumbers string `json:"phone_numbers"` // 如:"12345678901,13322223333"
|
|
|
|
|
PhoneCount int `json:"phone_count" gorm:"-"` // 号码数量(从 phone_numbers 计算)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// SmsBlackList 黑名单列表
|
|
|
|
|
type SmsBlackList struct {
|
|
|
|
|
models.Model
|
|
|
|
|
|
|
|
|
|
PhoneNumber string `json:"phone_number"`
|
|
|
|
|
Remark string `json:"remark"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// SmsTemplate 短信模版表
|
|
|
|
|
type SmsTemplate struct {
|
|
|
|
|
models.Model
|
|
|
|
|
|
|
|
|
|
CooperativeNumber string `gorm:"column:cooperative_number"` // 合作商编号
|
|
|
|
|
CooperativeName string `gorm:"column:cooperative_name"` // 合作商名称
|
|
|
|
|
Content string `json:"content"` // 模版内容(必填)
|
|
|
|
|
ExpireAt *time.Time `json:"expire_at"` // 到期时间(有效期)
|
|
|
|
|
Remark string `json:"remark"` // 备注
|
|
|
|
|
Status int `json:"status"` // 状态:0=审核中 1=正常 2=拒绝 3=过期
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type ContactInput struct {
|
|
|
|
|
CategoryID []uint64 `json:"category_id" binding:"required"`
|
|
|
|
|
ID uint64 `json:"id"` // 联系人ID
|
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
PhoneNumber string `json:"phone_number"`
|
|
|
|
|
Gender string `json:"gender"`
|
|
|
|
|
BirthdayStr string `json:"birthday"` // 先用 string 接收
|
|
|
|
|
Company string `json:"company"`
|
|
|
|
|
Address string `json:"address"`
|
|
|
|
|
Remark string `json:"remark"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type EditContactInput struct {
|
|
|
|
|
CategoryID uint64 `json:"category_id" binding:"required"`
|
|
|
|
|
ID uint64 `json:"id"` // 联系人ID
|
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
PhoneNumber string `json:"phone_number"`
|
|
|
|
|
Gender string `json:"gender"`
|
|
|
|
|
BirthdayStr string `json:"birthday"` // 先用 string 接收
|
|
|
|
|
Company string `json:"company"`
|
|
|
|
|
Address string `json:"address"`
|
|
|
|
|
Remark string `json:"remark"`
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-11 12:15:45 +00:00
|
|
|
|
type MassImportPhoneResp struct {
|
|
|
|
|
List []string `json:"list"` // 加密后的数据
|
|
|
|
|
ImportSerialNumber string `json:"import_serial_number"` // 导入excel返回的编号
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type SendSmsReq struct {
|
2025-04-18 10:08:14 +00:00
|
|
|
|
Data string `json:"data"` // 加密数据
|
2025-04-11 12:15:45 +00:00
|
|
|
|
PhoneList []string `json:"phone_list"` // 手机号码列表
|
|
|
|
|
ImportSerialNumber string `json:"import_serial_number"` // 导入excel返回的编号
|
|
|
|
|
SmsContent string `json:"sms_content"` // 短信内容
|
2025-04-18 10:08:14 +00:00
|
|
|
|
SendTime string `json:"send_time"` // 发送时间(定时设置)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type ExportMessPhoneReq struct {
|
|
|
|
|
Data string `json:"data"` // 加密数据
|
|
|
|
|
PhoneList []string `json:"phone_list"` // 手机号码列表
|
|
|
|
|
ImportSerialNumber string `json:"import_serial_number"` // 导入excel返回的编号
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type ExportMessPhoneResp struct {
|
|
|
|
|
ExportUrl string `json:"export_url"` // 下载链接
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type CheckSensitiveWordsReq struct {
|
|
|
|
|
Content string `json:"content" binding:"required"` // 短信内容
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type CheckSensitiveWordsResponse struct {
|
|
|
|
|
HasSensitiveWords bool `json:"has_sensitive_words"` // 是否检测到敏感词:true 检测到; false 未检测到
|
|
|
|
|
SensitiveWords []string `json:"sensitive_words"` // 敏感词
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// SmsTaskQueryRequest 请求参数结构体(带分页)
|
|
|
|
|
type SmsTaskQueryRequest struct {
|
|
|
|
|
BatchID string `json:"batch_id"` // 批次ID
|
|
|
|
|
StartTime string `json:"start_time"` // 格式:2006-01-02 15:04:05
|
|
|
|
|
EndTime string `json:"end_time"` // 格式:2006-01-02 15:04:05
|
|
|
|
|
MinTotalSms int `json:"min_total_sms"` // 最小短信计费条数
|
|
|
|
|
MinPhoneCount int `json:"min_phone_count"` // 最小手机号总数
|
|
|
|
|
Status *int `json:"status"` // 状态(可选)
|
|
|
|
|
Page int `json:"page"` // 页码,从 1 开始
|
|
|
|
|
PageSize int `json:"page_size"` // 每页条数
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// SmsTaskQueryResponse 响应结构体(带分页)
|
|
|
|
|
type SmsTaskQueryResponse struct {
|
|
|
|
|
List []SmsTask `json:"list"` // 数据列表
|
|
|
|
|
Total int64 `json:"total"` // 总条数
|
|
|
|
|
Page int `json:"page"` // 当前页码
|
|
|
|
|
PageSize int `json:"page_size"` // 每页条数
|
|
|
|
|
TotalPage int `json:"total_page"` // 总页数
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type SmsSendRecordQueryReq struct {
|
|
|
|
|
BatchID string `json:"batch_id"`
|
|
|
|
|
Phone string `json:"phone"`
|
|
|
|
|
StartTime string `json:"start_time"`
|
|
|
|
|
EndTime string `json:"end_time"`
|
|
|
|
|
MinSegments int `json:"min_segments"`
|
|
|
|
|
SmsCode string `json:"sms_code"`
|
|
|
|
|
Page int `json:"page"` // 页码,从 1 开始
|
|
|
|
|
PageSize int `json:"page_size"` // 每页条数
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type SmsSendRecordQueryResp struct {
|
|
|
|
|
List []SmsSendRecord `json:"list"`
|
|
|
|
|
Total int64 `json:"total"` // 总条数
|
|
|
|
|
Page int `json:"page"` // 当前页码
|
|
|
|
|
PageSize int `json:"page_size"` // 每页条数
|
|
|
|
|
TotalPage int `json:"total_page"` // 总页数
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GetPhonesByBatchIDReq 请求结构体
|
|
|
|
|
type GetPhonesByBatchIDReq struct {
|
|
|
|
|
BatchID string `json:"batch_id" binding:"required"` // 批次ID
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// GetPhonesByBatchIDResp 响应结构体
|
|
|
|
|
type GetPhonesByBatchIDResp struct {
|
|
|
|
|
Phones []string `json:"phones"` // 手机号列表
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type SmsTaskScheduledQueryRequest struct {
|
|
|
|
|
Page int `json:"page"`
|
|
|
|
|
PageSize int `json:"page_size"`
|
|
|
|
|
StartTime string `json:"start_time"` // 查询开始时间(schedule_time)
|
|
|
|
|
EndTime string `json:"end_time"` // 查询结束时间(schedule_time)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type SmsUplinkQueryRequest struct {
|
|
|
|
|
PhoneNumber string `json:"phone_number"` // 手机号
|
|
|
|
|
SendID uint64 `json:"send_id"` // 下行ID
|
|
|
|
|
UplinkID uint64 `json:"uplink_id"` // 上行ID
|
|
|
|
|
ReplyContent string `json:"reply_content"` // 回复内容关键字
|
|
|
|
|
StartTime string `json:"start_time"` // 接收开始时间
|
|
|
|
|
EndTime string `json:"end_time"` // 接收结束时间
|
|
|
|
|
Page int `json:"page"` // 分页页码
|
|
|
|
|
PageSize int `json:"page_size"` // 每页数量
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type SmsUplinkRecordResponse struct {
|
|
|
|
|
UplinkID uint64 `json:"uplink_id"` // 上行ID
|
|
|
|
|
PhoneNumber string `json:"phone_number"` // 手机号
|
|
|
|
|
SendID uint64 `json:"send_id"` // 下行发送记录ID
|
|
|
|
|
SmsContent string `json:"sms_content"` // 下行发送内容
|
|
|
|
|
ReplyContent string `json:"reply_content"` // 上行回复内容
|
|
|
|
|
ReceiveTime time.Time `json:"receive_time"` // 上行接收时间
|
|
|
|
|
SendTime time.Time `json:"send_time"` // 下行发送时间
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type SmsUplinkQueryResponse struct {
|
|
|
|
|
List []SmsUplinkRecordResponse `json:"list"`
|
|
|
|
|
Total int64 `json:"total"`
|
|
|
|
|
Page int `json:"page"`
|
|
|
|
|
PageSize int `json:"page_size"`
|
|
|
|
|
TotalPage int64 `json:"total_page"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// BatchUpdateSmsContentRequest 批量修改短信内容请求
|
|
|
|
|
type BatchUpdateSmsContentRequest struct {
|
|
|
|
|
TaskIDs []uint64 `json:"task_ids"` // 任务ID列表
|
|
|
|
|
SmsContent string `json:"sms_content"` // 新的短信内容
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type BatchUpdateRequest struct {
|
|
|
|
|
TaskIDs []uint64 `json:"task_ids"` // 任务ID列表
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type BatchResetScheduleTimeRequest struct {
|
|
|
|
|
TaskIDs []uint64 `json:"task_ids"` // 任务ID列表
|
|
|
|
|
ScheduleTime string `json:"schedule_time"` // 新定时时间
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type DeleteSignatureRealnameRequest struct {
|
|
|
|
|
IDs []uint `json:"ids" binding:"required"` // 要删除的记录ID列表
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type SignatureRealnameQuery struct {
|
|
|
|
|
Signature string `json:"signature"`
|
|
|
|
|
CooperativeName string `json:"cooperative_name"`
|
|
|
|
|
CompanyName string `json:"company_name"`
|
|
|
|
|
CompanyCreditCode string `json:"company_credit_code"`
|
|
|
|
|
ResponsibleName string `json:"responsible_name"`
|
|
|
|
|
UsageCategory int `json:"usage_category"`
|
|
|
|
|
IsActive int `json:"is_active"`
|
|
|
|
|
Page int `json:"page"`
|
|
|
|
|
PageSize int `json:"page_size"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type SignatureRealnameQueryResp struct {
|
|
|
|
|
List []SmsSignatureRealname `json:"list"`
|
|
|
|
|
Total int64 `json:"total"`
|
|
|
|
|
Page int `json:"page"`
|
|
|
|
|
PageSize int `json:"page_size"`
|
|
|
|
|
TotalPage int64 `json:"total_page"`
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-23 10:00:14 +00:00
|
|
|
|
type AddContactCategoryReq struct {
|
|
|
|
|
Name string `json:"name" binding:"required"`
|
|
|
|
|
ParentID uint `json:"parent_id"` // 默认 0 表示顶级
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type EditContactCategoryReq struct {
|
|
|
|
|
ID uint `json:"id" binding:"required"`
|
|
|
|
|
Name string `json:"name" binding:"required"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// DeleteContactCategoryRequest 删除通讯录分类请求
|
|
|
|
|
type DeleteContactCategoryRequest struct {
|
|
|
|
|
IDs []uint `json:"ids" binding:"required"` // 要删除的分类ID列表
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ListContactCategoryRequest 查询通讯录分类树的请求
|
|
|
|
|
type ListContactCategoryRequest struct {
|
|
|
|
|
CategoryID uint64 `json:"category_id"` // 为空表示查询整个树
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type SmsContactCategoryTree struct {
|
|
|
|
|
ID uint64 `json:"id"`
|
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
ParentID uint64 `json:"parent_id"`
|
|
|
|
|
Children []SmsContactCategoryTree `json:"children,omitempty"`
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-18 10:08:14 +00:00
|
|
|
|
// ContactQuery 请求结构体
|
|
|
|
|
type ContactQuery struct {
|
2025-04-23 10:00:14 +00:00
|
|
|
|
CategoryID []uint64 `json:"category_id" binding:"required"`
|
|
|
|
|
Name string `form:"name"` // 模糊搜索
|
|
|
|
|
PhoneNumber string `form:"phone_number"` // 模糊搜索
|
|
|
|
|
Page int `form:"page"`
|
|
|
|
|
PageSize int `form:"page_size"`
|
2025-04-18 10:08:14 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ContactQueryResp 响应结构体
|
|
|
|
|
type ContactQueryResp struct {
|
|
|
|
|
List []SmsContact `json:"list"`
|
|
|
|
|
Total int64 `json:"total"`
|
|
|
|
|
Page int `json:"page"`
|
|
|
|
|
PageSize int `json:"page_size"`
|
|
|
|
|
TotalPage int64 `json:"total_page"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type ContactDeleteRequest struct {
|
|
|
|
|
ContactIDs []uint `json:"contact_ids" binding:"required"` // 要删除的记录ID列表
|
2025-04-11 12:15:45 +00:00
|
|
|
|
}
|
2025-04-23 10:00:14 +00:00
|
|
|
|
|
|
|
|
|
// ExportContactsRequest 导出联系人请求参数
|
|
|
|
|
type ExportContactsRequest struct {
|
|
|
|
|
IDs []uint `json:"ids"` // 联系人ID列表(优先)
|
|
|
|
|
All bool `json:"all"` // 是否导出全部
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type ExportContactsResp struct {
|
|
|
|
|
ExportUrl string `json:"export_url"` // 下载链接
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type AddPhraseCategoryReq struct {
|
|
|
|
|
Name string `json:"name" binding:"required"`
|
|
|
|
|
ParentID uint `json:"parent_id"` // 默认 0 表示顶级
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type EditPhraseCategoryReq struct {
|
|
|
|
|
ID uint `json:"id" binding:"required"`
|
|
|
|
|
Name string `json:"name" binding:"required"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// DeletePhraseCategoryRequest 删除短语分类请求
|
|
|
|
|
type DeletePhraseCategoryRequest struct {
|
|
|
|
|
IDs []uint `json:"ids" binding:"required"` // 要删除的分类ID列表
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// SmsPhraseQuery 查询参数
|
|
|
|
|
type SmsPhraseQuery struct {
|
|
|
|
|
Content string `form:"content" binding:"required"` // 模糊搜索内容
|
|
|
|
|
CategoryID uint `form:"category_id"` // 所属分类ID
|
|
|
|
|
Page int `form:"page"`
|
|
|
|
|
PageSize int `form:"page_size"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type SmsPhraseListResp struct {
|
|
|
|
|
List []SmsPhrase `json:"list"` // 短语列表
|
|
|
|
|
Total int64 `json:"total"` // 总条数
|
|
|
|
|
Page int `json:"page"` // 当前页
|
|
|
|
|
PageSize int `json:"page_size"` // 每页大小
|
|
|
|
|
TotalPage int64 `json:"total_page"` // 总页数
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// SmsPhraseAddOrEdit 新增或编辑参数
|
|
|
|
|
type SmsPhraseAddOrEdit struct {
|
|
|
|
|
ID uint `json:"id"` // 编辑时用
|
|
|
|
|
Content string `json:"content" binding:"required"`
|
|
|
|
|
CategoryID uint `json:"category_id" binding:"required"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// SmsPhraseBatchDeleteReq 批量删除
|
|
|
|
|
type SmsPhraseBatchDeleteReq struct {
|
|
|
|
|
IDs []uint `json:"ids" binding:"required"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ListPhraseCategoryRequest 查询短语分类树的请求
|
|
|
|
|
type ListPhraseCategoryRequest struct {
|
|
|
|
|
CategoryID uint64 `json:"category_id"` // 为空表示查询整个树
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type SmsPhraseCategoryTree struct {
|
|
|
|
|
ID uint64 `json:"id"`
|
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
ParentID uint64 `json:"parent_id"`
|
|
|
|
|
Children []SmsPhraseCategoryTree `json:"children,omitempty"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// SmsCommonNumberQuery 查询
|
|
|
|
|
type SmsCommonNumberQuery struct {
|
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
Page int `json:"page"`
|
|
|
|
|
PageSize int `json:"pageSize"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// SmsCommonNumberAddReq 添加常用号码请求结构体
|
|
|
|
|
type SmsCommonNumberAddReq struct {
|
|
|
|
|
Name string `json:"name" binding:"required"` // 名称
|
|
|
|
|
PhoneList []string `json:"phone_list" binding:"required"` // 号码列表
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// SmsCommonNumberAppendReq 追加常用号码请求结构体
|
|
|
|
|
type SmsCommonNumberAppendReq struct {
|
|
|
|
|
ID int64 `json:"id" binding:"required"` // 记录ID
|
|
|
|
|
PhoneList []string `json:"phone_list" binding:"required"` // 需要追加的号码列表
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// SmsCommonNumberDetailReq 常用号码详情
|
|
|
|
|
type SmsCommonNumberDetailReq struct {
|
|
|
|
|
ID int64 `json:"id" binding:"required"` // 记录ID
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// SmsCommonNumberDeleteReq 删除
|
|
|
|
|
type SmsCommonNumberDeleteReq struct {
|
|
|
|
|
Ids []uint64 `json:"ids"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// SmsCommonNumberExportReq 导出
|
|
|
|
|
type SmsCommonNumberExportReq struct {
|
|
|
|
|
All bool `json:"all"` // 是否导出全部
|
|
|
|
|
Ids []uint64 `json:"ids"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type SmsCommonNumberExportResp struct {
|
|
|
|
|
ExportUrl string `json:"export_url"` // 下载链接
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type SmsCommonNumberListResp struct {
|
|
|
|
|
List []SmsCommonNumber `json:"list"`
|
|
|
|
|
Total int64 `json:"total"`
|
|
|
|
|
Page int `json:"page"`
|
|
|
|
|
PageSize int `json:"pageSize"`
|
|
|
|
|
TotalPage int64 `json:"totalPage"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type BlacklistAddReq struct {
|
|
|
|
|
PhoneList []string `json:"phone_list" binding:"required"`
|
|
|
|
|
Remark string `json:"remark"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ExportBlacklistRequest 导出黑名单请求
|
|
|
|
|
type ExportBlacklistRequest struct {
|
|
|
|
|
All bool `json:"all"` // 是否导出全部
|
|
|
|
|
Ids []string `json:"ids"` // 指定导出的手机号ID
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ExportBlacklistResp 导出响应
|
|
|
|
|
type ExportBlacklistResp struct {
|
|
|
|
|
ExportUrl string `json:"export_url"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type BlacklistQuery struct {
|
|
|
|
|
PhoneNumber string `json:"phone_number"`
|
|
|
|
|
Page int `json:"page"`
|
|
|
|
|
PageSize int `json:"page_size"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type BlacklistListResp struct {
|
|
|
|
|
List []SmsBlackList `json:"list"`
|
|
|
|
|
Total int64 `json:"total"`
|
|
|
|
|
Page int `json:"page"`
|
|
|
|
|
PageSize int `json:"page_size"`
|
|
|
|
|
TotalPage int64 `json:"total_page"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// SmsBlacklistBatchDeleteReq 批量删除黑名单请求
|
|
|
|
|
type SmsBlacklistBatchDeleteReq struct {
|
|
|
|
|
IDs []uint `json:"ids"` // 黑名单记录ID
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// SmsTemplateQuery 短信模版查询参数
|
|
|
|
|
type SmsTemplateQuery struct {
|
|
|
|
|
Content string `json:"content"` // 模版内容模糊查询
|
|
|
|
|
Status int `json:"status"` // 模版状态(0=待审核,1=正常,2=审核拒绝,3=已过期)
|
|
|
|
|
CreateStart time.Time `json:"create_start"` // 创建时间起
|
|
|
|
|
CreateEnd time.Time `json:"create_end"` // 创建时间止
|
|
|
|
|
Page int `json:"page"`
|
|
|
|
|
PageSize int `json:"page_size"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// SmsTemplateListResp 返回模版列表结构
|
|
|
|
|
type SmsTemplateListResp struct {
|
|
|
|
|
List []SmsTemplate `json:"list"`
|
|
|
|
|
Total int64 `json:"total"`
|
|
|
|
|
Page int `json:"page"`
|
|
|
|
|
PageSize int `json:"page_size"`
|
|
|
|
|
TotalPage int64 `json:"total_page"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// SmsTemplateExportReq 短信模版导出请求
|
|
|
|
|
type SmsTemplateExportReq struct {
|
|
|
|
|
Ids []uint `json:"ids"` // 选择的模版 ID 列表
|
|
|
|
|
All bool `json:"all"` // 是否导出全部
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ExportTemplateResp 导出结果
|
|
|
|
|
type ExportTemplateResp struct {
|
|
|
|
|
ExportUrl string `json:"export_url"` // 下载地址
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type ApproveTemplateRequest struct {
|
|
|
|
|
ID uint `json:"id"`
|
|
|
|
|
Status int `json:"status"` // 1 正常, 2 审核不通过
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// SmsTemplateUpdateRequest 修改短信模版请求
|
|
|
|
|
type SmsTemplateUpdateRequest struct {
|
|
|
|
|
ID uint `json:"id" binding:"required"`
|
|
|
|
|
Content string `json:"content" binding:"required"`
|
|
|
|
|
ExpireAt *time.Time `json:"expire_at"`
|
|
|
|
|
Remark string `json:"remark"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// DeleteIdsRequest 批量删除模版时使用
|
|
|
|
|
type DeleteIdsRequest struct {
|
|
|
|
|
IDs []uint `json:"ids" binding:"required"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// SmsTemplateCreateRequest 创建短信模版请求
|
|
|
|
|
type SmsTemplateCreateRequest struct {
|
|
|
|
|
Content string `json:"content" binding:"required"` // 模版内容
|
|
|
|
|
ExpireAt *time.Time `json:"expire_at"` // 到期时间
|
|
|
|
|
Remark string `json:"remark"` // 备注
|
|
|
|
|
}
|