修正返回目录
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
package adminResponse
|
||||
|
||||
import (
|
||||
"hospital-admin-api/utils"
|
||||
)
|
||||
|
||||
// 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 = utils.AddOssDomain(l.Avatar)
|
||||
return Login{}
|
||||
}
|
||||
@@ -1,145 +0,0 @@
|
||||
package adminUserResponse
|
||||
|
||||
import (
|
||||
"hospital-admin-api/api/model"
|
||||
"hospital-admin-api/utils"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// getUserPage 获取用户列表-分页
|
||||
type getUserPage struct {
|
||||
UserID string `json:"user_id"` // 主键id
|
||||
Access string `json:"access"` // 账号
|
||||
Status int `json:"status"` // 状态(1:正常 2:审核中 3:审核失败)
|
||||
IsDeleted int `json:"is_deleted"` // 是否被删除(0:否 1:是)
|
||||
IsDisabled int `json:"is_disabled"` // 是否被禁用(0:否 1:是)
|
||||
NickName string `json:"nick_name"` // 昵称
|
||||
Phone string `json:"phone"` // 手机号
|
||||
Avatar string `json:"avatar"` // 头像
|
||||
Sex int `json:"sex"` // 性别(1:男 2:女)
|
||||
Email string `json:"email"` // 邮箱
|
||||
RoleID string `json:"role_id"` // 角色id
|
||||
DeptID string `json:"dept_id"` // 部门id
|
||||
PostID string `json:"post_id"` // 岗位id
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
Role *getUserPageRole `json:"role"` // 角色
|
||||
Dept *getUserPageDept `json:"dept"` // 部门
|
||||
Post *getUserPagePost `json:"post"` // 岗位
|
||||
}
|
||||
|
||||
type getUserPageRole struct {
|
||||
RoleId string `json:"role_id"` // 角色id
|
||||
RoleName string `json:"role_name"` // 角色名称
|
||||
}
|
||||
|
||||
type getUserPageDept struct {
|
||||
DeptId string `json:"dept_id"` // 部门id
|
||||
DeptName string `json:"dept_name"` // 部门名称
|
||||
}
|
||||
|
||||
type getUserPagePost struct {
|
||||
PostId string `json:"post_id"` // 岗位id
|
||||
PostName string `json:"post_name"` // 岗位名称
|
||||
}
|
||||
|
||||
// getUser 用户详情
|
||||
type getUser struct {
|
||||
UserID string `json:"user_id"`
|
||||
Access string `json:"access"`
|
||||
Status int `json:"status"`
|
||||
IsDeleted int `json:"is_deleted"`
|
||||
IsDisabled int `json:"is_disabled"`
|
||||
NickName string `json:"nick_name"`
|
||||
Phone string `json:"phone"`
|
||||
Avatar string `json:"avatar"`
|
||||
Sex int `json:"sex"`
|
||||
Email string `json:"email"`
|
||||
RoleID string `json:"role_id"`
|
||||
DeptID string `json:"dept_id"`
|
||||
PostID string `json:"post_id"`
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
}
|
||||
|
||||
// GetUserPageResponse 获取用户列表-分页
|
||||
func GetUserPageResponse(adminUser []*model.AdminUser) []getUserPage {
|
||||
// 处理返回值
|
||||
getUserPageResponses := make([]getUserPage, len(adminUser))
|
||||
|
||||
if len(adminUser) > 0 {
|
||||
for i, v := range adminUser {
|
||||
var role *getUserPageRole
|
||||
if v.Role != nil {
|
||||
role = &getUserPageRole{
|
||||
RoleId: strconv.FormatInt(v.Role.RoleId, 10),
|
||||
RoleName: v.Role.RoleName,
|
||||
}
|
||||
}
|
||||
|
||||
var dept *getUserPageDept
|
||||
if v.Dept != nil {
|
||||
dept = &getUserPageDept{
|
||||
DeptId: strconv.FormatInt(v.Dept.DeptId, 10),
|
||||
DeptName: v.Dept.DeptName,
|
||||
}
|
||||
}
|
||||
|
||||
var post *getUserPagePost
|
||||
if v.Post != nil {
|
||||
post = &getUserPagePost{
|
||||
PostId: strconv.FormatInt(v.Post.PostId, 10),
|
||||
PostName: v.Post.PostName,
|
||||
}
|
||||
}
|
||||
|
||||
// 将原始结构体转换为新结构体
|
||||
getUserPageResponse := getUserPage{
|
||||
UserID: strconv.Itoa(int(v.UserID)),
|
||||
Access: v.Access,
|
||||
Status: v.Status,
|
||||
IsDeleted: v.IsDeleted,
|
||||
IsDisabled: v.IsDisabled,
|
||||
NickName: v.NickName,
|
||||
Phone: v.Phone,
|
||||
Avatar: utils.AddOssDomain(v.Avatar),
|
||||
Sex: v.Sex,
|
||||
Email: v.Email,
|
||||
RoleID: strconv.Itoa(int(v.RoleID)),
|
||||
DeptID: strconv.Itoa(int(v.DeptID)),
|
||||
PostID: strconv.Itoa(int(v.PostID)),
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
Role: role,
|
||||
Dept: dept,
|
||||
Post: post,
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
getUserPageResponses[i] = getUserPageResponse
|
||||
}
|
||||
}
|
||||
|
||||
return getUserPageResponses
|
||||
}
|
||||
|
||||
// GetUserResponse 用户详情
|
||||
func GetUserResponse(adminUser *model.AdminUser) *getUser {
|
||||
return &getUser{
|
||||
UserID: strconv.FormatInt(adminUser.UserID, 10),
|
||||
Access: adminUser.Access,
|
||||
Status: adminUser.Status,
|
||||
IsDeleted: adminUser.IsDeleted,
|
||||
IsDisabled: adminUser.IsDisabled,
|
||||
NickName: adminUser.NickName,
|
||||
Phone: adminUser.Phone,
|
||||
Avatar: utils.AddOssDomain(adminUser.Avatar),
|
||||
Sex: adminUser.Sex,
|
||||
Email: adminUser.Email,
|
||||
RoleID: strconv.FormatInt(adminUser.RoleID, 10),
|
||||
DeptID: strconv.FormatInt(adminUser.DeptID, 10),
|
||||
PostID: strconv.FormatInt(adminUser.PostID, 10),
|
||||
CreatedAt: adminUser.CreatedAt,
|
||||
UpdatedAt: adminUser.UpdatedAt,
|
||||
}
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
package apiResponse
|
||||
|
||||
import (
|
||||
"hospital-admin-api/api/model"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// getApiPage 获取接口列表-分页
|
||||
type getApiPage struct {
|
||||
APIID string `json:"api_id"` // 主键id
|
||||
APIName string `json:"api_name"` // api名称
|
||||
APIPath string `json:"api_path"` // 接口路径(全路径 id为:id)
|
||||
APIMethod string `json:"api_method"` // 请求类型
|
||||
IsAuth int `json:"is_auth"` // 是否验证权限(0:否 1:是)
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
}
|
||||
|
||||
// getApiList 获取接口列表
|
||||
type getApiList struct {
|
||||
APIID string `json:"api_id"` // 主键id
|
||||
APIName string `json:"api_name"` // api名称
|
||||
}
|
||||
|
||||
// 接口详情
|
||||
type getApi struct {
|
||||
APIID string `json:"api_id"` // 主键id
|
||||
APIName string `json:"api_name"` // api名称
|
||||
APIPath string `json:"api_path"` // 接口路径(全路径 id为:id)
|
||||
APIMethod string `json:"api_method"` // 请求类型
|
||||
IsAuth int `json:"is_auth"` // 是否验证权限(0:否 1:是)
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
}
|
||||
|
||||
// GetApiPageResponse 获取接口列表-分页
|
||||
func GetApiPageResponse(adminApi []*model.AdminAPI) []getApiPage {
|
||||
// 处理返回值
|
||||
getApiPageResponses := make([]getApiPage, len(adminApi))
|
||||
|
||||
if len(adminApi) > 0 {
|
||||
for i, v := range adminApi {
|
||||
// 将原始结构体转换为新结构体
|
||||
getApiPageResponse := getApiPage{
|
||||
APIID: strconv.Itoa(int(v.APIID)),
|
||||
APIName: v.APIName,
|
||||
APIPath: v.APIPath,
|
||||
APIMethod: v.APIMethod,
|
||||
IsAuth: v.IsAuth,
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
getApiPageResponses[i] = getApiPageResponse
|
||||
}
|
||||
}
|
||||
|
||||
return getApiPageResponses
|
||||
}
|
||||
|
||||
// GetApiListResponse 获取接口列表
|
||||
func GetApiListResponse(adminApi []*model.AdminAPI) []getApiList {
|
||||
// 处理返回值
|
||||
getApiListResponses := make([]getApiList, len(adminApi))
|
||||
|
||||
if len(adminApi) > 0 {
|
||||
for i, v := range adminApi {
|
||||
// 将原始结构体转换为新结构体
|
||||
getApiListResponse := getApiList{
|
||||
APIID: strconv.Itoa(int(v.APIID)),
|
||||
APIName: v.APIName,
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
getApiListResponses[i] = getApiListResponse
|
||||
}
|
||||
}
|
||||
|
||||
return getApiListResponses
|
||||
}
|
||||
|
||||
// GetApiResponse 接口详情
|
||||
func GetApiResponse(adminApi *model.AdminAPI) *getApi {
|
||||
return &getApi{
|
||||
APIID: strconv.Itoa(int(adminApi.APIID)),
|
||||
APIName: adminApi.APIName,
|
||||
APIPath: adminApi.APIPath,
|
||||
APIMethod: adminApi.APIMethod,
|
||||
IsAuth: adminApi.IsAuth,
|
||||
CreatedAt: adminApi.CreatedAt,
|
||||
UpdatedAt: adminApi.UpdatedAt,
|
||||
}
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
package areaResponse
|
||||
|
||||
import (
|
||||
"hospital-admin-api/api/model"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
type Area struct {
|
||||
AreaId string `json:"area_id"` // 地区编号
|
||||
AreaName string `json:"area_name"` // 名称
|
||||
ParentId string `json:"parent_id"` // 上级编号
|
||||
Zip string `json:"zip"` // 邮编
|
||||
AreaType int `json:"area_type"` // 类型(1:国家,2:省,3:市,4:区县)
|
||||
}
|
||||
|
||||
// AreaResponse 地区详情
|
||||
func AreaResponse(area *model.Area) *Area {
|
||||
return &Area{
|
||||
AreaId: strconv.FormatInt(area.AreaId, 10),
|
||||
AreaName: area.AreaName,
|
||||
ParentId: strconv.FormatInt(area.ParentId, 10),
|
||||
Zip: area.Zip,
|
||||
AreaType: area.AreaType,
|
||||
}
|
||||
}
|
||||
|
||||
// GetAreaListResponse 获取银行列表
|
||||
func GetAreaListResponse(area []*model.Area) []Area {
|
||||
// 处理返回值
|
||||
r := make([]Area, len(area))
|
||||
|
||||
if len(area) > 0 {
|
||||
for i, v := range area {
|
||||
// 将原始结构体转换为新结构体
|
||||
l := Area{
|
||||
AreaId: strconv.FormatInt(v.AreaId, 10),
|
||||
AreaName: v.AreaName,
|
||||
ParentId: strconv.FormatInt(v.ParentId, 10),
|
||||
Zip: v.Zip,
|
||||
AreaType: v.AreaType,
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
r[i] = l
|
||||
}
|
||||
}
|
||||
|
||||
return r
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
package basicBankResponse
|
||||
|
||||
import (
|
||||
"hospital-admin-api/api/model"
|
||||
"hospital-admin-api/utils"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
type BasicBank struct {
|
||||
BankId string `json:"bank_id"` // 主键
|
||||
BankCode string `json:"bank_code"` // 银行编码
|
||||
BankName string `json:"bank_name"` // 银行名称
|
||||
BankIconPath string `json:"bank_icon_path"` // 银行图标地址
|
||||
BankImgPath string `json:"bank_img_path"` // 银行图片地址
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
}
|
||||
|
||||
// BasicBankResponse 银行详情
|
||||
func BasicBankResponse(basicBank *model.BasicBank) *BasicBank {
|
||||
return &BasicBank{
|
||||
BankId: strconv.FormatInt(basicBank.BankId, 10),
|
||||
BankCode: basicBank.BankCode,
|
||||
BankName: basicBank.BankName,
|
||||
BankIconPath: utils.AddOssDomain(basicBank.BankIconPath),
|
||||
BankImgPath: utils.AddOssDomain(basicBank.BankImgPath),
|
||||
CreatedAt: basicBank.CreatedAt,
|
||||
UpdatedAt: basicBank.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
// GetBasicBankListResponse 获取银行列表
|
||||
func GetBasicBankListResponse(basicBank []*model.BasicBank) []BasicBank {
|
||||
// 处理返回值
|
||||
getBasicBankListResponses := make([]BasicBank, len(basicBank))
|
||||
|
||||
if len(basicBank) > 0 {
|
||||
for i, v := range basicBank {
|
||||
// 将原始结构体转换为新结构体
|
||||
getBasicBankListResponse := BasicBank{
|
||||
BankId: strconv.FormatInt(v.BankId, 10),
|
||||
BankCode: v.BankCode,
|
||||
BankName: v.BankName,
|
||||
BankIconPath: utils.AddOssDomain(v.BankIconPath),
|
||||
BankImgPath: utils.AddOssDomain(v.BankImgPath),
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
getBasicBankListResponses[i] = getBasicBankListResponse
|
||||
}
|
||||
}
|
||||
|
||||
return getBasicBankListResponses
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
package deptResponse
|
||||
|
||||
import (
|
||||
"hospital-admin-api/api/model"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// GetDeptList 获取部门列表
|
||||
type GetDeptList struct {
|
||||
DeptId string `json:"dept_id"`
|
||||
ParentId string `json:"parent_id"` // 父菜单ID(0表示一级)
|
||||
DeptName string `json:"dept_name"` // 部门名称
|
||||
DeptStatus int `json:"dept_status"` // 部门状态(1:正常 2:删除)
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
Children []*GetDeptList `json:"children"` // 下级页面
|
||||
}
|
||||
|
||||
// GetDept 部门详情
|
||||
type getDept struct {
|
||||
DeptId string `json:"dept_id"`
|
||||
ParentId string `json:"parent_id"` // 父菜单ID(0表示一级)
|
||||
DeptName string `json:"dept_name"` // 部门名称
|
||||
DeptStatus int `json:"dept_status"` // 部门状态(1:正常 2:删除)
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
}
|
||||
|
||||
// GetDeptResponse 部门详情
|
||||
func GetDeptResponse(adminDept *model.AdminDept) *getDept {
|
||||
return &getDept{
|
||||
DeptId: strconv.Itoa(int(adminDept.DeptId)),
|
||||
ParentId: strconv.Itoa(int(adminDept.ParentId)),
|
||||
DeptName: adminDept.DeptName,
|
||||
DeptStatus: adminDept.DeptStatus,
|
||||
CreatedAt: adminDept.CreatedAt,
|
||||
UpdatedAt: adminDept.UpdatedAt,
|
||||
}
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
package diseaseClassExpertiseResponse
|
||||
|
||||
import (
|
||||
"hospital-admin-api/api/model"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
type DiseaseClassExpertise struct {
|
||||
ExpertiseId string `json:"expertise_id"` // 主键
|
||||
ExpertiseName string `json:"expertise_name"` // 专长名称
|
||||
ExpertiseSort int `json:"expertise_sort"` // 排序(越大排序越靠前)
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
}
|
||||
|
||||
// DiseaseClassExpertiseResponse 专长详情
|
||||
func DiseaseClassExpertiseResponse(diseaseClassExpertise *model.DiseaseClassExpertise) *DiseaseClassExpertise {
|
||||
return &DiseaseClassExpertise{
|
||||
ExpertiseId: strconv.FormatInt(diseaseClassExpertise.ExpertiseId, 10),
|
||||
ExpertiseName: diseaseClassExpertise.ExpertiseName,
|
||||
ExpertiseSort: diseaseClassExpertise.ExpertiseSort,
|
||||
CreatedAt: diseaseClassExpertise.CreatedAt,
|
||||
UpdatedAt: diseaseClassExpertise.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
// GetDiseaseClassExpertiseListResponse 自定义列表
|
||||
func GetDiseaseClassExpertiseListResponse(diseaseClassExpertises []*model.DiseaseClassExpertise) []DiseaseClassExpertise {
|
||||
// 处理返回值
|
||||
getDiseaseClassExpertiseListResponses := make([]DiseaseClassExpertise, len(diseaseClassExpertises))
|
||||
|
||||
if len(diseaseClassExpertises) > 0 {
|
||||
for i, v := range diseaseClassExpertises {
|
||||
// 将原始结构体转换为新结构体
|
||||
getDiseaseClassExpertiseListResponse := DiseaseClassExpertise{
|
||||
ExpertiseId: strconv.FormatInt(v.ExpertiseId, 10),
|
||||
ExpertiseName: v.ExpertiseName,
|
||||
ExpertiseSort: v.ExpertiseSort,
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
getDiseaseClassExpertiseListResponses[i] = getDiseaseClassExpertiseListResponse
|
||||
}
|
||||
}
|
||||
|
||||
return getDiseaseClassExpertiseListResponses
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
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
|
||||
}
|
||||
@@ -1,88 +0,0 @@
|
||||
package hospitalResponse
|
||||
|
||||
import (
|
||||
"hospital-admin-api/api/model"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
type Hospital struct {
|
||||
HospitalID string `json:"hospital_id"` // 主键id
|
||||
HospitalName string `json:"hospital_name"` // 医院名称
|
||||
HospitalStatus int `json:"hospital_status"` // 状态(0:禁用 1:正常 2:删除)
|
||||
HospitalLevelName string `json:"hospital_level_name"` // 医院等级名称
|
||||
PostCode string `json:"post_code"` // 邮政编码
|
||||
Telephone string `json:"telephone"` // 电话
|
||||
ProvinceID int `json:"province_id"` // 省份id
|
||||
Province string `json:"province"` // 省份
|
||||
CityID int `json:"city_id"` // 城市id
|
||||
City string `json:"city"` // 城市
|
||||
CountyID int `json:"county_id"` // 区县id
|
||||
County string `json:"county"` // 区县
|
||||
Address string `json:"address"` // 地址
|
||||
Latitude string `json:"latitude"` // 纬度
|
||||
Longitude string `json:"longitude"` // 经度
|
||||
Description string `json:"description"` // 简介
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
}
|
||||
|
||||
// HospitalResponse 医院
|
||||
func HospitalResponse(hospital *model.Hospital) *Hospital {
|
||||
return &Hospital{
|
||||
HospitalID: strconv.FormatInt(hospital.HospitalID, 10),
|
||||
HospitalName: hospital.HospitalName,
|
||||
HospitalStatus: hospital.HospitalStatus,
|
||||
HospitalLevelName: hospital.HospitalLevelName,
|
||||
PostCode: hospital.PostCode,
|
||||
Telephone: hospital.HospitalName,
|
||||
ProvinceID: hospital.ProvinceId,
|
||||
Province: hospital.Province,
|
||||
CityID: hospital.CityId,
|
||||
City: hospital.City,
|
||||
CountyID: hospital.CountyId,
|
||||
County: hospital.County,
|
||||
Address: hospital.Address,
|
||||
Latitude: hospital.Lat,
|
||||
Longitude: hospital.HospitalName,
|
||||
Description: hospital.Desc,
|
||||
CreatedAt: hospital.CreatedAt,
|
||||
UpdatedAt: hospital.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
// GetHospitalLimitResponse 自定义列表
|
||||
func GetHospitalLimitResponse(hospitals []*model.Hospital) []Hospital {
|
||||
// 处理返回值
|
||||
getHospitalLimitResponses := make([]Hospital, len(hospitals))
|
||||
|
||||
if len(hospitals) > 0 {
|
||||
for i, v := range hospitals {
|
||||
// 将原始结构体转换为新结构体
|
||||
getHospitalLimitResponse := Hospital{
|
||||
HospitalID: strconv.FormatInt(v.HospitalID, 10),
|
||||
HospitalName: v.HospitalName,
|
||||
HospitalStatus: v.HospitalStatus,
|
||||
HospitalLevelName: v.HospitalLevelName,
|
||||
PostCode: v.PostCode,
|
||||
Telephone: v.HospitalName,
|
||||
ProvinceID: v.ProvinceId,
|
||||
Province: v.Province,
|
||||
CityID: v.CityId,
|
||||
City: v.City,
|
||||
CountyID: v.CountyId,
|
||||
County: v.County,
|
||||
Address: v.Address,
|
||||
Latitude: v.Lat,
|
||||
Longitude: v.HospitalName,
|
||||
Description: v.Desc,
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
getHospitalLimitResponses[i] = getHospitalLimitResponse
|
||||
}
|
||||
}
|
||||
|
||||
return getHospitalLimitResponses
|
||||
}
|
||||
@@ -2,15 +2,15 @@ package orderInquiryResponse
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"hospital-admin-api/api/dto"
|
||||
"hospital-admin-api/api/model"
|
||||
"hospital-admin-api/api/responses/orderEvaluationResponse"
|
||||
"hospital-admin-api/api/responses/orderInquiryCaseResponse"
|
||||
"hospital-admin-api/api/responses/orderInquiryCouponResponse"
|
||||
"hospital-admin-api/api/responses/orderInquiryRefundResponse"
|
||||
"hospital-admin-api/api/responses/userDoctorResponse"
|
||||
)
|
||||
|
||||
// getOrderInquiryPage 获取医生列表-分页
|
||||
// getOrderInquiryPage 获取问诊列表-分页
|
||||
type getOrderInquiryPage struct {
|
||||
OrderInquiryId string `json:"order_inquiry_id"` // 主键id
|
||||
UserId string `json:"user_id"` // 用户id-患者
|
||||
@@ -88,12 +88,49 @@ type GetOrderInquiry struct {
|
||||
OrderInquiryCase *orderInquiryCaseResponse.OrderInquiryCase `json:"order_inquiry_case"` // 问诊病例
|
||||
OrderInquiryRefund *orderInquiryRefundResponse.OrderInquiryRefund `json:"order_inquiry_refund"` // 退款数据
|
||||
OrderEvaluation *orderEvaluationResponse.OrderEvaluation `json:"order_evaluation"` // 订单评价
|
||||
UserDoctor *userDoctorResponse.OrderInquiryUserDoctor `json:"user_doctor"` // 医生数据
|
||||
UserDoctor *dto.UserDoctorDto `json:"user_doctor"` // 医生数据
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间
|
||||
}
|
||||
|
||||
// GetOrderInquiryPageResponse 获取用户列表-分页
|
||||
type OrderInquiry struct {
|
||||
OrderInquiryId string `json:"order_inquiry_id"` // 主键id
|
||||
UserId string `json:"user_id"` // 用户id-患者
|
||||
PatientId string `json:"patient_id"` // 患者id
|
||||
DoctorId string `json:"doctor_id"` // 医生id(未分配时为null)
|
||||
FamilyId string `json:"family_id"` // 家庭成员id(就诊用户)
|
||||
InquiryType int `json:"inquiry_type"` // 订单类型(1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药 5:检测)
|
||||
InquiryMode int `json:"inquiry_mode"` // 订单问诊方式(1:图文 2:视频 3:语音 4:电话 5:会员)
|
||||
InquiryStatus int `json:"inquiry_status"` // 问诊订单状态(1:待支付 2:待分配 3:待接诊 4:已接诊 5:已完成 6:已结束 7:已取消)
|
||||
IsDelete int `json:"is_delete"` // 删除状态(0:否 1:是)
|
||||
InquiryRefundStatus int `json:"inquiry_refund_status"` // 问诊订单退款状态(0:无退款 1:申请退款 2:退款中 3:退款成功 4:拒绝退款 5:退款关闭 6:退款异常)
|
||||
InquiryPayChannel int `json:"inquiry_pay_channel"` // 支付渠道(1:小程序支付 2:微信扫码支付 3:模拟支付)
|
||||
InquiryPayStatus int `json:"inquiry_pay_status"` // 支付状态(1:未支付 2:已支付 3:支付中 4:支付失败 5:支付超时 6:支付关闭 7:已撤销 8:转入退款)
|
||||
InquiryNo string `json:"inquiry_no"` // 系统订单编号
|
||||
EscrowTradeNo string `json:"escrow_trade_no"` // 第三方支付流水号
|
||||
AmountTotal float64 `json:"amount_total"` // 订单金额
|
||||
CouponAmountTotal float64 `json:"coupon_amount_total"` // 优惠卷总金额
|
||||
PaymentAmountTotal float64 `json:"payment_amount_total"` // 实际付款金额
|
||||
PayTime model.LocalTime `json:"pay_time"` // 支付时间
|
||||
ReceptionTime model.LocalTime `json:"reception_time"` // 接诊时间(已接诊)
|
||||
CompleteTime model.LocalTime `json:"complete_time"` // 订单完成时间(问诊完成时间)
|
||||
FinishTime model.LocalTime `json:"finish_time"` // 订单结束时间
|
||||
StatisticsStatus int `json:"statistics_status"` // 订单统计状态(0:未统计 1:已统计 2:统计失败)
|
||||
StatisticsTime model.LocalTime `json:"statistics_time"` // 订单统计时间
|
||||
IsWithdrawal int `json:"is_withdrawal"` // 是否提现(0:否 1:是 2:提现中)
|
||||
WithdrawalTime model.LocalTime `json:"withdrawal_time"` // 提现时间
|
||||
CancelTime model.LocalTime `json:"cancel_time"` // 订单取消时间
|
||||
CancelReason int `json:"cancel_reason"` // 取消订单原因(1:医生未接诊 2:主动取消 3:无可分配医生 4:客服取消 5:支付超时)
|
||||
CancelRemarks string `json:"cancel_remarks"` // 取消订单备注(自动添加)
|
||||
PatientName string `json:"patient_name"` // 患者姓名-就诊人
|
||||
PatientNameMask string `json:"patient_name_mask"` // 患者姓名-就诊人(掩码)
|
||||
PatientSex int `json:"patient_sex"` // 患者性别-就诊人(0:未知 1:男 2:女)
|
||||
PatientAge int `json:"patient_age"` // 患者年龄-就诊人
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间
|
||||
}
|
||||
|
||||
// GetOrderInquiryPageResponse 获取问诊列表-分页
|
||||
func GetOrderInquiryPageResponse(orderInquiry []*model.OrderInquiry) []getOrderInquiryPage {
|
||||
// 处理返回值
|
||||
getOrderInquiryPages := make([]getOrderInquiryPage, len(orderInquiry))
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package orderPrescriptionIcdResponse
|
||||
|
||||
import (
|
||||
"hospital-admin-api/api/model"
|
||||
)
|
||||
|
||||
type OrderPrescriptionIcd struct {
|
||||
PrescriptionIcdId string `json:"prescription_icd_id"` // 主键id
|
||||
OrderPrescriptionId string `json:"order_prescription_id"` // 订单-处方id
|
||||
IcdId string `json:"icd_id"` // 疾病id(icd)
|
||||
IcdName string `json:"icd_name"` // 疾病名称(icd)
|
||||
IcdCode string `json:"icd_code"` // icd编码
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package orderPrescriptionProductResponse
|
||||
|
||||
import (
|
||||
"hospital-admin-api/api/model"
|
||||
)
|
||||
|
||||
type OrderPrescriptionProduct struct {
|
||||
PrescriptionProductId string `json:"prescription_product_id"` // 主键id
|
||||
OrderPrescriptionId string `json:"order_prescription_id"` // 订单-处方id;NOT NULL
|
||||
ProductId string `json:"product_id"` // 商品id;NOT NULL
|
||||
UseStatus int `json:"use_status"` // 使用状态(1:已使用 0:未使用)
|
||||
PrescriptionProductNum int `json:"prescription_product_num"` // 商品数量
|
||||
ProductName string `json:"product_name"` // 商品名称
|
||||
ProductSpec string `json:"product_spec"` // 商品规格
|
||||
LicenseNumber string `json:"license_number"` // 批准文号
|
||||
Manufacturer string `json:"manufacturer"` // 生产厂家
|
||||
SingleUnit string `json:"single_unit"` // 单次剂量(例:1次1包)
|
||||
SingleUse string `json:"single_use"` // 单次用法(例:口服)
|
||||
PackagingUnit string `json:"packaging_unit"` // 基本包装单位(例:盒/瓶)
|
||||
FrequencyUse string `json:"frequency_use"` // 使用频率(例:1天3次)
|
||||
AvailableDays int `json:"available_days"` // 可用天数(3)
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package orderPrescriptionResponse
|
||||
import (
|
||||
"fmt"
|
||||
"hospital-admin-api/api/model"
|
||||
"hospital-admin-api/api/responses/orderInquiryCaseResponse"
|
||||
"hospital-admin-api/utils"
|
||||
"strings"
|
||||
)
|
||||
@@ -67,6 +68,38 @@ type getOrderPrescriptionPage struct {
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
}
|
||||
|
||||
// GetOrderPrescription 处方详情
|
||||
type GetOrderPrescription struct {
|
||||
OrderPrescriptionId string `json:"order_prescription_id"` // 主键id
|
||||
OrderInquiryId string `json:"order_inquiry_id"` // 订单-问诊id;NOT NULL
|
||||
DoctorId string `json:"doctor_id"` // 医生id;NOT NULL
|
||||
PatientId string `json:"patient_id"` // 患者id
|
||||
FamilyId string `json:"family_id"` // 家庭成员id(就诊用户)
|
||||
PharmacistId string `json:"pharmacist_id"` // 药师id
|
||||
PrescriptionStatus int `json:"prescription_status"` // 处方状态(1:待审核 2:待使用 3:已失效 4:已使用)
|
||||
PharmacistAuditStatus int `json:"pharmacist_audit_status"` // 药师审核状态(0:审核中 1:审核成功 2:审核驳回)
|
||||
PharmacistVerifyTime model.LocalTime `json:"pharmacist_verify_time"` // 药师审核时间
|
||||
PharmacistFailReason string `json:"pharmacist_fail_reason"` // 药师审核驳回原因
|
||||
PlatformAuditStatus int `json:"platform_audit_status"` // 处方平台审核状态(0:审核中 1:审核成功 2:审核驳回)
|
||||
PlatformFailTime model.LocalTime `json:"platform_fail_time"` // 平台审核失败时间
|
||||
PlatformFailReason string `json:"platform_fail_reason"` // 处方平台驳回原因
|
||||
IsAutoPharVerify int `json:"is_auto_phar_verify"` // 是否药师自动审核(0:否 1:是)
|
||||
DoctorCreatedTime model.LocalTime `json:"doctor_created_time"` // 医生开具处方时间
|
||||
ExpiredTime model.LocalTime `json:"expired_time"` // 处方过期时间
|
||||
VoidTime model.LocalTime `json:"void_time"` // 处方作废时间
|
||||
IsDelete int `json:"is_delete"` // 是否删除(0:否 1:是)
|
||||
PrescriptionCode string `json:"prescription_code"` // 处方编号
|
||||
DoctorName string `json:"doctor_name"` // 医生名称
|
||||
PatientName string `json:"patient_name"` // 患者姓名-就诊人
|
||||
PatientSex int `json:"patient_sex"` // 患者性别-就诊人(1:男 2:女)
|
||||
PatientAge int `json:"patient_age"` // 患者年龄-就诊人
|
||||
DoctorAdvice string `json:"doctor_advice"` // 医嘱
|
||||
PharmacistName string `json:"pharmacist_name"` // 药师姓名
|
||||
OrderInquiryCase *orderInquiryCaseResponse.OrderInquiryCase `json:"order_inquiry_case"` // 问诊病例
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
}
|
||||
|
||||
// GetOrderPrescriptionPageResponse 获取处方列表-分页
|
||||
func GetOrderPrescriptionPageResponse(orderPrescription []*model.OrderPrescription) []getOrderPrescriptionPage {
|
||||
// 处理返回值
|
||||
|
||||
@@ -89,7 +89,7 @@ type GetOrderProduct struct {
|
||||
OrderProductRefund *orderProductRefundResponse.OrderProductRefund `json:"order_product_refund"` // 退款数据
|
||||
OrderProductItem []*orderProductItemResponse.OrderProductItem `json:"order_product_item"` // 商品数据
|
||||
OrderProductLogistics *orderProductLogisticsResponse.OrderProductLogistics `json:"order_product_logistics"` // 物流数据
|
||||
UserDoctor *userDoctorResponse.OrderInquiryUserDoctor `json:"user_doctor"` // 医生数据
|
||||
UserDoctor *userDoctorResponse.GetUserDoctorById `json:"user_doctor"` // 医生数据
|
||||
OrderPrescription *orderPrescriptionResponse.OrderPrescription `json:"order_prescription"` // 处方数据
|
||||
OrderInquiryCase *orderInquiryCaseResponse.OrderInquiryCase `json:"order_inquiry_case"` // 问诊病例
|
||||
}
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
package patientFamilyResponse
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"hospital-admin-api/api/model"
|
||||
"hospital-admin-api/api/responses/userResponse"
|
||||
"hospital-admin-api/utils"
|
||||
)
|
||||
|
||||
type PatientFamily struct {
|
||||
@@ -99,60 +97,3 @@ type GetPatientFamily struct {
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间
|
||||
}
|
||||
|
||||
// GetUserPatientResponse 获取患者详情
|
||||
func GetUserPatientResponse(patientFamilys []*model.PatientFamily) []*GetUserPatient {
|
||||
// 处理返回值
|
||||
items := make([]*GetUserPatient, len(patientFamilys))
|
||||
|
||||
if len(patientFamilys) > 0 {
|
||||
for i, v := range patientFamilys {
|
||||
// 将原始结构体转换为新结构体
|
||||
item := &GetUserPatient{
|
||||
FamilyId: fmt.Sprintf("%d", v.FamilyId),
|
||||
PatientId: fmt.Sprintf("%d", v.PatientId),
|
||||
Relation: v.Relation,
|
||||
Status: &v.Status,
|
||||
IsDefault: &v.IsDefault,
|
||||
CardNameMask: v.CardNameMask,
|
||||
IdNumberMask: v.IdNumberMask,
|
||||
Sex: &v.Sex,
|
||||
Age: v.Age,
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
items[i] = item
|
||||
}
|
||||
}
|
||||
|
||||
return items
|
||||
}
|
||||
|
||||
// GetPatientFamilyPageResponse 获取用户列表-分页
|
||||
func GetPatientFamilyPageResponse(patientFamily []*model.PatientFamily) []getPatientFamilyPage {
|
||||
// 处理返回值
|
||||
patientFamilyResponses := make([]getPatientFamilyPage, len(patientFamily))
|
||||
|
||||
if len(patientFamily) > 0 {
|
||||
for i, v := range patientFamily {
|
||||
// 将原始结构体转换为新结构体
|
||||
patientFamilyResponse := getPatientFamilyPage{
|
||||
FamilyId: fmt.Sprintf("%d", v.FamilyId),
|
||||
PatientId: fmt.Sprintf("%d", v.PatientId),
|
||||
Relation: v.Relation,
|
||||
Status: &v.Status,
|
||||
CardName: v.CardName,
|
||||
MobileMask: utils.MaskPhoneStr(v.UserPatient.User.Mobile),
|
||||
UserName: v.UserPatient.UserName,
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
patientFamilyResponses[i] = patientFamilyResponse
|
||||
}
|
||||
}
|
||||
return patientFamilyResponses
|
||||
}
|
||||
|
||||
@@ -1,92 +0,0 @@
|
||||
package postResponse
|
||||
|
||||
import (
|
||||
"hospital-admin-api/api/model"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// getPostPage 获取岗位列表-分页
|
||||
type getPostPage struct {
|
||||
PostId string `json:"post_id"` // 主键id
|
||||
PostName string `json:"post_name"` // 岗位名称
|
||||
PostStatus int `json:"post_status"` // 岗位状态(1:正常 2:删除)
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
}
|
||||
|
||||
// getPostList 获取岗位列表
|
||||
type getPostList struct {
|
||||
PostId string `json:"post_id"` // 主键id
|
||||
PostName string `json:"post_name"` // 岗位名称
|
||||
PostStatus int `json:"post_status"` // 岗位状态(1:正常 2:删除)
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
}
|
||||
|
||||
// GetPost 岗位详情
|
||||
type GetPost struct {
|
||||
PostId string `json:"post_id"` // 主键id
|
||||
PostName string `json:"post_name"` // 岗位名称
|
||||
PostStatus int `json:"post_status"` // 岗位状态(1:正常 2:删除)
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
}
|
||||
|
||||
// GetPostPageResponse 获取接口列表-分页
|
||||
func GetPostPageResponse(adminPost []*model.AdminPost) []getPostPage {
|
||||
// 处理返回值
|
||||
getPostPageResponses := make([]getPostPage, len(adminPost))
|
||||
|
||||
if len(adminPost) > 0 {
|
||||
for i, v := range adminPost {
|
||||
// 将原始结构体转换为新结构体
|
||||
getPostPageResponse := getPostPage{
|
||||
PostId: strconv.Itoa(int(v.PostId)),
|
||||
PostName: v.PostName,
|
||||
PostStatus: v.PostStatus,
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
getPostPageResponses[i] = getPostPageResponse
|
||||
}
|
||||
}
|
||||
|
||||
return getPostPageResponses
|
||||
}
|
||||
|
||||
// GetPostResponse 部门详情
|
||||
func GetPostResponse(adminPost *model.AdminPost) *GetPost {
|
||||
return &GetPost{
|
||||
PostId: strconv.Itoa(int(adminPost.PostId)),
|
||||
PostName: adminPost.PostName,
|
||||
PostStatus: adminPost.PostStatus,
|
||||
CreatedAt: adminPost.CreatedAt,
|
||||
UpdatedAt: adminPost.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
// GetPostListResponse 获取角色列表
|
||||
func GetPostListResponse(adminPost []*model.AdminPost) []getPostList {
|
||||
// 处理返回值
|
||||
getPostListResponses := make([]getPostList, len(adminPost))
|
||||
|
||||
if len(adminPost) > 0 {
|
||||
for i, v := range adminPost {
|
||||
// 将原始结构体转换为新结构体
|
||||
getPostListResponse := getPostList{
|
||||
PostId: strconv.Itoa(int(v.PostId)),
|
||||
PostName: v.PostName,
|
||||
PostStatus: v.PostStatus,
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
getPostListResponses[i] = getPostListResponse
|
||||
}
|
||||
}
|
||||
|
||||
return getPostListResponses
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
package roleResponse
|
||||
|
||||
import (
|
||||
"hospital-admin-api/api/model"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// GetRoleMenuList 角色菜单列表
|
||||
type GetRoleMenuList struct {
|
||||
MenuId string `json:"menu_id"` // 主键id
|
||||
MenuName string `json:"menu_name"` // 菜单名称
|
||||
MenuTitle string `json:"menu_title"` // 菜单名称
|
||||
ParentId string `json:"parent_id"` // 父菜单ID(0表示一级)
|
||||
MenuStatus int `json:"menu_status"` // 菜单状态(0:隐藏 1:正常)此优先级最高
|
||||
MenuType int `json:"menu_type"` // 菜单类型(1:模块 2:菜单 3:按钮)
|
||||
Permission string `json:"permission"` // 标识
|
||||
OrderNum int `json:"order_num"` // 显示顺序
|
||||
Icon string `json:"icon"` // 图标地址
|
||||
Path string `json:"path"` // 页面地址(#表示当前页)
|
||||
Component string `json:"component"` // 组件名称
|
||||
Children []*GetRoleMenuList `json:"children"` // 下级页面
|
||||
}
|
||||
|
||||
// GetRole 角色详情
|
||||
type GetRole struct {
|
||||
MenuIds []string `json:"menu_ids"` // 菜单id
|
||||
RoleId string `json:"role_id"` // 角色id
|
||||
RoleName string `json:"role_name"` // 角色名称
|
||||
RoleStatus int `json:"role_status"` // 角色状态(1:正常 2:禁用)
|
||||
IsAdmin int `json:"is_admin"` // 是否管理员(0:否 1:是)
|
||||
}
|
||||
|
||||
// GetRolePage 获取角色列表-分页
|
||||
type GetRolePage struct {
|
||||
RoleId string `json:"role_id"` // 角色id
|
||||
RoleName string `json:"role_name"` // 角色名称
|
||||
RoleStatus int `json:"role_status"` // 角色状态(1:正常 2:禁用)
|
||||
IsAdmin int `json:"is_admin"` // 是否管理员(0:否 1:是)
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
}
|
||||
|
||||
// GetRoleList 获取角色列表
|
||||
type GetRoleList struct {
|
||||
RoleId string `json:"role_id"` // 角色id
|
||||
RoleName string `json:"role_name"` // 角色名称
|
||||
RoleStatus int `json:"role_status"` // 角色状态(1:正常 2:禁用)
|
||||
IsAdmin int `json:"is_admin"` // 是否管理员(0:否 1:是)
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 修改时间
|
||||
}
|
||||
|
||||
// GetRoleListResponse 获取角色列表
|
||||
func GetRoleListResponse(adminRole []*model.AdminRole) []GetRoleList {
|
||||
// 处理返回值
|
||||
getRoleListResponses := make([]GetRoleList, len(adminRole))
|
||||
|
||||
if len(adminRole) > 0 {
|
||||
for i, v := range adminRole {
|
||||
// 将原始结构体转换为新结构体
|
||||
getRoleListResponse := GetRoleList{
|
||||
RoleId: strconv.Itoa(int(v.RoleId)),
|
||||
RoleName: v.RoleName,
|
||||
RoleStatus: v.RoleStatus,
|
||||
IsAdmin: v.IsAdmin,
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
getRoleListResponses[i] = getRoleListResponse
|
||||
}
|
||||
}
|
||||
|
||||
return getRoleListResponses
|
||||
}
|
||||
@@ -2,9 +2,6 @@ package userDoctorInfoResponse
|
||||
|
||||
import (
|
||||
"hospital-admin-api/api/model"
|
||||
"hospital-admin-api/utils"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type UserDoctorInfo struct {
|
||||
@@ -26,67 +23,3 @@ type UserDoctorInfo struct {
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间
|
||||
}
|
||||
|
||||
// UserDoctorInfoResponse 医生详情
|
||||
func UserDoctorInfoResponse(userDoctorInfo *model.UserDoctorInfo) *UserDoctorInfo {
|
||||
var licenseCert []string
|
||||
if userDoctorInfo.LicenseCert != "" {
|
||||
result := strings.Split(userDoctorInfo.LicenseCert, ",")
|
||||
if len(result) > 0 {
|
||||
for _, v := range result {
|
||||
v = utils.AddOssDomain(v)
|
||||
licenseCert = append(licenseCert, v)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var qualificationCert []string
|
||||
if userDoctorInfo.QualificationCert != "" {
|
||||
result := strings.Split(userDoctorInfo.QualificationCert, ",")
|
||||
if len(result) > 0 {
|
||||
for _, v := range result {
|
||||
v = utils.AddOssDomain(v)
|
||||
qualificationCert = append(qualificationCert, v)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var workCert []string
|
||||
if userDoctorInfo.WorkCert != "" {
|
||||
result := strings.Split(userDoctorInfo.WorkCert, ",")
|
||||
if len(result) > 0 {
|
||||
for _, v := range result {
|
||||
v = utils.AddOssDomain(v)
|
||||
workCert = append(workCert, v)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var multiPointImages []string
|
||||
if userDoctorInfo.MultiPointImages != "" {
|
||||
result := strings.Split(userDoctorInfo.MultiPointImages, ",")
|
||||
if len(result) > 0 {
|
||||
for _, v := range result {
|
||||
multiPointImages = append(multiPointImages, v)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return &UserDoctorInfo{
|
||||
DoctorInfoId: strconv.FormatInt(userDoctorInfo.DoctorInfoId, 10),
|
||||
UserId: strconv.FormatInt(userDoctorInfo.UserId, 10),
|
||||
DoctorId: strconv.FormatInt(userDoctorInfo.DoctorId, 10),
|
||||
CardType: userDoctorInfo.CardType,
|
||||
CardName: userDoctorInfo.CardName,
|
||||
CardNameMask: userDoctorInfo.CardNameMask,
|
||||
CardNumMask: userDoctorInfo.CardNumMask,
|
||||
LicenseCert: licenseCert,
|
||||
QualificationCert: qualificationCert,
|
||||
QualificationCertNum: userDoctorInfo.QualificationCertNum,
|
||||
WorkCert: workCert,
|
||||
MultiPointImages: multiPointImages,
|
||||
IdCardFront: utils.AddOssDomain(userDoctorInfo.IdCardFront),
|
||||
IdCardBack: utils.AddOssDomain(userDoctorInfo.IdCardBack),
|
||||
SignImage: utils.AddOssDomain(userDoctorInfo.SignImage),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,256 +1,13 @@
|
||||
package userDoctorResponse
|
||||
|
||||
import (
|
||||
"hospital-admin-api/api/dto"
|
||||
"hospital-admin-api/api/model"
|
||||
"hospital-admin-api/api/responses/doctorBankCardResponse"
|
||||
"hospital-admin-api/api/responses/doctorExpertiseResponse"
|
||||
"hospital-admin-api/api/responses/hospitalResponse"
|
||||
"hospital-admin-api/api/responses/userDoctorInfoResponse"
|
||||
"hospital-admin-api/api/responses/userResponse"
|
||||
"hospital-admin-api/utils"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// getUserDoctorPage 获取医生列表-分页
|
||||
type getUserDoctorPage struct {
|
||||
DoctorID string `json:"doctor_id"` // 主键id
|
||||
UserID string `json:"user_id"` // 用户id
|
||||
UserName string `json:"user_name"` // 用户名称
|
||||
Status int `json:"status"` // 状态(0:禁用 1:正常 2:删除)
|
||||
IDCardStatus int `json:"idcard_status"` // 实名认证状态(0:未认证 1:认证通过 2:认证失败)
|
||||
IdenAuthStatus int `json:"iden_auth_status"` // 身份认证状态(0:未认证 1:认证通过 2:审核中 3:认证失败)
|
||||
IdenAuthTime model.LocalTime `json:"iden_auth_time"` // 审核时间
|
||||
IdenAuthFailReason string `json:"iden_auth_fail_reason"` // 身份认证失败原因
|
||||
MultiPointStatus int `json:"multi_point_status"` // 医生多点执业认证状态(0:未认证 1:认证通过 2:审核中 3:认证失败)
|
||||
MultiPointTime model.LocalTime `json:"multi_point_time"` // 审核时间
|
||||
MultiPointFailReason string `json:"multi_point_fail_reason"` // 多点执业认证失败原因
|
||||
IsBindBank int `json:"is_bind_bank"` // 是否已绑定结算银行卡(0:否 1:是)
|
||||
IsRecommend int `json:"is_recommend"` // 是否首页推荐(0:否 1:是)
|
||||
Avatar string `json:"avatar"` // 头像
|
||||
DoctorTitle int `json:"doctor_title"` // 医生职称(1:主任医师 2:主任中医师 3:副主任医师 4:副主任中医师 5:主治医师 6:住院医师)
|
||||
DepartmentCustomName string `json:"department_custom_name"` // 科室名称(如未自己输入,填入标准科室名称)
|
||||
DepartmentCustomMobile string `json:"department_custom_mobile"` // 科室电话
|
||||
HospitalID string `json:"hospital_id"` // 所属医院id
|
||||
HospitalName string `json:"hospital_name"` // 医院名称
|
||||
ServedPatientsNum int `json:"served_patients_num"` // 服务患者数量(订单结束时统计)
|
||||
PraiseRate float64 `json:"praise_rate"` // 好评率(百分制。订单平均评价中超过4-5分的订单总数 / 总订单数 * 5)
|
||||
AvgResponseTime float64 `json:"avg_response_time"` // 平均响应时间(分钟制)
|
||||
NumberOfFans uint `json:"number_of_fans"` // 被关注数量
|
||||
IsImgExpertReception int `json:"is_img_expert_reception"` // 是否参加专家图文接诊(0:否 1:是)
|
||||
IsImgWelfareReception int `json:"is_img_welfare_reception"` // 是否参加公益图文问诊(0:否 1:是)
|
||||
IsImgQuickReception int `json:"is_img_quick_reception"` // 是否参加快速图文接诊(0:否 1:是)
|
||||
IsPlatformDeepCooperation int `json:"is_platform_deep_cooperation"` // 是否平台深度合作医生(0:否 1:是)
|
||||
Mobile string `json:"mobile"` // 手机号
|
||||
RegisterMethod int `json:"register_method"` // 注册方式(1:微信小程序 )
|
||||
Age uint `json:"age"` // 年龄
|
||||
Sex int `json:"sex"` // 性别(0:未知 1:男 2:女)
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间
|
||||
}
|
||||
|
||||
// GetUserDoctor 医生详情
|
||||
type GetUserDoctor struct {
|
||||
DoctorID string `json:"doctor_id"` // 主键id
|
||||
UserID string `json:"user_id"` // 用户id
|
||||
UserName string `json:"user_name"` // 用户名称
|
||||
Status int `json:"status"` // 状态(0:禁用 1:正常 2:删除)
|
||||
IDCardStatus int `json:"idcard_status"` // 实名认证状态(0:未认证 1:认证通过 2:认证失败)
|
||||
IdenAuthStatus int `json:"iden_auth_status"` // 身份认证状态(0:未认证 1:认证通过 2:审核中 3:认证失败)
|
||||
IdenAuthTime model.LocalTime `json:"iden_auth_time"` // 审核时间
|
||||
IdenAuthFailReason string `json:"iden_auth_fail_reason"` // 身份认证失败原因
|
||||
MultiPointStatus int `json:"multi_point_status"` // 医生多点执业认证状态(0:未认证 1:认证通过 2:审核中 3:认证失败)
|
||||
MultiPointTime model.LocalTime `json:"multi_point_time"` // 审核时间
|
||||
MultiPointFailReason string `json:"multi_point_fail_reason"` // 多点执业认证失败原因
|
||||
IsBindBank int `json:"is_bind_bank"` // 是否已绑定结算银行卡(0:否 1:是)
|
||||
IsRecommend int `json:"is_recommend"` // 是否首页推荐(0:否 1:是)
|
||||
Avatar string `json:"avatar"` // 头像
|
||||
DoctorTitle int `json:"doctor_title"` // 医生职称(1:主任医师 2:主任中医师 3:副主任医师 4:副主任中医师 5:主治医师 6:住院医师)
|
||||
DepartmentCustomID string `json:"department_custom_id"` // 科室id-自定义
|
||||
DepartmentCustomName string `json:"department_custom_name"` // 科室名称(如未自己输入,填入标准科室名称)
|
||||
DepartmentCustomMobile string `json:"department_custom_mobile"` // 科室电话
|
||||
HospitalID string `json:"hospital_id"` // 所属医院id
|
||||
ServedPatientsNum int `json:"served_patients_num"` // 服务患者数量(订单结束时统计)
|
||||
PraiseRate float64 `json:"praise_rate"` // 好评率(百分制。订单平均评价中超过4-5分的订单总数 / 总订单数 * 5)
|
||||
AvgResponseTime float64 `json:"avg_response_time"` // 平均响应时间(分钟制)
|
||||
NumberOfFans uint `json:"number_of_fans"` // 被关注数量
|
||||
IsOnline int `json:"is_online"` // 是否在线(0:不在线 1:在线)
|
||||
IsImgExpertReception int `json:"is_img_expert_reception"` // 是否参加专家图文接诊(0:否 1:是)
|
||||
IsImgWelfareReception int `json:"is_img_welfare_reception"` // 是否参加公益图文问诊(0:否 1:是)
|
||||
IsImgQuickReception int `json:"is_img_quick_reception"` // 是否参加快速图文接诊(0:否 1:是)
|
||||
IsPlatformDeepCooperation int `json:"is_platform_deep_cooperation"` // 是否平台深度合作医生(0:否 1:是)
|
||||
IsEnterpriseDeepCooperation int `json:"is_enterprise_deep_cooperation"` // 是否企业深度合作医生(0:否 1:是)
|
||||
IsSysDiagnoCooperation int `json:"is_sys_diagno_cooperation"` // 是否先思达合作医生(0:否 1:是)
|
||||
QrCode string `json:"qr_code"` // 分享二维码
|
||||
BeGoodAt string `json:"be_good_at"` // 擅长
|
||||
BriefIntroduction string `json:"brief_introduction"` // 医生简介
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间
|
||||
User *userResponse.User `json:"user"` // 用户
|
||||
Hospital *hospitalResponse.Hospital `json:"hospital"` // 医院
|
||||
UserDoctorInfo *userDoctorInfoResponse.UserDoctorInfo `json:"user_doctor_info"` // 医生详情
|
||||
DoctorExpertise []*doctorExpertiseResponse.DoctorExpertise `json:"doctor_expertise"` // 医生专长
|
||||
DoctorBankCard doctorBankCardResponse.DoctorBankCard `json:"doctor_bank_card"` // 医生银行卡
|
||||
}
|
||||
|
||||
// UserDoctor 医生详情
|
||||
type UserDoctor struct {
|
||||
DoctorID string `json:"doctor_id"` // 主键id
|
||||
UserID string `json:"user_id"` // 用户id
|
||||
UserName string `json:"user_name"` // 用户名称
|
||||
Status int `json:"status"` // 状态(0:禁用 1:正常 2:删除)
|
||||
IDCardStatus int `json:"idcard_status"` // 实名认证状态(0:未认证 1:认证通过 2:认证失败)
|
||||
IdenAuthStatus int `json:"iden_auth_status"` // 身份认证状态(0:未认证 1:认证通过 2:审核中 3:认证失败)
|
||||
IdenAuthTime model.LocalTime `json:"iden_auth_time"` // 审核时间
|
||||
IdenAuthFailReason string `json:"iden_auth_fail_reason"` // 身份认证失败原因
|
||||
MultiPointStatus int `json:"multi_point_status"` // 医生多点执业认证状态(0:未认证 1:认证通过 2:审核中 3:认证失败)
|
||||
MultiPointTime model.LocalTime `json:"multi_point_time"` // 审核时间
|
||||
MultiPointFailReason string `json:"multi_point_fail_reason"` // 多点执业认证失败原因
|
||||
IsBindBank int `json:"is_bind_bank"` // 是否已绑定结算银行卡(0:否 1:是)
|
||||
IsRecommend int `json:"is_recommend"` // 是否首页推荐(0:否 1:是)
|
||||
Avatar string `json:"avatar"` // 头像
|
||||
DoctorTitle int `json:"doctor_title"` // 医生职称(1:主任医师 2:主任中医师 3:副主任医师 4:副主任中医师 5:主治医师 6:住院医师)
|
||||
DepartmentCustomID string `json:"department_custom_id"` // 科室id-自定义
|
||||
DepartmentCustomName string `json:"department_custom_name"` // 科室名称(如未自己输入,填入标准科室名称)
|
||||
DepartmentCustomMobile string `json:"department_custom_mobile"` // 科室电话
|
||||
HospitalID string `json:"hospital_id"` // 所属医院id
|
||||
ServedPatientsNum int `json:"served_patients_num"` // 服务患者数量(订单结束时统计)
|
||||
PraiseRate float64 `json:"praise_rate"` // 好评率(百分制。订单平均评价中超过4-5分的订单总数 / 总订单数 * 5)
|
||||
AvgResponseTime float64 `json:"avg_response_time"` // 平均响应时间(分钟制)
|
||||
NumberOfFans uint `json:"number_of_fans"` // 被关注数量
|
||||
IsOnline int `json:"is_online"` // 是否在线(0:不在线 1:在线)
|
||||
IsImgExpertReception int `json:"is_img_expert_reception"` // 是否参加专家图文接诊(0:否 1:是)
|
||||
IsImgWelfareReception int `json:"is_img_welfare_reception"` // 是否参加公益图文问诊(0:否 1:是)
|
||||
IsImgQuickReception int `json:"is_img_quick_reception"` // 是否参加快速图文接诊(0:否 1:是)
|
||||
IsPlatformDeepCooperation int `json:"is_platform_deep_cooperation"` // 是否平台深度合作医生(0:否 1:是)
|
||||
IsEnterpriseDeepCooperation int `json:"is_enterprise_deep_cooperation"` // 是否企业深度合作医生(0:否 1:是)
|
||||
IsSysDiagnoCooperation int `json:"is_sys_diagno_cooperation"` // 是否先思达合作医生(0:否 1:是)
|
||||
QrCode string `json:"qr_code"` // 分享二维码
|
||||
BeGoodAt string `json:"be_good_at"` // 擅长
|
||||
BriefIntroduction string `json:"brief_introduction"` // 医生简介
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间
|
||||
User *userResponse.User `json:"user"` // 用户
|
||||
Hospital *hospitalResponse.Hospital `json:"hospital"` // 医院
|
||||
UserDoctorInfo *userDoctorInfoResponse.UserDoctorInfo `json:"user_doctor_info"` // 医生详情
|
||||
DoctorExpertise []*doctorExpertiseResponse.DoctorExpertise `json:"doctor_expertise"` // 医生专长
|
||||
DoctorBankCard doctorBankCardResponse.DoctorBankCard `json:"doctor_bank_card"` // 医生银行卡
|
||||
}
|
||||
|
||||
// getUserDoctorPendingPage 身份审核-获取医生列表-分页
|
||||
type getUserDoctorPendingPage struct {
|
||||
DoctorID string `json:"doctor_id"` // 主键id
|
||||
UserID string `json:"user_id"` // 用户id
|
||||
UserName string `json:"user_name"` // 用户名称
|
||||
Status int `json:"status"` // 状态(0:禁用 1:正常 2:删除)
|
||||
IDCardStatus int `json:"idcard_status"` // 实名认证状态(0:未认证 1:认证通过 2:认证失败)
|
||||
IdenAuthStatus int `json:"iden_auth_status"` // 身份认证状态(0:未认证 1:认证通过 2:审核中 3:认证失败)
|
||||
IdenAuthTime model.LocalTime `json:"iden_auth_time"` // 审核时间
|
||||
IdenAuthFailReason string `json:"iden_auth_fail_reason"` // 身份认证失败原因
|
||||
Avatar string `json:"avatar"` // 头像
|
||||
DoctorTitle int `json:"doctor_title"` // 医生职称(1:主任医师 2:主任中医师 3:副主任医师 4:副主任中医师 5:主治医师 6:住院医师)
|
||||
DepartmentCustomName string `json:"department_custom_name"` // 科室名称(如未自己输入,填入标准科室名称)
|
||||
DepartmentCustomMobile string `json:"department_custom_mobile"` // 科室电话
|
||||
HospitalID string `json:"hospital_id"` // 所属医院id
|
||||
HospitalName string `json:"hospital_name"` // 医院名称
|
||||
Mobile string `json:"mobile"` // 手机号
|
||||
Age uint `json:"age"` // 年龄
|
||||
Sex int `json:"sex"` // 性别(0:未知 1:男 2:女)
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间
|
||||
}
|
||||
|
||||
// GetMultiPage 多点-获取医生列表-分页
|
||||
type GetMultiPage struct {
|
||||
DoctorID string `json:"doctor_id"` // 主键id
|
||||
UserID string `json:"user_id"` // 用户id
|
||||
UserName string `json:"user_name"` // 用户名称
|
||||
Status int `json:"status"` // 状态(0:禁用 1:正常 2:删除)
|
||||
IDCardStatus int `json:"idcard_status"` // 实名认证状态(0:未认证 1:认证通过 2:认证失败)
|
||||
MultiPointStatus int `json:"multi_point_status"` // 医生多点执业认证状态(0:未认证 1:认证通过 2:审核中 3:认证失败)
|
||||
MultiPointTime model.LocalTime `json:"multi_point_time"` // 审核时间
|
||||
MultiPointFailReason string `json:"multi_point_fail_reason"` // 多点执业认证失败原因
|
||||
Avatar string `json:"avatar"` // 头像
|
||||
DoctorTitle int `json:"doctor_title"` // 医生职称(1:主任医师 2:主任中医师 3:副主任医师 4:副主任中医师 5:主治医师 6:住院医师)
|
||||
DepartmentCustomName string `json:"department_custom_name"` // 科室名称(如未自己输入,填入标准科室名称)
|
||||
DepartmentCustomMobile string `json:"department_custom_mobile"` // 科室电话
|
||||
HospitalID string `json:"hospital_id"` // 所属医院id
|
||||
HospitalName string `json:"hospital_name"` // 医院名称
|
||||
Mobile string `json:"mobile"` // 手机号
|
||||
Age uint `json:"age"` // 年龄
|
||||
Sex int `json:"sex"` // 性别(0:未知 1:男 2:女)
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间
|
||||
}
|
||||
|
||||
// GetUserDoctorPending 身份审核-医生详情
|
||||
type GetUserDoctorPending struct {
|
||||
DoctorID string `json:"doctor_id"` // 主键id
|
||||
UserID string `json:"user_id"` // 用户id
|
||||
UserName string `json:"user_name"` // 用户名称
|
||||
Status int `json:"status"` // 状态(0:禁用 1:正常 2:删除)
|
||||
IDCardStatus int `json:"idcard_status"` // 实名认证状态(0:未认证 1:认证通过 2:认证失败)
|
||||
IdenAuthStatus int `json:"iden_auth_status"` // 身份认证状态(0:未认证 1:认证通过 2:审核中 3:认证失败)
|
||||
IdenAuthTime model.LocalTime `json:"iden_auth_time"` // 审核时间
|
||||
IdenAuthFailReason *IdenAuthFailReason `json:"iden_auth_fail_reason"` // 身份认证失败原因
|
||||
Avatar string `json:"avatar"` // 头像
|
||||
DoctorTitle int `json:"doctor_title"` // 医生职称(1:主任医师 2:主任中医师 3:副主任医师 4:副主任中医师 5:主治医师 6:住院医师)
|
||||
DepartmentCustomID string `json:"department_custom_id"` // 科室id-自定义
|
||||
DepartmentCustomName string `json:"department_custom_name"` // 科室名称(如未自己输入,填入标准科室名称)
|
||||
DepartmentCustomMobile string `json:"department_custom_mobile"` // 科室电话
|
||||
HospitalID string `json:"hospital_id"` // 所属医院id
|
||||
BeGoodAt string `json:"be_good_at"` // 擅长
|
||||
BriefIntroduction string `json:"brief_introduction"` // 医生简介
|
||||
IsPlatformDeepCooperation int `json:"is_platform_deep_cooperation"` // 是否平台深度合作医生(0:否 1:是)
|
||||
IsEnterpriseDeepCooperation int `json:"is_enterprise_deep_cooperation"` // 是否企业深度合作医生(0:否 1:是)
|
||||
IsSysDiagnoCooperation int `json:"is_sys_diagno_cooperation"` // 是否先思达合作医生(0:否 1:是)
|
||||
IsRecommend int `json:"is_recommend"` // 是否首页推荐(0:否 1:是)
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间
|
||||
User *userResponse.User `json:"user"` // 用户
|
||||
Hospital *hospitalResponse.Hospital `json:"hospital"` // 医院
|
||||
UserDoctorInfo *userDoctorInfoResponse.UserDoctorInfo `json:"user_doctor_info"` // 医生详情
|
||||
DoctorExpertise []*doctorExpertiseResponse.DoctorExpertise `json:"doctor_expertise"` // 医生专长
|
||||
}
|
||||
|
||||
// IdenAuthFailReason 身份认证失败原因
|
||||
type IdenAuthFailReason struct {
|
||||
AvatarReason string `json:"avatar_reason"` // 头像失败原因
|
||||
DepartmentCustomMobileReason string `json:"department_custom_mobile_reason"` // 科室电话失败原因
|
||||
DepartmentCustomNameReason string `json:"department_custom_name_reason"` // 科室名称失败原因
|
||||
BriefIntroductionReason string `json:"brief_introduction_reason"` // 医生简介失败原因
|
||||
BeGoodAtReason string `json:"be_good_at_reason"` // 医生简介失败原因
|
||||
LicenseCertReason string `json:"license_cert_reason"` // 医师执业证失败原因
|
||||
QualificationCertReason string `json:"qualification_cert_reason"` // 医师资格证失败原因
|
||||
WorkCertReason string `json:"work_cert_reason"` // 医师工作证失败原因
|
||||
}
|
||||
|
||||
// GetMulti 多点-医生详情
|
||||
type GetMulti struct {
|
||||
DoctorID string `json:"doctor_id"` // 主键id
|
||||
UserID string `json:"user_id"` // 用户id
|
||||
UserName string `json:"user_name"` // 用户名称
|
||||
Status int `json:"status"` // 状态(0:禁用 1:正常 2:删除)
|
||||
IDCardStatus int `json:"idcard_status"` // 实名认证状态(0:未认证 1:认证通过 2:认证失败)
|
||||
MultiPointStatus int `json:"multi_point_status"` // 医生多点执业认证状态(0:未认证 1:认证通过 2:审核中 3:认证失败)
|
||||
MultiPointTime model.LocalTime `json:"multi_point_time"` // 审核时间
|
||||
MultiPointFailReason string `json:"multi_point_fail_reason"` // 多点执业认证失败原因
|
||||
Avatar string `json:"avatar"` // 头像
|
||||
DoctorTitle int `json:"doctor_title"` // 医生职称(1:主任医师 2:主任中医师 3:副主任医师 4:副主任中医师 5:主治医师 6:住院医师)
|
||||
DepartmentCustomID string `json:"department_custom_id"` // 科室id-自定义
|
||||
DepartmentCustomName string `json:"department_custom_name"` // 科室名称(如未自己输入,填入标准科室名称)
|
||||
DepartmentCustomMobile string `json:"department_custom_mobile"` // 科室电话
|
||||
HospitalID string `json:"hospital_id"` // 所属医院id
|
||||
BeGoodAt string `json:"be_good_at"` // 擅长
|
||||
BriefIntroduction string `json:"brief_introduction"` // 医生简介
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间
|
||||
User *userResponse.User `json:"user"` // 用户
|
||||
Hospital *hospitalResponse.Hospital `json:"hospital"` // 医院
|
||||
UserDoctorInfo *userDoctorInfoResponse.UserDoctorInfo `json:"user_doctor_info"` // 医生详情
|
||||
}
|
||||
|
||||
// OrderInquiryUserDoctor 订单-医生详情
|
||||
type OrderInquiryUserDoctor struct {
|
||||
// GetUserDoctorById 医生详情-医生id
|
||||
type GetUserDoctorById struct {
|
||||
DoctorID string `json:"doctor_id"` // 主键id
|
||||
UserID string `json:"user_id"` // 用户id
|
||||
UserName string `json:"user_name"` // 用户名称
|
||||
@@ -263,152 +20,6 @@ type OrderInquiryUserDoctor struct {
|
||||
HospitalID string `json:"hospital_id"` // 所属医院id
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间
|
||||
Hospital *hospitalResponse.Hospital `json:"hospital"` // 医院
|
||||
Hospital *dto.HospitalDto `json:"hospital"` // 医院
|
||||
UserDoctorInfo *userDoctorInfoResponse.UserDoctorInfo `json:"user_doctor_info"` // 医生详情
|
||||
}
|
||||
|
||||
// GetUserDoctorPageResponse 获取用户列表-分页
|
||||
func GetUserDoctorPageResponse(userDoctor []*model.UserDoctor) []getUserDoctorPage {
|
||||
// 处理返回值
|
||||
getUserPageResponses := make([]getUserDoctorPage, len(userDoctor))
|
||||
|
||||
if len(userDoctor) > 0 {
|
||||
for i, v := range userDoctor {
|
||||
// 将原始结构体转换为新结构体
|
||||
getUserDoctorPageResponse := getUserDoctorPage{
|
||||
DoctorID: strconv.Itoa(int(v.DoctorId)),
|
||||
UserID: strconv.Itoa(int(v.UserId)),
|
||||
UserName: v.UserName,
|
||||
Status: v.Status,
|
||||
IDCardStatus: v.Status,
|
||||
IdenAuthStatus: v.IdenAuthStatus,
|
||||
IdenAuthTime: v.IdenAuthTime,
|
||||
IdenAuthFailReason: v.IdenAuthFailReason,
|
||||
MultiPointStatus: v.MultiPointStatus,
|
||||
MultiPointTime: v.MultiPointTime,
|
||||
MultiPointFailReason: v.MultiPointFailReason,
|
||||
IsBindBank: v.IsBindBank,
|
||||
IsRecommend: v.IsRecommend,
|
||||
Avatar: utils.AddOssDomain(v.Avatar),
|
||||
DoctorTitle: v.DoctorTitle,
|
||||
DepartmentCustomName: v.DepartmentCustomName,
|
||||
DepartmentCustomMobile: v.DepartmentCustomMobile,
|
||||
HospitalID: strconv.Itoa(int(v.HospitalID)),
|
||||
ServedPatientsNum: v.ServedPatientsNum,
|
||||
PraiseRate: v.PraiseRate,
|
||||
AvgResponseTime: v.AvgResponseTime,
|
||||
NumberOfFans: v.NumberOfFans,
|
||||
IsImgExpertReception: v.IsImgExpertReception,
|
||||
IsImgWelfareReception: v.IsImgWelfareReception,
|
||||
IsImgQuickReception: v.IsImgQuickReception,
|
||||
IsPlatformDeepCooperation: v.IsPlatformDeepCooperation,
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
}
|
||||
|
||||
if v.User != nil {
|
||||
getUserDoctorPageResponse.Mobile = v.User.Mobile
|
||||
getUserDoctorPageResponse.RegisterMethod = v.User.RegisterMethod
|
||||
getUserDoctorPageResponse.Age = v.User.Age
|
||||
getUserDoctorPageResponse.Sex = v.User.Sex
|
||||
}
|
||||
|
||||
if v.Hospital != nil {
|
||||
getUserDoctorPageResponse.HospitalName = v.Hospital.HospitalName
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
getUserPageResponses[i] = getUserDoctorPageResponse
|
||||
}
|
||||
}
|
||||
|
||||
return getUserPageResponses
|
||||
}
|
||||
|
||||
// GetUserDoctorPendingPageResponse 身份审核-获取医生列表-分页
|
||||
func GetUserDoctorPendingPageResponse(userDoctor []*model.UserDoctor) []getUserDoctorPendingPage {
|
||||
// 处理返回值
|
||||
getUserDoctorPendingPageResponses := make([]getUserDoctorPendingPage, len(userDoctor))
|
||||
|
||||
if len(userDoctor) > 0 {
|
||||
for i, v := range userDoctor {
|
||||
// 将原始结构体转换为新结构体
|
||||
getUserDoctorPageResponse := getUserDoctorPendingPage{
|
||||
DoctorID: strconv.Itoa(int(v.DoctorId)),
|
||||
UserID: strconv.Itoa(int(v.UserId)),
|
||||
UserName: v.UserName,
|
||||
Status: v.Status,
|
||||
IDCardStatus: v.Status,
|
||||
IdenAuthStatus: v.IdenAuthStatus,
|
||||
IdenAuthTime: v.IdenAuthTime,
|
||||
IdenAuthFailReason: v.IdenAuthFailReason,
|
||||
Avatar: utils.AddOssDomain(v.Avatar),
|
||||
DoctorTitle: v.DoctorTitle,
|
||||
DepartmentCustomName: v.DepartmentCustomName,
|
||||
DepartmentCustomMobile: v.DepartmentCustomMobile,
|
||||
HospitalID: strconv.Itoa(int(v.HospitalID)),
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
}
|
||||
|
||||
if v.User != nil {
|
||||
getUserDoctorPageResponse.Mobile = v.User.Mobile
|
||||
getUserDoctorPageResponse.Age = v.User.Age
|
||||
getUserDoctorPageResponse.Sex = v.User.Sex
|
||||
}
|
||||
|
||||
if v.Hospital != nil {
|
||||
getUserDoctorPageResponse.HospitalName = v.Hospital.HospitalName
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
getUserDoctorPendingPageResponses[i] = getUserDoctorPageResponse
|
||||
}
|
||||
}
|
||||
|
||||
return getUserDoctorPendingPageResponses
|
||||
}
|
||||
|
||||
// GetMultiPageResponse 多点-获取医生列表-分页
|
||||
func GetMultiPageResponse(userDoctor []*model.UserDoctor) []GetMultiPage {
|
||||
// 处理返回值
|
||||
r := make([]GetMultiPage, len(userDoctor))
|
||||
|
||||
if len(userDoctor) > 0 {
|
||||
for i, v := range userDoctor {
|
||||
// 将原始结构体转换为新结构体
|
||||
g := GetMultiPage{
|
||||
DoctorID: strconv.Itoa(int(v.DoctorId)),
|
||||
UserID: strconv.Itoa(int(v.UserId)),
|
||||
UserName: v.UserName,
|
||||
Status: v.Status,
|
||||
IDCardStatus: v.Status,
|
||||
MultiPointStatus: v.MultiPointStatus,
|
||||
MultiPointTime: v.MultiPointTime,
|
||||
MultiPointFailReason: v.MultiPointFailReason,
|
||||
Avatar: utils.AddOssDomain(v.Avatar),
|
||||
DoctorTitle: v.DoctorTitle,
|
||||
DepartmentCustomName: v.DepartmentCustomName,
|
||||
DepartmentCustomMobile: v.DepartmentCustomMobile,
|
||||
HospitalID: strconv.Itoa(int(v.HospitalID)),
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
}
|
||||
|
||||
if v.User != nil {
|
||||
g.Mobile = v.User.Mobile
|
||||
g.Age = v.User.Age
|
||||
g.Sex = v.User.Sex
|
||||
}
|
||||
|
||||
if v.Hospital != nil {
|
||||
g.HospitalName = v.Hospital.HospitalName
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
r[i] = g
|
||||
}
|
||||
}
|
||||
|
||||
return r
|
||||
}
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
package userPatientResponse
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"hospital-admin-api/api/model"
|
||||
"hospital-admin-api/api/responses/patientFamilyResponse"
|
||||
"hospital-admin-api/api/responses/userShipAddressResponse"
|
||||
"hospital-admin-api/utils"
|
||||
)
|
||||
|
||||
// getUserPatientPage 获取患者列表-分页
|
||||
@@ -36,38 +34,3 @@ type GetUserPatient struct {
|
||||
CreatedAt model.LocalTime `json:"created_at"` // 创建时间
|
||||
UpdatedAt model.LocalTime `json:"updated_at"` // 更新时间
|
||||
}
|
||||
|
||||
// GetUserPatientPageResponse 获取用户列表-分页
|
||||
func GetUserPatientPageResponse(userPatient []*model.UserPatient) []getUserPatientPage {
|
||||
// 处理返回值
|
||||
responses := make([]getUserPatientPage, len(userPatient))
|
||||
|
||||
if len(userPatient) > 0 {
|
||||
for i, v := range userPatient {
|
||||
// 将原始结构体转换为新结构体
|
||||
response := getUserPatientPage{
|
||||
PatientId: fmt.Sprintf("%d", v.PatientId),
|
||||
UserId: fmt.Sprintf("%d", v.UserId),
|
||||
UserName: v.UserName,
|
||||
Status: v.Status,
|
||||
Avatar: utils.AddOssDomain(v.Avatar),
|
||||
DisableReason: v.DisableReason,
|
||||
CreatedAt: v.CreatedAt,
|
||||
UpdatedAt: v.UpdatedAt,
|
||||
}
|
||||
|
||||
if v.PatientFamily != nil {
|
||||
response.PatientFamilyCount = len(v.PatientFamily)
|
||||
}
|
||||
|
||||
if v.User != nil {
|
||||
response.Mobile = utils.MaskPhoneStr(v.User.Mobile)
|
||||
}
|
||||
|
||||
// 将转换后的结构体添加到新切片中
|
||||
responses[i] = response
|
||||
}
|
||||
}
|
||||
|
||||
return responses
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user