Browse Source

新增商家域名设置接口业务功能

multiwx
dy-hu 5 days ago
parent
commit
2b7e611b45
  1. 18
      cereshop-admin/src/main/java/com/shop/cereshop/admin/controller/BusinessController.java
  2. 3
      cereshop-admin/src/main/java/com/shop/cereshop/admin/dao/business/CerePlatformBusinessDAO.java
  3. 37
      cereshop-admin/src/main/java/com/shop/cereshop/admin/page/business/BusinessDomainSet.java
  4. 12
      cereshop-admin/src/main/java/com/shop/cereshop/admin/param/business/BusinessUpdateParam.java
  5. 3
      cereshop-admin/src/main/java/com/shop/cereshop/admin/service/business/CerePlatformBusinessService.java
  6. 6
      cereshop-admin/src/main/java/com/shop/cereshop/admin/service/business/impl/CerePlatformBusinessServiceImpl.java
  7. 6
      cereshop-admin/src/main/resources/mybatis/mapper/business/CerePlatformBusinessDAO.xml
  8. 7
      cereshop-app/src/main/java/com/shop/cereshop/app/interceptor/AuthorizationInterceptor.java

18
cereshop-admin/src/main/java/com/shop/cereshop/admin/controller/BusinessController.java

@ -7,8 +7,10 @@ package com.shop.cereshop.admin.controller;
import com.shop.cereshop.admin.annotation.NoRepeatSubmit;
import com.shop.cereshop.admin.annotation.NoRepeatWebLog;
import com.shop.cereshop.admin.page.business.BusinessDomainSet;
import com.shop.cereshop.admin.page.business.BusinessGetAll;
import com.shop.cereshop.admin.param.business.*;
import com.shop.cereshop.admin.param.sharesetting.ShareSettingUpdateParam;
import com.shop.cereshop.admin.service.business.CerePlatformBusinessService;
import com.shop.cereshop.admin.service.business.CerePlatformBusinessUserService;
import com.shop.cereshop.admin.utils.ContextUtil;
@ -162,4 +164,20 @@ public class BusinessController {
Boolean result = cerePlatformBusinessService.cleanShop(param.getBusinessId());
return new Result(result);
}
/**
* 修改商家域名
* @param label
* @return
*/
@PostMapping(value = "updateDomain")
@NoRepeatSubmit
@ApiOperation(value = "修改商家域名")
@NoRepeatWebLog
public Result updateDomain(@RequestBody BusinessDomainSet label, HttpServletRequest request){
//获取当前登录账户
CerePlatformUser user = (CerePlatformUser) request.getAttribute("user");
cerePlatformBusinessService.updateDomain(label);
return new Result(user.getUsername(),"修改商家域名", GsonUtil.objectToGson(label));
}
}

3
cereshop-admin/src/main/java/com/shop/cereshop/admin/dao/business/CerePlatformBusinessDAO.java

@ -7,6 +7,7 @@ package com.shop.cereshop.admin.dao.business;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.shop.cereshop.admin.page.business.Business;
import com.shop.cereshop.admin.page.business.BusinessDomainSet;
import com.shop.cereshop.admin.page.business.BusinessGetAll;
import com.shop.cereshop.admin.page.finance.Finance;
import com.shop.cereshop.admin.param.business.BusinessGetAllParam;
@ -66,4 +67,6 @@ public interface CerePlatformBusinessDAO extends BaseMapper<CerePlatformBusiness
Boolean cleanShop(Long businessId);
List<CerePlatformBusiness> getByIdList(@Param("businessIdList") List<Long> businessIdList);
void updateDomain(BusinessDomainSet domainSet);
}

37
cereshop-admin/src/main/java/com/shop/cereshop/admin/page/business/BusinessDomainSet.java

@ -0,0 +1,37 @@
/*
* Copyright (C) 2017-2021
* All rights reserved, Designed By 深圳中科鑫智科技有限公司
* Copyright authorization contact 18814114118
*/
package com.shop.cereshop.admin.page.business;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 商家域名设置
*/
@Data
@ApiModel(value = "BusinessDomainSet", description = "商家域名设置")
public class BusinessDomainSet{
/**
* 商家用户id
*/
@ApiModelProperty(value = "商家id")
private Long businessId;
/**
* 商家账号
*/
@ApiModelProperty(value = "PC端商城域名")
private String pcDomain;
/**
* 商家密码
*/
@ApiModelProperty(value = "移动端商城域名")
private String mobileDomain;
}

12
cereshop-admin/src/main/java/com/shop/cereshop/admin/param/business/BusinessUpdateParam.java

@ -93,4 +93,16 @@ public class BusinessUpdateParam {
*/
@ApiModelProperty(value = "审核直播间商品 1-开启 0-关闭")
private Integer auditLiveProduct;
/**
* PC端商城域名
*/
@ApiModelProperty(value = "PC端商城域名")
private String pcDomain;
/**
* 移动端商城域名
*/
@ApiModelProperty(value = "移动端商城域名")
private String mobileDomain;
}

3
cereshop-admin/src/main/java/com/shop/cereshop/admin/service/business/CerePlatformBusinessService.java

@ -6,6 +6,7 @@
package com.shop.cereshop.admin.service.business;
import com.shop.cereshop.admin.page.business.Business;
import com.shop.cereshop.admin.page.business.BusinessDomainSet;
import com.shop.cereshop.admin.page.business.BusinessGetAll;
import com.shop.cereshop.admin.page.finance.FinanceCount;
import com.shop.cereshop.admin.param.business.BusinessGetAllParam;
@ -54,4 +55,6 @@ public interface CerePlatformBusinessService {
Boolean cleanShop(Long businessId);
List<CerePlatformBusiness> getByIdList(List<Long> businessIdList);
void updateDomain(BusinessDomainSet domainSet);
}

6
cereshop-admin/src/main/java/com/shop/cereshop/admin/service/business/impl/CerePlatformBusinessServiceImpl.java

@ -9,6 +9,7 @@ import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.shop.cereshop.admin.dao.business.CerePlatformBusinessDAO;
import com.shop.cereshop.admin.page.business.Business;
import com.shop.cereshop.admin.page.business.BusinessDomainSet;
import com.shop.cereshop.admin.page.business.BusinessGetAll;
import com.shop.cereshop.admin.page.finance.Finance;
import com.shop.cereshop.admin.page.finance.FinanceCount;
@ -274,4 +275,9 @@ public class CerePlatformBusinessServiceImpl implements CerePlatformBusinessServ
public List<CerePlatformBusiness> getByIdList(List<Long> businessIdList){
return cerePlatformBusinessDAO.getByIdList(businessIdList);
}
@Override
public void updateDomain(BusinessDomainSet domainSet) {
cerePlatformBusinessDAO.updateDomain(domainSet);
}
}

6
cereshop-admin/src/main/resources/mybatis/mapper/business/CerePlatformBusinessDAO.xml

@ -318,7 +318,7 @@
SELECT a.business_id, a.business_code, a.business_name, a.business_brief, a.business_phone, a.charge_person_name,
a.charge_person_phone, a.business_adress, a.effective_date, a.effective_year, a.contract_state,
a.authentication_state, a.check_state, a.`state`, a.authen_type, a.create_time, a.update_time,
a.audit_live, a.audit_live_product,
a.audit_live, a.audit_live_product,a.pc_domain,a.mobile_domain,
b.business_user_id, c.password businessPassword
FROM cere_platform_business a
INNER JOIN cere_business_user b ON a.business_id = b.business_id AND b.is_main_user = 1
@ -493,4 +493,8 @@
</foreach>
)
</select>
<update id="updateDomain" parameterType="com.shop.cereshop.admin.page.business.BusinessDomainSet">
update cere_platform_business set pc_domain=#{pcDomain}, mobile_domain=#{mobileDomain} where business_id = #{businessId}
</update>
</mapper>

7
cereshop-app/src/main/java/com/shop/cereshop/app/interceptor/AuthorizationInterceptor.java

@ -126,7 +126,7 @@ public class AuthorizationInterceptor extends HandlerInterceptorAdapter {
String project = "";
//获取访问的二级域名
/* String subDomain = getSubDomain(request);
String subDomain = getSubDomain(request);
if (ObjectUtil.isNotEmpty(subDomain)){
//从商家设置的商城访问域名表中获取商家id即project
CerePlatformBusiness business = cerePlatformBusinessDAO.findByDomain(subDomain);
@ -135,9 +135,9 @@ public class AuthorizationInterceptor extends HandlerInterceptorAdapter {
}
}else {
project = request.getHeader("project");
}*/
}
project = request.getHeader("project");
//project = request.getHeader("project");
if (EmptyUtils.isEmpty(project) || project.equals("undefined")) {
project = "0";
@ -205,6 +205,7 @@ public class AuthorizationInterceptor extends HandlerInterceptorAdapter {
* @return
*/
private String getSubDomain(HttpServletRequest request) {
//String host = request.getServerName();
String host = request.getHeader("Host");
String[] parts = host.split("\\.");
if (parts.length >= 3){

Loading…
Cancel
Save