Commit 77f0f11f by guojuxing

分组策略

parent 43dadca6
......@@ -214,7 +214,7 @@ public class StoreStrategyApiServiceImpl implements StoreStrategyApiService{
public ServiceResponse getStoreGroupStrategyWeight(Integer enterpriseId) {
Object value = RedisUtil.getCache("enterprise:store:storeGroupStrategy:"+enterpriseId);
if(value == null){
ServiceResponse.success(0);
return ServiceResponse.success(0);
}
return ServiceResponse.success(Integer.valueOf(value.toString()));
}
......
......@@ -4,6 +4,7 @@ import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.store.constant.CreateTypeEnum;
import com.gic.store.constant.StoreFieldTypeEnum;
import com.gic.store.constant.StoreGroupConstant;
import com.gic.store.constant.StrategyStoreFieldEnum;
......@@ -98,6 +99,15 @@ public class StoreStrategyController {
return RestResponse.success(result.getResult());
}
@RequestMapping("/list-store-create-type")
public RestResponse listStoreCreateType() {
Map<Integer, String> result = new HashMap<>(16);
for (CreateTypeEnum createTypeEnum : CreateTypeEnum.values()) {
result.put(createTypeEnum.getCode(), createTypeEnum.getMessage());
}
return RestResponse.success(result);
}
@RequestMapping("/edit-store-strategy")
public RestResponse editStoreStrategy(@Validated({StoreStrategyQO.SaveValidView.class, StoreStrategyQO.RemoveValidView.class})
......@@ -182,7 +192,7 @@ public class StoreStrategyController {
@RequestMapping("/update-store-strategy-weights")
public RestResponse updateWeight(Integer weight) {
if (weight == null) {
RestResponse.failure(ErrorCode.ERR_5.getCode(), "参数错误");
return RestResponse.failure(ErrorCode.ERR_5.getCode(), "参数错误");
}
ServiceResponse<Integer> result = storeStrategyApiService.setStoreGroupStrategyWeight(StoreGroupConstant.TEST_ENTERPRISE_ID, weight);
return RestResponse.success(result.getResult());
......
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