Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
M
medical-server
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
aiming-medical
medical-server
Commits
e314e448
提交
e314e448
authored
9月 13, 2023
作者:
zhu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix
上级
1da8961c
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
107 行增加
和
18 行删除
+107
-18
User.java
src/main/java/com/xwd/hospital/server/domain/User.java
+22
-6
RegisterSourceEnum.java
...ava/com/xwd/hospital/server/enums/RegisterSourceEnum.java
+28
-0
UserTypeEnum.java
...main/java/com/xwd/hospital/server/enums/UserTypeEnum.java
+29
-0
UserParam.java
...main/java/com/xwd/hospital/server/rest/req/UserParam.java
+18
-5
V1.0.0__schema.sql
src/main/resources/db/migration/V1.0.0__schema.sql
+2
-1
UserBaseMapper.xml
src/main/resources/mappers/base/UserBaseMapper.xml
+8
-6
没有找到文件。
src/main/java/com/xwd/hospital/server/domain/User.java
浏览文件 @
e314e448
...
...
@@ -21,7 +21,8 @@ import org.springframework.format.annotation.DateTimeFormat;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.xwd.hospital.server.base.BaseDomain
;
import
com.xwd.hospital.server.enums.UserSourceEnum
;
import
com.xwd.hospital.server.enums.UserTypeEnum
;
import
com.xwd.hospital.server.enums.RegisterSourceEnum
;
import
com.xwd.hospital.server.enums.YesNoEnum
;
@Data
...
...
@@ -59,9 +60,15 @@ public class User extends BaseDomain {
/**
* 用户类型
*/
@TableField
(
value
=
"user_
sourc
e"
)
@TableField
(
value
=
"user_
typ
e"
)
@Schema
(
description
=
"用户类型"
,
nullable
=
false
)
private
UserSourceEnum
userSource
;
private
UserTypeEnum
userType
;
/**
* 注册来源
*/
@TableField
(
value
=
"register_source"
)
@Schema
(
description
=
"注册来源"
,
nullable
=
false
)
private
RegisterSourceEnum
registerSource
;
/**
* 关联对象(doctor_info、user_info)
*/
...
...
@@ -131,8 +138,11 @@ public class User extends BaseDomain {
*/
@Override
public
User
setDefault
()
{
if
(
this
.
getUserSource
()
==
null
)
{
this
.
setUserSource
(
UserSourceEnum
.
ADMIN
);
if
(
this
.
getUserType
()
==
null
)
{
this
.
setUserType
(
UserTypeEnum
.
ADMIN
);
}
if
(
this
.
getRegisterSource
()
==
null
)
{
this
.
setRegisterSource
(
RegisterSourceEnum
.
WX
);
}
if
(
this
.
getDeleteStatus
()
==
null
)
{
this
.
setDeleteStatus
(
YesNoEnum
.
NO
);
...
...
@@ -183,12 +193,18 @@ public class User extends BaseDomain {
}
return
false
;
}
if
(
this
.
getUser
Sourc
e
()
==
null
)
{
if
(
this
.
getUser
Typ
e
()
==
null
)
{
if
(
throwException
)
{
throw
new
ApiCode
.
ApiException
(-
1
,
"用户类型不能为空!"
);
}
return
false
;
}
if
(
this
.
getRegisterSource
()
==
null
)
{
if
(
throwException
)
{
throw
new
ApiCode
.
ApiException
(-
1
,
"注册来源不能为空!"
);
}
return
false
;
}
if
(
this
.
getObjId
()
==
null
)
{
if
(
throwException
)
{
throw
new
ApiCode
.
ApiException
(-
1
,
"关联对象(doctor_info、user_info)不能为空!"
);
...
...
src/main/java/com/xwd/hospital/server/enums/RegisterSourceEnum.java
0 → 100644
浏览文件 @
e314e448
/**
* 项目:互联网医疗
* @Author: xiongwei
* @Date: 2023-09-05 09:42:00
*/
package
com
.
xwd
.
hospital
.
server
.
enums
;
/**
* 用户注册来源
*/
public
enum
RegisterSourceEnum
{
WX
(
"微信"
),
PLATFORM
(
"平台"
);
RegisterSourceEnum
(
String
name
)
{
this
.
name
=
name
;
}
private
String
name
;
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
}
src/main/java/com/xwd/hospital/server/enums/UserTypeEnum.java
0 → 100644
浏览文件 @
e314e448
/**
* 项目:互联网医疗
* @Author: xiongwei
* @Date: 2023-09-05 09:42:00
*/
package
com
.
xwd
.
hospital
.
server
.
enums
;
/**
* 注册来源类型
*/
public
enum
UserTypeEnum
{
PATIENT
(
"患者"
),
DOCTOR
(
"医生"
),
ADMIN
(
"平台"
);
UserTypeEnum
(
String
name
)
{
this
.
name
=
name
;
}
private
String
name
;
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
}
src/main/java/com/xwd/hospital/server/rest/req/UserParam.java
浏览文件 @
e314e448
...
...
@@ -17,7 +17,8 @@ import lombok.*;
import
org.springframework.format.annotation.DateTimeFormat
;
import
com.xwd.hospital.server.base.BaseParam
;
import
com.xwd.hospital.server.enums.UserSourceEnum
;
import
com.xwd.hospital.server.enums.UserTypeEnum
;
import
com.xwd.hospital.server.enums.RegisterSourceEnum
;
import
com.xwd.hospital.server.enums.YesNoEnum
;
import
com.xwd.hospital.server.domain.User
;
...
...
@@ -51,12 +52,22 @@ public class UserParam extends BaseParam<User> {
* 用户类型
*/
@Parameter
(
description
=
"用户类型"
)
private
User
SourceEnum
userSourc
e
;
private
User
TypeEnum
userTyp
e
;
/**
* 用户类型 IN值List
*/
@Parameter
(
description
=
"用户类型 IN值List"
)
private
List
<
String
>
userSourceList
;
private
List
<
String
>
userTypeList
;
/**
* 注册来源
*/
@Parameter
(
description
=
"注册来源"
)
private
RegisterSourceEnum
registerSource
;
/**
* 注册来源 IN值List
*/
@Parameter
(
description
=
"注册来源 IN值List"
)
private
List
<
String
>
registerSourceList
;
/**
* 关联对象(doctor_info、user_info)
*/
...
...
@@ -180,8 +191,10 @@ public class UserParam extends BaseParam<User> {
wrapper
.
eq
(
columnPrefix
+
"open_id"
,
this
.
getOpenId
());
}
}
wrapper
.
eq
(
this
.
getUserSource
()
!=
null
,
columnPrefix
+
"user_source"
,
this
.
getUserSource
());
wrapper
.
in
(
this
.
getUserSourceList
()
!=
null
&&
this
.
getUserSourceList
().
size
()
>
0
,
columnPrefix
+
"user_source"
,
this
.
getUserSourceList
());
wrapper
.
eq
(
this
.
getUserType
()
!=
null
,
columnPrefix
+
"user_type"
,
this
.
getUserType
());
wrapper
.
in
(
this
.
getUserTypeList
()
!=
null
&&
this
.
getUserTypeList
().
size
()
>
0
,
columnPrefix
+
"user_type"
,
this
.
getUserTypeList
());
wrapper
.
eq
(
this
.
getRegisterSource
()
!=
null
,
columnPrefix
+
"register_source"
,
this
.
getRegisterSource
());
wrapper
.
in
(
this
.
getRegisterSourceList
()
!=
null
&&
this
.
getRegisterSourceList
().
size
()
>
0
,
columnPrefix
+
"register_source"
,
this
.
getRegisterSourceList
());
wrapper
.
eq
(
this
.
getObjId
()
!=
null
,
columnPrefix
+
"obj_id"
,
this
.
getObjId
());
wrapper
.
eq
(
this
.
getDeleteStatus
()
!=
null
,
columnPrefix
+
"delete_status"
,
this
.
getDeleteStatus
());
wrapper
.
in
(
this
.
getDeleteStatusList
()
!=
null
&&
this
.
getDeleteStatusList
().
size
()
>
0
,
columnPrefix
+
"delete_status"
,
this
.
getDeleteStatusList
());
...
...
src/main/resources/db/migration/V1.0.0__schema.sql
浏览文件 @
e314e448
...
...
@@ -536,7 +536,8 @@ create table `sys_user`
id
int
(
11
)
auto_increment
not
null
comment
'Id'
,
username
varchar
(
255
)
not
null
comment
'用户名'
,
open_id
varchar
(
255
)
not
null
comment
'微信open_id'
,
user_source
varchar
(
50
)
not
null
default
ADMIN
comment
'用户类型 [PATIENT.患者 DOCTOR.医生 ADMIN.平台]'
,
user_type
varchar
(
50
)
not
null
default
ADMIN
comment
'用户类型 [PATIENT.患者 DOCTOR.医生 ADMIN.平台]'
,
register_source
varchar
(
50
)
not
null
default
WX
comment
'注册来源 [WX.微信 PLATFORM.平台]'
,
obj_id
int
(
11
)
not
null
comment
'关联对象(doctor_info、user_info)'
,
delete_status
varchar
(
50
)
not
null
default
'NO'
comment
'是否删除 [YES.是 NO.否]'
,
password
varchar
(
255
)
null
comment
'密码'
,
...
...
src/main/resources/mappers/base/UserBaseMapper.xml
浏览文件 @
e314e448
...
...
@@ -5,7 +5,8 @@
<id
column=
"id"
jdbcType=
"BIGINT"
property=
"id"
/>
<result
column=
"username"
jdbcType=
"VARCHAR"
property=
"username"
/>
<result
column=
"open_id"
jdbcType=
"VARCHAR"
property=
"openId"
/>
<result
column=
"user_source"
jdbcType=
"VARCHAR"
property=
"userSource"
/>
<result
column=
"user_type"
jdbcType=
"VARCHAR"
property=
"userType"
/>
<result
column=
"register_source"
jdbcType=
"VARCHAR"
property=
"registerSource"
/>
<result
column=
"obj_id"
jdbcType=
"BIGINT"
property=
"objId"
/>
<result
column=
"delete_status"
jdbcType=
"VARCHAR"
property=
"deleteStatus"
/>
<result
column=
"password"
jdbcType=
"VARCHAR"
property=
"password"
/>
...
...
@@ -21,10 +22,10 @@
<collection
column=
"id"
property=
"roleList"
select=
"queryRoleById"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
`id`, `username`, `open_id`, `user_source`, `obj_id`, `delete_status`, `password`, `real_name`, `phone`, `avatar`, `editor_id`, `editor_name`, `create_time`, `update_time`
`id`, `username`, `open_id`, `user_
type`, `register_
source`, `obj_id`, `delete_status`, `password`, `real_name`, `phone`, `avatar`, `editor_id`, `editor_name`, `create_time`, `update_time`
</sql>
<sql
id=
"Base_Column_List_With_Prefix"
>
t.`id`, t.`username`, t.`open_id`, t.`user_source`, t.`obj_id`, t.`delete_status`, t.`password`, t.`real_name`, t.`phone`, t.`avatar`, t.`editor_id`, t.`editor_name`, t.`create_time`, t.`update_time`
t.`id`, t.`username`, t.`open_id`, t.`user_
type`, t.`register_
source`, t.`obj_id`, t.`delete_status`, t.`password`, t.`real_name`, t.`phone`, t.`avatar`, t.`editor_id`, t.`editor_name`, t.`create_time`, t.`update_time`
</sql>
<select
id=
"queryRoleById"
resultMap=
"com.xwd.hospital.server.repository.base.RoleBaseMapper.ResultMap"
>
select
...
...
@@ -36,12 +37,12 @@
</select>
<insert
id=
"batchInsert"
>
insert into sys_user (
`username`, `open_id`, `user_source`, `obj_id`, `delete_status`, `password`, `real_name`, `phone`, `avatar`, `editor_id`, `editor_name`
`username`, `open_id`, `user_
type`, `register_
source`, `obj_id`, `delete_status`, `password`, `real_name`, `phone`, `avatar`, `editor_id`, `editor_name`
)
values
<foreach
collection=
"records"
item=
"record"
separator=
","
>
(
#{record.username, jdbcType=VARCHAR}, #{record.openId, jdbcType=VARCHAR}, #{record.userSource, jdbcType=VARCHAR}, #{record.objId, jdbcType=BIGINT}, #{record.deleteStatus, jdbcType=VARCHAR}, #{record.password, jdbcType=VARCHAR}, #{record.realName, jdbcType=VARCHAR}, #{record.phone, jdbcType=VARCHAR}, #{record.avatar, jdbcType=VARCHAR}, #{record.editorId, jdbcType=BIGINT}, #{record.editorName, jdbcType=VARCHAR}
#{record.username, jdbcType=VARCHAR}, #{record.openId, jdbcType=VARCHAR}, #{record.user
Type, jdbcType=VARCHAR}, #{record.register
Source, jdbcType=VARCHAR}, #{record.objId, jdbcType=BIGINT}, #{record.deleteStatus, jdbcType=VARCHAR}, #{record.password, jdbcType=VARCHAR}, #{record.realName, jdbcType=VARCHAR}, #{record.phone, jdbcType=VARCHAR}, #{record.avatar, jdbcType=VARCHAR}, #{record.editorId, jdbcType=BIGINT}, #{record.editorName, jdbcType=VARCHAR}
)
</foreach>
</insert>
...
...
@@ -50,7 +51,8 @@
<trim
suffixOverrides=
","
>
username = #{et.username, jdbcType=VARCHAR},
open_id = #{et.openId, jdbcType=VARCHAR},
user_source = #{et.userSource, jdbcType=VARCHAR},
user_type = #{et.userType, jdbcType=VARCHAR},
register_source = #{et.registerSource, jdbcType=VARCHAR},
obj_id = #{et.objId, jdbcType=BIGINT},
delete_status = #{et.deleteStatus, jdbcType=VARCHAR},
password = #{et.password, jdbcType=VARCHAR},
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论