84 lines
3.5 KiB
Go
84 lines
3.5 KiB
Go
package bus_models
|
||
|
||
import "go-admin/app/admin/models"
|
||
|
||
type BusContract struct {
|
||
models.Model
|
||
|
||
ContractNumber string `gorm:"type:varchar(32);not null;unique" json:"contract_number"` // 合同号
|
||
CooperativeNumber string `gorm:"type:varchar(32);not null" json:"cooperative_number"` // 合作商编号
|
||
CooperativeName string `gorm:"type:varchar(64);not null" json:"cooperative_name"` // 合作商名称
|
||
Status uint8 `gorm:"type:tinyint(1);not null;default:1" json:"status"` // 状态(1: 生效中, 2: 已作废)
|
||
SignatoryAccount string `gorm:"type:varchar(32);not null" json:"signatory_account"` // 签署帐户
|
||
Files string `gorm:"type:text" json:"files"` // 文件
|
||
Remark string `gorm:"type:text" json:"remark"` // 备注
|
||
}
|
||
|
||
type CreateContractReq struct {
|
||
CooperativeNumber string `json:"cooperative_number" binding:"required"`
|
||
CooperativeName string `json:"cooperative_name" binding:"required"`
|
||
Files string `json:"files" binding:"required"`
|
||
Remark string `json:"remark"`
|
||
}
|
||
|
||
type CreateContractResp struct {
|
||
ContractNumber string `json:"contract_number"` // 合同号
|
||
}
|
||
|
||
// EditContractReq 编辑合同请求结构体
|
||
type EditContractReq struct {
|
||
ContractNumber string `json:"contract_number" binding:"required"` // 合同号(必填,用于匹配要修改的合同)
|
||
CooperativeNumber string `json:"cooperative_number"` // 合作商编号(可选)
|
||
CooperativeName string `json:"cooperative_name"` // 合作商名称(可选)
|
||
SignatoryAccount string `json:"signatory_account"` // 签署账户(可选)
|
||
Remark string `json:"remark"` // 备注(可选)
|
||
}
|
||
|
||
// ListContractReq 获取合同列表请求
|
||
type ListContractReq struct {
|
||
Page int `json:"page"` // 页码
|
||
PageSize int `json:"page_size"` // 每页数量
|
||
ContractNumber string `json:"contract_number"` // 合同号(可选)
|
||
CooperativeNumber string `json:"cooperative_number"` // 合作商编号(可选)
|
||
CooperativeName string `json:"cooperative_name"` // 合作商名称(可选)
|
||
Status uint8 `json:"status"` // 合同状态(1: 生效中, 2: 已作废,可选)
|
||
}
|
||
|
||
type ListContractResp struct {
|
||
List []BusContract `json:"list"`
|
||
Total int `json:"total"` // 总记录数
|
||
Page int `json:"page"` // 页码
|
||
PageSize int `json:"page_size"` // 每页大小
|
||
}
|
||
|
||
type ContractDetailReq struct {
|
||
ContractNumber string `json:"contract_number" binding:"required"` // 合同号
|
||
}
|
||
|
||
type ContractDetailResp struct {
|
||
BusContract
|
||
}
|
||
|
||
type EditContractRemarkReq struct {
|
||
ContractNumber string `json:"contract_number" binding:"required"` // 合同号
|
||
Remark string `json:"remark"`
|
||
}
|
||
|
||
type InvalidContractReq struct {
|
||
ContractNumber string `json:"contract_number" binding:"required"` // 合同号
|
||
}
|
||
|
||
type DeleteContractReq struct {
|
||
ContractNumber string `json:"contract_number" binding:"required"` // 合同号
|
||
}
|
||
|
||
// GetContractDownloadLinkReq 获取合同下载链接请求结构体
|
||
type GetContractDownloadLinkReq struct {
|
||
ContractNumber string `json:"contract_number" binding:"required"` // 合同号(必填)
|
||
}
|
||
|
||
// GetContractDownloadLinkResp 获取合同下载链接响应结构体
|
||
type GetContractDownloadLinkResp struct {
|
||
DownloadURL []string `json:"download_url"` // 合同下载链接
|
||
}
|