Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
O
online-edu-backend
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
online-edu
online-edu-backend
Commits
443025f2
Commit
443025f2
authored
Apr 27, 2021
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
complete develop framework
parent
8b831585
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
36 additions
and
10 deletions
+36
-10
pom.xml
pom.xml
+5
-0
AccountTypeEnum.java
src/main/java/com/qkdata/biz/enums/AccountTypeEnum.java
+17
-0
SysRoleController.java
...java/com/qkdata/biz/sys/controller/SysRoleController.java
+8
-6
SysUserController.java
...java/com/qkdata/biz/sys/controller/SysUserController.java
+1
-2
BasePO.java
src/main/java/com/qkdata/common/base/entity/BasePO.java
+3
-0
application.yml
src/main/resources/application.yml
+1
-1
SysUserMapper.xml
src/main/resources/mappers/sys/SysUserMapper.xml
+1
-1
No files found.
pom.xml
View file @
443025f2
...
@@ -91,6 +91,11 @@
...
@@ -91,6 +91,11 @@
<groupId>
org.springframework.retry
</groupId>
<groupId>
org.springframework.retry
</groupId>
<artifactId>
spring-retry
</artifactId>
<artifactId>
spring-retry
</artifactId>
</dependency>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-devtools
</artifactId>
<optional>
true
</optional>
</dependency>
<!--shiro-->
<!--shiro-->
<dependency>
<dependency>
<groupId>
org.apache.shiro
</groupId>
<groupId>
org.apache.shiro
</groupId>
...
...
src/main/java/com/qkdata/biz/enums/AccountTypeEnum.java
0 → 100644
View file @
443025f2
package
com
.
qkdata
.
biz
.
enums
;
import
com.baomidou.mybatisplus.annotation.EnumValue
;
public
enum
AccountTypeEnum
{
USER
(
0
,
"普通用户"
),
VIP
(
1
,
"会员"
),
ENTERPRISE_VIP
(
2
,
"企业会员"
);
@EnumValue
private
Integer
value
;
private
String
text
;
AccountTypeEnum
(
Integer
value
,
String
text
)
{
this
.
value
=
value
;
this
.
text
=
text
;
}
}
src/main/java/com/qkdata/biz/sys/controller/SysRoleController.java
View file @
443025f2
package
com
.
qkdata
.
biz
.
sys
.
controller
;
package
com
.
qkdata
.
biz
.
sys
.
controller
;
import
com.qkdata.biz.common.BizConstants
;
import
com.qkdata.biz.sys.entity.SysRolePO
;
import
com.qkdata.biz.sys.entity.SysRolePO
;
import
com.qkdata.biz.sys.service.SysRoleService
;
import
com.qkdata.biz.sys.service.SysRoleService
;
import
com.qkdata.biz.sys.vo.QueryRoleModel
;
import
com.qkdata.biz.sys.vo.QueryRoleModel
;
...
@@ -10,6 +11,7 @@ import com.qkdata.common.base.model.Result;
...
@@ -10,6 +11,7 @@ import com.qkdata.common.base.model.Result;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.apache.shiro.authz.annotation.RequiresRoles
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -29,21 +31,21 @@ public class SysRoleController {
...
@@ -29,21 +31,21 @@ public class SysRoleController {
*/
*/
@ApiOperation
(
"获取全部角色列表"
)
@ApiOperation
(
"获取全部角色列表"
)
@GetMapping
(
"/select"
)
@GetMapping
(
"/select"
)
@Requires
Permissions
(
"sys:role:select"
)
@Requires
Roles
(
value
=
{
BizConstants
.
ROLE_ADMIN
}
)
public
List
<
SysRolePO
>
select
(){
public
List
<
SysRolePO
>
select
(){
return
sysRoleService
.
list
();
return
sysRoleService
.
list
();
}
}
@ApiOperation
(
"查询角色列表"
)
@ApiOperation
(
"查询角色列表"
)
@PostMapping
(
"/list"
)
@PostMapping
(
"/list"
)
@Requires
Permissions
(
"sys:role:list"
)
@Requires
Roles
(
value
=
{
BizConstants
.
ROLE_ADMIN
}
)
public
PageResult
<
SysRolePO
>
list
(
@RequestBody
QueryRoleModel
queryRoleModel
){
public
PageResult
<
SysRolePO
>
list
(
@RequestBody
QueryRoleModel
queryRoleModel
){
return
sysRoleService
.
queryPageList
(
queryRoleModel
);
return
sysRoleService
.
queryPageList
(
queryRoleModel
);
}
}
@ApiOperation
(
"获取某一角色信息"
)
@ApiOperation
(
"获取某一角色信息"
)
@GetMapping
(
"/info/{id}"
)
@GetMapping
(
"/info/{id}"
)
@Requires
Permissions
(
"sys:role:info"
)
@Requires
Roles
(
value
=
{
BizConstants
.
ROLE_ADMIN
}
)
public
Result
<
SysRoleModel
>
info
(
@PathVariable
Long
id
){
public
Result
<
SysRoleModel
>
info
(
@PathVariable
Long
id
){
return
Result
.
succeed
(
sysRoleService
.
getRoleInfo
(
id
));
return
Result
.
succeed
(
sysRoleService
.
getRoleInfo
(
id
));
}
}
...
@@ -51,7 +53,7 @@ public class SysRoleController {
...
@@ -51,7 +53,7 @@ public class SysRoleController {
@ApiOperation
(
"保存某一角色信息"
)
@ApiOperation
(
"保存某一角色信息"
)
@SysLog
(
"保存某一角色信息"
)
@SysLog
(
"保存某一角色信息"
)
@PostMapping
(
"/save"
)
@PostMapping
(
"/save"
)
@Requires
Permissions
(
"sys:role:save"
)
@Requires
Roles
(
value
=
{
BizConstants
.
ROLE_ADMIN
}
)
public
Result
<
String
>
save
(
@RequestBody
@Validated
SysRoleModel
sysRoleModel
){
public
Result
<
String
>
save
(
@RequestBody
@Validated
SysRoleModel
sysRoleModel
){
sysRoleService
.
saveRole
(
sysRoleModel
);
sysRoleService
.
saveRole
(
sysRoleModel
);
return
Result
.
succeed
(
"ok"
);
return
Result
.
succeed
(
"ok"
);
...
@@ -60,7 +62,7 @@ public class SysRoleController {
...
@@ -60,7 +62,7 @@ public class SysRoleController {
@ApiOperation
(
"修改某一角色信息"
)
@ApiOperation
(
"修改某一角色信息"
)
@SysLog
(
"修改某一角色信息"
)
@SysLog
(
"修改某一角色信息"
)
@PostMapping
(
"/update"
)
@PostMapping
(
"/update"
)
@Requires
Permissions
(
"sys:role:update"
)
@Requires
Roles
(
value
=
{
BizConstants
.
ROLE_ADMIN
}
)
public
Result
<
String
>
update
(
@RequestBody
@Validated
SysRoleModel
sysRoleModel
){
public
Result
<
String
>
update
(
@RequestBody
@Validated
SysRoleModel
sysRoleModel
){
sysRoleService
.
updateRole
(
sysRoleModel
);
sysRoleService
.
updateRole
(
sysRoleModel
);
return
Result
.
succeed
(
"ok"
);
return
Result
.
succeed
(
"ok"
);
...
@@ -69,7 +71,7 @@ public class SysRoleController {
...
@@ -69,7 +71,7 @@ public class SysRoleController {
@ApiOperation
(
"删除角色信息"
)
@ApiOperation
(
"删除角色信息"
)
@SysLog
(
"删除角色信息"
)
@SysLog
(
"删除角色信息"
)
@PostMapping
(
"/delete"
)
@PostMapping
(
"/delete"
)
@Requires
Permissions
(
"sys:role:delete"
)
@Requires
Roles
(
value
=
{
BizConstants
.
ROLE_ADMIN
}
)
public
Result
<
String
>
delete
(
@RequestBody
Long
[]
ids
){
public
Result
<
String
>
delete
(
@RequestBody
Long
[]
ids
){
sysRoleService
.
removeByIds
(
Arrays
.
asList
(
ids
));
sysRoleService
.
removeByIds
(
Arrays
.
asList
(
ids
));
return
Result
.
succeed
(
"ok"
);
return
Result
.
succeed
(
"ok"
);
...
...
src/main/java/com/qkdata/biz/sys/controller/SysUserController.java
View file @
443025f2
...
@@ -17,7 +17,6 @@ import com.qkdata.common.util.UserContext;
...
@@ -17,7 +17,6 @@ import com.qkdata.common.util.UserContext;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.apache.shiro.authz.annotation.RequiresRoles
;
import
org.apache.shiro.authz.annotation.RequiresRoles
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -27,7 +26,7 @@ import org.springframework.web.bind.annotation.*;
...
@@ -27,7 +26,7 @@ import org.springframework.web.bind.annotation.*;
import
javax.validation.Valid
;
import
javax.validation.Valid
;
import
java.util.Arrays
;
import
java.util.Arrays
;
@Api
(
tags
=
"用户管理"
)
@Api
(
tags
=
"
系统
用户管理"
)
@RestController
@RestController
@RequestMapping
(
"/api/sys/user"
)
@RequestMapping
(
"/api/sys/user"
)
public
class
SysUserController
{
public
class
SysUserController
{
...
...
src/main/java/com/qkdata/common/base/entity/BasePO.java
View file @
443025f2
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.FieldFill;
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.FieldFill;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.extension.activerecord.Model
;
import
com.baomidou.mybatisplus.extension.activerecord.Model
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.io.Serializable
;
...
@@ -19,8 +20,10 @@ public class BasePO<T extends Model<?>> extends Model<T> {
...
@@ -19,8 +20,10 @@ public class BasePO<T extends Model<?>> extends Model<T> {
*/
*/
@TableId
@TableId
private
Long
id
;
private
Long
id
;
@ApiModelProperty
(
example
=
"1619423186000"
)
@TableField
(
fill
=
FieldFill
.
INSERT
)
@TableField
(
fill
=
FieldFill
.
INSERT
)
private
LocalDateTime
createTime
;
private
LocalDateTime
createTime
;
@ApiModelProperty
(
example
=
"1619423186000"
)
@TableField
(
fill
=
FieldFill
.
INSERT_UPDATE
)
@TableField
(
fill
=
FieldFill
.
INSERT_UPDATE
)
private
LocalDateTime
updateTime
;
private
LocalDateTime
updateTime
;
...
...
src/main/resources/application.yml
View file @
443025f2
...
@@ -63,7 +63,7 @@ spring:
...
@@ -63,7 +63,7 @@ spring:
allow-bean-definition-overriding
:
true
allow-bean-definition-overriding
:
true
mybatis-plus
:
mybatis-plus
:
mapper-locations
:
classpath:/mappers/*Mapper.xml
mapper-locations
:
classpath:/mappers/*
*/*
Mapper.xml
#实体扫描,多个package用逗号或者分号分隔
#实体扫描,多个package用逗号或者分号分隔
typeAliasesPackage
:
com.qkdata.biz.sys.entity
typeAliasesPackage
:
com.qkdata.biz.sys.entity
typeEnumsPackage
:
com.qkdata.biz.enums
typeEnumsPackage
:
com.qkdata.biz.enums
...
...
src/main/resources/mappers/sys/SysUserMapper.xml
View file @
443025f2
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
where ur.user_id = #{userId}
where ur.user_id = #{userId}
</select>
</select>
<select
id=
"queryPageList"
resultType=
"com.qkdata.biz.sys.vo.SysUserModel"
>
<select
id=
"queryPageList"
resultType=
"com.qkdata.biz.sys.vo.SysUserModel"
>
select id,username,
email,mobile,
status
select id,username,status
from sys_user
from sys_user
where 1=1
where 1=1
<if
test=
"p.username != null and p.username != ''"
>
<if
test=
"p.username != null and p.username != ''"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment