获取用户菜单列表,新增医生管理
This commit is contained in:
parent
869666a831
commit
28df69f9e2
@ -9,4 +9,21 @@ type Api struct {
|
|||||||
AdminApi // 接口数据
|
AdminApi // 接口数据
|
||||||
Dept // 部门数据
|
Dept // 部门数据
|
||||||
Post // 岗位数据
|
Post // 岗位数据
|
||||||
|
UserDoctor
|
||||||
|
}
|
||||||
|
|
||||||
|
// SysSetting 系统设置
|
||||||
|
type sysSetting struct {
|
||||||
|
Basic // 基础数据
|
||||||
|
Role // 角色数据
|
||||||
|
Menu // 菜单数据
|
||||||
|
User // 用户数据
|
||||||
|
AdminApi // 接口数据
|
||||||
|
Dept // 部门数据
|
||||||
|
Post // 岗位数据
|
||||||
|
}
|
||||||
|
|
||||||
|
// 医生管理
|
||||||
|
type userDoctorManage struct {
|
||||||
|
UserDoctor // 医生列表
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package controller
|
package controller
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"hospital-admin-api/api/dao"
|
"hospital-admin-api/api/dao"
|
||||||
"hospital-admin-api/api/requests"
|
"hospital-admin-api/api/requests"
|
||||||
@ -267,6 +268,7 @@ func (b *User) LoginOut(c *gin.Context) {
|
|||||||
|
|
||||||
// GetUserMenuList 获取用户菜单列表
|
// GetUserMenuList 获取用户菜单列表
|
||||||
func (r *User) GetUserMenuList(c *gin.Context) {
|
func (r *User) GetUserMenuList(c *gin.Context) {
|
||||||
|
fmt.Println(1111111)
|
||||||
roleId := c.GetInt64("RoleId")
|
roleId := c.GetInt64("RoleId")
|
||||||
if roleId == 0 {
|
if roleId == 0 {
|
||||||
responses.Fail(c)
|
responses.Fail(c)
|
||||||
@ -277,6 +279,7 @@ func (r *User) GetUserMenuList(c *gin.Context) {
|
|||||||
|
|
||||||
// 获取用户角色身份
|
// 获取用户角色身份
|
||||||
isAdmin, err := roleService.GetRoleIden(c)
|
isAdmin, err := roleService.GetRoleIden(c)
|
||||||
|
fmt.Println(isAdmin)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
responses.FailWithMessage(err.Error(), c)
|
responses.FailWithMessage(err.Error(), c)
|
||||||
return
|
return
|
||||||
|
|||||||
56
api/controller/userDoctor.go
Normal file
56
api/controller/userDoctor.go
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
package controller
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
"hospital-admin-api/api/dao"
|
||||||
|
"hospital-admin-api/api/requests"
|
||||||
|
"hospital-admin-api/api/responses"
|
||||||
|
"hospital-admin-api/global"
|
||||||
|
"hospital-admin-api/utils"
|
||||||
|
)
|
||||||
|
|
||||||
|
type UserDoctor struct{}
|
||||||
|
|
||||||
|
// GetUserDoctorPage 获取医生列表-分页
|
||||||
|
func (r *UserDoctor) GetUserDoctorPage(c *gin.Context) {
|
||||||
|
userDoctorRequest := requests.UserDoctorRequest{}
|
||||||
|
if err := c.ShouldBind(&userDoctorRequest.GetUserDoctorPage); err != nil {
|
||||||
|
responses.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 参数验证
|
||||||
|
if err := global.Validate.Struct(userDoctorRequest.GetUserDoctorPage); err != nil {
|
||||||
|
responses.FailWithMessage(utils.Translate(err), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if userDoctorRequest.GetUserDoctorPage.Page == 0 {
|
||||||
|
userDoctorRequest.GetUserDoctorPage.Page = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if userDoctorRequest.GetUserDoctorPage.PageSize == 0 {
|
||||||
|
userDoctorRequest.GetUserDoctorPage.PageSize = 20
|
||||||
|
}
|
||||||
|
|
||||||
|
userDoctorDao := dao.UserDoctorDao{}
|
||||||
|
userDoctor, total, err := userDoctorDao.GetUserDoctorDaoPageSearch(userDoctorRequest.GetUserDoctorPage, userDoctorRequest.GetUserDoctorPage.Page, userDoctorRequest.GetUserDoctorPage.PageSize)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
responses.FailWithMessage(err.Error(), c)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Println(total)
|
||||||
|
|
||||||
|
// // 处理返回值
|
||||||
|
// getUserPageResponses := userResponse.GetUserPageResponse(userDoctor)
|
||||||
|
//
|
||||||
|
// result := make(map[string]interface{})
|
||||||
|
// result["page"] = userDoctorRequest.GetUserDoctorPage.Page
|
||||||
|
// result["page_size"] = userDoctorRequest.GetUserDoctorPage.PageSize
|
||||||
|
// result["total"] = total
|
||||||
|
// result["data"] = getUserPageResponses
|
||||||
|
responses.OkWithData(userDoctor, c)
|
||||||
|
}
|
||||||
202
api/dao/userDoctor.go
Normal file
202
api/dao/userDoctor.go
Normal file
@ -0,0 +1,202 @@
|
|||||||
|
package dao
|
||||||
|
|
||||||
|
import (
|
||||||
|
"gorm.io/gorm"
|
||||||
|
"hospital-admin-api/api/model"
|
||||||
|
"hospital-admin-api/api/requests"
|
||||||
|
"hospital-admin-api/global"
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
|
type UserDoctorDao struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetUserDoctorById 获取医生数据-医生id
|
||||||
|
func (r *UserDoctorDao) GetUserDoctorById(doctorId int64) (m *model.UserDoctor, err error) {
|
||||||
|
err = global.Db.First(&m, doctorId).Error
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return m, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeleteUserDoctor 删除医生
|
||||||
|
func (r *UserDoctorDao) DeleteUserDoctor(tx *gorm.DB, maps interface{}) error {
|
||||||
|
err := tx.Where(maps).Delete(&model.UserDoctor{}).Error
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeleteUserDoctorById 删除医生-医生id
|
||||||
|
func (r *UserDoctorDao) DeleteUserDoctorById(tx *gorm.DB, userId int64) error {
|
||||||
|
if err := tx.Delete(&model.UserDoctor{}, userId).Error; err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// EditUserDoctor 修改医生
|
||||||
|
func (r *UserDoctorDao) EditUserDoctor(tx *gorm.DB, maps interface{}, data interface{}) error {
|
||||||
|
err := tx.Model(&model.UserDoctor{}).Where(maps).Updates(data).Error
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// EditUserDoctorById 修改医生-医生id
|
||||||
|
func (r *UserDoctorDao) EditUserDoctorById(tx *gorm.DB, userId int64, data interface{}) error {
|
||||||
|
err := tx.Model(&model.UserDoctor{}).Where("doctor_id = ?", userId).Updates(data).Error
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetUserDoctorList 获取医生列表
|
||||||
|
func (r *UserDoctorDao) GetUserDoctorList(maps interface{}) (m []*model.UserDoctor, err error) {
|
||||||
|
err = global.Db.Where(maps).Find(&m).Error
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return m, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetUserDoctorDaoPageSearch 获取医生列表-分页
|
||||||
|
func (r *UserDoctorDao) GetUserDoctorDaoPageSearch(getUserDoctorPage requests.GetUserDoctorPage, page, pageSize int) (m []*model.UserDoctor, total int64, err error) {
|
||||||
|
var totalRecords int64
|
||||||
|
|
||||||
|
// 构建查询条件
|
||||||
|
query := global.Db.Model(&model.UserDoctor{}).Omit("open_id", "union_id", "wx_session_key")
|
||||||
|
|
||||||
|
// 用户
|
||||||
|
query = query.Preload("User", func(db *gorm.DB) *gorm.DB {
|
||||||
|
return db.Omit("user_password", "salt")
|
||||||
|
})
|
||||||
|
|
||||||
|
// 医院
|
||||||
|
query = query.Preload("Hospital", func(db *gorm.DB) *gorm.DB {
|
||||||
|
return db.Select("hospital_id, hospital_name,hospital_level_name")
|
||||||
|
})
|
||||||
|
|
||||||
|
// 手机号
|
||||||
|
if getUserDoctorPage.Mobile != "" {
|
||||||
|
subQuery := global.Db.Model(&model.User{}).
|
||||||
|
Select("user_id").
|
||||||
|
Where("mobile LIKE ?", "%"+getUserDoctorPage.Mobile+"%")
|
||||||
|
|
||||||
|
query = query.Where(gorm.Expr("user_id IN (?)", subQuery))
|
||||||
|
}
|
||||||
|
|
||||||
|
// 用户名称
|
||||||
|
if getUserDoctorPage.UserName != "" {
|
||||||
|
query = query.Where("user_name = ?", getUserDoctorPage.UserName)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 状态
|
||||||
|
if getUserDoctorPage.UserStatus != 0 {
|
||||||
|
query = query.Where("status = ?", getUserDoctorPage.UserStatus)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 医院名称
|
||||||
|
if getUserDoctorPage.HospitalName != "" {
|
||||||
|
subQuery := global.Db.Model(&model.Hospital{}).
|
||||||
|
Select("hospital_id").
|
||||||
|
Where("hospital_name LIKE ?", "%"+getUserDoctorPage.HospitalName+"%")
|
||||||
|
|
||||||
|
query = query.Where(gorm.Expr("hospital_id IN (?)", subQuery))
|
||||||
|
}
|
||||||
|
|
||||||
|
// 科室名称
|
||||||
|
if getUserDoctorPage.DepartmentCustomName != "" {
|
||||||
|
query = query.Where("department_custom_name = ?", getUserDoctorPage.DepartmentCustomName)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 实名认证状态
|
||||||
|
if getUserDoctorPage.IDCardStatus != 0 {
|
||||||
|
query = query.Where("idcard_status = ?", getUserDoctorPage.IDCardStatus)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 身份认证状态
|
||||||
|
if getUserDoctorPage.IdenAuthStatus != 0 {
|
||||||
|
query = query.Where("iden_auth_status = ?", getUserDoctorPage.IdenAuthStatus)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 医生多点执业认证状态
|
||||||
|
if getUserDoctorPage.MultiPointStatus != 0 {
|
||||||
|
query = query.Where("multi_point_status = ?", getUserDoctorPage.MultiPointStatus)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 是否首页推荐
|
||||||
|
if getUserDoctorPage.IsRecommend != 0 {
|
||||||
|
query = query.Where("is_recommend = ?", getUserDoctorPage.IsRecommend)
|
||||||
|
}
|
||||||
|
|
||||||
|
if getUserDoctorPage.DoctorTitle != 0 {
|
||||||
|
query = query.Where("doctor_title = ?", getUserDoctorPage.DoctorTitle)
|
||||||
|
}
|
||||||
|
|
||||||
|
if getUserDoctorPage.InquiryService != "" {
|
||||||
|
result := strings.Split(getUserDoctorPage.InquiryService, ",")
|
||||||
|
if len(result) > 0 {
|
||||||
|
subQuery := global.Db
|
||||||
|
for _, v := range result {
|
||||||
|
if v == "1" {
|
||||||
|
subQuery = subQuery.Where("is_img_expert_reception = ?", 1)
|
||||||
|
}
|
||||||
|
|
||||||
|
if v == "2" {
|
||||||
|
if subQuery != nil {
|
||||||
|
subQuery = subQuery.Or("is_img_quick_reception = ?", 1)
|
||||||
|
} else {
|
||||||
|
subQuery = subQuery.Where("is_img_quick_reception = ?", 1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if v == "3" {
|
||||||
|
if subQuery != nil {
|
||||||
|
subQuery = subQuery.Or("is_img_welfare_reception = ?", 1)
|
||||||
|
} else {
|
||||||
|
subQuery = subQuery.Where("is_img_welfare_reception = ?", 1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if v == "4" {
|
||||||
|
if subQuery != nil {
|
||||||
|
subQuery = subQuery.Or("multi_point_status = ?", 1)
|
||||||
|
} else {
|
||||||
|
subQuery = subQuery.Where("multi_point_status = ?", 1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
query = query.Where(subQuery)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if getUserDoctorPage.IsEnterpriseDeepCooperation != 0 {
|
||||||
|
query = query.Where("doctor_title = ?", getUserDoctorPage.DoctorTitle)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询总数量
|
||||||
|
if err := query.Count(&totalRecords).Error; err != nil {
|
||||||
|
return nil, 0, err
|
||||||
|
}
|
||||||
|
|
||||||
|
err = query.Scopes(model.Paginate(page, pageSize)).Find(&m).Error
|
||||||
|
if err != nil {
|
||||||
|
return nil, 0, err
|
||||||
|
}
|
||||||
|
return m, totalRecords, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// AddUserDoctor 新增医生
|
||||||
|
func (r *UserDoctorDao) AddUserDoctor(tx *gorm.DB, model *model.UserDoctor) (*model.UserDoctor, error) {
|
||||||
|
if err := tx.Create(model).Error; err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return model, nil
|
||||||
|
}
|
||||||
@ -1,7 +1,6 @@
|
|||||||
package middlewares
|
package middlewares
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"hospital-admin-api/api/dao"
|
"hospital-admin-api/api/dao"
|
||||||
"hospital-admin-api/api/responses"
|
"hospital-admin-api/api/responses"
|
||||||
@ -30,8 +29,6 @@ func Auth() gin.HandlerFunc {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println(1111)
|
|
||||||
|
|
||||||
// 获取用户数据
|
// 获取用户数据
|
||||||
adminUserDao := dao.AdminUserDao{}
|
adminUserDao := dao.AdminUserDao{}
|
||||||
adminUser, err := adminUserDao.GetAdminUserFirstById(userId)
|
adminUser, err := adminUserDao.GetAdminUserFirstById(userId)
|
||||||
@ -60,8 +57,8 @@ func Auth() gin.HandlerFunc {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 获取角色数据
|
// 获取角色数据
|
||||||
AdminRoleDao := dao.AdminRoleDao{}
|
adminRoleDao := dao.AdminRoleDao{}
|
||||||
adminRole, err := AdminRoleDao.GetAdminRoleFirstById(roleId)
|
adminRole, err := adminRoleDao.GetAdminRoleFirstById(roleId)
|
||||||
if err != nil || adminRole == nil {
|
if err != nil || adminRole == nil {
|
||||||
responses.FailWithMessage("角色错误", c)
|
responses.FailWithMessage("角色错误", c)
|
||||||
c.Abort()
|
c.Abort()
|
||||||
|
|||||||
26
api/model/hospital.go
Normal file
26
api/model/hospital.go
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
package model
|
||||||
|
|
||||||
|
// Hospital 医院表
|
||||||
|
type Hospital struct {
|
||||||
|
HospitalId int64 `gorm:"column:hospital_id;type:bigint(19);primary_key;comment:主键id" json:"hospital_id"`
|
||||||
|
HospitalName string `gorm:"column:hospital_name;type:varchar(255);comment:医院名称" json:"hospital_name"`
|
||||||
|
HospitalStatus int `gorm:"column:hospital_status;type:tinyint(1);default:1;comment:状态(0:禁用 1:正常 2:删除)" json:"hospital_status"`
|
||||||
|
HospitalLevelName string `gorm:"column:hospital_level_name;type:varchar(20);comment:医院等级名称" json:"hospital_level_name"`
|
||||||
|
PostCode string `gorm:"column:post_code;type:varchar(50);comment:邮政编码" json:"post_code"`
|
||||||
|
TelePhone string `gorm:"column:tele_phone;type:varchar(20);comment:电话" json:"tele_phone"`
|
||||||
|
ProvinceId int `gorm:"column:province_id;type:int(11);comment:省份id" json:"province_id"`
|
||||||
|
Province string `gorm:"column:province;type:varchar(50);comment:省份" json:"province"`
|
||||||
|
CityId int `gorm:"column:city_id;type:int(11);comment:城市id" json:"city_id"`
|
||||||
|
City string `gorm:"column:city;type:varchar(50);comment:城市" json:"city"`
|
||||||
|
CountyId int `gorm:"column:county_id;type:int(11);comment:区县id" json:"county_id"`
|
||||||
|
County string `gorm:"column:county;type:varchar(50);comment:区县" json:"county"`
|
||||||
|
Address string `gorm:"column:address;type:varchar(255);comment:地址" json:"address"`
|
||||||
|
Lat string `gorm:"column:lat;type:varchar(255);comment:纬度" json:"lat"`
|
||||||
|
Lng string `gorm:"column:lng;type:varchar(255);comment:经度" json:"lng"`
|
||||||
|
Desc string `gorm:"column:desc;type:varchar(255);comment:简介" json:"desc"`
|
||||||
|
Model
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Hospital) TableName() string {
|
||||||
|
return "gdxz_hospital"
|
||||||
|
}
|
||||||
25
api/model/user.go
Normal file
25
api/model/user.go
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
package model
|
||||||
|
|
||||||
|
// User 用户主表
|
||||||
|
type User struct {
|
||||||
|
UserId int64 `gorm:"column:user_id;type:bigint(19);primary_key;comment:主键" json:"user_id"`
|
||||||
|
UserName string `gorm:"column:user_name;type:varchar(50);comment:用户名称" json:"user_name"`
|
||||||
|
UserAccount string `gorm:"column:user_account;type:varchar(50);comment:账号" json:"user_account"`
|
||||||
|
Mobile string `gorm:"column:mobile;type:varchar(20);comment:手机号" json:"mobile"`
|
||||||
|
WxMobile string `gorm:"column:wx_mobile;type:varchar(20);comment:微信手机号" json:"wx_mobile"`
|
||||||
|
UserPassword string `gorm:"column:user_password;type:varchar(50);comment:密码" json:"user_password"`
|
||||||
|
Salt string `gorm:"column:salt;type:varchar(50);comment:密码混淆码" json:"salt"`
|
||||||
|
UserType int `gorm:"column:user_type;type:tinyint(1);comment:用户类型(1:患者 2:医师 3:药师);NOT NULL" json:"user_type"`
|
||||||
|
UserStatus int `gorm:"column:user_status;type:tinyint(4);default:1;comment:状态(0:禁用 1:正常 2:删除)" json:"user_status"`
|
||||||
|
RegisterMethod int `gorm:"column:register_method;type:tinyint(1);comment:注册方式(1:微信小程序 )" json:"register_method"`
|
||||||
|
Age uint `gorm:"column:age;type:int(10) unsigned;comment:年龄" json:"age"`
|
||||||
|
Sex int `gorm:"column:sex;type:tinyint(1);default:0;comment:性别(0:未知 1:男 2:女)" json:"sex"`
|
||||||
|
Avatar string `gorm:"column:avatar;type:varchar(255);comment:头像" json:"avatar"`
|
||||||
|
LoginIp string `gorm:"column:login_ip;type:varchar(255);comment:登陆ip" json:"login_ip"`
|
||||||
|
LastLoginAt LocalTime `gorm:"column:last_login_at;type:datetime;comment:最后登陆时间" json:"last_login_at"`
|
||||||
|
Model
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *User) TableName() string {
|
||||||
|
return "gdxz_user"
|
||||||
|
}
|
||||||
47
api/model/userDoctor.go
Normal file
47
api/model/userDoctor.go
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
package model
|
||||||
|
|
||||||
|
// UserDoctor 用户-医生表
|
||||||
|
type UserDoctor struct {
|
||||||
|
DoctorId int64 `gorm:"column:doctor_id;type:bigint(19);primary_key;comment:主键" json:"doctor_id"`
|
||||||
|
UserId int64 `gorm:"column:user_id;type:bigint(19);comment:用户id;NOT NULL" json:"user_id"`
|
||||||
|
UserName string `gorm:"column:user_name;type:varchar(50);comment:用户名称" json:"user_name"`
|
||||||
|
OpenId string `gorm:"column:open_id;type:varchar(100);comment:微信open_id" json:"open_id"`
|
||||||
|
UnionId string `gorm:"column:union_id;type:varchar(100);comment:微信开放平台唯一标识" json:"union_id"`
|
||||||
|
WxSessionKey string `gorm:"column:wx_session_key;type:varchar(255);comment:微信会话密钥" json:"wx_session_key"`
|
||||||
|
Status int `gorm:"column:status;type:tinyint(1);default:1;comment:状态(0:禁用 1:正常 2:删除);NOT NULL" json:"status"`
|
||||||
|
IdcardStatus int `gorm:"column:idcard_status;type:tinyint(1);default:0;comment:实名认证状态(0:未认证 1:认证通过 2:认证失败)" json:"idcard_status"`
|
||||||
|
IdenAuthStatus int `gorm:"column:iden_auth_status;type:tinyint(1);default:0;comment:身份认证状态(0:未认证 1:认证通过 2:审核中 3:认证失败);NOT NULL" json:"iden_auth_status"`
|
||||||
|
IdenAuthTime LocalTime `gorm:"column:iden_auth_time;type:datetime;comment:审核时间" json:"iden_auth_time"`
|
||||||
|
IdenAuthFailReason string `gorm:"column:iden_auth_fail_reason;type:text;comment:身份认证失败原因" json:"iden_auth_fail_reason"`
|
||||||
|
MultiPointStatus int `gorm:"column:multi_point_status;type:tinyint(1);default:0;comment:医生多点执业认证状态(0:未认证 1:认证通过 2:审核中 3:认证失败)" json:"multi_point_status"`
|
||||||
|
MultiPointTime LocalTime `gorm:"column:multi_point_time;type:datetime;comment:审核时间" json:"multi_point_time"`
|
||||||
|
MultiPointFailReason string `gorm:"column:multi_point_fail_reason;type:varchar(255);comment:多点执业认证失败原因" json:"multi_point_fail_reason"`
|
||||||
|
IsBindBank int `gorm:"column:is_bind_bank;type:tinyint(1);default:0;comment:是否已绑定结算银行卡(0:否 1:是);NOT NULL" json:"is_bind_bank"`
|
||||||
|
IsRecommend int `gorm:"column:is_recommend;type:tinyint(1);default:0;comment:是否首页推荐(0:否 1:是)" json:"is_recommend"`
|
||||||
|
Avatar string `gorm:"column:avatar;type:varchar(255);comment:头像" json:"avatar"`
|
||||||
|
DoctorTitle int `gorm:"column:doctor_title;type:tinyint(1);comment:医生职称(1:主任医师 2:主任中医师 3:副主任医师 4:副主任中医师 5:主治医师 6:住院医师)" json:"doctor_title"`
|
||||||
|
DepartmentCustomId int64 `gorm:"column:department_custom_id;type:bigint(19);comment:科室id-自定义" json:"department_custom_id"`
|
||||||
|
DepartmentCustomName string `gorm:"column:department_custom_name;type:varchar(100);comment:科室名称(如未自己输入,填入标准科室名称)" json:"department_custom_name"`
|
||||||
|
DepartmentCustomMobile string `gorm:"column:department_custom_mobile;type:varchar(30);comment:科室电话" json:"department_custom_mobile"`
|
||||||
|
HospitalId int64 `gorm:"column:hospital_id;type:bigint(19);comment:所属医院id" json:"hospital_id"`
|
||||||
|
ServedPatientsNum int `gorm:"column:served_patients_num;type:int(11);default:0;comment:服务患者数量(订单结束时统计)" json:"served_patients_num"`
|
||||||
|
PraiseRate float64 `gorm:"column:praise_rate;type:float(10,2);default:0.00;comment:好评率(百分制。订单平均评价中超过4-5分的订单总数 / 总订单数 * 5)" json:"praise_rate"`
|
||||||
|
AvgResponseTime float64 `gorm:"column:avg_response_time;type:float(10,2);default:0.00;comment:平均响应时间(分钟制)" json:"avg_response_time"`
|
||||||
|
NumberOfFans uint `gorm:"column:number_of_fans;type:int(10) unsigned;default:0;comment:被关注数量" json:"number_of_fans"`
|
||||||
|
IsOnline int `gorm:"column:is_online;type:tinyint(1);default:0;comment:是否在线(0:不在线 1:在线)" json:"is_online"`
|
||||||
|
IsImgExpertReception int `gorm:"column:is_img_expert_reception;type:tinyint(1);default:0;comment:是否参加专家图文接诊(0:否 1:是)" json:"is_img_expert_reception"`
|
||||||
|
IsImgWelfareReception int `gorm:"column:is_img_welfare_reception;type:tinyint(1);default:0;comment:是否参加公益图文问诊(0:否 1:是)" json:"is_img_welfare_reception"`
|
||||||
|
IsImgQuickReception int `gorm:"column:is_img_quick_reception;type:tinyint(1);default:0;comment:是否参加快速图文接诊(0:否 1:是)" json:"is_img_quick_reception"`
|
||||||
|
IsPlatformDeepCooperation int `gorm:"column:is_platform_deep_cooperation;type:tinyint(1);default:0;comment:是否平台深度合作医生(0:否 1:是)" json:"is_platform_deep_cooperation"`
|
||||||
|
IsEnterpriseDeepCooperation int `gorm:"column:is_enterprise_deep_cooperation;type:tinyint(1);default:0;comment:是否企业深度合作医生(0:否 1:是)" json:"is_enterprise_deep_cooperation"`
|
||||||
|
QrCode string `gorm:"column:qr_code;type:varchar(255);comment:分享二维码" json:"qr_code"`
|
||||||
|
BeGoodAt string `gorm:"column:be_good_at;type:text;comment:擅长" json:"be_good_at"`
|
||||||
|
BriefIntroduction string `gorm:"column:brief_introduction;type:text;comment:医生简介" json:"brief_introduction"`
|
||||||
|
Model
|
||||||
|
User *AdminPost `gorm:"foreignKey:UserId" json:"user"` // 用户
|
||||||
|
Hospital *AdminPost `gorm:"foreignKey:HospitalId" json:"hospital"` // 医院
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *UserDoctor) TableName() string {
|
||||||
|
return "gdxz_user_doctor"
|
||||||
|
}
|
||||||
23
api/requests/userDoctor.go
Normal file
23
api/requests/userDoctor.go
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
package requests
|
||||||
|
|
||||||
|
type UserDoctorRequest struct {
|
||||||
|
GetUserDoctorPage // 获取医生列表-分页
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetUserDoctorPage 获取医生列表-分页
|
||||||
|
type GetUserDoctorPage struct {
|
||||||
|
Page int `json:"page" form:"page" label:"页码"`
|
||||||
|
PageSize int `json:"page_size" form:"page_size" label:"每页个数"`
|
||||||
|
Mobile string `json:"mobile" form:"mobile" label:"手机号"`
|
||||||
|
UserName string `json:"user_name" form:"user_name" label:"用户名"`
|
||||||
|
UserStatus int `json:"user_status" form:"user_status" label:"用户状态"` // (0:禁用 1:正常 2:删除)
|
||||||
|
HospitalName string `json:"hospital_name" form:"hospital_name" label:"医院名称"`
|
||||||
|
DepartmentCustomName string `json:"department_custom_name" form:"department_custom_name" label:"科室名称"`
|
||||||
|
IDCardStatus int `json:"idcard_status" form:"idcard_status" label:"身份证状态"` // (0:未认证 1:认证通过 2:认证失败)
|
||||||
|
IdenAuthStatus int `json:"iden_auth_status" form:"iden_auth_status" label:"认证状态"` // (0:未认证 1:认证通过 2:审核中 3:认证失败)
|
||||||
|
MultiPointStatus int `json:"multi_point_status" form:"multi_point_status" label:"多点执业状态"` // 医生多点执业认证状态(0:未认证 1:认证通过 2:审核中 3:认证失败)
|
||||||
|
IsRecommend int `json:"is_recommend" form:"is_recommend" label:"是否推荐"` // (0:否 1:是)
|
||||||
|
DoctorTitle int `json:"doctor_title" form:"doctor_title" label:"医生职称"` // (1:主任医师 2:主任中医师 3:副主任医师 4:副主任中医师 5:主治医师 6:住院医师)
|
||||||
|
InquiryService string `json:"inquiry_service" form:"inquiry_service" label:"问诊服务"` // (1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药)
|
||||||
|
IsEnterpriseDeepCooperation int `json:"is_enterprise_deep_cooperation" form:"is_enterprise_deep_cooperation" label:"是否企业深度合作"` // (0:否 1:是)
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user