Commit 6e2dc63c by guojuxing

微盟商城店铺增删改接口

parent e4a277da
package com.gic.enterprise.web.controller.wm;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.enterprise.constant.MallModeEnum;
import com.gic.enterprise.utils.ResultControllerUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.download.utils.OperationResultUtils;
import com.gic.enterprise.dto.WmStoreDTO;
import com.gic.enterprise.service.WmStoreApiService;
import com.gic.enterprise.utils.UserDetailUtils;
import java.util.HashMap;
import java.util.Map;
@RestController
@RequestMapping("/wm-mall-store")
public class WmMallStoreController {
private final static Logger LOGGER = LogManager.getLogger(WmMallStoreController.class);
@Autowired
private WmStoreApiService wmStoreApiService;
@RequestMapping("/save-wm-store")
public RestResponse save(WmStoreDTO dto) {
dto.setEnterpriseId(UserDetailUtils.getUserDetail().getEnterpriseId());
return OperationResultUtils.operationResult(wmStoreApiService.saveWmStore(dto),
OperationResultUtils.LOG_NEW + "微盟商城店铺", dto.getWmPidName());
}
@RequestMapping("/edit-wm-store")
public RestResponse edit(WmStoreDTO dto) {
return OperationResultUtils.operationResult(wmStoreApiService.modifyWmStore(dto),
OperationResultUtils.LOG_EDIT + "微盟商城店铺", dto.getWmPidName());
}
@RequestMapping("/get-wm-store-detail")
public RestResponse getDetail(Integer wmMallStoreId) {
return ResultControllerUtils.commonResult(wmStoreApiService.getWmStoreByWmMallStoreId(wmMallStoreId));
}
@RequestMapping("/list-wm-store")
public RestResponse listWmStore() {
return ResultControllerUtils
.commonResult(wmStoreApiService.listWmStore(UserDetailUtils.getUserDetail().getEnterpriseId()));
}
/**
* 授权
* @Title: authWmStore

* @Description:

* @author guojuxing
* @param wmMallStoreId

* @return com.gic.commons.webapi.reponse.RestResponse


*/
@RequestMapping("/auth-wm-store")
public RestResponse authWmStore(Integer wmMallStoreId) {
ServiceResponse<String> result = wmStoreApiService.authWmStore(wmMallStoreId);
return OperationResultUtils.operationResult(result, "授权微盟商城店铺",
OperationResultUtils.getOperationObject(result));
}
@RequestMapping("/list-mall-mode")
public RestResponse listMallMode() {
Map<String, String> result = new HashMap<>(16);
for (MallModeEnum modeEnum : MallModeEnum.values()) {
result.put(String.valueOf(modeEnum.getCode()), modeEnum.getMsg());
}
return RestResponse.success(result);
}
}
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