Commit f82f93f4 by guojuxing

商品资源开关修改

parent 12dd9996
......@@ -45,6 +45,8 @@ public interface EnterpriseApiService {

 */
ServiceResponse<Integer> editEnterprise(EnterpriseDTO enterpriseDTO);
ServiceResponse<String> editResourceSwitch(Integer enterpriseId, String resources);
/**
* 修改商户信息
* @Title: editEnterpriseInfo

......
......@@ -159,6 +159,19 @@ public class EnterpriseApiServiceImpl implements EnterpriseApiService {
}
@Override
public ServiceResponse<String> editResourceSwitch(Integer enterpriseId, String resources) {
TabEnterprise tabEnterprise = enterpriseService.getEnterpriseById(enterpriseId);
if (tabEnterprise == null) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "商户ID错误,查询不到数据");
}
EnterpriseDTO dto = new EnterpriseDTO();
dto.setEnterpriseId(enterpriseId);
dto.setGoodsResource(Integer.parseInt(resources));
enterpriseService.editEnterprise(dto);
return ServiceResponse.success(tabEnterprise.getEnterpriseName());
}
@Override
public ServiceResponse<Integer> editEnterpriseInfo(EnterpriseDTO enterpriseDTO) {
TabEnterprise tabEnterprise = enterpriseService.getEnterpriseById(enterpriseDTO.getEnterpriseId());
if (tabEnterprise == null) {
......
......@@ -193,6 +193,11 @@ public class EnterpriseController {
return ResultControllerUtils.commonResult(enterpriseApiService.editEnterprise(enterpriseDTO));
}
@RequestMapping("/edit-resource-switch")
public RestResponse editResourceSwitch(Integer enterpriseId, String resources) {
return ResultControllerUtils.commonResult(enterpriseApiService.editResourceSwitch(enterpriseId, resources));
}
@RequestMapping("/modify-enterprise-logo")
public RestResponse modifyEnterpriseLogo(Integer enterpriseId, String logoUrl) {
return ResultControllerUtils.commonResult(enterpriseApiService.modifyEnterpriseLogo(enterpriseId, logoUrl));
......
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