修改了部分数据结构

This commit is contained in:
wucongxing8150 2025-01-08 14:47:34 +08:00
parent 069c972327
commit dc65bd9e09
5 changed files with 3 additions and 12 deletions

View File

@ -11,8 +11,6 @@ type ProjectDto struct {
ProjectName string `json:"project_name"` // 项目名称 ProjectName string `json:"project_name"` // 项目名称
ProjectStatus int `json:"project_status"` // 项目状态0:无效 1:正常) ProjectStatus int `json:"project_status"` // 项目状态0:无效 1:正常)
ProjectImage string `json:"project_image"` // 项目背景图 ProjectImage string `json:"project_image"` // 项目背景图
IsLimitNum int `json:"is_limit_num"` // 是否限制参加数量0:否 1:是)
MaxJoinNum int `json:"max_join_num"` // 医生最多可参加数量
CreatedAt model.LocalTime `json:"created_at"` // 创建时间 CreatedAt model.LocalTime `json:"created_at"` // 创建时间
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间 UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
CaseCount int `json:"case_count"` // 关联病例数量 CaseCount int `json:"case_count"` // 关联病例数量
@ -31,8 +29,6 @@ func GetProjectListDto(m []*model.Project) []*ProjectDto {
ProjectId: fmt.Sprintf("%d", v.ProjectId), ProjectId: fmt.Sprintf("%d", v.ProjectId),
ProjectName: v.ProjectName, ProjectName: v.ProjectName,
ProjectStatus: v.ProjectStatus, ProjectStatus: v.ProjectStatus,
IsLimitNum: v.IsLimitNum,
MaxJoinNum: v.MaxJoinNum,
ProjectImage: utils.AddOssDomain(v.ProjectImage), ProjectImage: utils.AddOssDomain(v.ProjectImage),
CreatedAt: v.CreatedAt, CreatedAt: v.CreatedAt,
UpdatedAt: v.UpdatedAt, UpdatedAt: v.UpdatedAt,
@ -56,8 +52,6 @@ func GetProjectDto(m *model.Project) *ProjectDto {
ProjectName: m.ProjectName, ProjectName: m.ProjectName,
ProjectStatus: m.ProjectStatus, ProjectStatus: m.ProjectStatus,
ProjectImage: utils.AddOssDomain(m.ProjectImage), ProjectImage: utils.AddOssDomain(m.ProjectImage),
IsLimitNum: m.IsLimitNum,
MaxJoinNum: m.MaxJoinNum,
CreatedAt: m.CreatedAt, CreatedAt: m.CreatedAt,
UpdatedAt: m.UpdatedAt, UpdatedAt: m.UpdatedAt,
} }

View File

@ -107,8 +107,6 @@ func GetResProjectListDto(m []*model.Project) []*ResProjectDto {
ProjectId: fmt.Sprintf("%d", v.ProjectId), ProjectId: fmt.Sprintf("%d", v.ProjectId),
ProjectName: v.ProjectName, ProjectName: v.ProjectName,
ProjectStatus: v.ProjectStatus, ProjectStatus: v.ProjectStatus,
IsLimitNum: v.IsLimitNum,
MaxJoinNum: v.MaxJoinNum,
ProjectImage: utils.AddOssDomain(v.ProjectImage), ProjectImage: utils.AddOssDomain(v.ProjectImage),
CreatedAt: v.CreatedAt, CreatedAt: v.CreatedAt,
UpdatedAt: v.UpdatedAt, UpdatedAt: v.UpdatedAt,
@ -178,7 +176,7 @@ func (r *ResProjectDto) LoadIsRecentlyUpdate(m *model.Case) *ResProjectDto {
// LoadLink 加载访问链接 // LoadLink 加载访问链接
func (r *ResCaseDto) LoadLink(m *model.Case) *ResCaseDto { func (r *ResCaseDto) LoadLink(m *model.Case) *ResCaseDto {
if m != nil { if m != nil {
link := config.C.DomainName + "?source=3" + "&platform_key=654321" + "&case_id=" + fmt.Sprintf("%d", m.CaseId) link := config.C.DomainName + "/caseIntro" + "?source=3" + "&platform_key=654321" + "&case_id=" + fmt.Sprintf("%d", m.CaseId)
r.Url = link r.Url = link
} }

View File

@ -9,6 +9,7 @@ import (
// BasicHospital 基础数据-医院 // BasicHospital 基础数据-医院
type BasicHospital struct { type BasicHospital struct {
HospitalId int64 `gorm:"column:hospital_id;type:bigint(19);primary_key;comment:主键id" json:"hospital_id"` HospitalId int64 `gorm:"column:hospital_id;type:bigint(19);primary_key;comment:主键id" json:"hospital_id"`
HospitalIden string `gorm:"column:hospital_iden;type:varchar(50);comment:app唯一标识" json:"hospital_iden"`
HospitalName string `gorm:"column:hospital_name;type:varchar(100);comment:医院名称" json:"hospital_name"` HospitalName string `gorm:"column:hospital_name;type:varchar(100);comment:医院名称" json:"hospital_name"`
Source int `gorm:"column:source;type:tinyint(1);comment:来源2:肝胆相照 3:佳动例);NOT NULL" json:"source"` Source int `gorm:"column:source;type:tinyint(1);comment:来源2:肝胆相照 3:佳动例);NOT NULL" json:"source"`
HospitalLevel string `gorm:"column:hospital_level;type:varchar(20);comment:医院等级" json:"hospital_level"` HospitalLevel string `gorm:"column:hospital_level;type:varchar(20);comment:医院等级" json:"hospital_level"`

View File

@ -16,7 +16,7 @@ type CasePlatform struct {
JoinWhiteNum int `gorm:"column:join_white_num;type:int(5);default:0;comment:白名单参加人数" json:"join_white_num"` JoinWhiteNum int `gorm:"column:join_white_num;type:int(5);default:0;comment:白名单参加人数" json:"join_white_num"`
MessageNum int `gorm:"column:message_num;type:int(5);default:0;comment:留言人数" json:"message_num"` MessageNum int `gorm:"column:message_num;type:int(5);default:0;comment:留言人数" json:"message_num"`
Model Model
ProjectPlatform *ProjectPlatform `gorm:"foreignKey:PlatformId;references:platform_id" json:"project_platform"` Platform *Platform `gorm:"foreignKey:PlatformId;references:platform_id" json:"platform"`
} }
func (m *CasePlatform) TableName() string { func (m *CasePlatform) TableName() string {

View File

@ -12,8 +12,6 @@ type Project struct {
ProjectName string `gorm:"column:project_name;type:varchar(255);comment:项目名称" json:"project_name"` ProjectName string `gorm:"column:project_name;type:varchar(255);comment:项目名称" json:"project_name"`
ProjectStatus int `gorm:"column:project_status;type:tinyint(1);comment:项目状态0:无效 1:正常)" json:"project_status"` ProjectStatus int `gorm:"column:project_status;type:tinyint(1);comment:项目状态0:无效 1:正常)" json:"project_status"`
ProjectImage string `gorm:"column:project_image;type:varchar(255);comment:项目背景图" json:"project_image"` ProjectImage string `gorm:"column:project_image;type:varchar(255);comment:项目背景图" json:"project_image"`
IsLimitNum int `gorm:"column:is_limit_num;type:tinyint(1);default:0;comment:是否限制参加数量0:否 1:是)" json:"is_limit_num"`
MaxJoinNum int `gorm:"column:max_join_num;type:int(5);default:0;comment:医生最多可参加数量" json:"max_join_num"`
Model Model
Case []*Case `gorm:"foreignKey:ProjectId;references:project_id" json:"case"` Case []*Case `gorm:"foreignKey:ProjectId;references:project_id" json:"case"`
ProjectPlatform []*ProjectPlatform `gorm:"foreignKey:ProjectId;references:project_id" json:"project_platform"` ProjectPlatform []*ProjectPlatform `gorm:"foreignKey:ProjectId;references:project_id" json:"project_platform"`