Skip to content

Commit 43df127

Browse files
author
smallchill
committed
🎉 2.2.3.RELEASE
1 parent 2e71e38 commit 43df127

File tree

28 files changed

+506
-40
lines changed

28 files changed

+506
-40
lines changed

blade-auth/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<parent>
99
<artifactId>SpringBlade</artifactId>
1010
<groupId>org.springblade</groupId>
11-
<version>2.2.1</version>
11+
<version>2.2.3</version>
1212
</parent>
1313

1414
<artifactId>blade-auth</artifactId>

blade-common/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>SpringBlade</artifactId>
77
<groupId>org.springblade</groupId>
8-
<version>2.2.1</version>
8+
<version>2.2.3</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

blade-gateway/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>SpringBlade</artifactId>
77
<groupId>org.springblade</groupId>
8-
<version>2.2.1</version>
8+
<version>2.2.3</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

blade-ops/blade-admin/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>blade-ops</artifactId>
77
<groupId>org.springblade</groupId>
8-
<version>2.2.1</version>
8+
<version>2.2.3</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

blade-ops/blade-develop/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>org.springblade</groupId>
88
<artifactId>blade-ops</artifactId>
9-
<version>2.2.1</version>
9+
<version>2.2.3</version>
1010
</parent>
1111

1212
<modelVersion>4.0.0</modelVersion>
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
/**
2+
* Copyright (c) 2018-2028, Chill Zhuang 庄骞 ([email protected]).
3+
* <p>
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
* <p>
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
* <p>
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package org.springblade.system.controller;
17+
18+
import io.swagger.annotations.Api;
19+
import io.swagger.annotations.ApiOperation;
20+
import io.swagger.annotations.ApiParam;
21+
import lombok.AllArgsConstructor;
22+
import javax.validation.Valid;
23+
24+
import org.springblade.core.mp.support.Condition;
25+
import org.springblade.core.mp.support.Query;
26+
import org.springblade.system.feign.IDictClient;
27+
import org.springblade.core.tool.api.R;
28+
import org.springblade.core.tool.utils.Func;
29+
import org.springframework.web.bind.annotation.*;
30+
import org.springframework.web.bind.annotation.RequestParam;
31+
import com.baomidou.mybatisplus.core.metadata.IPage;
32+
import org.springblade.system.entity.Tenant;
33+
import org.springblade.system.vo.TenantVO;
34+
import org.springblade.system.wrapper.TenantWrapper;
35+
import org.springblade.system.service.ITenantService;
36+
import org.springblade.core.boot.ctrl.BladeController;
37+
import java.util.List;
38+
39+
/**
40+
* 控制器
41+
*
42+
* @author Blade
43+
* @since 2019-04-17
44+
*/
45+
@RestController
46+
@AllArgsConstructor
47+
@RequestMapping("/tenant")
48+
@Api(value = "", tags = "接口")
49+
public class TenantController extends BladeController {
50+
51+
private ITenantService tenantService;
52+
53+
private IDictClient dictClient;
54+
55+
/**
56+
* 详情
57+
*/
58+
@GetMapping("/detail")
59+
@ApiOperation(value = "详情", notes = "传入tenant", position = 1)
60+
public R<TenantVO> detail(Tenant tenant) {
61+
Tenant detail = tenantService.getOne(Condition.getQueryWrapper(tenant));
62+
TenantWrapper tenantWrapper = new TenantWrapper(dictClient);
63+
return R.data(tenantWrapper.entityVO(detail));
64+
}
65+
66+
/**
67+
* 分页
68+
*/
69+
@GetMapping("/list")
70+
@ApiOperation(value = "分页", notes = "传入tenant", position = 2)
71+
public R<IPage<TenantVO>> list(Tenant tenant, Query query) {
72+
IPage<Tenant> pages = tenantService.page(Condition.getPage(query), Condition.getQueryWrapper(tenant));
73+
TenantWrapper tenantWrapper = new TenantWrapper(dictClient);
74+
return R.data(tenantWrapper.pageVO(pages));
75+
}
76+
77+
/**
78+
* 自定义分页
79+
*/
80+
@GetMapping("/page")
81+
@ApiOperation(value = "分页", notes = "传入tenant", position = 3)
82+
public R<IPage<TenantVO>> page(TenantVO tenant, Query query) {
83+
IPage<TenantVO> pages = tenantService.selectTenantPage(Condition.getPage(query), tenant);
84+
return R.data(pages);
85+
}
86+
87+
/**
88+
* 新增
89+
*/
90+
@PostMapping("/save")
91+
@ApiOperation(value = "新增", notes = "传入tenant", position = 4)
92+
public R save(@Valid @RequestBody Tenant tenant) {
93+
return R.status(tenantService.save(tenant));
94+
}
95+
96+
/**
97+
* 修改
98+
*/
99+
@PostMapping("/update")
100+
@ApiOperation(value = "修改", notes = "传入tenant", position = 5)
101+
public R update(@Valid @RequestBody Tenant tenant) {
102+
return R.status(tenantService.updateById(tenant));
103+
}
104+
105+
/**
106+
* 新增或修改
107+
*/
108+
@PostMapping("/submit")
109+
@ApiOperation(value = "新增或修改", notes = "传入tenant", position = 6)
110+
public R submit(@Valid @RequestBody Tenant tenant) {
111+
return R.status(tenantService.saveOrUpdate(tenant));
112+
}
113+
114+
115+
/**
116+
* 删除
117+
*/
118+
@PostMapping("/remove")
119+
@ApiOperation(value = "逻辑删除", notes = "传入ids", position = 7)
120+
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
121+
return R.status(tenantService.deleteLogic(Func.toIntList(ids)));
122+
}
123+
124+
125+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/**
2+
* Copyright (c) 2018-2028, Chill Zhuang 庄骞 ([email protected]).
3+
* <p>
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
* <p>
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
* <p>
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package org.springblade.system.dto;
17+
18+
import org.springblade.system.entity.Tenant;
19+
import lombok.Data;
20+
import lombok.EqualsAndHashCode;
21+
22+
/**
23+
* 数据传输对象实体类
24+
*
25+
* @author Blade
26+
* @since 2019-04-17
27+
*/
28+
@Data
29+
@EqualsAndHashCode(callSuper = true)
30+
public class TenantDTO extends Tenant {
31+
private static final long serialVersionUID = 1L;
32+
33+
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/**
2+
* Copyright (c) 2018-2028, Chill Zhuang 庄骞 ([email protected]).
3+
* <p>
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
* <p>
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
* <p>
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package org.springblade.system.entity;
17+
18+
import com.baomidou.mybatisplus.annotation.TableName;
19+
import org.springblade.core.mp.base.BaseEntity;
20+
import lombok.Data;
21+
import lombok.EqualsAndHashCode;
22+
import io.swagger.annotations.ApiModel;
23+
import io.swagger.annotations.ApiModelProperty;
24+
25+
/**
26+
* 实体类
27+
*
28+
* @author Blade
29+
* @since 2019-04-17
30+
*/
31+
@Data
32+
@TableName("blade_tenant")
33+
@EqualsAndHashCode(callSuper = true)
34+
@ApiModel(value = "Tenant对象", description = "Tenant对象")
35+
public class Tenant extends BaseEntity {
36+
37+
private static final long serialVersionUID = 1L;
38+
39+
/**
40+
* 租户名称
41+
*/
42+
@ApiModelProperty(value = "租户名称")
43+
private String tenantName;
44+
/**
45+
* 联系人
46+
*/
47+
@ApiModelProperty(value = "联系人")
48+
private String linkman;
49+
/**
50+
* 联系电话
51+
*/
52+
@ApiModelProperty(value = "联系电话")
53+
private String contactNumber;
54+
/**
55+
* 联系地址
56+
*/
57+
@ApiModelProperty(value = "联系地址")
58+
private String address;
59+
60+
61+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/**
2+
* Copyright (c) 2018-2028, Chill Zhuang 庄骞 ([email protected]).
3+
* <p>
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
* <p>
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
* <p>
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package org.springblade.system.mapper;
17+
18+
import org.springblade.system.entity.Tenant;
19+
import org.springblade.system.vo.TenantVO;
20+
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
21+
import com.baomidou.mybatisplus.core.metadata.IPage;
22+
import java.util.List;
23+
24+
/**
25+
* Mapper 接口
26+
*
27+
* @author Blade
28+
* @since 2019-04-17
29+
*/
30+
public interface TenantMapper extends BaseMapper<Tenant> {
31+
32+
/**
33+
* 自定义分页
34+
*
35+
* @param page
36+
* @param tenant
37+
* @return
38+
*/
39+
List<TenantVO> selectTenantPage(IPage page, TenantVO tenant);
40+
41+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3+
<mapper namespace="org.springblade.system.mapper.TenantMapper">
4+
5+
<!-- 通用查询映射结果 -->
6+
<resultMap id="tenantResultMap" type="org.springblade.system.entity.Tenant">
7+
<result column="id" property="id"/>
8+
<result column="create_user" property="createUser"/>
9+
<result column="create_time" property="createTime"/>
10+
<result column="update_user" property="updateUser"/>
11+
<result column="update_time" property="updateTime"/>
12+
<result column="status" property="status"/>
13+
<result column="is_deleted" property="isDeleted"/>
14+
<result column="tenant_name" property="tenantName"/>
15+
<result column="linkman" property="linkman"/>
16+
<result column="contact_number" property="contactNumber"/>
17+
<result column="address" property="address"/>
18+
</resultMap>
19+
20+
21+
<select id="selectTenantPage" resultMap="tenantResultMap">
22+
select * from blade_tenant where is_deleted = 0
23+
</select>
24+
25+
</mapper>
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/**
2+
* Copyright (c) 2018-2028, Chill Zhuang 庄骞 ([email protected]).
3+
* <p>
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
* <p>
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
* <p>
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package org.springblade.system.service;
17+
18+
import org.springblade.system.entity.Tenant;
19+
import org.springblade.system.vo.TenantVO;
20+
import org.springblade.core.mp.base.BaseService;
21+
import com.baomidou.mybatisplus.core.metadata.IPage;
22+
23+
/**
24+
* 服务类
25+
*
26+
* @author Blade
27+
* @since 2019-04-17
28+
*/
29+
public interface ITenantService extends BaseService<Tenant> {
30+
31+
/**
32+
* 自定义分页
33+
*
34+
* @param page
35+
* @param tenant
36+
* @return
37+
*/
38+
IPage<TenantVO> selectTenantPage(IPage<TenantVO> page, TenantVO tenant);
39+
40+
}

0 commit comments

Comments
 (0)