Commit 458c1322 by hewei

Merge branch 'double_realm_test' into 'master'

初始化提交

See merge request hewei/Jumeirah!1
parents 50f89ea2 21b4c3fa
......@@ -18,11 +18,56 @@
└── api-system 平台管理系统api模块
└── api-app app的api模块
└── api-merchant 商家api服务模块
└── common 通用模块
└── common 通用模块(包含service dao mapper)
```
## 安装中间件
redis(必须本地开启)
mysql5.7 (你本地可以不开,在本地配置中已经连上了测试环境)
## 开发规范
### 关于模块
api-system api-app api-merchant
三个模块是各自针对不同后端模块的api接口,都包含common模块的依赖,
你只能在其中开发模块属于自己的controller和service,
并且可以实现当前模块的service业务逻辑层,但对数据库操作,请一定调用common模块的service,不要在api-XXX的模块下写数据库的操作.
如果业务流程没有很复杂, 在controller类中你可以直接调用common模块的service
### 例如:
#### 商户注册
在api-merchant模块中的controller包下新建一个Register控制器,
模块下每个控制器url路径必须要加上前缀```"/merchant/"```,这样为了方便权限控制
像这样:
```
@RequestMapping("/merchant/register/")
```
注册业务逻辑要调用common模块中的service去操作
#### app注册
在api-app模块中的controller包下新建一个Register控制器,
模块下每个控制器url路径必须要加上前缀```"/app/"```,这样为了方便权限控制
像这样:
```
@RequestMapping("/app/register/")
```
注册业务逻辑要调用common模块中的service去操作
## 安装软件
redis
mysql5.7
......@@ -17,7 +17,7 @@ import java.io.IOException;
*
**/
@Slf4j
@Api(value = "Hello World2", tags = {"Hello World2"})
@Api(value = "Hello World2", tags = {"APP Hello World2"})
@RestController
@RequestMapping("/app")
public class AppHelloWorldController {
......
......@@ -45,7 +45,7 @@ import javax.servlet.http.HttpServletResponse;
@Slf4j
@RestController
@Module("system")
@Api(value = "用户注册API", tags = {"用户注册"})
@Api(value = "用户注册API", tags = {"APP用户注册"})
@RequestMapping("/app")
public class RegisterController {
......
package com.jumeirah.api.app.service;
public interface RegisterService {
void regiest();
}
package com.jumeirah.api.app.service.impl;
import com.jumeirah.api.app.service.RegisterService;
import org.springframework.stereotype.Service;
@Service
public class RegisterServiceImpl implements RegisterService {
@Override
public void regiest() {
}
}
package com.jumeirah.api.merchant.controller;
import io.geekidea.springbootplus.framework.common.api.ApiResult;
import io.geekidea.springbootplus.framework.log.annotation.OperationLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.io.IOException;
/**
* Hello World Controller
*
**/
@Slf4j
@Api(value = "Hello World2", tags = {"商户Hello World2"})
@RestController
@RequestMapping("/merchant/")
public class AppHelloWorldController {
/**
* Hello World
*
* @return
* @throws IOException
*/
@GetMapping(value = "/world")
@OperationLog(name = "helloWorld")
@ApiOperation(value = "Hello World", response = String.class)
public ApiResult<String> helloWorld() throws IOException {
log.debug("Hello World...app");
return ApiResult.ok("Hello World app merchant");
}
}
/*
* 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.merchant.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 = {"商户注册"})
@RequestMapping("/merchant/")
public class RegisterController {
@Autowired
private RegisterService registerService;
@PostMapping("/register")
@OperationLogIgnore
@ApiOperation(value = "注册", notes = "商户注册", 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);
}
}
......@@ -43,7 +43,7 @@ import java.util.List;
*/
@Slf4j
@Controller
@RequestMapping("/download")
@RequestMapping("/sys/download")
@Module("system")
@Api(value = "文件下载", tags = {"文件下载"})
public class DownloadController {
......
......@@ -36,7 +36,7 @@ import java.io.IOException;
@Slf4j
@Api(value = "Hello World", tags = {"Hello World"})
@RestController
@RequestMapping("/system/hello")
@RequestMapping("/sys/hello")
public class HelloWorldController {
/**
......
......@@ -17,14 +17,14 @@
package com.jumeirah.api.system.controller;
import com.alibaba.fastjson.JSON;
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 com.jumeirah.common.param.LoginParam;
import com.jumeirah.common.service.LoginService;
import com.jumeirah.common.service.SysUserService;
import com.jumeirah.common.vo.LoginSysUserTokenVo;
import com.jumeirah.common.vo.SysUserQueryVo;
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;
......@@ -35,6 +35,7 @@ import org.springframework.web.bind.annotation.GetMapping;
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.HttpServletRequest;
......@@ -51,6 +52,8 @@ import javax.servlet.http.HttpServletResponse;
@RestController
@Module("system")
@Api(value = "系统登录API", tags = {"系统登录"})
@RequestMapping("/sys/")
public class LoginController {
@Autowired
......
......@@ -52,7 +52,7 @@ import java.util.List;
*/
@Slf4j
@RestController
@RequestMapping("/sysDepartment")
@RequestMapping("/sys/sysDepartment")
@Module("system")
@Api(value = "系统部门API", tags = {"系统部门"})
public class SysDepartmentController extends BaseController {
......
......@@ -53,7 +53,7 @@ import java.util.List;
*/
@Slf4j
@RestController
@RequestMapping("/sysPermission")
@RequestMapping("/sys/sysPermission")
@Module("system")
@Api(value = "系统权限 API", tags = {"系统权限"})
public class SysPermissionController extends BaseController {
......
......@@ -53,7 +53,7 @@ import java.util.List;
*/
@Slf4j
@RestController
@RequestMapping("/sysRole")
@RequestMapping("/sys/sysRole")
@Module("system")
@Api(value = "系统角色API", tags = {"系统角色"})
public class SysRoleController extends BaseController {
......
......@@ -55,7 +55,7 @@ import org.springframework.web.bind.annotation.RestController;
*/
@Slf4j
@RestController
@RequestMapping("/sysUser")
@RequestMapping("/sys/sysUser")
@Module("system")
@Api(value = "系统用户API", tags = {"系统用户"})
public class SysUserController extends BaseController {
......
......@@ -48,7 +48,7 @@ import java.time.format.DateTimeFormatter;
*/
@Slf4j
@RestController
@RequestMapping("/upload")
@RequestMapping("/sys/upload")
@Module("system")
@Api(value = "文件上传", tags = {"文件上传"})
public class UploadController {
......
......@@ -56,7 +56,7 @@ import java.util.concurrent.TimeUnit;
@Controller
@Api(value = "验证码API", tags = {"验证码"})
@Module("system")
@RequestMapping("/verificationCode")
@RequestMapping("/sys/verificationCode")
@ConditionalOnProperty(value = {"spring-boot-plus.enable-verify-code"}, matchIfMissing = true)
public class VerificationCodeController {
......
......@@ -14,10 +14,9 @@ spring-boot-plus:
spring:
datasource:
# url: jdbc:mysql://localhost:3306/spring_boot_plus?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&useSSL=false&allowPublicKeyRetrieval=true
url: jdbc:mysql://localhost:3306/Jumeirah?serverTimezone=UTC&useUnicode=true&characterEncoding=utf8&useSSL=false&allowPublicKeyRetrieval=true
url: jdbc:mysql://47.99.47.225:3306/Jumeirah?serverTimezone=UTC&useUnicode=true&characterEncoding=utf8&useSSL=false&allowPublicKeyRetrieval=true
username: root
password: 123
password: temple123456
# Redis配置
redis:
......
......@@ -6,8 +6,8 @@ server:
servlet:
context-path: /api
tomcat:
max-threads: 1000
min-spare-threads: 30
max-threads: 200
min-spare-threads: 10
uri-encoding: UTF-8
############################# 访问路径、端口tomcat end ###############################
......@@ -192,8 +192,6 @@ spring-boot-plus:
# - /actuator/**
- # 排除首页
- /,/index.html
- /app/world/*
- /system/hello/*
# 多行字符串权限配置
filter-chain-definitions: |
......@@ -201,7 +199,8 @@ spring-boot-plus:
/upload/**=anon
/verificationCode/**=anon
/enum=anon
# /getSysUserInfo=anon
# 配置/app/**路径下登陆的用户就能访问
/app/**=authc
######################## Spring Shiro end ##########################
......
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