🎉 2.0.0-RC1.

This commit is contained in:
smallchill 2019-01-02 00:54:50 +08:00
parent 25c5e34053
commit 452db24b15
34 changed files with 176 additions and 151 deletions

View File

@ -13,7 +13,7 @@ SpringBlade 2.0 是一个基于 Spring Boot 2 & Spring Cloud Finchley & Mybatis
## 工程结构
```
bladex
SpringBlade
├── blade-auth -- 授权服务提供
├── blade-common -- 常用工具封装包
├── blade-gateway -- Spring Cloud 网关

View File

@ -27,11 +27,11 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class RegistryConfiguration implements WebMvcConfigurer {
@Bean
public SecureRegistry secureRegistry() {
SecureRegistry secureRegistry = new SecureRegistry();
secureRegistry.excludePathPatterns("/token/**");
return secureRegistry;
}
@Bean
public SecureRegistry secureRegistry() {
SecureRegistry secureRegistry = new SecureRegistry();
secureRegistry.excludePathPatterns("/token/**");
return secureRegistry;
}
}

View File

@ -20,13 +20,17 @@ import org.springblade.core.launch.constant.AppConstant;
import org.springblade.core.launch.BladeApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* admin启动器
*
* @author Chill
*/
@EnableAdminServer
@SpringBootApplication
public class BladeAdminApplication {
public static void main(String[] args) {
BladeApplication.run(AppConstant.APPLICATION_ADMIN_NAME, BladeAdminApplication.class, args);
BladeApplication.run(AppConstant.APPLICATION_ADMIN_NAME, BladeAdminApplication.class, args);
}
}

View File

@ -20,6 +20,8 @@ import org.springblade.support.BladeGenerator;
/**
* 代码生成器
*
* @author Chill
*/
public class CodeGenerator {

View File

@ -20,13 +20,17 @@ import org.springblade.core.launch.BladeApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.config.server.EnableConfigServer;
/**
* 服务中心启动器
*
* @author Chill
*/
@EnableConfigServer
@SpringBootApplication
public class BladeConfigApplication {
public static void main(String[] args) {
BladeApplication.run(AppConstant.APPLICATION_CONFIG_NAME, BladeConfigApplication.class, args);
BladeApplication.run(AppConstant.APPLICATION_CONFIG_NAME, BladeConfigApplication.class, args);
}
}

View File

@ -25,21 +25,24 @@ import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
/**
* Feign接口类
* Notice Feign接口类
*
* @author Chill
*/
@FeignClient(
value = AppConstant.APPLICATION_DESK_NAME
value = AppConstant.APPLICATION_DESK_NAME
)
public interface INoticeClient {
String API_PREFIX = "/dashboard";
String API_PREFIX = "/dashboard";
/**
* 获取notice列表
* @param number
* @return
*/
/**
* 获取notice列表
*
* @param number
* @return
*/
@GetMapping(API_PREFIX + "/top")
R<List<Notice>> top(@RequestParam("number") Integer number);
R<List<Notice>> top(@RequestParam("number") Integer number);
}

View File

@ -28,6 +28,6 @@ import org.springblade.system.entity.Dict;
@Data
@EqualsAndHashCode(callSuper = true)
public class DictDTO extends Dict {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
}

View File

@ -26,31 +26,32 @@ import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
/**
* Feign接口类
* Feign接口类
*/
@FeignClient(
value = AppConstant.APPLICATION_SYSTEM_NAME,
fallback = IDictClientFallback.class
value = AppConstant.APPLICATION_SYSTEM_NAME,
fallback = IDictClientFallback.class
)
public interface IDictClient {
String API_PREFIX = "/dict";
String API_PREFIX = "/dict";
/**
* 获取字典表对应值
*
* @param code 字典编号
* @param dictKey 字典序号
* @return
*/
/**
* 获取字典表对应值
*
* @param code 字典编号
* @param dictKey 字典序号
* @return
*/
@GetMapping(API_PREFIX + "/getValue")
R<String> getValue(@RequestParam("code") String code, @RequestParam("dictKey") Integer dictKey);
/**
* 获取字典表
* @param code 字典编号
* @return
*/
/**
* 获取字典表
*
* @param code 字典编号
* @return
*/
@GetMapping(API_PREFIX + "/getList")
R<List<Dict>> getList(@RequestParam("code") String code);

View File

@ -20,6 +20,11 @@ import org.springblade.system.entity.Dict;
import java.util.List;
/**
* Feign失败配置
*
* @author Chill
*/
public class IDictClientFallback implements IDictClient {
@Override
public R<String> getValue(String code, Integer dictKey) {

View File

@ -28,6 +28,6 @@ import org.springblade.system.entity.Code;
@Data
@EqualsAndHashCode(callSuper = true)
public class CodeDTO extends Code {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
}

View File

@ -28,6 +28,6 @@ import org.springblade.system.entity.Dept;
@Data
@EqualsAndHashCode(callSuper = true)
public class DeptDTO extends Dept {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
}

View File

@ -28,6 +28,6 @@ import org.springblade.system.entity.Menu;
@Data
@EqualsAndHashCode(callSuper = true)
public class MenuDTO extends Menu {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
}

View File

@ -28,6 +28,6 @@ import org.springblade.system.entity.Role;
@Data
@EqualsAndHashCode(callSuper = true)
public class RoleDTO extends Role {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
}

View File

@ -28,6 +28,6 @@ import org.springblade.system.entity.RoleMenu;
@Data
@EqualsAndHashCode(callSuper = true)
public class RoleMenuDTO extends RoleMenu {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
}

View File

@ -30,6 +30,6 @@ import org.springblade.system.entity.Code;
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "CodeVO对象", description = "CodeVO对象")
public class CodeVO extends Code {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
}

View File

@ -30,6 +30,6 @@ import org.springblade.system.entity.RoleMenu;
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "RoleMenuVO对象", description = "RoleMenuVO对象")
public class RoleMenuVO extends RoleMenu {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
}

View File

@ -23,7 +23,7 @@ import org.springblade.core.mp.base.BaseEntity;
import java.time.LocalDateTime;
/**
* 实体类
* 实体类
*
* @author Chill
*/
@ -32,48 +32,48 @@ import java.time.LocalDateTime;
@EqualsAndHashCode(callSuper = true)
public class User extends BaseEntity {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
/**
* 账号
*/
private String account;
/**
* 密码
*/
private String password;
/**
* 昵称
*/
private String name;
/**
* 真名
*/
private String realName;
/**
* 邮箱
*/
private String email;
/**
* 手机
*/
private String phone;
/**
* 生日
*/
private LocalDateTime birthday;
/**
* 性别
*/
private Integer sex;
/**
* 角色id
*/
private String roleId;
/**
* 部门id
*/
private String deptId;
/**
* 账号
*/
private String account;
/**
* 密码
*/
private String password;
/**
* 昵称
*/
private String name;
/**
* 真名
*/
private String realName;
/**
* 邮箱
*/
private String email;
/**
* 手机
*/
private String phone;
/**
* 生日
*/
private LocalDateTime birthday;
/**
* 性别
*/
private Integer sex;
/**
* 角色id
*/
private String roleId;
/**
* 部门id
*/
private String deptId;
}

View File

@ -22,29 +22,33 @@ import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 用户信息
*
* @author Chill
*/
@Data
@ApiModel(description = "用户信息")
public class UserInfo implements Serializable {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
/**
* 用户基础信息
*/
@ApiModelProperty(value = "用户")
private User user;
/**
* 用户基础信息
*/
@ApiModelProperty(value = "用户")
private User user;
/**
* 权限标识集合
*/
@ApiModelProperty(value = "权限集合")
private List<String> permissions;
/**
* 权限标识集合
*/
@ApiModelProperty(value = "权限集合")
private List<String> permissions;
/**
* 角色集合
*/
@ApiModelProperty(value = "角色集合")
private List<String> roles;
/**
* 角色集合
*/
@ApiModelProperty(value = "角色集合")
private List<String> roles;
}

View File

@ -24,21 +24,23 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
/**
* Feign接口类
* User Feign接口类
* @author Chill
*/
@FeignClient(
value = AppConstant.APPLICATION_USER_NAME
value = AppConstant.APPLICATION_USER_NAME
)
public interface IUserClient {
String API_PREFIX = "/user";
String API_PREFIX = "/user";
/**
* 获取用户信息
* @param account 账号
* @param password 密码
* @return
*/
/**
* 获取用户信息
*
* @param account 账号
* @param password 密码
* @return
*/
@GetMapping(API_PREFIX + "/userInfo")
R<UserInfo> userInfo(@RequestParam("account") String account, @RequestParam("password") String password);

View File

@ -21,15 +21,17 @@ import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
/**
* 首页
* Desk启动器
*
* @author Chill
*/
@SpringCloudApplication
@EnableFeignClients(AppConstant.BASE_PACKAGES)
public class DeskApplication {
public static void main(String[] args) {
BladeApplication.run(AppConstant.APPLICATION_DESK_NAME, DeskApplication.class, args);
}
public static void main(String[] args) {
BladeApplication.run(AppConstant.APPLICATION_DESK_NAME, DeskApplication.class, args);
}
}

View File

@ -25,17 +25,22 @@ import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
/**
* Notice Feign
*
* @author Chill
*/
@ApiIgnore()
@RestController
@AllArgsConstructor
public class NoticeClient implements INoticeClient {
NoticeMapper mapper;
NoticeMapper mapper;
@Override
@Override
@GetMapping(API_PREFIX + "/top")
public R<List<Notice>> top(Integer number) {
return R.data(mapper.topList(number));
}
return R.data(mapper.topList(number));
}
}

View File

@ -22,15 +22,15 @@ import org.springblade.desk.entity.Notice;
import java.util.List;
/**
* Mapper 接口
* Mapper 接口
*
* @author Chill
* @since 2018-09-29
*/
public interface NoticeMapper extends BaseMapper<Notice> {
List<Notice> topList(Integer number);
List<Notice> topList(Integer number);
List<Notice> selectNoticePage(IPage page, Notice notice);
List<Notice> selectNoticePage(IPage page, Notice notice);
}

View File

@ -20,7 +20,7 @@ import org.springblade.core.mp.base.BaseService;
import org.springblade.desk.entity.Notice;
/**
* 服务类
* 服务类
*
* @author Chill
* @since 2018-09-29

View File

@ -23,7 +23,7 @@ import org.springblade.desk.service.INoticeService;
import org.springframework.stereotype.Service;
/**
* 服务实现类
* 服务实现类
*
* @author Chill
* @since 2018-09-29
@ -31,9 +31,9 @@ import org.springframework.stereotype.Service;
@Service
public class NoticeServiceImpl extends BaseServiceImpl<NoticeMapper, Notice> implements INoticeService {
@Override
public IPage<Notice> selectNoticePage(IPage<Notice> page, Notice notice) {
return page.setRecords(baseMapper.selectNoticePage(page, notice));
}
@Override
public IPage<Notice> selectNoticePage(IPage<Notice> page, Notice notice) {
return page.setRecords(baseMapper.selectNoticePage(page, notice));
}
}

View File

@ -19,7 +19,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import org.springblade.core.log.model.LogApi;
/**
* 服务类
* 服务类
*
* @author Chill
* @since 2018-09-26

View File

@ -19,7 +19,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import org.springblade.core.log.model.LogError;
/**
* 服务类
* 服务类
*
* @author Chill
* @since 2018-09-26

View File

@ -19,7 +19,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import org.springblade.core.log.model.LogUsual;
/**
* 服务类
* 服务类
*
* @author Chill
* @since 2018-10-12

View File

@ -22,7 +22,7 @@ import org.springblade.core.log.service.ILogApiService;
import org.springframework.stereotype.Service;
/**
* 服务实现类
* 服务实现类
*
* @author Chill
*/

View File

@ -22,7 +22,7 @@ import org.springblade.core.log.service.ILogErrorService;
import org.springframework.stereotype.Service;
/**
* 服务实现类
* 服务实现类
*
* @author Chill
* @since 2018-09-26

View File

@ -22,7 +22,7 @@ import org.springblade.core.log.service.ILogUsualService;
import org.springframework.stereotype.Service;
/**
* 服务实现类
* 服务实现类
*
* @author Chill
* @since 2018-10-12

View File

@ -66,9 +66,9 @@ public class CodeController extends BladeController {
*/
@GetMapping("/list")
@ApiImplicitParams({
@ApiImplicitParam(name="codeName", value = "模块名", paramType = "query", dataType = "string"),
@ApiImplicitParam(name="tableName", value = "表名", paramType = "query", dataType = "string"),
@ApiImplicitParam(name="modelName", value = "实体名", paramType = "query", dataType = "string")
@ApiImplicitParam(name = "codeName", value = "模块名", paramType = "query", dataType = "string"),
@ApiImplicitParam(name = "tableName", value = "表名", paramType = "query", dataType = "string"),
@ApiImplicitParam(name = "modelName", value = "实体名", paramType = "query", dataType = "string")
})
@ApiOperation(value = "分页", notes = "传入code", position = 2)
public R<IPage<CodeVO>> list(@ApiIgnore @RequestParam Map<String, Object> code, Query query) {

View File

@ -63,8 +63,8 @@ public class DictController extends BladeController {
*/
@GetMapping("/list")
@ApiImplicitParams({
@ApiImplicitParam(name="code", value = "字典编号", paramType = "query", dataType = "string"),
@ApiImplicitParam(name="dictValue", value = "字典名称", paramType = "query", dataType = "string")
@ApiImplicitParam(name = "code", value = "字典编号", paramType = "query", dataType = "string"),
@ApiImplicitParam(name = "dictValue", value = "字典名称", paramType = "query", dataType = "string")
})
@ApiOperation(value = "列表", notes = "传入dict", position = 2)
public R<List<INode>> list(@ApiIgnore @RequestParam Map<String, Object> dict) {

View File

@ -66,9 +66,9 @@ public class ParamController extends BladeController {
*/
@GetMapping("/list")
@ApiImplicitParams({
@ApiImplicitParam(name="paramName", value = "参数名称", paramType = "query", dataType = "string"),
@ApiImplicitParam(name="paramKey", value = "参数键名", paramType = "query", dataType = "string"),
@ApiImplicitParam(name="paramValue", value = "参数键值", paramType = "query", dataType = "string")
@ApiImplicitParam(name = "paramName", value = "参数名称", paramType = "query", dataType = "string"),
@ApiImplicitParam(name = "paramKey", value = "参数键名", paramType = "query", dataType = "string"),
@ApiImplicitParam(name = "paramValue", value = "参数键值", paramType = "query", dataType = "string")
})
@ApiOperation(value = "分页", notes = "传入param", position = 2)
public R<IPage<ParamVO>> list(@ApiIgnore @RequestParam Map<String, Object> param, Query query) {

View File

@ -29,20 +29,13 @@ import org.springblade.system.vo.ParamVO;
* @since 2018-12-28
*/
@AllArgsConstructor
public class ParamWrapper extends BaseEntityWrapper<Param, ParamVO> {
public class ParamWrapper extends BaseEntityWrapper<Param, ParamVO> {
private IDictClient dictClient;
@Override
public ParamVO entityVO(Param param) {
ParamVO paramVO = BeanUtil.copy(param, ParamVO.class);
/*R<String> dict = dictClient.getValue("param" , paramVO.getCategory());
if (dict.isSuccess()) {
String categoryName = dict.getData();
paramVO.setCategoryName(categoryName);
}*/
return paramVO;
}