Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica-cloud-permission
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
提交
打开侧边栏
com.pica.cloud.permission
pica-cloud-permission
提交
7171b266
提交
7171b266
编写于
1月 06, 2020
作者:
rushui.chen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
20200106 注册用户角色处理
上级
63cc12d6
变更
8
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
667 行增加
和
0 行删除
+667
-0
UseRoleClient.java
...ica/cloud/permission/permission/client/UseRoleClient.java
+25
-0
PUserRole.java
...om/pica/cloud/permission/permission/entity/PUserRole.java
+165
-0
UseRoleController.java
...ssion/permission/server/controller/UseRoleController.java
+28
-0
PUserRole.java
.../cloud/permission/permission/server/entity/PUserRole.java
+165
-0
PUserRoleMapper.java
.../permission/permission/server/mapper/PUserRoleMapper.java
+18
-0
IUseRoleService.java
...permission/permission/server/service/IUseRoleService.java
+17
-0
UseRoleServiceImpl.java
...on/permission/server/service/impl/UseRoleServiceImpl.java
+24
-0
PUserRoleMapper.xml
server/src/main/resources/mybatis/PUserRoleMapper.xml
+225
-0
未找到文件。
client/src/main/java/com/pica/cloud/permission/permission/client/UseRoleClient.java
0 → 100644
浏览文件 @
7171b266
package
com
.
pica
.
cloud
.
permission
.
permission
.
client
;
import
com.pica.cloud.foundation.entity.PicaResponse
;
import
com.pica.cloud.permission.permission.entity.PUserRole
;
import
org.springframework.cloud.netflix.feign.FeignClient
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
/**
* Created on 2020/1/6 10:53
* author:crs
* Description:UseRoleClient
*/
@FeignClient
(
name
=
"13501-pica-cloud-permission"
)
public
interface
UseRoleClient
{
/**
* 注册用户角色
*
* @param pUserRole
* @return
*/
@PostMapping
(
"/permission/role/register"
)
PicaResponse
postUserRole
(
@RequestBody
PUserRole
pUserRole
);
}
common/src/main/java/com/pica/cloud/permission/permission/entity/PUserRole.java
0 → 100644
浏览文件 @
7171b266
package
com
.
pica
.
cloud
.
permission
.
permission
.
entity
;
import
java.util.Date
;
public
class
PUserRole
{
private
Integer
id
;
private
Integer
systemId
;
private
Integer
userRoleId
;
private
Integer
userId
;
private
Integer
userType
;
private
String
param1
;
private
String
param2
;
private
String
param3
;
private
String
param4
;
private
String
param5
;
private
Integer
status
;
private
Integer
deleteFlag
;
private
Integer
creatId
;
private
Date
creatTime
;
private
Integer
modifyId
;
private
Date
modifyTime
;
public
Integer
getId
()
{
return
id
;
}
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
public
Integer
getSystemId
()
{
return
systemId
;
}
public
void
setSystemId
(
Integer
systemId
)
{
this
.
systemId
=
systemId
;
}
public
Integer
getUserRoleId
()
{
return
userRoleId
;
}
public
void
setUserRoleId
(
Integer
userRoleId
)
{
this
.
userRoleId
=
userRoleId
;
}
public
Integer
getUserId
()
{
return
userId
;
}
public
void
setUserId
(
Integer
userId
)
{
this
.
userId
=
userId
;
}
public
Integer
getUserType
()
{
return
userType
;
}
public
void
setUserType
(
Integer
userType
)
{
this
.
userType
=
userType
;
}
public
String
getParam1
()
{
return
param1
;
}
public
void
setParam1
(
String
param1
)
{
this
.
param1
=
param1
==
null
?
null
:
param1
.
trim
();
}
public
String
getParam2
()
{
return
param2
;
}
public
void
setParam2
(
String
param2
)
{
this
.
param2
=
param2
==
null
?
null
:
param2
.
trim
();
}
public
String
getParam3
()
{
return
param3
;
}
public
void
setParam3
(
String
param3
)
{
this
.
param3
=
param3
==
null
?
null
:
param3
.
trim
();
}
public
String
getParam4
()
{
return
param4
;
}
public
void
setParam4
(
String
param4
)
{
this
.
param4
=
param4
==
null
?
null
:
param4
.
trim
();
}
public
String
getParam5
()
{
return
param5
;
}
public
void
setParam5
(
String
param5
)
{
this
.
param5
=
param5
==
null
?
null
:
param5
.
trim
();
}
public
Integer
getStatus
()
{
return
status
;
}
public
void
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
}
public
Integer
getDeleteFlag
()
{
return
deleteFlag
;
}
public
void
setDeleteFlag
(
Integer
deleteFlag
)
{
this
.
deleteFlag
=
deleteFlag
;
}
public
Integer
getCreatId
()
{
return
creatId
;
}
public
void
setCreatId
(
Integer
creatId
)
{
this
.
creatId
=
creatId
;
}
public
Date
getCreatTime
()
{
return
creatTime
;
}
public
void
setCreatTime
(
Date
creatTime
)
{
this
.
creatTime
=
creatTime
;
}
public
Integer
getModifyId
()
{
return
modifyId
;
}
public
void
setModifyId
(
Integer
modifyId
)
{
this
.
modifyId
=
modifyId
;
}
public
Date
getModifyTime
()
{
return
modifyTime
;
}
public
void
setModifyTime
(
Date
modifyTime
)
{
this
.
modifyTime
=
modifyTime
;
}
}
\ No newline at end of file
server/src/main/java/com/pica/cloud/permission/permission/server/controller/UseRoleController.java
0 → 100644
浏览文件 @
7171b266
package
com
.
pica
.
cloud
.
permission
.
permission
.
server
.
controller
;
import
com.pica.cloud.foundation.entity.PicaResponse
;
import
com.pica.cloud.permission.permission.server.entity.PUserRole
;
import
com.pica.cloud.permission.permission.server.service.IUseRoleService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* Created on 2020/1/6 10:31
* author:crs
* Description:注册用户角色
*/
@RestController
@RequestMapping
(
"/role"
)
public
class
UseRoleController
{
@Autowired
private
IUseRoleService
iUseRoleService
;
@PostMapping
(
"/register"
)
public
PicaResponse
postUserRole
(
@RequestBody
PUserRole
pUserRole
)
{
iUseRoleService
.
postRegisterRole
(
pUserRole
);
return
PicaResponse
.
toResponse
();
}
}
server/src/main/java/com/pica/cloud/permission/permission/server/entity/PUserRole.java
0 → 100644
浏览文件 @
7171b266
package
com
.
pica
.
cloud
.
permission
.
permission
.
server
.
entity
;
import
java.util.Date
;
public
class
PUserRole
{
private
Integer
id
;
private
Integer
systemId
;
private
Integer
userRoleId
;
private
Integer
userId
;
private
Integer
userType
;
private
String
param1
;
private
String
param2
;
private
String
param3
;
private
String
param4
;
private
String
param5
;
private
Integer
status
;
private
Integer
deleteFlag
;
private
Integer
creatId
;
private
Date
creatTime
;
private
Integer
modifyId
;
private
Date
modifyTime
;
public
Integer
getId
()
{
return
id
;
}
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
public
Integer
getSystemId
()
{
return
systemId
;
}
public
void
setSystemId
(
Integer
systemId
)
{
this
.
systemId
=
systemId
;
}
public
Integer
getUserRoleId
()
{
return
userRoleId
;
}
public
void
setUserRoleId
(
Integer
userRoleId
)
{
this
.
userRoleId
=
userRoleId
;
}
public
Integer
getUserId
()
{
return
userId
;
}
public
void
setUserId
(
Integer
userId
)
{
this
.
userId
=
userId
;
}
public
Integer
getUserType
()
{
return
userType
;
}
public
void
setUserType
(
Integer
userType
)
{
this
.
userType
=
userType
;
}
public
String
getParam1
()
{
return
param1
;
}
public
void
setParam1
(
String
param1
)
{
this
.
param1
=
param1
==
null
?
null
:
param1
.
trim
();
}
public
String
getParam2
()
{
return
param2
;
}
public
void
setParam2
(
String
param2
)
{
this
.
param2
=
param2
==
null
?
null
:
param2
.
trim
();
}
public
String
getParam3
()
{
return
param3
;
}
public
void
setParam3
(
String
param3
)
{
this
.
param3
=
param3
==
null
?
null
:
param3
.
trim
();
}
public
String
getParam4
()
{
return
param4
;
}
public
void
setParam4
(
String
param4
)
{
this
.
param4
=
param4
==
null
?
null
:
param4
.
trim
();
}
public
String
getParam5
()
{
return
param5
;
}
public
void
setParam5
(
String
param5
)
{
this
.
param5
=
param5
==
null
?
null
:
param5
.
trim
();
}
public
Integer
getStatus
()
{
return
status
;
}
public
void
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
}
public
Integer
getDeleteFlag
()
{
return
deleteFlag
;
}
public
void
setDeleteFlag
(
Integer
deleteFlag
)
{
this
.
deleteFlag
=
deleteFlag
;
}
public
Integer
getCreatId
()
{
return
creatId
;
}
public
void
setCreatId
(
Integer
creatId
)
{
this
.
creatId
=
creatId
;
}
public
Date
getCreatTime
()
{
return
creatTime
;
}
public
void
setCreatTime
(
Date
creatTime
)
{
this
.
creatTime
=
creatTime
;
}
public
Integer
getModifyId
()
{
return
modifyId
;
}
public
void
setModifyId
(
Integer
modifyId
)
{
this
.
modifyId
=
modifyId
;
}
public
Date
getModifyTime
()
{
return
modifyTime
;
}
public
void
setModifyTime
(
Date
modifyTime
)
{
this
.
modifyTime
=
modifyTime
;
}
}
\ No newline at end of file
server/src/main/java/com/pica/cloud/permission/permission/server/mapper/PUserRoleMapper.java
0 → 100644
浏览文件 @
7171b266
package
com
.
pica
.
cloud
.
permission
.
permission
.
server
.
mapper
;
import
com.pica.cloud.permission.permission.server.entity.PUserRole
;
public
interface
PUserRoleMapper
{
int
deleteByPrimaryKey
(
Integer
id
);
int
insert
(
PUserRole
record
);
int
insertSelective
(
PUserRole
record
);
PUserRole
selectByPrimaryKey
(
Integer
id
);
int
updateByPrimaryKeySelective
(
PUserRole
record
);
int
updateByPrimaryKey
(
PUserRole
record
);
}
\ No newline at end of file
server/src/main/java/com/pica/cloud/permission/permission/server/service/IUseRoleService.java
0 → 100644
浏览文件 @
7171b266
package
com
.
pica
.
cloud
.
permission
.
permission
.
server
.
service
;
import
com.pica.cloud.permission.permission.server.entity.PUserRole
;
/**
* Created on 2020/1/6 10:44
* author:crs
* Description:IUseRoleService
*/
public
interface
IUseRoleService
{
/**
* 插入注册用户的角色
*
* @param pUserRole
*/
void
postRegisterRole
(
PUserRole
pUserRole
);
}
server/src/main/java/com/pica/cloud/permission/permission/server/service/impl/UseRoleServiceImpl.java
0 → 100644
浏览文件 @
7171b266
package
com
.
pica
.
cloud
.
permission
.
permission
.
server
.
service
.
impl
;
import
com.pica.cloud.permission.permission.server.entity.PUserRole
;
import
com.pica.cloud.permission.permission.server.mapper.PUserRoleMapper
;
import
com.pica.cloud.permission.permission.server.service.IUseRoleService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
/**
* Created on 2020/1/6 10:45
* author:crs
* Description:UseRoleServiceImpl
*/
@Service
public
class
UseRoleServiceImpl
implements
IUseRoleService
{
@Autowired
private
PUserRoleMapper
pUserRoleMapper
;
@Override
public
void
postRegisterRole
(
PUserRole
pUserRole
)
{
pUserRoleMapper
.
insertSelective
(
pUserRole
);
}
}
server/src/main/resources/mybatis/PUserRoleMapper.xml
0 → 100644
浏览文件 @
7171b266
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.pica.cloud.permission.permission.server.mapper.PUserRoleMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pica.cloud.permission.permission.server.entity.PUserRole"
>
<id
column=
"id"
property=
"id"
jdbcType=
"INTEGER"
/>
<result
column=
"system_id"
property=
"systemId"
jdbcType=
"INTEGER"
/>
<result
column=
"user_role_id"
property=
"userRoleId"
jdbcType=
"INTEGER"
/>
<result
column=
"user_id"
property=
"userId"
jdbcType=
"INTEGER"
/>
<result
column=
"user_type"
property=
"userType"
jdbcType=
"INTEGER"
/>
<result
column=
"param_1"
property=
"param1"
jdbcType=
"VARCHAR"
/>
<result
column=
"param_2"
property=
"param2"
jdbcType=
"VARCHAR"
/>
<result
column=
"param_3"
property=
"param3"
jdbcType=
"VARCHAR"
/>
<result
column=
"param_4"
property=
"param4"
jdbcType=
"VARCHAR"
/>
<result
column=
"param_5"
property=
"param5"
jdbcType=
"VARCHAR"
/>
<result
column=
"status"
property=
"status"
jdbcType=
"INTEGER"
/>
<result
column=
"delete_flag"
property=
"deleteFlag"
jdbcType=
"INTEGER"
/>
<result
column=
"creat_id"
property=
"creatId"
jdbcType=
"INTEGER"
/>
<result
column=
"creat_time"
property=
"creatTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"modify_id"
property=
"modifyId"
jdbcType=
"INTEGER"
/>
<result
column=
"modify_time"
property=
"modifyTime"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, system_id, user_role_id, user_id, user_type, param_1, param_2, param_3, param_4,
param_5, status, delete_flag, creat_id, creat_time, modify_id, modify_time
</sql>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Integer"
>
select
<include
refid=
"Base_Column_List"
/>
from p_user_role_mapping
where id = #{id,jdbcType=INTEGER}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Integer"
>
delete from p_user_role_mapping
where id = #{id,jdbcType=INTEGER}
</delete>
<insert
id=
"insert"
parameterType=
"com.pica.cloud.permission.permission.server.entity.PUserRole"
>
insert into p_user_role_mapping (id, system_id, user_role_id,
user_id, user_type, param_1,
param_2, param_3, param_4,
param_5, status, delete_flag,
creat_id, creat_time, modify_id,
modify_time)
values (#{id,jdbcType=INTEGER}, #{systemId,jdbcType=INTEGER}, #{userRoleId,jdbcType=INTEGER},
#{userId,jdbcType=INTEGER}, #{userType,jdbcType=INTEGER}, #{param1,jdbcType=VARCHAR},
#{param2,jdbcType=VARCHAR}, #{param3,jdbcType=VARCHAR}, #{param4,jdbcType=VARCHAR},
#{param5,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{deleteFlag,jdbcType=INTEGER},
#{creatId,jdbcType=INTEGER}, #{creatTime,jdbcType=TIMESTAMP}, #{modifyId,jdbcType=INTEGER},
#{modifyTime,jdbcType=TIMESTAMP})
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.pica.cloud.permission.permission.server.entity.PUserRole"
>
insert into p_user_role_mapping
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
id,
</if>
<if
test=
"systemId != null"
>
system_id,
</if>
<if
test=
"userRoleId != null"
>
user_role_id,
</if>
<if
test=
"userId != null"
>
user_id,
</if>
<if
test=
"userType != null"
>
user_type,
</if>
<if
test=
"param1 != null"
>
param_1,
</if>
<if
test=
"param2 != null"
>
param_2,
</if>
<if
test=
"param3 != null"
>
param_3,
</if>
<if
test=
"param4 != null"
>
param_4,
</if>
<if
test=
"param5 != null"
>
param_5,
</if>
<if
test=
"status != null"
>
status,
</if>
<if
test=
"deleteFlag != null"
>
delete_flag,
</if>
<if
test=
"creatId != null"
>
creat_id,
</if>
<if
test=
"creatTime != null"
>
creat_time,
</if>
<if
test=
"modifyId != null"
>
modify_id,
</if>
<if
test=
"modifyTime != null"
>
modify_time,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
#{id,jdbcType=INTEGER},
</if>
<if
test=
"systemId != null"
>
#{systemId,jdbcType=INTEGER},
</if>
<if
test=
"userRoleId != null"
>
#{userRoleId,jdbcType=INTEGER},
</if>
<if
test=
"userId != null"
>
#{userId,jdbcType=INTEGER},
</if>
<if
test=
"userType != null"
>
#{userType,jdbcType=INTEGER},
</if>
<if
test=
"param1 != null"
>
#{param1,jdbcType=VARCHAR},
</if>
<if
test=
"param2 != null"
>
#{param2,jdbcType=VARCHAR},
</if>
<if
test=
"param3 != null"
>
#{param3,jdbcType=VARCHAR},
</if>
<if
test=
"param4 != null"
>
#{param4,jdbcType=VARCHAR},
</if>
<if
test=
"param5 != null"
>
#{param5,jdbcType=VARCHAR},
</if>
<if
test=
"status != null"
>
#{status,jdbcType=INTEGER},
</if>
<if
test=
"deleteFlag != null"
>
#{deleteFlag,jdbcType=INTEGER},
</if>
<if
test=
"creatId != null"
>
#{creatId,jdbcType=INTEGER},
</if>
<if
test=
"creatTime != null"
>
#{creatTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"modifyId != null"
>
#{modifyId,jdbcType=INTEGER},
</if>
<if
test=
"modifyTime != null"
>
#{modifyTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.pica.cloud.permission.permission.server.entity.PUserRole"
>
update p_user_role_mapping
<set
>
<if
test=
"systemId != null"
>
system_id = #{systemId,jdbcType=INTEGER},
</if>
<if
test=
"userRoleId != null"
>
user_role_id = #{userRoleId,jdbcType=INTEGER},
</if>
<if
test=
"userId != null"
>
user_id = #{userId,jdbcType=INTEGER},
</if>
<if
test=
"userType != null"
>
user_type = #{userType,jdbcType=INTEGER},
</if>
<if
test=
"param1 != null"
>
param_1 = #{param1,jdbcType=VARCHAR},
</if>
<if
test=
"param2 != null"
>
param_2 = #{param2,jdbcType=VARCHAR},
</if>
<if
test=
"param3 != null"
>
param_3 = #{param3,jdbcType=VARCHAR},
</if>
<if
test=
"param4 != null"
>
param_4 = #{param4,jdbcType=VARCHAR},
</if>
<if
test=
"param5 != null"
>
param_5 = #{param5,jdbcType=VARCHAR},
</if>
<if
test=
"status != null"
>
status = #{status,jdbcType=INTEGER},
</if>
<if
test=
"deleteFlag != null"
>
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if>
<if
test=
"creatId != null"
>
creat_id = #{creatId,jdbcType=INTEGER},
</if>
<if
test=
"creatTime != null"
>
creat_time = #{creatTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"modifyId != null"
>
modify_id = #{modifyId,jdbcType=INTEGER},
</if>
<if
test=
"modifyTime != null"
>
modify_time = #{modifyTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.pica.cloud.permission.permission.server.entity.PUserRole"
>
update p_user_role_mapping
set system_id = #{systemId,jdbcType=INTEGER},
user_role_id = #{userRoleId,jdbcType=INTEGER},
user_id = #{userId,jdbcType=INTEGER},
user_type = #{userType,jdbcType=INTEGER},
param_1 = #{param1,jdbcType=VARCHAR},
param_2 = #{param2,jdbcType=VARCHAR},
param_3 = #{param3,jdbcType=VARCHAR},
param_4 = #{param4,jdbcType=VARCHAR},
param_5 = #{param5,jdbcType=VARCHAR},
status = #{status,jdbcType=INTEGER},
delete_flag = #{deleteFlag,jdbcType=INTEGER},
creat_id = #{creatId,jdbcType=INTEGER},
creat_time = #{creatTime,jdbcType=TIMESTAMP},
modify_id = #{modifyId,jdbcType=INTEGER},
modify_time = #{modifyTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
\ No newline at end of file
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录