Commit 443025f2 authored by liuyang's avatar liuyang

complete develop framework

parent 8b831585
......@@ -91,6 +91,11 @@
<groupId>org.springframework.retry</groupId>
<artifactId>spring-retry</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
<!--shiro-->
<dependency>
<groupId>org.apache.shiro</groupId>
......
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;
}
}
package com.qkdata.biz.sys.controller;
import com.qkdata.biz.common.BizConstants;
import com.qkdata.biz.sys.entity.SysRolePO;
import com.qkdata.biz.sys.service.SysRoleService;
import com.qkdata.biz.sys.vo.QueryRoleModel;
......@@ -10,6 +11,7 @@ import com.qkdata.common.base.model.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
......@@ -29,21 +31,21 @@ public class SysRoleController {
*/
@ApiOperation("获取全部角色列表")
@GetMapping("/select")
@RequiresPermissions("sys:role:select")
@RequiresRoles(value = {BizConstants.ROLE_ADMIN})
public List<SysRolePO> select(){
return sysRoleService.list();
}
@ApiOperation("查询角色列表")
@PostMapping("/list")
@RequiresPermissions("sys:role:list")
@RequiresRoles(value = {BizConstants.ROLE_ADMIN})
public PageResult<SysRolePO> list(@RequestBody QueryRoleModel queryRoleModel){
return sysRoleService.queryPageList(queryRoleModel);
}
@ApiOperation("获取某一角色信息")
@GetMapping("/info/{id}")
@RequiresPermissions("sys:role:info")
@RequiresRoles(value = {BizConstants.ROLE_ADMIN})
public Result<SysRoleModel> info(@PathVariable Long id){
return Result.succeed(sysRoleService.getRoleInfo(id));
}
......@@ -51,7 +53,7 @@ public class SysRoleController {
@ApiOperation("保存某一角色信息")
@SysLog("保存某一角色信息")
@PostMapping("/save")
@RequiresPermissions("sys:role:save")
@RequiresRoles(value = {BizConstants.ROLE_ADMIN})
public Result<String> save(@RequestBody @Validated SysRoleModel sysRoleModel){
sysRoleService.saveRole(sysRoleModel);
return Result.succeed("ok");
......@@ -60,7 +62,7 @@ public class SysRoleController {
@ApiOperation("修改某一角色信息")
@SysLog("修改某一角色信息")
@PostMapping("/update")
@RequiresPermissions("sys:role:update")
@RequiresRoles(value = {BizConstants.ROLE_ADMIN})
public Result<String> update(@RequestBody @Validated SysRoleModel sysRoleModel){
sysRoleService.updateRole(sysRoleModel);
return Result.succeed("ok");
......@@ -69,7 +71,7 @@ public class SysRoleController {
@ApiOperation("删除角色信息")
@SysLog("删除角色信息")
@PostMapping("/delete")
@RequiresPermissions("sys:role:delete")
@RequiresRoles(value = {BizConstants.ROLE_ADMIN})
public Result<String> delete(@RequestBody Long[] ids){
sysRoleService.removeByIds(Arrays.asList(ids));
return Result.succeed("ok");
......
......@@ -17,7 +17,6 @@ import com.qkdata.common.util.UserContext;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -27,7 +26,7 @@ import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.Arrays;
@Api(tags = "用户管理")
@Api(tags = "系统用户管理")
@RestController
@RequestMapping("/api/sys/user")
public class SysUserController {
......
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
......@@ -19,8 +20,10 @@ public class BasePO<T extends Model<?>> extends Model<T> {
*/
@TableId
private Long id;
@ApiModelProperty(example = "1619423186000")
@TableField(fill = FieldFill.INSERT)
private LocalDateTime createTime;
@ApiModelProperty(example = "1619423186000")
@TableField(fill = FieldFill.INSERT_UPDATE)
private LocalDateTime updateTime;
......
......@@ -63,7 +63,7 @@ spring:
allow-bean-definition-overriding: true
mybatis-plus:
mapper-locations: classpath:/mappers/*Mapper.xml
mapper-locations: classpath:/mappers/**/*Mapper.xml
#实体扫描,多个package用逗号或者分号分隔
typeAliasesPackage: com.qkdata.biz.sys.entity
typeEnumsPackage: com.qkdata.biz.enums
......
......@@ -8,7 +8,7 @@
where ur.user_id = #{userId}
</select>
<select id="queryPageList" resultType="com.qkdata.biz.sys.vo.SysUserModel">
select id,username,email,mobile,status
select id,username,status
from sys_user
where 1=1
<if test="p.username != null and p.username != ''">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment