处理链接为默认值的问题
This commit is contained in:
parent
11c926fbfb
commit
12c5379d78
@ -1,6 +1,8 @@
|
|||||||
package adminResponse
|
package adminResponse
|
||||||
|
|
||||||
import "hospital-admin-api/config"
|
import (
|
||||||
|
"hospital-admin-api/utils"
|
||||||
|
)
|
||||||
|
|
||||||
// Login 登陆
|
// Login 登陆
|
||||||
type Login struct {
|
type Login struct {
|
||||||
@ -12,6 +14,6 @@ type Login struct {
|
|||||||
|
|
||||||
// GetFullAvatar 返回带有指定字符串的头像路径
|
// GetFullAvatar 返回带有指定字符串的头像路径
|
||||||
func (l *Login) GetFullAvatar() Login {
|
func (l *Login) GetFullAvatar() Login {
|
||||||
l.Avatar = config.C.Oss.OssCustomDomainName + "/" + l.Avatar
|
l.Avatar = utils.AddOssDomain(l.Avatar)
|
||||||
return Login{}
|
return Login{}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@ package adminUserResponse
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"hospital-admin-api/api/model"
|
"hospital-admin-api/api/model"
|
||||||
"hospital-admin-api/config"
|
"hospital-admin-api/utils"
|
||||||
"strconv"
|
"strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -102,7 +102,7 @@ func GetUserPageResponse(adminUser []*model.AdminUser) []getUserPage {
|
|||||||
IsDisabled: v.IsDisabled,
|
IsDisabled: v.IsDisabled,
|
||||||
NickName: v.NickName,
|
NickName: v.NickName,
|
||||||
Phone: v.Phone,
|
Phone: v.Phone,
|
||||||
Avatar: config.C.Oss.OssCustomDomainName + "/" + v.Avatar,
|
Avatar: utils.AddOssDomain(v.Avatar),
|
||||||
Sex: v.Sex,
|
Sex: v.Sex,
|
||||||
Email: v.Email,
|
Email: v.Email,
|
||||||
RoleID: strconv.Itoa(int(v.RoleID)),
|
RoleID: strconv.Itoa(int(v.RoleID)),
|
||||||
@ -133,7 +133,7 @@ func GetUserResponse(adminUser *model.AdminUser) *getUser {
|
|||||||
IsDisabled: adminUser.IsDisabled,
|
IsDisabled: adminUser.IsDisabled,
|
||||||
NickName: adminUser.NickName,
|
NickName: adminUser.NickName,
|
||||||
Phone: adminUser.Phone,
|
Phone: adminUser.Phone,
|
||||||
Avatar: config.C.Oss.OssCustomDomainName + "/" + adminUser.Avatar,
|
Avatar: utils.AddOssDomain(adminUser.Avatar),
|
||||||
Sex: adminUser.Sex,
|
Sex: adminUser.Sex,
|
||||||
Email: adminUser.Email,
|
Email: adminUser.Email,
|
||||||
RoleID: strconv.FormatInt(adminUser.RoleID, 10),
|
RoleID: strconv.FormatInt(adminUser.RoleID, 10),
|
||||||
|
|||||||
@ -2,7 +2,7 @@ package basicBankResponse
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"hospital-admin-api/api/model"
|
"hospital-admin-api/api/model"
|
||||||
"hospital-admin-api/config"
|
"hospital-admin-api/utils"
|
||||||
"strconv"
|
"strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -22,8 +22,8 @@ func BasicBankResponse(basicBank *model.BasicBank) *BasicBank {
|
|||||||
BankId: strconv.FormatInt(basicBank.BankId, 10),
|
BankId: strconv.FormatInt(basicBank.BankId, 10),
|
||||||
BankCode: basicBank.BankCode,
|
BankCode: basicBank.BankCode,
|
||||||
BankName: basicBank.BankName,
|
BankName: basicBank.BankName,
|
||||||
BankIconPath: config.C.Oss.OssCustomDomainName + basicBank.BankIconPath,
|
BankIconPath: utils.AddOssDomain(basicBank.BankIconPath),
|
||||||
BankImgPath: config.C.Oss.OssCustomDomainName + basicBank.BankImgPath,
|
BankImgPath: utils.AddOssDomain(basicBank.BankImgPath),
|
||||||
CreatedAt: basicBank.CreatedAt,
|
CreatedAt: basicBank.CreatedAt,
|
||||||
UpdatedAt: basicBank.UpdatedAt,
|
UpdatedAt: basicBank.UpdatedAt,
|
||||||
}
|
}
|
||||||
@ -41,8 +41,8 @@ func GetBasicBankListResponse(basicBank []*model.BasicBank) []BasicBank {
|
|||||||
BankId: strconv.FormatInt(v.BankId, 10),
|
BankId: strconv.FormatInt(v.BankId, 10),
|
||||||
BankCode: v.BankCode,
|
BankCode: v.BankCode,
|
||||||
BankName: v.BankName,
|
BankName: v.BankName,
|
||||||
BankIconPath: config.C.Oss.OssCustomDomainName + v.BankIconPath,
|
BankIconPath: utils.AddOssDomain(v.BankIconPath),
|
||||||
BankImgPath: config.C.Oss.OssCustomDomainName + v.BankImgPath,
|
BankImgPath: utils.AddOssDomain(v.BankImgPath),
|
||||||
CreatedAt: v.CreatedAt,
|
CreatedAt: v.CreatedAt,
|
||||||
UpdatedAt: v.UpdatedAt,
|
UpdatedAt: v.UpdatedAt,
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@ package userDoctorInfoResponse
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"hospital-admin-api/api/model"
|
"hospital-admin-api/api/model"
|
||||||
"hospital-admin-api/config"
|
"hospital-admin-api/utils"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
@ -34,7 +34,7 @@ func UserDoctorInfoResponse(userDoctorInfo *model.UserDoctorInfo) *UserDoctorInf
|
|||||||
result := strings.Split(userDoctorInfo.LicenseCert, ",")
|
result := strings.Split(userDoctorInfo.LicenseCert, ",")
|
||||||
if len(result) > 0 {
|
if len(result) > 0 {
|
||||||
for _, v := range result {
|
for _, v := range result {
|
||||||
v = config.C.Oss.OssCustomDomainName + v
|
v = utils.AddOssDomain(v)
|
||||||
licenseCert = append(licenseCert, v)
|
licenseCert = append(licenseCert, v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -45,7 +45,7 @@ func UserDoctorInfoResponse(userDoctorInfo *model.UserDoctorInfo) *UserDoctorInf
|
|||||||
result := strings.Split(userDoctorInfo.QualificationCert, ",")
|
result := strings.Split(userDoctorInfo.QualificationCert, ",")
|
||||||
if len(result) > 0 {
|
if len(result) > 0 {
|
||||||
for _, v := range result {
|
for _, v := range result {
|
||||||
v = config.C.Oss.OssCustomDomainName + v
|
v = utils.AddOssDomain(v)
|
||||||
qualificationCert = append(qualificationCert, v)
|
qualificationCert = append(qualificationCert, v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -56,7 +56,7 @@ func UserDoctorInfoResponse(userDoctorInfo *model.UserDoctorInfo) *UserDoctorInf
|
|||||||
result := strings.Split(userDoctorInfo.WorkCert, ",")
|
result := strings.Split(userDoctorInfo.WorkCert, ",")
|
||||||
if len(result) > 0 {
|
if len(result) > 0 {
|
||||||
for _, v := range result {
|
for _, v := range result {
|
||||||
v = config.C.Oss.OssCustomDomainName + v
|
v = utils.AddOssDomain(v)
|
||||||
workCert = append(workCert, v)
|
workCert = append(workCert, v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -85,8 +85,8 @@ func UserDoctorInfoResponse(userDoctorInfo *model.UserDoctorInfo) *UserDoctorInf
|
|||||||
QualificationCertNum: userDoctorInfo.QualificationCertNum,
|
QualificationCertNum: userDoctorInfo.QualificationCertNum,
|
||||||
WorkCert: workCert,
|
WorkCert: workCert,
|
||||||
MultiPointImages: multiPointImages,
|
MultiPointImages: multiPointImages,
|
||||||
IdCardFront: config.C.Oss.OssCustomDomainName + "/" + userDoctorInfo.IdCardFront,
|
IdCardFront: utils.AddOssDomain(userDoctorInfo.IdCardFront),
|
||||||
IdCardBack: config.C.Oss.OssCustomDomainName + "/" + userDoctorInfo.IdCardBack,
|
IdCardBack: utils.AddOssDomain(userDoctorInfo.IdCardBack),
|
||||||
SignImage: config.C.Oss.OssCustomDomainName + "/" + userDoctorInfo.SignImage,
|
SignImage: utils.AddOssDomain(userDoctorInfo.SignImage),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import (
|
|||||||
"hospital-admin-api/api/responses/hospitalResponse"
|
"hospital-admin-api/api/responses/hospitalResponse"
|
||||||
"hospital-admin-api/api/responses/userDoctorInfoResponse"
|
"hospital-admin-api/api/responses/userDoctorInfoResponse"
|
||||||
"hospital-admin-api/api/responses/userResponse"
|
"hospital-admin-api/api/responses/userResponse"
|
||||||
"hospital-admin-api/config"
|
"hospital-admin-api/utils"
|
||||||
"strconv"
|
"strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -223,7 +223,7 @@ func GetUserDoctorPageResponse(userDoctor []*model.UserDoctor) []getUserDoctorPa
|
|||||||
MultiPointFailReason: v.MultiPointFailReason,
|
MultiPointFailReason: v.MultiPointFailReason,
|
||||||
IsBindBank: v.IsBindBank,
|
IsBindBank: v.IsBindBank,
|
||||||
IsRecommend: v.IsRecommend,
|
IsRecommend: v.IsRecommend,
|
||||||
Avatar: config.C.Oss.OssCustomDomainName + "/" + v.Avatar,
|
Avatar: utils.AddOssDomain(v.Avatar),
|
||||||
DoctorTitle: v.DoctorTitle,
|
DoctorTitle: v.DoctorTitle,
|
||||||
DepartmentCustomName: v.DepartmentCustomName,
|
DepartmentCustomName: v.DepartmentCustomName,
|
||||||
DepartmentCustomMobile: v.DepartmentCustomMobile,
|
DepartmentCustomMobile: v.DepartmentCustomMobile,
|
||||||
@ -276,7 +276,7 @@ func GetUserDoctorPendingPageResponse(userDoctor []*model.UserDoctor) []getUserD
|
|||||||
IdenAuthStatus: v.IdenAuthStatus,
|
IdenAuthStatus: v.IdenAuthStatus,
|
||||||
IdenAuthTime: v.IdenAuthTime,
|
IdenAuthTime: v.IdenAuthTime,
|
||||||
IdenAuthFailReason: v.IdenAuthFailReason,
|
IdenAuthFailReason: v.IdenAuthFailReason,
|
||||||
Avatar: config.C.Oss.OssCustomDomainName + "/" + v.Avatar,
|
Avatar: utils.AddOssDomain(v.Avatar),
|
||||||
DoctorTitle: v.DoctorTitle,
|
DoctorTitle: v.DoctorTitle,
|
||||||
DepartmentCustomName: v.DepartmentCustomName,
|
DepartmentCustomName: v.DepartmentCustomName,
|
||||||
DepartmentCustomMobile: v.DepartmentCustomMobile,
|
DepartmentCustomMobile: v.DepartmentCustomMobile,
|
||||||
@ -320,7 +320,7 @@ func GetMultiPageResponse(userDoctor []*model.UserDoctor) []GetMultiPage {
|
|||||||
MultiPointStatus: v.MultiPointStatus,
|
MultiPointStatus: v.MultiPointStatus,
|
||||||
MultiPointTime: v.MultiPointTime,
|
MultiPointTime: v.MultiPointTime,
|
||||||
MultiPointFailReason: v.MultiPointFailReason,
|
MultiPointFailReason: v.MultiPointFailReason,
|
||||||
Avatar: config.C.Oss.OssCustomDomainName + "/" + v.Avatar,
|
Avatar: utils.AddOssDomain(v.Avatar),
|
||||||
DoctorTitle: v.DoctorTitle,
|
DoctorTitle: v.DoctorTitle,
|
||||||
DepartmentCustomName: v.DepartmentCustomName,
|
DepartmentCustomName: v.DepartmentCustomName,
|
||||||
DepartmentCustomMobile: v.DepartmentCustomMobile,
|
DepartmentCustomMobile: v.DepartmentCustomMobile,
|
||||||
|
|||||||
@ -2,7 +2,7 @@ package userResponse
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"hospital-admin-api/api/model"
|
"hospital-admin-api/api/model"
|
||||||
"hospital-admin-api/config"
|
"hospital-admin-api/utils"
|
||||||
"strconv"
|
"strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ func UserResponse(user *model.User) *User {
|
|||||||
RegisterMethod: user.RegisterMethod,
|
RegisterMethod: user.RegisterMethod,
|
||||||
Age: user.Age,
|
Age: user.Age,
|
||||||
Sex: user.Sex,
|
Sex: user.Sex,
|
||||||
Avatar: config.C.Oss.OssCustomDomainName + "/" + user.Avatar,
|
Avatar: utils.AddOssDomain(user.Avatar),
|
||||||
LoginIP: user.LoginIp,
|
LoginIP: user.LoginIp,
|
||||||
LastLoginAt: user.LastLoginAt,
|
LastLoginAt: user.LastLoginAt,
|
||||||
CreatedBy: user.CreatedBy,
|
CreatedBy: user.CreatedBy,
|
||||||
|
|||||||
@ -79,7 +79,7 @@ func (r *UserDoctorService) GetUserDoctor(doctorId int64) (getUserDoctorResponse
|
|||||||
MultiPointFailReason: userDoctor.MultiPointFailReason,
|
MultiPointFailReason: userDoctor.MultiPointFailReason,
|
||||||
IsBindBank: userDoctor.IsBindBank,
|
IsBindBank: userDoctor.IsBindBank,
|
||||||
IsRecommend: userDoctor.IsRecommend,
|
IsRecommend: userDoctor.IsRecommend,
|
||||||
Avatar: config.C.Oss.OssCustomDomainName + userDoctor.Avatar,
|
Avatar: utils.AddOssDomain(userDoctor.Avatar),
|
||||||
DoctorTitle: userDoctor.DoctorTitle,
|
DoctorTitle: userDoctor.DoctorTitle,
|
||||||
DepartmentCustomID: strconv.Itoa(int(userDoctor.DepartmentCustomId)),
|
DepartmentCustomID: strconv.Itoa(int(userDoctor.DepartmentCustomId)),
|
||||||
DepartmentCustomName: userDoctor.DepartmentCustomName,
|
DepartmentCustomName: userDoctor.DepartmentCustomName,
|
||||||
@ -94,7 +94,7 @@ func (r *UserDoctorService) GetUserDoctor(doctorId int64) (getUserDoctorResponse
|
|||||||
IsImgQuickReception: userDoctor.IsImgQuickReception,
|
IsImgQuickReception: userDoctor.IsImgQuickReception,
|
||||||
IsPlatformDeepCooperation: userDoctor.IsPlatformDeepCooperation,
|
IsPlatformDeepCooperation: userDoctor.IsPlatformDeepCooperation,
|
||||||
IsSysDiagnoCooperation: userDoctor.IsSysDiagnoCooperation,
|
IsSysDiagnoCooperation: userDoctor.IsSysDiagnoCooperation,
|
||||||
QrCode: config.C.Oss.OssCustomDomainName + userDoctor.QrCode,
|
QrCode: utils.AddOssDomain(userDoctor.QrCode),
|
||||||
BeGoodAt: userDoctor.BeGoodAt,
|
BeGoodAt: userDoctor.BeGoodAt,
|
||||||
BriefIntroduction: userDoctor.BriefIntroduction,
|
BriefIntroduction: userDoctor.BriefIntroduction,
|
||||||
CreatedAt: userDoctor.CreatedAt,
|
CreatedAt: userDoctor.CreatedAt,
|
||||||
@ -934,7 +934,7 @@ func (r *UserDoctorService) GetUserDoctorPending(doctorId int64) (g *userDoctorR
|
|||||||
IdenAuthStatus: userDoctor.IdenAuthStatus,
|
IdenAuthStatus: userDoctor.IdenAuthStatus,
|
||||||
IdenAuthTime: userDoctor.IdenAuthTime,
|
IdenAuthTime: userDoctor.IdenAuthTime,
|
||||||
IdenAuthFailReason: IdenAuthFailReason,
|
IdenAuthFailReason: IdenAuthFailReason,
|
||||||
Avatar: config.C.Oss.OssCustomDomainName + userDoctor.Avatar,
|
Avatar: utils.AddOssDomain(userDoctor.Avatar),
|
||||||
DoctorTitle: userDoctor.DoctorTitle,
|
DoctorTitle: userDoctor.DoctorTitle,
|
||||||
DepartmentCustomID: strconv.Itoa(int(userDoctor.DepartmentCustomId)),
|
DepartmentCustomID: strconv.Itoa(int(userDoctor.DepartmentCustomId)),
|
||||||
DepartmentCustomName: userDoctor.DepartmentCustomName,
|
DepartmentCustomName: userDoctor.DepartmentCustomName,
|
||||||
@ -1209,7 +1209,7 @@ func (r *UserDoctorService) GetMulti(doctorId int64) (g *userDoctorResponse.GetM
|
|||||||
MultiPointStatus: userDoctor.MultiPointStatus,
|
MultiPointStatus: userDoctor.MultiPointStatus,
|
||||||
MultiPointTime: userDoctor.MultiPointTime,
|
MultiPointTime: userDoctor.MultiPointTime,
|
||||||
MultiPointFailReason: userDoctor.MultiPointFailReason,
|
MultiPointFailReason: userDoctor.MultiPointFailReason,
|
||||||
Avatar: config.C.Oss.OssCustomDomainName + userDoctor.Avatar,
|
Avatar: utils.AddOssDomain(userDoctor.Avatar),
|
||||||
DoctorTitle: userDoctor.DoctorTitle,
|
DoctorTitle: userDoctor.DoctorTitle,
|
||||||
DepartmentCustomID: strconv.Itoa(int(userDoctor.DepartmentCustomId)),
|
DepartmentCustomID: strconv.Itoa(int(userDoctor.DepartmentCustomId)),
|
||||||
DepartmentCustomName: userDoctor.DepartmentCustomName,
|
DepartmentCustomName: userDoctor.DepartmentCustomName,
|
||||||
|
|||||||
@ -9,3 +9,11 @@ import (
|
|||||||
func RemoveOssDomain(url string) string {
|
func RemoveOssDomain(url string) string {
|
||||||
return strings.Replace(url, config.C.Oss.OssCustomDomainName, "", 1)
|
return strings.Replace(url, config.C.Oss.OssCustomDomainName, "", 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// AddOssDomain 去除oss地址中的前缀
|
||||||
|
func AddOssDomain(url string) string {
|
||||||
|
if url == "" {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
return config.C.Oss.OssCustomDomainName + url
|
||||||
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user