Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
SiEn
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hewei
SiEn
Commits
82c0b977
Commit
82c0b977
authored
Oct 19, 2020
by
lpx
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://119.28.51.83/hewei/Jumeirah
into dev/lanpingxiong
parents
6b65b870
f96a5897
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
902 additions
and
424 deletions
+902
-424
api-merchant/src/main/java/com/jumeirah/api/merchant/controller/MerchantPermissionController.java
+99
-99
api-merchant/src/main/java/com/jumeirah/api/merchant/controller/MerchantRoleController.java
+99
-99
api-merchant/src/main/java/com/jumeirah/api/merchant/controller/MerchantRolePermissionController.java
+99
-99
api-merchant/src/main/java/com/jumeirah/api/merchant/controller/MerchantSmsController.java
+45
-45
api-merchant/src/main/java/com/jumeirah/api/merchant/controller/MerchantUserPermissionController.java
+97
-0
common/src/main/java/com/jumeirah/common/entity/CharterIntroduction.java
+3
-0
common/src/main/java/com/jumeirah/common/entity/MerchantUserPermission.java
+62
-0
common/src/main/java/com/jumeirah/common/entity/Stroke.java
+0
-4
common/src/main/java/com/jumeirah/common/mapper/MerchantUserPermissionMapper.java
+49
-0
common/src/main/java/com/jumeirah/common/param/MerchantUserPermissionPageParam.java
+23
-0
common/src/main/java/com/jumeirah/common/param/MerchantUserPermissionQueryVo.java
+52
-0
common/src/main/java/com/jumeirah/common/service/MerchantUserPermissionService.java
+73
-0
common/src/main/java/com/jumeirah/common/service/MerchantUserService.java
+1
-2
common/src/main/java/com/jumeirah/common/service/impl/MerchantUserPermissionServiceImpl.java
+69
-0
common/src/main/java/com/jumeirah/common/service/impl/MerchantUserServiceImpl.java
+86
-70
common/src/main/java/com/jumeirah/common/vo/CharterIntroductionQueryForAppVo.java
+3
-0
common/src/main/resources/mapper/CharterIntroductionMapper.xml
+1
-1
common/src/main/resources/mapper/MerchantUserPermissionMapper.xml
+36
-0
framework/src/main/java/io/geekidea/springbootplus/framework/shiro/cache/MerchantLoginRedisService.java
+1
-1
framework/src/main/java/io/geekidea/springbootplus/framework/shiro/cache/impl/MerchantLoginRedisServiceImpl.java
+3
-3
framework/src/main/java/io/geekidea/springbootplus/framework/shiro/jwt/realm/JwtRealmMerchant.java
+1
-1
No files found.
api-merchant/src/main/java/com/jumeirah/api/merchant/controller/MerchantPermissionController.java
View file @
82c0b977
package
com
.
jumeirah
.
api
.
merchant
.
controller
;
import
com.jumeirah.common.entity.MerchantPermission
;
import
com.jumeirah.common.param.MerchantPermissionPageParam
;
import
com.jumeirah.common.service.MerchantPermissionService
;
import
com.jumeirah.common.vo.MerchantPermissionQueryVo
;
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.Module
;
import
io.geekidea.springbootplus.framework.log.annotation.OperationLog
;
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.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* 商家权限 控制器
*
* @author wei
* @since 2020-09-27
*/
@Slf4j
@RestController
@RequestMapping
(
"/merchant/permission"
)
@Module
(
"${cfg.module}"
)
@Api
(
value
=
"商家权限API"
,
tags
=
{
"商家权限"
})
public
class
MerchantPermissionController
extends
BaseController
{
@Autowired
private
MerchantPermissionService
merchantPermissionService
;
/**
* 添加商家权限
*/
@PostMapping
(
"/add"
)
@OperationLog
(
name
=
"添加商家权限"
,
type
=
OperationLogType
.
ADD
)
@ApiOperation
(
value
=
"添加商家权限"
,
response
=
ApiResult
.
class
)
public
ApiResult
<
Boolean
>
addMerchantPermission
(
@Validated
(
Add
.
class
)
@RequestBody
MerchantPermission
merchantPermission
)
throws
Exception
{
boolean
flag
=
merchantPermissionService
.
saveMerchantPermission
(
merchantPermission
);
return
ApiResult
.
result
(
flag
);
}
/**
* 修改商家权限
*/
@PostMapping
(
"/update"
)
@OperationLog
(
name
=
"修改商家权限"
,
type
=
OperationLogType
.
UPDATE
)
@ApiOperation
(
value
=
"修改商家权限"
,
response
=
ApiResult
.
class
)
public
ApiResult
<
Boolean
>
updateMerchantPermission
(
@Validated
(
Update
.
class
)
@RequestBody
MerchantPermission
merchantPermission
)
throws
Exception
{
boolean
flag
=
merchantPermissionService
.
updateMerchantPermission
(
merchantPermission
);
return
ApiResult
.
result
(
flag
);
}
/**
* 删除商家权限
*/
@PostMapping
(
"/delete/{id}"
)
@OperationLog
(
name
=
"删除商家权限"
,
type
=
OperationLogType
.
DELETE
)
@ApiOperation
(
value
=
"删除商家权限"
,
response
=
ApiResult
.
class
)
public
ApiResult
<
Boolean
>
deleteMerchantPermission
(
@PathVariable
(
"id"
)
Long
id
)
throws
Exception
{
boolean
flag
=
merchantPermissionService
.
deleteMerchantPermission
(
id
);
return
ApiResult
.
result
(
flag
);
}
/**
* 获取商家权限详情
*/
@GetMapping
(
"/info/{id}"
)
@OperationLog
(
name
=
"商家权限详情"
,
type
=
OperationLogType
.
INFO
)
@ApiOperation
(
value
=
"商家权限详情"
,
response
=
MerchantPermissionQueryVo
.
class
)
public
ApiResult
<
MerchantPermissionQueryVo
>
getMerchantPermission
(
@PathVariable
(
"id"
)
Long
id
)
throws
Exception
{
MerchantPermissionQueryVo
merchantPermissionQueryVo
=
merchantPermissionService
.
getMerchantPermissionById
(
id
);
return
ApiResult
.
ok
(
merchantPermissionQueryVo
);
}
/**
* 商家权限分页列表
*/
@PostMapping
(
"/getPageList"
)
@OperationLog
(
name
=
"商家权限分页列表"
,
type
=
OperationLogType
.
PAGE
)
@ApiOperation
(
value
=
"商家权限分页列表"
,
response
=
MerchantPermissionQueryVo
.
class
)
public
ApiResult
<
Paging
<
MerchantPermissionQueryVo
>>
getMerchantPermissionPageList
(
@Validated
@RequestBody
MerchantPermissionPageParam
merchantPermissionPageParam
)
throws
Exception
{
Paging
<
MerchantPermissionQueryVo
>
paging
=
merchantPermissionService
.
getMerchantPermissionPageList
(
merchantPermissionPageParam
);
return
ApiResult
.
ok
(
paging
);
}
}
//
package com.jumeirah.api.merchant.controller;
//
//
import com.jumeirah.common.entity.MerchantPermission;
//
import com.jumeirah.common.param.MerchantPermissionPageParam;
//
import com.jumeirah.common.service.MerchantPermissionService;
//
import com.jumeirah.common.vo.MerchantPermissionQueryVo;
//
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.Module;
//
import io.geekidea.springbootplus.framework.log.annotation.OperationLog;
//
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.RequestMapping;
//
import org.springframework.web.bind.annotation.RestController;
//
/
//
**
//
* 商家权限 控制器
//
*
//
* @author wei
//
* @since 2020-09-27
//
*/
//
@Slf4j
//
@RestController
//
@RequestMapping("/merchant/permission")
//
@Module("${cfg.module}")
//
@Api(value = "商家权限API", tags = {"商家权限"})
//
public class MerchantPermissionController extends BaseController {
//
//
@Autowired
//
private MerchantPermissionService merchantPermissionService;
//
//
/**
//
* 添加商家权限
//
*/
//
@PostMapping("/add")
//
@OperationLog(name = "添加商家权限", type = OperationLogType.ADD)
//
@ApiOperation(value = "添加商家权限", response = ApiResult.class)
//
public ApiResult<Boolean> addMerchantPermission(@Validated(Add.class) @RequestBody MerchantPermission merchantPermission) throws Exception {
//
boolean flag = merchantPermissionService.saveMerchantPermission(merchantPermission);
//
return ApiResult.result(flag);
//
}
//
//
/**
//
* 修改商家权限
//
*/
//
@PostMapping("/update")
//
@OperationLog(name = "修改商家权限", type = OperationLogType.UPDATE)
//
@ApiOperation(value = "修改商家权限", response = ApiResult.class)
//
public ApiResult<Boolean> updateMerchantPermission(@Validated(Update.class) @RequestBody MerchantPermission merchantPermission) throws Exception {
//
boolean flag = merchantPermissionService.updateMerchantPermission(merchantPermission);
//
return ApiResult.result(flag);
//
}
//
//
/**
//
* 删除商家权限
//
*/
//
@PostMapping("/delete/{id}")
//
@OperationLog(name = "删除商家权限", type = OperationLogType.DELETE)
//
@ApiOperation(value = "删除商家权限", response = ApiResult.class)
//
public ApiResult<Boolean> deleteMerchantPermission(@PathVariable("id") Long id) throws Exception {
//
boolean flag = merchantPermissionService.deleteMerchantPermission(id);
//
return ApiResult.result(flag);
//
}
//
//
/**
//
* 获取商家权限详情
//
*/
//
@GetMapping("/info/{id}")
//
@OperationLog(name = "商家权限详情", type = OperationLogType.INFO)
//
@ApiOperation(value = "商家权限详情", response = MerchantPermissionQueryVo.class)
//
public ApiResult<MerchantPermissionQueryVo> getMerchantPermission(@PathVariable("id") Long id) throws Exception {
//
MerchantPermissionQueryVo merchantPermissionQueryVo = merchantPermissionService.getMerchantPermissionById(id);
//
return ApiResult.ok(merchantPermissionQueryVo);
//
}
//
//
/**
//
* 商家权限分页列表
//
*/
//
@PostMapping("/getPageList")
//
@OperationLog(name = "商家权限分页列表", type = OperationLogType.PAGE)
//
@ApiOperation(value = "商家权限分页列表", response = MerchantPermissionQueryVo.class)
//
public ApiResult<Paging<MerchantPermissionQueryVo>> getMerchantPermissionPageList(@Validated @RequestBody MerchantPermissionPageParam merchantPermissionPageParam) throws Exception {
//
Paging<MerchantPermissionQueryVo> paging = merchantPermissionService.getMerchantPermissionPageList(merchantPermissionPageParam);
//
return ApiResult.ok(paging);
//
}
//
//
}
//
api-merchant/src/main/java/com/jumeirah/api/merchant/controller/MerchantRoleController.java
View file @
82c0b977
package
com
.
jumeirah
.
api
.
merchant
.
controller
;
import
com.jumeirah.common.entity.MerchantRole
;
import
com.jumeirah.common.param.MerchantRolePageParam
;
import
com.jumeirah.common.service.MerchantRoleService
;
import
com.jumeirah.common.vo.MerchantRoleQueryVo
;
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.Module
;
import
io.geekidea.springbootplus.framework.log.annotation.OperationLog
;
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.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* 商家角色 控制器
*
* @author wei
* @since 2020-09-27
*/
@Slf4j
@RestController
@RequestMapping
(
"/merchant/role"
)
@Module
(
"${cfg.module}"
)
@Api
(
value
=
"商家角色API"
,
tags
=
{
"商家角色"
})
public
class
MerchantRoleController
extends
BaseController
{
@Autowired
private
MerchantRoleService
merchantRoleService
;
/**
* 添加商家角色
*/
@PostMapping
(
"/add"
)
@OperationLog
(
name
=
"添加商家角色"
,
type
=
OperationLogType
.
ADD
)
@ApiOperation
(
value
=
"添加商家角色"
,
response
=
ApiResult
.
class
)
public
ApiResult
<
Boolean
>
addMerchantRole
(
@Validated
(
Add
.
class
)
@RequestBody
MerchantRole
merchantRole
)
throws
Exception
{
boolean
flag
=
merchantRoleService
.
saveMerchantRole
(
merchantRole
);
return
ApiResult
.
result
(
flag
);
}
/**
* 修改商家角色
*/
@PostMapping
(
"/update"
)
@OperationLog
(
name
=
"修改商家角色"
,
type
=
OperationLogType
.
UPDATE
)
@ApiOperation
(
value
=
"修改商家角色"
,
response
=
ApiResult
.
class
)
public
ApiResult
<
Boolean
>
updateMerchantRole
(
@Validated
(
Update
.
class
)
@RequestBody
MerchantRole
merchantRole
)
throws
Exception
{
boolean
flag
=
merchantRoleService
.
updateMerchantRole
(
merchantRole
);
return
ApiResult
.
result
(
flag
);
}
/**
* 删除商家角色
*/
@PostMapping
(
"/delete/{id}"
)
@OperationLog
(
name
=
"删除商家角色"
,
type
=
OperationLogType
.
DELETE
)
@ApiOperation
(
value
=
"删除商家角色"
,
response
=
ApiResult
.
class
)
public
ApiResult
<
Boolean
>
deleteMerchantRole
(
@PathVariable
(
"id"
)
Long
id
)
throws
Exception
{
boolean
flag
=
merchantRoleService
.
deleteMerchantRole
(
id
);
return
ApiResult
.
result
(
flag
);
}
/**
* 获取商家角色详情
*/
@GetMapping
(
"/info/{id}"
)
@OperationLog
(
name
=
"商家角色详情"
,
type
=
OperationLogType
.
INFO
)
@ApiOperation
(
value
=
"商家角色详情"
,
response
=
MerchantRoleQueryVo
.
class
)
public
ApiResult
<
MerchantRoleQueryVo
>
getMerchantRole
(
@PathVariable
(
"id"
)
Long
id
)
throws
Exception
{
MerchantRoleQueryVo
merchantRoleQueryVo
=
merchantRoleService
.
getMerchantRoleById
(
id
);
return
ApiResult
.
ok
(
merchantRoleQueryVo
);
}
/**
* 商家角色分页列表
*/
@PostMapping
(
"/getPageList"
)
@OperationLog
(
name
=
"商家角色分页列表"
,
type
=
OperationLogType
.
PAGE
)
@ApiOperation
(
value
=
"商家角色分页列表"
,
response
=
MerchantRoleQueryVo
.
class
)
public
ApiResult
<
Paging
<
MerchantRoleQueryVo
>>
getMerchantRolePageList
(
@Validated
@RequestBody
MerchantRolePageParam
merchantRolePageParam
)
throws
Exception
{
Paging
<
MerchantRoleQueryVo
>
paging
=
merchantRoleService
.
getMerchantRolePageList
(
merchantRolePageParam
);
return
ApiResult
.
ok
(
paging
);
}
}
//
package com.jumeirah.api.merchant.controller;
//
//
import com.jumeirah.common.entity.MerchantRole;
//
import com.jumeirah.common.param.MerchantRolePageParam;
//
import com.jumeirah.common.service.MerchantRoleService;
//
import com.jumeirah.common.vo.MerchantRoleQueryVo;
//
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.Module;
//
import io.geekidea.springbootplus.framework.log.annotation.OperationLog;
//
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.RequestMapping;
//
import org.springframework.web.bind.annotation.RestController;
//
/
//
**
//
* 商家角色 控制器
//
*
//
* @author wei
//
* @since 2020-09-27
//
*/
//
@Slf4j
//
@RestController
//
@RequestMapping("/merchant/role")
//
@Module("${cfg.module}")
//
@Api(value = "商家角色API", tags = {"商家角色"})
//
public class MerchantRoleController extends BaseController {
//
//
@Autowired
//
private MerchantRoleService merchantRoleService;
//
//
/**
//
* 添加商家角色
//
*/
//
@PostMapping("/add")
//
@OperationLog(name = "添加商家角色", type = OperationLogType.ADD)
//
@ApiOperation(value = "添加商家角色", response = ApiResult.class)
//
public ApiResult<Boolean> addMerchantRole(@Validated(Add.class) @RequestBody MerchantRole merchantRole) throws Exception {
//
boolean flag = merchantRoleService.saveMerchantRole(merchantRole);
//
return ApiResult.result(flag);
//
}
//
//
/**
//
* 修改商家角色
//
*/
//
@PostMapping("/update")
//
@OperationLog(name = "修改商家角色", type = OperationLogType.UPDATE)
//
@ApiOperation(value = "修改商家角色", response = ApiResult.class)
//
public ApiResult<Boolean> updateMerchantRole(@Validated(Update.class) @RequestBody MerchantRole merchantRole) throws Exception {
//
boolean flag = merchantRoleService.updateMerchantRole(merchantRole);
//
return ApiResult.result(flag);
//
}
//
//
/**
//
* 删除商家角色
//
*/
//
@PostMapping("/delete/{id}")
//
@OperationLog(name = "删除商家角色", type = OperationLogType.DELETE)
//
@ApiOperation(value = "删除商家角色", response = ApiResult.class)
//
public ApiResult<Boolean> deleteMerchantRole(@PathVariable("id") Long id) throws Exception {
//
boolean flag = merchantRoleService.deleteMerchantRole(id);
//
return ApiResult.result(flag);
//
}
//
//
/**
//
* 获取商家角色详情
//
*/
//
@GetMapping("/info/{id}")
//
@OperationLog(name = "商家角色详情", type = OperationLogType.INFO)
//
@ApiOperation(value = "商家角色详情", response = MerchantRoleQueryVo.class)
//
public ApiResult<MerchantRoleQueryVo> getMerchantRole(@PathVariable("id") Long id) throws Exception {
//
MerchantRoleQueryVo merchantRoleQueryVo = merchantRoleService.getMerchantRoleById(id);
//
return ApiResult.ok(merchantRoleQueryVo);
//
}
//
//
/**
//
* 商家角色分页列表
//
*/
//
@PostMapping("/getPageList")
//
@OperationLog(name = "商家角色分页列表", type = OperationLogType.PAGE)
//
@ApiOperation(value = "商家角色分页列表", response = MerchantRoleQueryVo.class)
//
public ApiResult<Paging<MerchantRoleQueryVo>> getMerchantRolePageList(@Validated @RequestBody MerchantRolePageParam merchantRolePageParam) throws Exception {
//
Paging<MerchantRoleQueryVo> paging = merchantRoleService.getMerchantRolePageList(merchantRolePageParam);
//
return ApiResult.ok(paging);
//
}
//
//
}
//
api-merchant/src/main/java/com/jumeirah/api/merchant/controller/MerchantRolePermissionController.java
View file @
82c0b977
This diff is collapsed.
Click to expand it.
api-merchant/src/main/java/com/jumeirah/api/merchant/controller/MerchantSmsController.java
View file @
82c0b977
package
com
.
jumeirah
.
api
.
merchant
.
controller
;
import
com.jumeirah.common.service.impl.MerchantSmsService
;
import
io.geekidea.springbootplus.framework.common.api.ApiResult
;
import
io.geekidea.springbootplus.framework.common.controller.BaseController
;
import
io.geekidea.springbootplus.framework.log.annotation.OperationLog
;
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.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* APP用户 控制器
*
* @author wei
* @since 2020-09-23
*/
@Slf4j
@RestController
//@Module("api-app")
@Api
(
value
=
"短信验证码"
,
tags
=
{
"APP短信验证码相关"
},
hidden
=
true
)
@RequestMapping
(
"/merchant/sms/"
)
public
class
MerchantSmsController
extends
BaseController
{
@Autowired
private
MerchantSmsService
merchantSmsService
;
/**
* 获取注册验证码
*/
@GetMapping
(
"/registerCode"
)
@OperationLog
(
name
=
"获取注册或登陆的验证码"
,
type
=
OperationLogType
.
INFO
)
@ApiOperation
(
value
=
"获取注册或登陆的验证码"
,
response
=
Object
.
class
,
notes
=
"本地环境默认666666"
)
public
ApiResult
<
Object
>
registerOrLoginCode
(
@RequestParam
String
phoneArea
,
@RequestParam
String
phone
)
throws
Exception
{
return
merchantSmsService
.
registerCode
(
phoneArea
,
phone
);
}
}
//
package com.jumeirah.api.merchant.controller;
//
//
import com.jumeirah.common.service.impl.MerchantSmsService;
//
import io.geekidea.springbootplus.framework.common.api.ApiResult;
//
import io.geekidea.springbootplus.framework.common.controller.BaseController;
//
import io.geekidea.springbootplus.framework.log.annotation.OperationLog;
//
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.web.bind.annotation.GetMapping;
//
import org.springframework.web.bind.annotation.RequestMapping;
//
import org.springframework.web.bind.annotation.RequestParam;
//
import org.springframework.web.bind.annotation.RestController;
//
/
//
**
//
* APP用户 控制器
//
*
//
* @author wei
//
* @since 2020-09-23
//
*/
//
@Slf4j
//
@RestController
//
//
@Module("api-app")
//
@Api(value = "短信验证码", tags = {"APP短信验证码相关"},hidden = true)
//
@RequestMapping("/merchant/sms/")
//
public class MerchantSmsController extends BaseController {
//
//
@Autowired
//
private MerchantSmsService merchantSmsService;
//
//
/**
//
* 获取注册验证码
//
*/
//
@GetMapping("/registerCode")
//
@OperationLog(name = "获取注册或登陆的验证码", type = OperationLogType.INFO)
//
@ApiOperation(value = "获取注册或登陆的验证码", response = Object.class, notes = "本地环境默认666666")
//
public ApiResult<Object> registerOrLoginCode(@RequestParam String phoneArea, @RequestParam String phone) throws Exception {
//
//
return merchantSmsService.registerCode(phoneArea, phone);
//
}
//
//
}
//
api-merchant/src/main/java/com/jumeirah/api/merchant/controller/MerchantUserPermissionController.java
0 → 100644
View file @
82c0b977
package
com
.
jumeirah
.
api
.
merchant
.
controller
;
import
com.jumeirah.common.entity.MerchantUserPermission
;
import
com.jumeirah.common.param.MerchantUserPermissionPageParam
;
import
com.jumeirah.common.param.MerchantUserPermissionQueryVo
;
import
com.jumeirah.common.service.MerchantUserPermissionService
;
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.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.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* 商家用户权限关系 控制器
*
* @author giao
* @since 2020-10-19
*/
@Slf4j
@RestController
@RequestMapping
(
"/merchant/merchantUserPermission"
)
@Api
(
value
=
"商家用户权限关系API"
,
tags
=
{
"商家用户权限关系"
})
public
class
MerchantUserPermissionController
extends
BaseController
{
@Autowired
private
MerchantUserPermissionService
merchantUserPermissionService
;
/**
* 添加商家用户权限关系
*/
@PostMapping
(
"/add"
)
@OperationLog
(
name
=
"添加商家用户权限关系"
,
type
=
OperationLogType
.
ADD
)
@ApiOperation
(
value
=
"添加商家用户权限关系"
)
public
ApiResult
<
Boolean
>
addMerchantUserPermission
(
@Validated
(
Add
.
class
)
@RequestBody
MerchantUserPermission
merchantUserPermission
)
throws
Exception
{
boolean
flag
=
merchantUserPermissionService
.
saveMerchantUserPermission
(
merchantUserPermission
);
return
ApiResult
.
result
(
flag
);
}
/**
* 修改商家用户权限关系
*/
@PostMapping
(
"/update"
)
@OperationLog
(
name
=
"修改商家用户权限关系"
,
type
=
OperationLogType
.
UPDATE
)
@ApiOperation
(
value
=
"修改商家用户权限关系"
)
public
ApiResult
<
Boolean
>
updateMerchantUserPermission
(
@Validated
(
Update
.
class
)
@RequestBody
MerchantUserPermission
merchantUserPermission
)
throws
Exception
{
boolean
flag
=
merchantUserPermissionService
.
updateMerchantUserPermission
(
merchantUserPermission
);
return
ApiResult
.
result
(
flag
);
}
/**
* 删除商家用户权限关系
*/
@PostMapping
(
"/delete/{id}"
)
@OperationLog
(
name
=
"删除商家用户权限关系"
,
type
=
OperationLogType
.
DELETE
)
@ApiOperation
(
value
=
"删除商家用户权限关系"
)
public
ApiResult
<
Boolean
>
deleteMerchantUserPermission
(
@PathVariable
(
"id"
)
Long
id
)
throws
Exception
{
boolean
flag
=
merchantUserPermissionService
.
deleteMerchantUserPermission
(
id
);
return
ApiResult
.
result
(
flag
);
}
/**
* 获取商家用户权限关系详情
*/
@GetMapping
(
"/info/{id}"
)
@OperationLog
(
name
=
"商家用户权限关系详情"
,
type
=
OperationLogType
.
INFO
)
@ApiOperation
(
value
=
"商家用户权限关系详情"
)
public
ApiResult
<
MerchantUserPermissionQueryVo
>
getMerchantUserPermission
(
@PathVariable
(
"id"
)
Long
id
)
throws
Exception
{
MerchantUserPermissionQueryVo
merchantUserPermissionQueryVo
=
merchantUserPermissionService
.
getMerchantUserPermissionById
(
id
);
return
ApiResult
.
ok
(
merchantUserPermissionQueryVo
);
}
/**
* 商家用户权限关系分页列表
*/
@PostMapping
(
"/getPageList"
)
@OperationLog
(
name
=
"商家用户权限关系分页列表"
,
type
=
OperationLogType
.
PAGE
)
@ApiOperation
(
value
=
"商家用户权限关系分页列表"
)
public
ApiResult
<
Paging
<
MerchantUserPermissionQueryVo
>>
getMerchantUserPermissionPageList
(
@Validated
@RequestBody
MerchantUserPermissionPageParam
merchantUserPermissionPageParam
)
throws
Exception
{
Paging
<
MerchantUserPermissionQueryVo
>
paging
=
merchantUserPermissionService
.
getMerchantUserPermissionPageList
(
merchantUserPermissionPageParam
);
return
ApiResult
.
ok
(
paging
);
}
}
common/src/main/java/com/jumeirah/common/entity/CharterIntroduction.java
View file @
82c0b977
...
...
@@ -50,6 +50,9 @@ public class CharterIntroduction extends BaseEntity {
@ApiModelProperty
(
"包机文字"
)
private
String
text
;
@ApiModelProperty
(
"包机标题"
)
private
String
title
;
@ApiModelProperty
(
"类型 1私人;2团体;3货运;4医疗"
)
private
Integer
type
;
...
...
common/src/main/java/com/jumeirah/common/entity/MerchantUserPermission.java
0 → 100644
View file @
82c0b977
package
com
.
jumeirah
.
common
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.Version
;
import
io.geekidea.springbootplus.framework.common.entity.BaseEntity
;
import
io.geekidea.springbootplus.framework.core.validator.groups.Update
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
javax.validation.constraints.NotNull
;
import
java.util.Date
;
/**
* 商家用户权限关系
*
* @author giao
* @since 2020-10-19
*/
@Data
@Accessors
(
chain
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
@ApiModel
(
value
=
"MerchantUserPermission对象"
)
public
class
MerchantUserPermission
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
@NotNull
(
message
=
"id不能为空"
,
groups
=
{
Update
.
class
})
@ApiModelProperty
(
"主键"
)
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Long
id
;
@NotNull
(
message
=
"用户id不能为空"
)
@ApiModelProperty
(
"用户id"
)
private
Long
userId
;
@NotNull
(
message
=
"权限id不能为空"
)
@ApiModelProperty
(
"权限id"
)
private
Long
permissionId
;
@ApiModelProperty
(
"状态,0:禁用,1:启用"
)
private
Integer
state
;
@ApiModelProperty
(
"备注"
)
private
String
remark
;
@ApiModelProperty
(
"职位名称"
)
private
String
positionName
;
@ApiModelProperty
(
"版本"
)
@Version
private
Integer
version
;
@ApiModelProperty
(
"创建时间"
)
private
Date
createTime
;
@ApiModelProperty
(
"修改时间"
)
private
Date
updateTime
;
}
common/src/main/java/com/jumeirah/common/entity/Stroke.java
View file @
82c0b977
...
...
@@ -168,8 +168,4 @@ public class Stroke extends BaseEntity {
@ApiModelProperty
(
"用户充值截图证据, 传入数组"
)
private
String
userRechargeCredentialsUrl
;
@ApiModelProperty
(
"备注"
)
private
String
remark
;
}
common/src/main/java/com/jumeirah/common/mapper/MerchantUserPermissionMapper.java
0 → 100644
View file @
82c0b977
package
com
.
jumeirah
.
common
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.jumeirah.common.entity.MerchantUserPermission
;
import
com.jumeirah.common.param.MerchantUserPermissionPageParam
;
import
com.jumeirah.common.param.MerchantUserPermissionQueryVo
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
import
java.io.Serializable
;
import
java.util.Set
;
/**
* 商家用户权限关系 Mapper 接口
*
* @author giao
* @since 2020-10-19
*/
@Repository
public
interface
MerchantUserPermissionMapper
extends
BaseMapper
<
MerchantUserPermission
>
{
/**
* 根据角色id获取可用的权限编码
*
* @param userId
* @return
*/
Set
<
String
>
getPermissionCodesByUserId
(
@Param
(
"userId"
)
Long
userId
);
/**
* 根据ID获取查询对象
*
* @param id
* @return
*/
MerchantUserPermissionQueryVo
getMerchantUserPermissionById
(
Serializable
id
);
/**
* 获取分页对象
*
* @param page
* @param merchantUserPermissionPageParam
* @return
*/
IPage
<
MerchantUserPermissionQueryVo
>
getMerchantUserPermissionPageList
(
@Param
(
"page"
)
Page
page
,
@Param
(
"param"
)
MerchantUserPermissionPageParam
merchantUserPermissionPageParam
);
}
common/src/main/java/com/jumeirah/common/param/MerchantUserPermissionPageParam.java
0 → 100644
View file @
82c0b977
package
com
.
jumeirah
.
common
.
param
;
import
io.geekidea.springbootplus.framework.core.pagination.BasePageOrderParam
;
import
io.swagger.annotations.ApiModel
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
/**
* <pre>
* 商家用户权限关系 分页参数对象
* </pre>
*
* @author giao
* @date 2020-10-19
*/
@Data
@Accessors
(
chain
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
@ApiModel
(
value
=
"商家用户权限关系分页参数"
)
public
class
MerchantUserPermissionPageParam
extends
BasePageOrderParam
{
private
static
final
long
serialVersionUID
=
1L
;
}
common/src/main/java/com/jumeirah/common/param/MerchantUserPermissionQueryVo.java
0 → 100644
View file @
82c0b977
package
com
.
jumeirah
.
common
.
param
;
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>
* 商家用户权限关系 查询结果对象
* </pre>
*
* @author giao
* @date 2020-10-19
*/
@Data
@Accessors
(
chain
=
true
)
@ApiModel
(
value
=
"MerchantUserPermissionQueryVo对象"
)
public
class
MerchantUserPermissionQueryVo
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
"主键"
)
private
Long
id
;
@ApiModelProperty
(
"用户id"
)
private
Long
userId
;
@ApiModelProperty
(
"权限id"
)
private
Long
permissionId
;
@ApiModelProperty
(
"状态,0:禁用,1:启用"
)
private
Integer
state
;
@ApiModelProperty
(
"备注"
)
private
String
remark
;
@ApiModelProperty
(
"职位名称"
)
private
String
positionName
;
@ApiModelProperty
(
"版本"
)
private
Integer
version
;
@ApiModelProperty
(
"创建时间"
)
private
Date
createTime
;
@ApiModelProperty
(
"修改时间"
)
private
Date
updateTime
;
}
\ No newline at end of file
common/src/main/java/com/jumeirah/common/service/MerchantUserPermissionService.java
0 → 100644
View file @
82c0b977
package
com
.
jumeirah
.
common
.
service
;
import
com.jumeirah.common.entity.MerchantUserPermission
;
import
com.jumeirah.common.param.MerchantUserPermissionPageParam
;
import
com.jumeirah.common.param.MerchantUserPermissionQueryVo
;
import
io.geekidea.springbootplus.framework.common.service.BaseService
;
import
io.geekidea.springbootplus.framework.core.pagination.Paging
;
import
java.util.Set
;
/**
* 商家用户权限关系 服务类
*
* @author giao
* @since 2020-10-19
*/
public
interface
MerchantUserPermissionService
extends
BaseService
<
MerchantUserPermission
>
{
/**
* 根据角色id获取可用的权限编码
*
* @param userId
* @return
* @throws Exception
*/
Set
<
String
>
getPermissionCodesByUserId
(
Long
userId
)
throws
Exception
;
/**
* 保存
*
* @param merchantUserPermission
* @return
* @throws Exception
*/
boolean
saveMerchantUserPermission
(
MerchantUserPermission
merchantUserPermission
)
throws
Exception
;
/**
* 修改
*
* @param merchantUserPermission
* @return
* @throws Exception
*/
boolean
updateMerchantUserPermission
(
MerchantUserPermission
merchantUserPermission
)
throws
Exception
;
/**
* 删除
*
* @param id
* @return
* @throws Exception
*/
boolean
deleteMerchantUserPermission
(
Long
id
)
throws
Exception
;
/**
* 根据ID获取查询对象
*
* @param id
* @return
* @throws Exception
*/
MerchantUserPermissionQueryVo
getMerchantUserPermissionById
(
Long
id
)
throws
Exception
;
/**
* 获取分页对象
*
* @param merchantUserPermissionPageParam
* @return
* @throws Exception
*/
Paging
<
MerchantUserPermissionQueryVo
>
getMerchantUserPermissionPageList
(
MerchantUserPermissionPageParam
merchantUserPermissionPageParam
)
throws
Exception
;
}
common/src/main/java/com/jumeirah/common/service/MerchantUserService.java
View file @
82c0b977
...
...
@@ -2,7 +2,6 @@ package com.jumeirah.common.service;
import
com.jumeirah.common.entity.MerchantUser
;
import
com.jumeirah.common.param.MerchantLoginParam
;
import
com.jumeirah.common.param.MerchantRegisterParam
;
import
com.jumeirah.common.param.MerchantUserPageParam
;
import
com.jumeirah.common.vo.LoginMerUserTokenVo
;
import
com.jumeirah.common.vo.MerchantUserQueryVo
;
...
...
@@ -37,7 +36,7 @@ public interface MerchantUserService extends BaseService<MerchantUser> {
ApiResult
<
LoginMerUserTokenVo
>
login
(
MerchantLoginParam
merchantLoginParam
)
throws
Exception
;
ApiResult
<
Boolean
>
register
(
MerchantRegisterParam
merchantRegisterParam
)
throws
Exception
;
//
ApiResult<Boolean> register(MerchantRegisterParam merchantRegisterParam) throws Exception;
/**
...
...
common/src/main/java/com/jumeirah/common/service/impl/MerchantUserPermissionServiceImpl.java
0 → 100644
View file @
82c0b977
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.MerchantUserPermission
;
import
com.jumeirah.common.mapper.MerchantUserPermissionMapper
;
import
com.jumeirah.common.param.MerchantUserPermissionPageParam
;
import
com.jumeirah.common.param.MerchantUserPermissionQueryVo
;
import
com.jumeirah.common.service.MerchantUserPermissionService
;
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
;
import
java.util.Set
;
/**
* 商家用户权限关系 服务实现类
*
* @author giao
* @since 2020-10-19
*/
@Slf4j
@Service
public
class
MerchantUserPermissionServiceImpl
extends
BaseServiceImpl
<
MerchantUserPermissionMapper
,
MerchantUserPermission
>
implements
MerchantUserPermissionService
{
@Autowired
private
MerchantUserPermissionMapper
merchantUserPermissionMapper
;
@Override
public
Set
<
String
>
getPermissionCodesByUserId
(
Long
userId
)
throws
Exception
{
return
merchantUserPermissionMapper
.
getPermissionCodesByUserId
(
userId
);
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
boolean
saveMerchantUserPermission
(
MerchantUserPermission
merchantUserPermission
)
throws
Exception
{
return
super
.
save
(
merchantUserPermission
);
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
boolean
updateMerchantUserPermission
(
MerchantUserPermission
merchantUserPermission
)
throws
Exception
{
return
super
.
updateById
(
merchantUserPermission
);
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
boolean
deleteMerchantUserPermission
(
Long
id
)
throws
Exception
{
return
super
.
removeById
(
id
);
}
@Override
public
MerchantUserPermissionQueryVo
getMerchantUserPermissionById
(
Long
id
)
throws
Exception
{
return
merchantUserPermissionMapper
.
getMerchantUserPermissionById
(
id
);
}
@Override
public
Paging
<
MerchantUserPermissionQueryVo
>
getMerchantUserPermissionPageList
(
MerchantUserPermissionPageParam
merchantUserPermissionPageParam
)
throws
Exception
{
Page
<
MerchantUserPermissionQueryVo
>
page
=
new
PageInfo
<>(
merchantUserPermissionPageParam
,
OrderItem
.
desc
(
getLambdaColumn
(
MerchantUserPermission:
:
getCreateTime
)));
IPage
<
MerchantUserPermissionQueryVo
>
iPage
=
merchantUserPermissionMapper
.
getMerchantUserPermissionPageList
(
page
,
merchantUserPermissionPageParam
);
return
new
Paging
<
MerchantUserPermissionQueryVo
>(
iPage
);
}
}
common/src/main/java/com/jumeirah/common/service/impl/MerchantUserServiceImpl.java
View file @
82c0b977
...
...
@@ -5,17 +5,14 @@ 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.convert.UserConvert
;
import
com.jumeirah.common.entity.Merchant
;
import
com.jumeirah.common.entity.MerchantRole
;
import
com.jumeirah.common.entity.MerchantPermission
;
import
com.jumeirah.common.entity.MerchantUser
;
import
com.jumeirah.common.enums.StateEnum
;
import
com.jumeirah.common.mapper.MerchantUserMapper
;
import
com.jumeirah.common.param.MerchantLoginParam
;
import
com.jumeirah.common.param.MerchantRegisterParam
;
import
com.jumeirah.common.param.MerchantUserPageParam
;
import
com.jumeirah.common.service.MerchantRolePermissionService
;
import
com.jumeirah.common.service.MerchantRoleService
;
import
com.jumeirah.common.service.MerchantService
;
import
com.jumeirah.common.service.MerchantPermissionService
;
import
com.jumeirah.common.service.MerchantUserPermissionService
;
import
com.jumeirah.common.service.MerchantUserService
;
import
com.jumeirah.common.vo.LoginMerUserTokenVo
;
import
com.jumeirah.common.vo.MerchantUserQueryVo
;
...
...
@@ -35,16 +32,15 @@ import io.geekidea.springbootplus.framework.shiro.vo.LoginUserVo;
import
io.geekidea.springbootplus.framework.util.PasswordUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.shiro.SecurityUtils
;
import
org.apache.shiro.authc.AuthenticationException
;
import
org.apache.shiro.subject.Subject
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.time.Duration
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Set
;
/**
...
...
@@ -61,31 +57,37 @@ public class MerchantUserServiceImpl extends BaseServiceImpl<MerchantUserMapper,
@Autowired
private
SpringBootPlusProperties
springBootPlusProperties
;
@Lazy
@Autowired
private
RedisTemplate
redisTemplate
;
//
@Lazy
//
@Autowired
//
private RedisTemplate redisTemplate;
@Lazy
@Autowired
private
MerchantLoginRedisService
merchantLoginRedisService
;
@Lazy
@Autowired
private
JwtProperties
jwtProperties
;
@Autowired
private
MerchantUserMapper
merchantUserMapper
;
@Autowired
private
MerchantRoleService
merchantRoleService
;
private
MerchantPermissionService
merchantPermissionService
;
@Autowired
private
Merchant
Service
merchant
Service
;
private
Merchant
UserPermissionService
merchantUserPermission
Service
;
@Lazy
@Autowired
private
MerchantSmsService
merchantSmsService
;
private
JwtProperties
jwtProperties
;
@Autowired
private
MerchantRolePermissionService
merchantRolePermissionService
;
private
MerchantUserMapper
merchantUserMapper
;
//
// @Autowired
// private MerchantRoleService merchantRoleService;
//
// @Autowired
// private MerchantService merchantService;
//
// @Autowired
// private MerchantSmsService merchantSmsService;
// @Autowired
// private MerchantRolePermissionService merchantRolePermissionService;
public
MerchantUser
getMerUserByUsername
(
String
username
)
throws
Exception
{
MerchantUser
sysUser
=
new
MerchantUser
().
setUsername
(
username
);
...
...
@@ -121,22 +123,36 @@ public class MerchantUserServiceImpl extends BaseServiceImpl<MerchantUserMapper,
// 将系统用户对象转换成登录用户对象
LoginUserVo
loginSysUserVo
=
UserConvert
.
INSTANCE
.
merchantUserToLoginSysUserVo
(
merchantUser
);
// 获取当前用户角色
Long
roleId
=
merchantUser
.
getRoleId
();
MerchantRole
merchantRole
=
merchantRoleService
.
getById
(
roleId
);
if
(
merchantRole
==
null
)
{
throw
new
AuthenticationException
(
"角色不存在"
);
}
if
(
StateEnum
.
DISABLE
.
getCode
().
equals
(
merchantRole
.
getState
()))
{
throw
new
AuthenticationException
(
"角色已禁用"
);
// // 获取当前用户角色
// Long roleId = merchantUser.getRoleId();
// MerchantRole merchantRole = merchantRoleService.getById(roleId);
// if (merchantRole == null) {
// throw new AuthenticationException("角色不存在");
// }
// if (StateEnum.DISABLE.getCode().equals(merchantRole.getState())) {
// throw new AuthenticationException("角色已禁用");
// }
// loginSysUserVo.setRoleId(merchantRole.getId())
// .setRoleName(merchantRole.getName())
// .setRoleCode(merchantRole.getCode());
// // 获取当前用户权限
// Set<String> permissionCodes = merchantRolePermissionService.getPermissionCodesByRoleId(roleId);
// loginSysUserVo.setPermissionCodes(permissionCodes);
// 如果是超级管理员查询所有权限
if
(
merchantUser
.
getIsAdmin
().
equals
(
1
))
{
List
<
MerchantPermission
>
merchantPermissions
=
merchantPermissionService
.
list
();
Set
<
String
>
permissionCodes
=
new
HashSet
<>();
for
(
MerchantPermission
merchantPermission
:
merchantPermissions
)
{
permissionCodes
.
add
(
merchantPermission
.
getCode
());
}
loginSysUserVo
.
setPermissionCodes
(
permissionCodes
);
}
else
{
Set
<
String
>
permissionCodes
=
merchantUserPermissionService
.
getPermissionCodesByUserId
(
merchantUser
.
getId
());
loginSysUserVo
.
setPermissionCodes
(
permissionCodes
);
}
loginSysUserVo
.
setRoleId
(
merchantRole
.
getId
())
.
setRoleName
(
merchantRole
.
getName
())
.
setRoleCode
(
merchantRole
.
getCode
());
// 获取当前用户权限
Set
<
String
>
permissionCodes
=
merchantRolePermissionService
.
getPermissionCodesByRoleId
(
roleId
);
loginSysUserVo
.
setPermissionCodes
(
permissionCodes
);
// 获取数据库中保存的盐值
String
newSalt
=
SaltUtil
.
getSalt
(
merchantUser
.
getSalt
(),
jwtProperties
);
...
...
@@ -147,7 +163,7 @@ public class MerchantUserServiceImpl extends BaseServiceImpl<MerchantUserMapper,
log
.
debug
(
"token:{}"
,
token
);
// 创建AuthenticationToken
JwtToken
jwtToken
=
JwtToken
.
build
(
token
,
username
,
merchantUser
.
getId
(),
newSalt
,
expireSecond
,
LoginClientTypeEnum
.
MERCHANT
.
getType
(),
merchantUser
.
getMcId
());
JwtToken
jwtToken
=
JwtToken
.
build
(
token
,
username
,
merchantUser
.
getId
(),
newSalt
,
expireSecond
,
LoginClientTypeEnum
.
MERCHANT
.
getType
(),
merchantUser
.
getMcId
());
boolean
enableShiro
=
springBootPlusProperties
.
getShiro
().
isEnable
();
if
(
enableShiro
)
{
...
...
@@ -175,37 +191,37 @@ public class MerchantUserServiceImpl extends BaseServiceImpl<MerchantUserMapper,
return
ApiResult
.
ok
(
loginSysUserTokenVo
);
}
@Override
public
ApiResult
<
Boolean
>
register
(
MerchantRegisterParam
merchantRegisterPram
)
throws
Exception
{
// 校验验证码
boolean
equalsRegisterCode
=
merchantSmsService
.
equalsRegisterCode
(
merchantRegisterPram
.
getPhoneArea
(),
merchantRegisterPram
.
getPhone
(),
merchantRegisterPram
.
getSmsCode
());
if
(!
equalsRegisterCode
)
{
return
ApiResult
.
fail
(
ApiCode
.
SMS_CODE_ERROR
);
}
// 删除已使用的验证码
merchantSmsService
.
deleteRegisterCode
(
merchantRegisterPram
.
getPhoneArea
(),
merchantRegisterPram
.
getPhone
());
// 判断是否已经注册
// if (appUserService.hasUserByPhoneNumer(loginParam.getPhoneArea(), loginParam.getPhone())) {
// // 如果已经注册直接走登陆的代码
// return appUserService.login(loginParam, language, true);
// }
// 没注册则先保存到数据库
Merchant
merchant
=
new
Merchant
();
BeanUtils
.
copyProperties
(
merchantRegisterPram
,
merchant
);
merchant
.
setAuditRegisterStatus
(
0
);
merchant
.
setState
(
1
);
boolean
isDbOk
=
merchantService
.
saveMerchant
(
merchant
);
if
(!
isDbOk
)
{
return
ApiResult
.
fail
(
ApiCode
.
SPRING_BOOT_PLUS_EXCEPTION
);
}
// 创建一个该公司默认的管理员账号
return
ApiResult
.
ok
();
}
//
@Override
//
public ApiResult<Boolean> register(MerchantRegisterParam merchantRegisterPram) throws Exception {
//
//
// 校验验证码
//
boolean equalsRegisterCode = merchantSmsService.equalsRegisterCode(merchantRegisterPram.getPhoneArea(), merchantRegisterPram.getPhone(), merchantRegisterPram.getSmsCode());
//
if (!equalsRegisterCode) {
//
return ApiResult.fail(ApiCode.SMS_CODE_ERROR);
//
}
//
// 删除已使用的验证码
//
merchantSmsService.deleteRegisterCode(merchantRegisterPram.getPhoneArea(), merchantRegisterPram.getPhone());
//
// 判断是否已经注册
//
//
if (appUserService.hasUserByPhoneNumer(loginParam.getPhoneArea(), loginParam.getPhone())) {
//
//
// 如果已经注册直接走登陆的代码
//
//
return appUserService.login(loginParam, language, true);
//
//
}
//
//
// 没注册则先保存到数据库
//
Merchant merchant = new Merchant();
//
BeanUtils.copyProperties(merchantRegisterPram, merchant);
//
merchant.setAuditRegisterStatus(0);
//
merchant.setState(1);
//
boolean isDbOk = merchantService.saveMerchant(merchant);
//
if (!isDbOk) {
//
return ApiResult.fail(ApiCode.SPRING_BOOT_PLUS_EXCEPTION);
//
}
//
//
// 创建一个该公司默认的管理员账号
//
//
return ApiResult.ok();
//
}
//
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
...
...
common/src/main/java/com/jumeirah/common/vo/CharterIntroductionQueryForAppVo.java
View file @
82c0b977
...
...
@@ -31,6 +31,9 @@ public class CharterIntroductionQueryForAppVo implements Serializable {
@ApiModelProperty
(
"包机文字"
)
private
String
text
;
@ApiModelProperty
(
"包机标题"
)
private
String
title
;
@ApiModelProperty
(
"图片高"
)
private
Integer
imageListHeight
;
@ApiModelProperty
(
"图片宽"
)
...
...
common/src/main/resources/mapper/CharterIntroductionMapper.xml
View file @
82c0b977
...
...
@@ -7,7 +7,7 @@
id, mc_id, status, create_time, update_time,type,text,img_url,image_list_height,image_list_width
</sql>
<sql
id=
"Base_Column_ListForApp"
>
text,img_url,ci.image_list_height,ci.image_list_width,m.head AS mcHead,m.name AS mcName
t
itle,t
ext,img_url,ci.image_list_height,ci.image_list_width,m.head AS mcHead,m.name AS mcName
</sql>
<select
id=
"getCharterIntroductionById"
resultType=
"com.jumeirah.common.vo.CharterIntroductionQueryVo"
>
...
...
common/src/main/resources/mapper/MerchantUserPermissionMapper.xml
0 → 100644
View file @
82c0b977
<?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.MerchantUserPermissionMapper"
>
<!-- 通用查询结果列 -->
<sql
id=
"Base_Column_List"
>
id, user_id, permission_id, state, remark, position_name, version, create_time, update_time
</sql>
<select
id=
"getPermissionCodesByUserId"
resultType=
"java.lang.String"
>
SELECT
mp.CODE
FROM
merchant_user_permission mup
INNER JOIN merchant_permission mp ON mp.id = mup.permission_id
WHERE
mup.user_id = #{userId}
</select>
<select
id=
"getMerchantUserPermissionById"
resultType=
"com.jumeirah.common.param.MerchantUserPermissionQueryVo"
>
select
<include
refid=
"Base_Column_List"
/>
from merchant_user_permission where id = #{id}
</select>
<select
id=
"getMerchantUserPermissionPageList"
parameterType=
"com.jumeirah.common.param.MerchantUserPermissionPageParam"
resultType=
"com.jumeirah.common.param.MerchantUserPermissionQueryVo"
>
select
<include
refid=
"Base_Column_List"
/>
from merchant_user_permission
</select>
</mapper>
framework/src/main/java/io/geekidea/springbootplus/framework/shiro/cache/MerchantLoginRedisService.java
View file @
82c0b977
...
...
@@ -54,7 +54,7 @@ public interface MerchantLoginRedisService {
* @param username
* @return
*/
LoginUserRedisVo
getLogin
Sys
UserRedisVo
(
String
username
);
LoginUserRedisVo
getLogin
Mer
UserRedisVo
(
String
username
);
/**
* 获取登录用户对象
...
...
framework/src/main/java/io/geekidea/springbootplus/framework/shiro/cache/impl/MerchantLoginRedisServiceImpl.java
View file @
82c0b977
...
...
@@ -94,7 +94,7 @@ public class MerchantLoginRedisServiceImpl implements MerchantLoginRedisService
@Override
public
void
refreshLoginInfo
(
String
oldToken
,
String
username
,
JwtToken
newJwtToken
)
{
// 获取缓存的登录用户信息
LoginUserRedisVo
loginSysUserRedisVo
=
getLogin
Sys
UserRedisVo
(
username
);
LoginUserRedisVo
loginSysUserRedisVo
=
getLogin
Mer
UserRedisVo
(
username
);
// 删除之前的token信息
deleteLoginInfo
(
oldToken
,
username
);
// 缓存登录信息
...
...
@@ -102,7 +102,7 @@ public class MerchantLoginRedisServiceImpl implements MerchantLoginRedisService
}
@Override
public
LoginUserRedisVo
getLogin
Sys
UserRedisVo
(
String
username
)
{
public
LoginUserRedisVo
getLogin
Mer
UserRedisVo
(
String
username
)
{
if
(
StringUtils
.
isBlank
(
username
))
{
throw
new
IllegalArgumentException
(
"username不能为空"
);
}
...
...
@@ -114,7 +114,7 @@ public class MerchantLoginRedisServiceImpl implements MerchantLoginRedisService
if
(
StringUtils
.
isBlank
(
username
))
{
throw
new
IllegalArgumentException
(
"username不能为空"
);
}
LoginUserRedisVo
userRedisVo
=
getLogin
Sys
UserRedisVo
(
username
);
LoginUserRedisVo
userRedisVo
=
getLogin
Mer
UserRedisVo
(
username
);
return
userRedisVo
;
}
...
...
framework/src/main/java/io/geekidea/springbootplus/framework/shiro/jwt/realm/JwtRealmMerchant.java
View file @
82c0b977
...
...
@@ -73,7 +73,7 @@ public class JwtRealmMerchant extends AuthorizingRealm {
// 获取username
String
username
=
jwtToken
.
getUsername
();
// 获取登录用户角色权限信息
LoginUserRedisVo
loginSysUserRedisVo
=
merchantLoginRedisService
.
getLogin
Sys
UserRedisVo
(
username
);
LoginUserRedisVo
loginSysUserRedisVo
=
merchantLoginRedisService
.
getLogin
Mer
UserRedisVo
(
username
);
SimpleAuthorizationInfo
authorizationInfo
=
new
SimpleAuthorizationInfo
();
// 设置角色
authorizationInfo
.
setRoles
(
SetUtils
.
hashSet
(
loginSysUserRedisVo
.
getRoleCode
()));
...
...
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