fead&fix: 1.0.0

1. 新增组最大分区,用于在创建组限制其所能选的最大的分区
2. 修复了迁移代码包影响全局返回的扫描路径
This commit is contained in:
byteblogs168 2023-04-21 09:36:22 +08:00
parent a731ad70e2
commit aab93f7b44
7 changed files with 32 additions and 9 deletions

View File

@ -152,7 +152,7 @@ CREATE TABLE `system_user`
UNIQUE KEY `uk_username` (`username`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='系统用户表';
INSERT INTO x_retry.system_user (username, password, role)
INSERT INTO system_user (username, password, role)
VALUES ('admin', 'cdf4a007e2b02a0c49fc9b7ccfbb8a10c644f635e1765dcf2a7ab794ddc7edac', 2);
CREATE TABLE `system_user_permission`

View File

@ -14,7 +14,7 @@ import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice;
import java.lang.annotation.Annotation;
@Slf4j
@ControllerAdvice(basePackages = {"com.x.retry.client.core", "com.x.retry.server"})
@ControllerAdvice(basePackages = {"com.aizuda.easy.retry.client.core", "com.aizuda.easy.retry.server"})
public class GlobalRestfulResponseBodyAdvice implements ResponseBodyAdvice<Object> {
@Override
@ -40,4 +40,4 @@ public class GlobalRestfulResponseBodyAdvice implements ResponseBodyAdvice<Objec
return true;
}
}
}

View File

@ -1,5 +1,6 @@
package com.aizuda.easy.retry.server.web.controller;
import com.aizuda.easy.retry.server.config.SystemProperties;
import com.aizuda.easy.retry.server.service.GroupConfigService;
import com.aizuda.easy.retry.server.web.model.base.PageResult;
import com.aizuda.easy.retry.server.web.model.request.GroupConfigQueryVO;
@ -23,6 +24,8 @@ public class GroupConfigController {
@Autowired
private GroupConfigService groupConfigService;
@Autowired
private SystemProperties systemProperties;
@LoginRequired(role = RoleEnum.ADMIN)
@PostMapping("")
@ -54,4 +57,12 @@ public class GroupConfigController {
return groupConfigService.getAllGroupNameList();
}
@LoginRequired
@GetMapping("/partition")
public Integer getTotalPartition() {
// 组分区从0开始,所以是最大值减一
return systemProperties.getTotalPartition() - 1;
}
}

View File

@ -30,7 +30,7 @@ import java.util.Objects;
@Configuration
public class AuthenticationInterceptor implements HandlerInterceptor {
public static final String AUTHENTICATION = "easy-retry-AUTH";
public static final String AUTHENTICATION = "EASY-RETRY-AUTH";
@Autowired
private SystemUserMapper systemUserMapper;

View File

@ -30,12 +30,19 @@ const api = {
countDispatch: '/dashboard/dispatch/count',
countActivePod: '/dashboard/active-pod/count',
rankSceneQuantity: '/dashboard/scene/rank',
lineDispatchQuantity: '/dashboard/dispatch/line'
lineDispatchQuantity: '/dashboard/dispatch/line',
totalPartition: '/group/partition'
}
export default api
export function getTotalPartition () {
return request({
url: api.totalPartition,
method: 'get'
})
}
export function getLineDispatchQuantity (parameter) {
return request({
url: api.lineDispatchQuantity,

View File

@ -47,7 +47,7 @@ request.interceptors.request.use(config => {
// 如果 token 存在
// 让每个请求携带自定义 token 请根据实际情况自行修改
if (token) {
config.headers['easy-retry-AUTH'] = token
config.headers['EASY-RETRY-AUTH'] = token
}
return config
}, errorHandler)

View File

@ -64,7 +64,7 @@
'groupPartition'
]"
:min="0"
:max="10"
:max="maxGroupPartition"
/>
</a-form-item>
</a-col>
@ -76,7 +76,7 @@
</template>
<script>
import { getGroupConfigByGroupName } from '@/api/manage'
import { getGroupConfigByGroupName, getTotalPartition } from '@/api/manage'
import pick from 'lodash.pick'
export default {
@ -90,6 +90,7 @@ export default {
data () {
return {
form: this.$form.createForm(this),
maxGroupPartition: 32,
routeKey: {
'1': '一致性hash算法',
'2': '随机算法',
@ -99,6 +100,10 @@ export default {
},
mounted () {
this.$nextTick(() => {
getTotalPartition().then(res => {
this.maxGroupPartition = res.data
})
const groupName = this.$route.query.groupName
if (groupName) {
getGroupConfigByGroupName(groupName).then(res => {