|
@@ -1,34 +1,26 @@
|
|
|
package com.ydd.app.controller;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
-import com.ydd.app.dto.ShopReq;
|
|
|
import com.ydd.app.dto.StoreDto;
|
|
|
import com.ydd.app.dto.StoreStatusDto;
|
|
|
-import com.ydd.app.service.ApiShopService;
|
|
|
import com.ydd.app.service.ApiStoreService;
|
|
|
import com.ydd.common.annotation.AccessToken;
|
|
|
+import com.ydd.common.annotation.ControllerLog;
|
|
|
import com.ydd.common.core.controller.BaseController;
|
|
|
import com.ydd.common.core.domain.BaseResult;
|
|
|
-import com.ydd.common.core.page.PageResult;
|
|
|
+import com.ydd.common.core.domain.ResponseResult;
|
|
|
import com.ydd.common.utils.StringUtils;
|
|
|
import com.ydd.module.domain.Shop;
|
|
|
-import com.ydd.module.dto.ShopDto;
|
|
|
-import com.ydd.module.dto.ShopSelectDto;
|
|
|
import com.ydd.module.expection.CustomAppException;
|
|
|
import io.swagger.annotations.Api;
|
|
|
-import io.swagger.annotations.ApiImplicitParam;
|
|
|
-import io.swagger.annotations.ApiImplicitParams;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
-import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
-import java.util.List;
|
|
|
-
|
|
|
/**
|
|
|
* Project:lb-server
|
|
|
* Class:ShopApi
|
|
@@ -52,10 +44,10 @@ public class StoreApi extends BaseController {
|
|
|
@ApiOperation("新增门店")
|
|
|
@RequestMapping(value = "/create", method = RequestMethod.POST)
|
|
|
@AccessToken
|
|
|
- public BaseResult saveShop(StoreDto storeDto) {
|
|
|
- logger.info("创建门店参数---" + JSONObject.toJSONString(storeDto));
|
|
|
+ @ControllerLog("开放接口-创建门店")
|
|
|
+ public ResponseResult saveShop(StoreDto storeDto) {
|
|
|
Shop shop = apiStoreService.saveShop(getLoginId(), storeDto, false);
|
|
|
- return BaseResult.success((Object) shop.getCode());
|
|
|
+ return ResponseResult.success(shop.getCode());
|
|
|
}
|
|
|
|
|
|
|
|
@@ -65,19 +57,19 @@ public class StoreApi extends BaseController {
|
|
|
@ApiOperation("更新门店资料")
|
|
|
@RequestMapping(value = "/update", method = RequestMethod.POST)
|
|
|
@AccessToken
|
|
|
- public BaseResult modify(StoreDto shopReq) {
|
|
|
- logger.info("-----更新门店资料-提交数据----" + JSONObject.toJSONString(shopReq));
|
|
|
+ @ControllerLog("开放接口-更新门店")
|
|
|
+ public ResponseResult modify(StoreDto shopReq) {
|
|
|
Shop shop = apiStoreService.modify(getLoginId(), shopReq);
|
|
|
- return BaseResult.success((Object) shop.getCode());
|
|
|
+ return ResponseResult.success(shop.getCode());
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 第三方审核修改
|
|
|
*/
|
|
|
@ApiOperation("门店运力禁用")
|
|
|
@RequestMapping(value = "/delivery/status", method = RequestMethod.POST)
|
|
|
@AccessToken
|
|
|
+ @ControllerLog("开放接口-门店运力禁用")
|
|
|
public BaseResult changeShopDelivery(@Validated StoreStatusDto dto) {
|
|
|
try {
|
|
|
if (StringUtils.isNotBlank(dto.getDeliveryIdStr())) {
|
|
@@ -86,7 +78,6 @@ public class StoreApi extends BaseController {
|
|
|
} else {
|
|
|
return BaseResult.error("运力id不能为空");
|
|
|
}
|
|
|
-
|
|
|
} catch (CustomAppException e) {
|
|
|
return BaseResult.error(e.getMessage());
|
|
|
}
|
|
@@ -95,6 +86,7 @@ public class StoreApi extends BaseController {
|
|
|
@ApiOperation("门店运力查询")
|
|
|
@RequestMapping(value = "/delivery", method = RequestMethod.POST)
|
|
|
@AccessToken
|
|
|
+ @ControllerLog("开放接口-门店运力查询")
|
|
|
public BaseResult delivery(@Validated StoreStatusDto dto) {
|
|
|
try {
|
|
|
if (StringUtils.isNotBlank(dto.getDeliveryIdStr())) {
|
|
@@ -103,9 +95,9 @@ public class StoreApi extends BaseController {
|
|
|
} else {
|
|
|
return BaseResult.error("运力id不能为空");
|
|
|
}
|
|
|
-
|
|
|
} catch (CustomAppException e) {
|
|
|
return BaseResult.error(e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
}
|