Commit 19573744 by hewei

Merge branch 'double_realm_test' into 'master'

Double realm test

See merge request hewei/Jumeirah!2
parents 458c1322 82168ad8
...@@ -71,3 +71,12 @@ api-system api-app api-merchant ...@@ -71,3 +71,12 @@ api-system api-app api-merchant
## 权限验证
使用shiro框架
authc:所有url都必须认证通过才可以访问;
anon:所有url都都可以匿名访问;
过滤链定义,从上向下顺序执行,一般将/**放在最为下边
\ No newline at end of file
...@@ -20,6 +20,7 @@ import java.io.IOException; ...@@ -20,6 +20,7 @@ import java.io.IOException;
@Api(value = "Hello World2", tags = {"APP Hello World2"}) @Api(value = "Hello World2", tags = {"APP Hello World2"})
@RestController @RestController
@RequestMapping("/app") @RequestMapping("/app")
//@Module("api-app")
public class AppHelloWorldController { public class AppHelloWorldController {
/** /**
...@@ -36,4 +37,21 @@ public class AppHelloWorldController { ...@@ -36,4 +37,21 @@ public class AppHelloWorldController {
return ApiResult.ok("Hello World app"); return ApiResult.ok("Hello World app");
} }
@GetMapping(value = "/needRole")
@OperationLog(name = "helloWorld")
@ApiOperation(value = "Hello World", response = String.class)
public ApiResult<String> needRole() throws IOException {
log.debug("Hello World...app");
return ApiResult.ok("Hello World app");
}
@GetMapping(value = "/noRole")
@OperationLog(name = "helloWorld")
@ApiOperation(value = "Hello World", response = String.class)
public ApiResult<String> noRole() throws IOException {
log.debug("Hello World...app");
return ApiResult.ok("Hello World app noRole");
}
} }
package com.jumeirah.api.app.controller;
import com.jumeirah.common.entity.AppUser;
import com.jumeirah.common.param.AppUserPageParam;
import com.jumeirah.common.param.RegisterParam;
import com.jumeirah.common.service.AppUserService;
import com.jumeirah.common.vo.AppUserQueryVo;
import com.jumeirah.common.vo.LoginSysUserTokenVo;
import io.geekidea.springbootplus.framework.common.api.ApiResult;
import io.geekidea.springbootplus.framework.common.controller.BaseController;
import io.geekidea.springbootplus.framework.core.pagination.Paging;
import io.geekidea.springbootplus.framework.core.validator.groups.Add;
import io.geekidea.springbootplus.framework.core.validator.groups.Update;
import io.geekidea.springbootplus.framework.log.annotation.OperationLog;
import io.geekidea.springbootplus.framework.log.annotation.OperationLogIgnore;
import io.geekidea.springbootplus.framework.log.enums.OperationLogType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletResponse;
/**
* APP用户 控制器
*
* @author wei
* @since 2020-09-23
*/
@Slf4j
@RestController
//@Module("api-app")
@Api(value = "用户API", tags = {"APP相关"})
@RequestMapping("/app/user/")
public class AppUserController extends BaseController {
@Autowired
private AppUserService appUserService;
/**
* 添加APP用户
*/
@PostMapping("/add")
@OperationLog(name = "添加APP用户", type = OperationLogType.ADD)
@ApiOperation(value = "添加APP用户", response = ApiResult.class)
public ApiResult<Boolean> addAppUser(@Validated(Add.class) @RequestBody AppUser appUser) throws Exception {
boolean flag = appUserService.saveAppUser(appUser);
return ApiResult.result(flag);
}
/**
* 修改APP用户
*/
@PostMapping("/update")
@OperationLog(name = "修改APP用户", type = OperationLogType.UPDATE)
@ApiOperation(value = "修改APP用户", response = ApiResult.class)
public ApiResult<Boolean> updateAppUser(@Validated(Update.class) @RequestBody AppUser appUser) throws Exception {
boolean flag = appUserService.updateAppUser(appUser);
return ApiResult.result(flag);
}
/**
* 删除APP用户
*/
@PostMapping("/delete/{id}")
@OperationLog(name = "删除APP用户", type = OperationLogType.DELETE)
@ApiOperation(value = "删除APP用户", response = ApiResult.class)
public ApiResult<Boolean> deleteAppUser(@PathVariable("id") Long id) throws Exception {
boolean flag = appUserService.deleteAppUser(id);
return ApiResult.result(flag);
}
/**
* 获取APP用户详情
*/
@GetMapping("/info/{id}")
@OperationLog(name = "APP用户详情", type = OperationLogType.INFO)
@ApiOperation(value = "APP用户详情", response = AppUserQueryVo.class)
public ApiResult<AppUserQueryVo> getAppUser(@PathVariable("id") Long id) throws Exception {
AppUserQueryVo appUserQueryVo = appUserService.getAppUserById(id);
return ApiResult.ok(appUserQueryVo);
}
/**
* APP用户分页列表
*/
@PostMapping("/getPageList")
@OperationLog(name = "APP用户分页列表", type = OperationLogType.PAGE)
@ApiOperation(value = "APP用户分页列表", response = AppUserQueryVo.class)
public ApiResult<Paging<AppUserQueryVo>> getAppUserPageList(@Validated @RequestBody AppUserPageParam appUserPageParam) throws Exception {
Paging<AppUserQueryVo> paging = appUserService.getAppUserPageList(appUserPageParam);
return ApiResult.ok(paging);
}
@PostMapping("/register")
@OperationLogIgnore
@ApiOperation(value = "注册", notes = "web用户注册", response = LoginSysUserTokenVo.class)
public ApiResult<LoginSysUserTokenVo> register(@Validated @RequestBody RegisterParam registerParam, HttpServletResponse response, @RequestHeader(required = false) String language) throws Exception {
return appUserService.register(registerParam, language);
}
@PostMapping("/phoneLogin")
@OperationLogIgnore
@ApiOperation(value = "手机号登陆", notes = "手机号登陆", response = LoginSysUserTokenVo.class)
public ApiResult<LoginSysUserTokenVo> phoneLogin(@Validated @RequestBody RegisterParam registerParam, HttpServletResponse response, @RequestHeader(required = false) String language) throws Exception {
return appUserService.register(registerParam, language);
}
}
/*
* Copyright 2019-2029 geekidea(https://github.com/geekidea)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.jumeirah.api.app.controller;
import com.jumeirah.common.param.RegisterParam;
import com.jumeirah.common.service.RegisterService;
import com.jumeirah.common.vo.LoginSysUserTokenVo;
import io.geekidea.springbootplus.framework.common.api.ApiResult;
import io.geekidea.springbootplus.framework.log.annotation.Module;
import io.geekidea.springbootplus.framework.log.annotation.OperationLogIgnore;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletResponse;
/**
* 注册控制器
*
* @author geekidea
* @date 2019-09-28
* @since 1.3.0.RELEASE
**/
@Slf4j
@RestController
@Module("system")
@Api(value = "用户注册API", tags = {"APP用户注册"})
@RequestMapping("/app")
public class RegisterController {
@Autowired
private RegisterService registerService;
@PostMapping("/register")
@OperationLogIgnore
@ApiOperation(value = "注册", notes = "web用户注册", response = LoginSysUserTokenVo.class)
public ApiResult<LoginSysUserTokenVo> register(@Validated @RequestBody RegisterParam registerParam, HttpServletResponse response, @RequestHeader(required = false) String language) throws Exception {
return registerService.register(registerParam, response,language);
}
}
package com.jumeirah.api.app.service; package com.jumeirah.api.app.service;
public interface RegisterService { public interface AppRegisterService {
void regiest(); void regiest();
} }
package com.jumeirah.api.app.service.impl; package com.jumeirah.api.app.service.impl;
import com.jumeirah.api.app.service.RegisterService; import com.jumeirah.api.app.service.AppRegisterService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@Service @Service
public class RegisterServiceImpl implements RegisterService { public class AppRegisterServiceImpl implements AppRegisterService {
@Override @Override
public void regiest() { public void regiest() {
......
...@@ -20,7 +20,7 @@ import java.io.IOException; ...@@ -20,7 +20,7 @@ import java.io.IOException;
@Api(value = "Hello World2", tags = {"商户Hello World2"}) @Api(value = "Hello World2", tags = {"商户Hello World2"})
@RestController @RestController
@RequestMapping("/merchant/") @RequestMapping("/merchant/")
public class AppHelloWorldController { public class MerchantHelloWorldController {
/** /**
* Hello World * Hello World
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
package com.jumeirah.api.merchant.controller; package com.jumeirah.api.merchant.controller;
import com.jumeirah.common.param.RegisterParam; import com.jumeirah.common.param.RegisterParam;
import com.jumeirah.common.service.RegisterService; import com.jumeirah.common.service.SysRegisterService;
import com.jumeirah.common.vo.LoginSysUserTokenVo; import com.jumeirah.common.vo.LoginSysUserTokenVo;
import io.geekidea.springbootplus.framework.common.api.ApiResult; import io.geekidea.springbootplus.framework.common.api.ApiResult;
import io.geekidea.springbootplus.framework.log.annotation.Module; import io.geekidea.springbootplus.framework.log.annotation.Module;
...@@ -47,10 +47,10 @@ import javax.servlet.http.HttpServletResponse; ...@@ -47,10 +47,10 @@ import javax.servlet.http.HttpServletResponse;
@Module("system") @Module("system")
@Api(value = "商户注册API", tags = {"商户注册"}) @Api(value = "商户注册API", tags = {"商户注册"})
@RequestMapping("/merchant/") @RequestMapping("/merchant/")
public class RegisterController { public class MerchantRegisterController {
@Autowired @Autowired
private RegisterService registerService; private SysRegisterService registerService;
@PostMapping("/register") @PostMapping("/register")
......
...@@ -18,7 +18,7 @@ package com.jumeirah.api.system.controller; ...@@ -18,7 +18,7 @@ package com.jumeirah.api.system.controller;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.jumeirah.common.param.LoginParam; import com.jumeirah.common.param.LoginParam;
import com.jumeirah.common.service.LoginService; import com.jumeirah.common.service.SysLoginService;
import com.jumeirah.common.service.SysUserService; import com.jumeirah.common.service.SysUserService;
import com.jumeirah.common.vo.LoginSysUserTokenVo; import com.jumeirah.common.vo.LoginSysUserTokenVo;
import com.jumeirah.common.vo.SysUserQueryVo; import com.jumeirah.common.vo.SysUserQueryVo;
...@@ -57,7 +57,7 @@ import javax.servlet.http.HttpServletResponse; ...@@ -57,7 +57,7 @@ import javax.servlet.http.HttpServletResponse;
public class LoginController { public class LoginController {
@Autowired @Autowired
private LoginService loginService; private SysLoginService loginService;
@Autowired @Autowired
private SysUserService sysUserService; private SysUserService sysUserService;
......
...@@ -37,7 +37,7 @@ import java.io.IOException; ...@@ -37,7 +37,7 @@ import java.io.IOException;
@Api(value = "Hello World", tags = {"Hello World"}) @Api(value = "Hello World", tags = {"Hello World"})
@RestController @RestController
@RequestMapping("/sys/hello") @RequestMapping("/sys/hello")
public class HelloWorldController { public class SysHelloWorldController {
/** /**
* Hello World * Hello World
......
package com.jumeirah.common.entity;
import io.geekidea.springbootplus.framework.common.entity.BaseEntity;
import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import io.geekidea.springbootplus.framework.core.validator.groups.Update;
/**
* APP用户
*
* @author wei
* @since 2020-09-23
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "AppUser对象")
public class AppUser extends BaseEntity {
private static final long serialVersionUID=1L;
@NotNull(message = "id不能为空", groups = {Update.class})
@ApiModelProperty("主键")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty("用户名")
private String username;
@ApiModelProperty("昵称")
private String nickname;
@NotBlank(message = "密码不能为空")
@ApiModelProperty("密码")
private String password;
@ApiModelProperty("盐值")
private String salt;
@ApiModelProperty("手机号码")
private String phone;
@ApiModelProperty("手机区号")
private String phoneArea;
@ApiModelProperty("性别,0:女,1:男,默认1")
private Integer gender;
@ApiModelProperty("头像")
private String head;
@ApiModelProperty("备注")
private String remark;
@ApiModelProperty("状态,0:禁用,1:启用,2:锁定")
private Integer state;
@ApiModelProperty("部门id")
private Long departmentId;
@ApiModelProperty("角色id")
private Long roleId;
@ApiModelProperty("逻辑删除,0:未删除,1:已删除")
@TableLogic
private Integer deleted;
@ApiModelProperty("版本")
@Version
private Integer version;
@ApiModelProperty("创建时间")
private Date createTime;
@ApiModelProperty("修改时间")
private Date updateTime;
}
package com.jumeirah.common.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jumeirah.common.entity.AppUser;
import com.jumeirah.common.param.AppUserPageParam;
import com.jumeirah.common.vo.AppUserQueryVo;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import java.io.Serializable;
/**
* APP用户 Mapper 接口
*
* @author wei
* @since 2020-09-23
*/
@Repository
public interface AppUserMapper extends BaseMapper<AppUser> {
/**
* 根据ID获取查询对象
*
* @param id
* @return
*/
AppUserQueryVo getAppUserById(Serializable id);
/**
* 获取分页对象
*
* @param page
* @param appUserPageParam
* @return
*/
IPage<AppUserQueryVo> getAppUserPageList(@Param("page") Page page,@Param("param") AppUserPageParam appUserPageParam);
}
package com.jumeirah.common.param;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import io.geekidea.springbootplus.framework.core.pagination.BasePageOrderParam;
/**
* <pre>
* APP用户 分页参数对象
* </pre>
*
* @author wei
* @date 2020-09-23
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "APP用户分页参数")
public class AppUserPageParam extends BasePageOrderParam{
private static final long serialVersionUID=1L;
}
package com.jumeirah.common.service;
import com.jumeirah.common.entity.AppUser;
import com.jumeirah.common.param.AppUserPageParam;
import com.jumeirah.common.param.RegisterParam;
import com.jumeirah.common.vo.AppUserQueryVo;
import com.jumeirah.common.vo.LoginSysUserTokenVo;
import io.geekidea.springbootplus.framework.common.api.ApiResult;
import io.geekidea.springbootplus.framework.common.service.BaseService;
import io.geekidea.springbootplus.framework.core.pagination.Paging;
/**
* APP用户 服务类
*
* @author wei
* @since 2020-09-23
*/
public interface AppUserService extends BaseService<AppUser> {
ApiResult<LoginSysUserTokenVo> register(RegisterParam registerParam, String language);
ApiResult<LoginSysUserTokenVo> phoneLogin(RegisterParam registerParam, String language);
/**
* 保存
*
* @param appUser
* @return
* @throws Exception
*/
boolean saveAppUser(AppUser appUser)throws Exception;
/**
* 修改
*
* @param appUser
* @return
* @throws Exception
*/
boolean updateAppUser(AppUser appUser)throws Exception;
/**
* 删除
*
* @param id
* @return
* @throws Exception
*/
boolean deleteAppUser(Long id)throws Exception;
/**
* 根据ID获取查询对象
*
* @param id
* @return
* @throws Exception
*/
AppUserQueryVo getAppUserById(Long id)throws Exception;
/**
* 获取分页对象
*
* @param appUserPageParam
* @return
* @throws Exception
*/
Paging<AppUserQueryVo> getAppUserPageList(AppUserPageParam appUserPageParam) throws Exception;
}
...@@ -32,7 +32,7 @@ import javax.servlet.http.HttpServletResponse; ...@@ -32,7 +32,7 @@ import javax.servlet.http.HttpServletResponse;
* @author geekidea * @author geekidea
* @date 2019-05-23 * @date 2019-05-23
**/ **/
public interface LoginService { public interface SysLoginService {
/** /**
* 登录 * 登录
......
...@@ -30,7 +30,7 @@ import javax.servlet.http.HttpServletResponse; ...@@ -30,7 +30,7 @@ import javax.servlet.http.HttpServletResponse;
* @author geekidea * @author geekidea
* @date 2019-05-23 * @date 2019-05-23
**/ **/
public interface RegisterService { public interface SysRegisterService {
/** /**
* 注册 * 注册
......
package com.jumeirah.common.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jumeirah.common.entity.AppUser;
import com.jumeirah.common.mapper.AppUserMapper;
import com.jumeirah.common.param.AppUserPageParam;
import com.jumeirah.common.param.RegisterParam;
import com.jumeirah.common.service.AppUserService;
import com.jumeirah.common.vo.AppUserQueryVo;
import com.jumeirah.common.vo.LoginSysUserTokenVo;
import io.geekidea.springbootplus.framework.common.api.ApiResult;
import io.geekidea.springbootplus.framework.common.service.impl.BaseServiceImpl;
import io.geekidea.springbootplus.framework.core.pagination.PageInfo;
import io.geekidea.springbootplus.framework.core.pagination.Paging;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* APP用户 服务实现类
*
* @author wei
* @since 2020-09-23
*/
@Slf4j
@Service
public class AppUserServiceImpl extends BaseServiceImpl<AppUserMapper, AppUser> implements AppUserService {
@Autowired
private AppUserMapper appUserMapper;
@Override
public ApiResult<LoginSysUserTokenVo> register(RegisterParam registerParam, String language) {
return null;
}
@Override
public ApiResult<LoginSysUserTokenVo> phoneLogin(RegisterParam registerParam, String language) {
return null;
}
@Transactional(rollbackFor = Exception.class)
@Override
public boolean saveAppUser(AppUser appUser) throws Exception {
return super.save(appUser);
}
@Transactional(rollbackFor = Exception.class)
@Override
public boolean updateAppUser(AppUser appUser) throws Exception {
return super.updateById(appUser);
}
@Transactional(rollbackFor = Exception.class)
@Override
public boolean deleteAppUser(Long id) throws Exception {
return super.removeById(id);
}
@Override
public AppUserQueryVo getAppUserById(Long id) throws Exception {
return appUserMapper.getAppUserById(id);
}
@Override
public Paging<AppUserQueryVo> getAppUserPageList(AppUserPageParam appUserPageParam) throws Exception {
Page<AppUserQueryVo> page = new PageInfo<>(appUserPageParam, OrderItem.desc(getLambdaColumn(AppUser::getCreateTime)));
IPage<AppUserQueryVo> iPage = appUserMapper.getAppUserPageList(page, appUserPageParam);
return new Paging<AppUserQueryVo>(iPage);
}
}
...@@ -38,7 +38,7 @@ import io.geekidea.springbootplus.framework.shiro.util.SaltUtil; ...@@ -38,7 +38,7 @@ import io.geekidea.springbootplus.framework.shiro.util.SaltUtil;
import io.geekidea.springbootplus.framework.shiro.vo.LoginSysUserVo; import io.geekidea.springbootplus.framework.shiro.vo.LoginSysUserVo;
import io.geekidea.springbootplus.framework.util.PasswordUtil; import io.geekidea.springbootplus.framework.util.PasswordUtil;
import com.jumeirah.common.exception.VerificationCodeException; import com.jumeirah.common.exception.VerificationCodeException;
import com.jumeirah.common.service.LoginService; import com.jumeirah.common.service.SysLoginService;
import com.jumeirah.common.service.SysDepartmentService; import com.jumeirah.common.service.SysDepartmentService;
import com.jumeirah.common.service.SysRolePermissionService; import com.jumeirah.common.service.SysRolePermissionService;
import com.jumeirah.common.service.SysRoleService; import com.jumeirah.common.service.SysRoleService;
...@@ -74,7 +74,7 @@ import static io.geekidea.springbootplus.framework.common.api.ApiResult.fail; ...@@ -74,7 +74,7 @@ import static io.geekidea.springbootplus.framework.common.api.ApiResult.fail;
@Api @Api
@Slf4j @Slf4j
@Service @Service
public class LoginServiceImpl implements LoginService { public class SysLoginServiceImpl implements SysLoginService {
@Lazy @Lazy
@Autowired @Autowired
......
...@@ -4,10 +4,10 @@ import cn.hutool.core.util.RandomUtil; ...@@ -4,10 +4,10 @@ import cn.hutool.core.util.RandomUtil;
import com.jumeirah.common.entity.SysUser; import com.jumeirah.common.entity.SysUser;
import com.jumeirah.common.param.LoginParam; import com.jumeirah.common.param.LoginParam;
import com.jumeirah.common.param.RegisterParam; import com.jumeirah.common.param.RegisterParam;
import com.jumeirah.common.service.RegisterService; import com.jumeirah.common.service.SysRegisterService;
import com.jumeirah.common.vo.LoginSysUserTokenVo; import com.jumeirah.common.vo.LoginSysUserTokenVo;
import io.geekidea.springbootplus.framework.common.api.ApiResult; import io.geekidea.springbootplus.framework.common.api.ApiResult;
import com.jumeirah.common.service.LoginService; import com.jumeirah.common.service.SysLoginService;
import com.jumeirah.common.service.SysUserService; import com.jumeirah.common.service.SysUserService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -19,10 +19,10 @@ import javax.servlet.http.HttpServletResponse; ...@@ -19,10 +19,10 @@ import javax.servlet.http.HttpServletResponse;
@Api @Api
@Slf4j @Slf4j
@Service @Service
public class RegisterServiceImpl implements RegisterService { public class SysRegisterServiceImpl implements SysRegisterService {
@Autowired @Autowired
private LoginService loginService; private SysLoginService loginService;
@Autowired @Autowired
private SysUserService sysUserService; private SysUserService sysUserService;
......
package com.jumeirah.common.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
* <pre>
* APP用户 查询结果对象
* </pre>
*
* @author wei
* @date 2020-09-23
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "AppUserQueryVo对象")
public class AppUserQueryVo implements Serializable{
private static final long serialVersionUID=1L;
@ApiModelProperty("主键")
private Long id;
@ApiModelProperty("用户名")
private String username;
@ApiModelProperty("昵称")
private String nickname;
@ApiModelProperty("密码")
private String password;
@ApiModelProperty("盐值")
private String salt;
@ApiModelProperty("手机号码")
private String phone;
@ApiModelProperty("手机区号")
private String phoneArea;
@ApiModelProperty("性别,0:女,1:男,默认1")
private Integer gender;
@ApiModelProperty("头像")
private String head;
@ApiModelProperty("备注")
private String remark;
@ApiModelProperty("状态,0:禁用,1:启用,2:锁定")
private Integer state;
@ApiModelProperty("部门id")
private Long departmentId;
@ApiModelProperty("角色id")
private Long roleId;
@ApiModelProperty("逻辑删除,0:未删除,1:已删除")
private Integer deleted;
@ApiModelProperty("版本")
private Integer version;
@ApiModelProperty("创建时间")
private Date createTime;
@ApiModelProperty("修改时间")
private Date updateTime;
}
\ No newline at end of file
<?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.jumeirah.common.mapper.AppUserMapper">
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, username, nickname, password, salt, phone, phone_area, gender, head, remark, state, department_id, role_id, deleted, version, create_time, update_time
</sql>
<select id="getAppUserById" resultType="com.jumeirah.common.vo.AppUserQueryVo">
select
<include refid="Base_Column_List"/>
from app_user where id = #{id}
</select>
<select id="getAppUserPageList" parameterType="com.jumeirah.common.param.AppUserPageParam" resultType="com.jumeirah.common.vo.AppUserQueryVo">
select
<include refid="Base_Column_List"/>
from app_user
</select>
</mapper>
...@@ -183,7 +183,7 @@ spring-boot-plus: ...@@ -183,7 +183,7 @@ spring-boot-plus:
# 权限配置 # 权限配置
anon: anon:
# 排除登录 注册 登出 # 排除登录 注册 登出
- /login,/logout,/register - /app/user/register,/app/user/phoneLogin,/sys/login,/sys/logout,/sys/register
# 排除静态资源 # 排除静态资源
- /static/**,/templates/** - /static/**,/templates/**
# 排除Swagger # 排除Swagger
...@@ -192,6 +192,7 @@ spring-boot-plus: ...@@ -192,6 +192,7 @@ spring-boot-plus:
# - /actuator/** # - /actuator/**
- # 排除首页 - # 排除首页
- /,/index.html - /,/index.html
- /app/noRole
# 多行字符串权限配置 # 多行字符串权限配置
filter-chain-definitions: | filter-chain-definitions: |
...@@ -199,8 +200,7 @@ spring-boot-plus: ...@@ -199,8 +200,7 @@ spring-boot-plus:
/upload/**=anon /upload/**=anon
/verificationCode/**=anon /verificationCode/**=anon
/enum=anon /enum=anon
# 配置/app/**路径下登陆的用户就能访问 # /app/**=authc
/app/**=authc
######################## Spring Shiro end ########################## ######################## Spring Shiro end ##########################
......
...@@ -14,9 +14,10 @@ ...@@ -14,9 +14,10 @@
* limitations under the License. * limitations under the License.
*/ */
package io.geekidea.springbootplus.framework.shiro.jwt; package io.geekidea.springbootplus.framework.shiro.jwt.realm;
import io.geekidea.springbootplus.framework.shiro.cache.LoginRedisService; import io.geekidea.springbootplus.framework.shiro.cache.LoginRedisService;
import io.geekidea.springbootplus.framework.shiro.jwt.JwtToken;
import io.geekidea.springbootplus.framework.shiro.vo.LoginSysUserRedisVo; import io.geekidea.springbootplus.framework.shiro.vo.LoginSysUserRedisVo;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.SetUtils; import org.apache.commons.collections4.SetUtils;
......
...@@ -44,14 +44,14 @@ public class SpringBootPlusGenerator { ...@@ -44,14 +44,14 @@ public class SpringBootPlusGenerator {
// 设置基本信息 // 设置基本信息
generatorProperties generatorProperties
.setMavenModuleName("server") .setMavenModuleName("common")
.setParentPackage("io.geekidea.springbootplus") .setParentPackage("com.jumeirah.common")
.setModuleName("webapi") // .setModuleName("api-app")
.setAuthor("wei") .setAuthor("wei")
.setFileOverride(true); .setFileOverride(true);
// 设置表信息 // 设置表信息
generatorProperties.addTable("vk_task_type", "id"); generatorProperties.addTable("app_user", "id");
// 设置表前缀 // 设置表前缀
// generatorProperties.setTablePrefix(Arrays.asList("tb_")); // generatorProperties.setTablePrefix(Arrays.asList("tb_"));
...@@ -59,9 +59,9 @@ public class SpringBootPlusGenerator { ...@@ -59,9 +59,9 @@ public class SpringBootPlusGenerator {
generatorProperties.getDataSourceConfig() generatorProperties.getDataSourceConfig()
.setDbType(DbType.MYSQL) .setDbType(DbType.MYSQL)
.setUsername("root") .setUsername("root")
.setPassword("123") .setPassword("temple123456")
.setDriverName("com.mysql.jdbc.Driver") .setDriverName("com.mysql.jdbc.Driver")
.setUrl("jdbc:mysql://localhost:3306/vike?useUnicode=true&characterEncoding=UTF-8&useSSL=false"); .setUrl("jdbc:mysql://47.99.47.225:3306/Jumeirah?useUnicode=true&characterEncoding=UTF-8&useSSL=false");
// 生成配置 // 生成配置
generatorProperties.getGeneratorConfig() generatorProperties.getGeneratorConfig()
......
...@@ -15,10 +15,10 @@ ...@@ -15,10 +15,10 @@
<description>任务调度JOB模块</description> <description>任务调度JOB模块</description>
<dependencies> <dependencies>
<dependency> <!-- <dependency>-->
<groupId>io.geekidea.springbootplus</groupId> <!-- <groupId>io.geekidea.springbootplus</groupId>-->
<artifactId>example</artifactId> <!-- <artifactId>example</artifactId>-->
</dependency> <!-- </dependency>-->
</dependencies> </dependencies>
</project> </project>
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