Browse Source

resi_mine,增加app/footbars接口,用于获取footbar

dev_shibei_match
wxz 5 years ago
parent
commit
97c97299bf
  1. 8
      epmet-module/gov-mine/gov-mine-client/src/main/java/com/epmet/dto/form/GovFootBarFormDTO.java
  2. 11
      epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/AppController.java
  3. 21
      epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/OperCustomizeFeignClient.java
  4. 22
      epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/OperCustomizeFeignClientFallBack.java
  5. 11
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java
  6. 11
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java
  7. 4
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerFootBarEntity.java
  8. 6
      epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFootBarDao.xml
  9. 10
      epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/ResiFootBarFormDTO.java
  10. 7
      epmet-module/resi-mine/resi-mine-server/pom.xml
  11. 39
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/app/controller/AppController.java

8
epmet-module/gov-mine/gov-mine-client/src/main/java/com/epmet/dto/form/FootBarFormDTO.java → epmet-module/gov-mine/gov-mine-client/src/main/java/com/epmet/dto/form/GovFootBarFormDTO.java

@ -5,11 +5,7 @@ import lombok.Data;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
@Data @Data
public class FootBarFormDTO { public class GovFootBarFormDTO {
//@NotBlank(message = "客户ID不能为空") //@NotBlank(message = "客户ID不能为空")
private String customerId; private String customerId;
}
// 哪一个端:gov,resi
@NotBlank(message = "app类型不能为空")
private String appType;
}

11
epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/controller/AppController.java

@ -1,10 +1,11 @@
package com.epmet.controller; package com.epmet.controller;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerFootBarDTO; import com.epmet.dto.CustomerFootBarDTO;
import com.epmet.dto.form.CustomerFootBarFormDTO; import com.epmet.dto.form.CustomerFootBarFormDTO;
import com.epmet.dto.form.FootBarFormDTO; import com.epmet.dto.form.GovFootBarFormDTO;
import com.epmet.feign.OperCustomizeFeignClient; import com.epmet.feign.OperCustomizeOpenFeignClient;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
@ -19,17 +20,17 @@ import java.util.List;
public class AppController { public class AppController {
@Autowired @Autowired
private OperCustomizeFeignClient operCustomizeFeign; private OperCustomizeOpenFeignClient operCustomizeFeign;
/** /**
* 查询 * 查询
* @return * @return
*/ */
@PostMapping("getcustomerfootbars") @PostMapping("getcustomerfootbars")
public Result<List<CustomerFootBarDTO>> getCustomerFootBars(@RequestBody FootBarFormDTO input) { public Result<List<CustomerFootBarDTO>> getCustomerFootBars(@RequestBody GovFootBarFormDTO input) {
CustomerFootBarFormDTO form = new CustomerFootBarFormDTO(); CustomerFootBarFormDTO form = new CustomerFootBarFormDTO();
form.setCustomerId(input.getCustomerId()); form.setCustomerId(input.getCustomerId());
form.setAppType(input.getAppType()); form.setAppType(AppClientConstant.APP_GOV);
Result<List<CustomerFootBarDTO>> result = operCustomizeFeign.getCustomerfootbars(form); Result<List<CustomerFootBarDTO>> result = operCustomizeFeign.getCustomerfootbars(form);
if (CollectionUtils.isEmpty(result.getData())) { if (CollectionUtils.isEmpty(result.getData())) {
form.setCustomerId("default"); form.setCustomerId("default");

21
epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/OperCustomizeFeignClient.java

@ -1,21 +0,0 @@
package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerFootBarDTO;
import com.epmet.dto.form.CustomerFootBarFormDTO;
import com.epmet.feign.fallback.OperCustomizeFeignClientFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
@FeignClient(name = ServiceConstant.OPER_CUSTOMIZE_SERVER, fallback = OperCustomizeFeignClientFallBack.class)
public interface OperCustomizeFeignClient {
@PostMapping(value = "/oper/customize/customerfootbar/customerfootbars", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
Result<List<CustomerFootBarDTO>> getCustomerfootbars(@RequestBody CustomerFootBarFormDTO formDTO);
}

22
epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/feign/fallback/OperCustomizeFeignClientFallBack.java

@ -1,22 +0,0 @@
package com.epmet.feign.fallback;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerFootBarDTO;
import com.epmet.dto.form.CustomerFootBarFormDTO;
import com.epmet.dto.form.CustomerHomeFormDTO;
import com.epmet.dto.result.HomeDesignByCustomerResultDTO;
import com.epmet.feign.OperCustomizeFeignClient;
import org.springframework.stereotype.Component;
import java.util.List;
@Component
public class OperCustomizeFeignClientFallBack implements OperCustomizeFeignClient {
@Override
public Result<List<CustomerFootBarDTO>> getCustomerfootbars(CustomerFootBarFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "getCustomerfootbars",formDTO);
}
}

11
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java

@ -1,9 +1,17 @@
package com.epmet.feign; package com.epmet.feign;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerFootBarDTO;
import com.epmet.dto.form.CustomerFootBarFormDTO;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.feign.fallback.OperCustomizeOpenFeignClientFallback; import com.epmet.feign.fallback.OperCustomizeOpenFeignClientFallback;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
/** /**
* 本服务对外开放的API,其他服务通过引用此client调用该服务 * 本服务对外开放的API,其他服务通过引用此client调用该服务
@ -14,4 +22,7 @@ import com.epmet.feign.fallback.OperCustomizeOpenFeignClientFallback;
@FeignClient(name = ServiceConstant.OPER_CUSTOMIZE_SERVER, fallback = OperCustomizeOpenFeignClientFallback.class) @FeignClient(name = ServiceConstant.OPER_CUSTOMIZE_SERVER, fallback = OperCustomizeOpenFeignClientFallback.class)
public interface OperCustomizeOpenFeignClient { public interface OperCustomizeOpenFeignClient {
@PostMapping(value = "/oper/customize/customerfootbar/customerfootbars", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
Result<List<CustomerFootBarDTO>> getCustomerfootbars(@RequestBody CustomerFootBarFormDTO formDTO);
} }

11
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java

@ -1,8 +1,15 @@
package com.epmet.feign.fallback; package com.epmet.feign.fallback;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerFootBarDTO;
import com.epmet.dto.form.CustomerFootBarFormDTO;
import com.epmet.feign.OperCustomizeOpenFeignClient; import com.epmet.feign.OperCustomizeOpenFeignClient;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.List;
/** /**
* 本服务对外开放的API,其他服务通过引用此client调用该服务 * 本服务对外开放的API,其他服务通过引用此client调用该服务
* *
@ -11,4 +18,8 @@ import org.springframework.stereotype.Component;
*/ */
@Component @Component
public class OperCustomizeOpenFeignClientFallback implements OperCustomizeOpenFeignClient { public class OperCustomizeOpenFeignClientFallback implements OperCustomizeOpenFeignClient {
@Override
public Result<List<CustomerFootBarDTO>> getCustomerfootbars(CustomerFootBarFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "getCustomerfootbars", formDTO);
}
} }

4
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerFootBarEntity.java

@ -48,6 +48,8 @@ public class CustomerFootBarEntity extends BaseEpmetEntity {
*/ */
private String barKey; private String barKey;
private String appType;
/** /**
* 页面标题 * 页面标题
*/ */
@ -63,4 +65,6 @@ public class CustomerFootBarEntity extends BaseEpmetEntity {
*/ */
private String selectedIconPath; private String selectedIconPath;
private Integer order;
} }

6
epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFootBarDao.xml

@ -7,9 +7,11 @@
<result property="id" column="ID"/> <result property="id" column="ID"/>
<result property="barName" column="BAR_NAME"/> <result property="barName" column="BAR_NAME"/>
<result property="barKey" column="BAR_KEY"/> <result property="barKey" column="BAR_KEY"/>
<result property="appType" column="APP_TYPE"/>
<result property="pageTitle" column="PAGE_TITLE"/> <result property="pageTitle" column="PAGE_TITLE"/>
<result property="iconPath" column="ICON_PATH"/> <result property="iconPath" column="ICON_PATH"/>
<result property="selectedIconPath" column="SELECTED_ICON_PATH"/> <result property="selectedIconPath" column="SELECTED_ICON_PATH"/>
<result property="order" column="ORDER"/>
<result property="delFlag" column="DEL_FLAG"/> <result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/> <result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/> <result property="createdBy" column="CREATED_BY"/>
@ -26,6 +28,7 @@
app_type, app_type,
bar_key, bar_key,
bar_name, bar_name,
app_type,
page_title, page_title,
icon_path, icon_path,
selected_icon_path, selected_icon_path,
@ -35,7 +38,8 @@
created_by, created_by,
created_time, created_time,
updated_by, updated_by,
updated_time updated_time,
`order`
FROM FROM
customer_foot_bar customer_foot_bar
<where> <where>

10
epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/ResiFootBarFormDTO.java

@ -0,0 +1,10 @@
package com.epmet.resi.mine.dto.from;
import lombok.Data;
@Data
public class ResiFootBarFormDTO {
private String customerId;
}

7
epmet-module/resi-mine/resi-mine-server/pom.xml

@ -83,6 +83,13 @@
<version>2.0.0</version> <version>2.0.0</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>oper-customize-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies> </dependencies>
<build> <build>

39
epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/app/controller/AppController.java

@ -0,0 +1,39 @@
package com.epmet.modules.app.controller;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerFootBarDTO;
import com.epmet.dto.form.CustomerFootBarFormDTO;
import com.epmet.feign.OperCustomizeOpenFeignClient;
import com.epmet.resi.mine.dto.from.ResiFootBarFormDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@RequestMapping("app")
public class AppController {
@Autowired
private OperCustomizeOpenFeignClient operCustomizeFeign;
@PostMapping("footbar")
public Result getResiFootBars(@RequestBody ResiFootBarFormDTO input) {
CustomerFootBarFormDTO form = new CustomerFootBarFormDTO();
form.setCustomerId(input.getCustomerId());
form.setAppType(AppClientConstant.APP_RESI);
Result<List<CustomerFootBarDTO>> result = operCustomizeFeign.getCustomerfootbars(form);
if (CollectionUtils.isEmpty(result.getData())) {
form.setCustomerId("default");
result = operCustomizeFeign.getCustomerfootbars(form);
}
return result;
}
}
Loading…
Cancel
Save