1
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package adminResponse
|
||||
|
||||
import "hospital-admin-api/config"
|
||||
|
||||
// Login 登陆
|
||||
type Login struct {
|
||||
UserId string `json:"user_id"` // 用户id
|
||||
NickName string `json:"nick_name"` // 昵称
|
||||
Avatar string `json:"avatar"` // 头像
|
||||
Token string `json:"token"` // 用户名
|
||||
}
|
||||
|
||||
// GetFullAvatar 返回带有指定字符串的头像路径
|
||||
func (l *Login) GetFullAvatar() Login {
|
||||
l.Avatar = config.C.Oss.OssCustomDomainName + "/" + l.Avatar
|
||||
return Login{}
|
||||
}
|
||||
@@ -1,17 +1 @@
|
||||
package basicResponse
|
||||
|
||||
import "hospital-admin-api/config"
|
||||
|
||||
// Login 登陆
|
||||
type Login struct {
|
||||
UserId string `json:"user_id"` // 用户id
|
||||
NickName string `json:"nick_name"` // 昵称
|
||||
Avatar string `json:"avatar"` // 头像
|
||||
Token string `json:"token"` // 用户名
|
||||
}
|
||||
|
||||
// GetFullAvatar 返回带有指定字符串的头像路径
|
||||
func (l *Login) GetFullAvatar() Login {
|
||||
l.Avatar = config.C.Oss.OssCustomDomainName + "/" + l.Avatar
|
||||
return Login{}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
package hosDepCustomResponse
|
||||
|
||||
import (
|
||||
"hospital-admin-api/api/model"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
type HosDepCustom struct {
|
||||
DepartmentCustomId string `json:"department_custom_id"` // 主键
|
||||
DepartmentId string `json:"department_id"` // 医院科室-标准id
|
||||
DepartmentCustomName string `json:"department_custom_name"` // 科室名称-自定义
|
||||
DepartmentName string `json:"department_name"` // 科室名称-标准
|
||||
DepartmentCode string `json:"department_code"` // 科室编码-标准
|
||||
DepartmentStatus int `json:"department_status"` // 状态(1:正常 2:删除)
|
||||
}
|
||||
|
||||
// HospitalDepartmentCustomResponse 自定义详情
|
||||
func HospitalDepartmentCustomResponse(hospitalDepartmentCustom *model.HospitalDepartmentCustom) *HosDepCustom {
|
||||
return &HosDepCustom{
|
||||
DepartmentCustomId: strconv.FormatInt(hospitalDepartmentCustom.DepartmentCustomId, 10),
|
||||
DepartmentId: strconv.FormatInt(hospitalDepartmentCustom.DepartmentId, 10),
|
||||
DepartmentCustomName: hospitalDepartmentCustom.DepartmentCustomName,
|
||||
DepartmentName: hospitalDepartmentCustom.DepartmentName,
|
||||
DepartmentCode: hospitalDepartmentCustom.DepartmentCode,
|
||||
DepartmentStatus: hospitalDepartmentCustom.DepartmentStatus,
|
||||
}
|
||||
}
|
||||
|
||||
// GetHospitalDepartmentCustomListResponse 自定义列表
|
||||
func GetHospitalDepartmentCustomListResponse(hospitalDepartmentCustom []*model.HospitalDepartmentCustom) []HosDepCustom {
|
||||
// 处理返回值
|
||||
getHospitalDepartmentCustomListResponses := make([]HosDepCustom, len(hospitalDepartmentCustom))
|
||||
|
||||
if len(hospitalDepartmentCustom) > 0 {
|
||||
for i, v := range hospitalDepartmentCustom {
|
||||
// 将原始结构体转换为新结构体
|
||||
getHospitalDepartmentCustomListResponse := HosDepCustom{
|
||||
DepartmentCustomId: strconv.FormatInt(v.DepartmentCustomId, 10),
|
||||
DepartmentId: strconv.FormatInt(v.DepartmentId, 10),
|
||||
DepartmentCustomName: v.DepartmentCustomName,
|
||||
DepartmentName: v.DepartmentName,
|
||||
DepartmentCode: v.DepartmentCode,
|
||||
DepartmentStatus: v.DepartmentStatus,
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
getHospitalDepartmentCustomListResponses[i] = getHospitalDepartmentCustomListResponse
|
||||
}
|
||||
}
|
||||
|
||||
return getHospitalDepartmentCustomListResponses
|
||||
}
|
||||
Reference in New Issue
Block a user