Commit 49ea908a by 墨竹

refactor:代码优化

parent 6055960d
...@@ -176,13 +176,19 @@ public class TestController extends WebBaseController { ...@@ -176,13 +176,19 @@ public class TestController extends WebBaseController {
/** /**
* 获取到分表到哪个表内 * 获取到分表到哪个表内
* *
* @param enterpriseId * @param tableId 分表id
* @param count * @param count 分表数量
* @return * @return
*/ */
@RequestMapping("/test-table") @RequestMapping("/test-table")
public HaobanResponse testTable(String enterpriseId, int count) { public HaobanResponse testTable(String tableId, Integer count) {
int i = enterpriseId.hashCode() % count; if (StringUtils.isBlank(tableId)) {
return resultResponse(HaoBanErrCode.ERR_5);
}
if (count == null) {
return resultResponse(HaoBanErrCode.ERR_5);
}
int i = tableId.hashCode() % count;
return resultResponse(HaoBanErrCode.ERR_1, i); return resultResponse(HaoBanErrCode.ERR_1, i);
} }
} }
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