Browse Source

平安榆山接口实现

feature/yujt_analysisHomeChange
yujt 5 years ago
parent
commit
f2a2ff0272
  1. 10
      epdc-cloud-api/pom.xml
  2. 21
      epdc-cloud-api/src/main/java/com/elink/esua/epdc/controller/ApiPropertyController.java
  3. 11
      epdc-cloud-api/src/main/java/com/elink/esua/epdc/feign/NewsFeignClient.java
  4. 5
      epdc-cloud-api/src/main/java/com/elink/esua/epdc/feign/fallback/NewsFeignClientFallback.java
  5. 13
      epdc-cloud-api/src/main/java/com/elink/esua/epdc/service/PropertyService.java
  6. 12
      epdc-cloud-api/src/main/java/com/elink/esua/epdc/service/impl/PropertyServiceImpl.java

10
epdc-cloud-api/pom.xml

@ -179,15 +179,15 @@
<spring.redis.password>epdc!redis@master1405</spring.redis.password>
<spring.datasource.druid.url>
<![CDATA[jdbc:mysql://47.104.224.45:3308/esua_epdc_api?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
<![CDATA[jdbc:mysql://47.104.224.45:3308/yushan_esua_epdc_api?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</spring.datasource.druid.url>
<spring.datasource.druid.username>epdc</spring.datasource.druid.username>
<spring.datasource.druid.username>epdcyushan</spring.datasource.druid.username>
<spring.datasource.druid.password>elink833066</spring.datasource.druid.password>
<nacos.register-enabled>false</nacos.register-enabled>
<nacos.server-addr>47.104.224.45:8848</nacos.server-addr>
<nacos.ip></nacos.ip>
<nacos.namespace>6a3577b4-7b79-43f6-aebb-9c3f31263f6a</nacos.namespace>
<nacos.namespace>de000340-5fc4-45aa-bdbc-dd96852012ad</nacos.namespace>
<!--公众号配置-->
<wx.mp.configs.appId>wx3ef8f2cd12a19fcb</wx.mp.configs.appId>
@ -220,9 +220,9 @@
<spring.redis.password>epdc!redis@master1405</spring.redis.password>
<spring.datasource.druid.url>
<![CDATA[jdbc:mysql://47.104.224.45:3308/esua_epdc_api?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
<![CDATA[jdbc:mysql://47.104.224.45:3308/yushan_esua_epdc_api?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</spring.datasource.druid.url>
<spring.datasource.druid.username>epdc</spring.datasource.druid.username>
<spring.datasource.druid.username>epdcyushan</spring.datasource.druid.username>
<spring.datasource.druid.password>elink833066</spring.datasource.druid.password>
<nacos.register-enabled>true</nacos.register-enabled>

21
epdc-cloud-api/src/main/java/com/elink/esua/epdc/controller/ApiPropertyController.java

@ -8,7 +8,9 @@ import com.elink.esua.epdc.dto.comment.TopicCommentFormDTO;
import com.elink.esua.epdc.dto.comment.TopicCommentStatementFormDTO;
import com.elink.esua.epdc.dto.comment.TopicCommentsFormDTO;
import com.elink.esua.epdc.dto.comment.result.EventCommentsResultDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcNewsListByCategoryFromDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcUserGroupInviteFormDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcNewsListResultDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcUserGroupInviteResultDTO;
import com.elink.esua.epdc.dto.group.form.*;
import com.elink.esua.epdc.dto.group.result.*;
@ -316,9 +318,26 @@ public class ApiPropertyController {
* @author zhangyuan
* @since 2020/5/21 15:04
*/
@GetMapping("police/getByDept")
@GetMapping("safety/policeGroupInfo")
public Result<PoliceResultDTO> score(@LoginUser TokenDto userDetail, PoliceFormDTO formDto) {
ValidatorUtils.validateEntity(formDto);
return propertyService.getDeptPolice(userDetail, formDto);
}
/**
* 小程序端-平安榆山-平安防范与敬请通报
*
* @param categoryCode 新闻类别编码 {@link com.elink.esua.epdc.enums.IndependentFunctionCodeEnum}
* @param userDetail 用户信息
* @param formDto 分页及查询参数
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.police.result.PoliceResultDTO>
* @author work@yujt.net.cn
* @date 2020/5/22 15:50
*/
@GetMapping("safety/newsList/{categoryCode}")
public Result<List<EpdcNewsListResultDTO>> listNewsByCategory(@PathVariable("categoryCode") String categoryCode, @LoginUser TokenDto userDetail, EpdcNewsListByCategoryFromDTO formDto) {
ValidatorUtils.validateEntity(formDto);
formDto.setCategoryCode(categoryCode);
return propertyService.listNewsByCategory(userDetail, formDto);
}
}

11
epdc-cloud-api/src/main/java/com/elink/esua/epdc/feign/NewsFeignClient.java

@ -67,6 +67,17 @@ public interface NewsFeignClient {
@GetMapping(value = "news/epdc-app/news/listNews", consumes = MediaType.APPLICATION_JSON_VALUE)
Result<List<EpdcNewsListResultDTO>> listNews(@RequestBody EpdcNewsListFromDTO formDto);
/**
* 小程序端 根据新闻类别获取新闻列表
*
* @param formDto
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List < com.elink.esua.epdc.dto.epdc.result.EpdcNewsListResultDTO>>
* @author work@yujt.net.cn
* @date 2020/5/22 15:54
*/
@GetMapping(value = "news/epdc-app/news/listNewsByCategory", consumes = MediaType.APPLICATION_JSON_VALUE)
Result<List<EpdcNewsListResultDTO>> listNewsByCategory(@RequestBody EpdcNewsListFromDTO formDto);
/**
* 移动端获取新闻详情
*

5
epdc-cloud-api/src/main/java/com/elink/esua/epdc/feign/fallback/NewsFeignClientFallback.java

@ -38,6 +38,11 @@ public class NewsFeignClientFallback implements NewsFeignClient {
return ModuleUtils.feignConError(ServiceConstant.EPDC_NEWS_SERVER, "listNews", formDto);
}
@Override
public Result<List<EpdcNewsListResultDTO>> listNewsByCategory(EpdcNewsListFromDTO formDto) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_NEWS_SERVER, "listNewsByCategory", formDto);
}
@Override
public Result<EpdcNewsDetailResultDTO> getNewsDetail(EpdcNewsDetailFormDTO formDto) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_NEWS_SERVER, "getNewsDetail", formDto);

13
epdc-cloud-api/src/main/java/com/elink/esua/epdc/service/PropertyService.java

@ -7,7 +7,9 @@ import com.elink.esua.epdc.dto.comment.TopicCommentFormDTO;
import com.elink.esua.epdc.dto.comment.TopicCommentStatementFormDTO;
import com.elink.esua.epdc.dto.comment.TopicCommentsFormDTO;
import com.elink.esua.epdc.dto.comment.result.EventCommentsResultDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcNewsListByCategoryFromDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcUserGroupInviteFormDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcNewsListResultDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcUserGroupInviteResultDTO;
import com.elink.esua.epdc.dto.group.form.*;
import com.elink.esua.epdc.dto.group.result.*;
@ -248,4 +250,15 @@ public interface PropertyService {
* @since 2020/5/21 15:50
*/
Result<PoliceResultDTO> getDeptPolice(TokenDto userDetail, PoliceFormDTO formDto);
/**
* 小程序端-平安榆山-平安防范与敬请通报
*
* @param userDetail 用户信息
* @param formDto 分页及查询参数
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.police.result.PoliceResultDTO>
* @author work@yujt.net.cn
* @date 2020/5/22 15:51
*/
Result<List<EpdcNewsListResultDTO>> listNewsByCategory(TokenDto userDetail, EpdcNewsListByCategoryFromDTO formDto);
}

12
epdc-cloud-api/src/main/java/com/elink/esua/epdc/service/impl/PropertyServiceImpl.java

@ -11,7 +11,9 @@ import com.elink.esua.epdc.dto.comment.TopicCommentStatementFormDTO;
import com.elink.esua.epdc.dto.comment.TopicCommentsFormDTO;
import com.elink.esua.epdc.dto.comment.result.EventCommentsResultDTO;
import com.elink.esua.epdc.dto.enums.TopicStateEnum;
import com.elink.esua.epdc.dto.epdc.form.EpdcNewsListByCategoryFromDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcUserGroupInviteFormDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcNewsListResultDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcUserGroupInviteResultDTO;
import com.elink.esua.epdc.dto.group.form.*;
import com.elink.esua.epdc.dto.group.result.*;
@ -26,6 +28,7 @@ import com.elink.esua.epdc.dto.topic.form.*;
import com.elink.esua.epdc.dto.topic.result.TopicDetailResultDTO;
import com.elink.esua.epdc.dto.topic.result.TopicListResultDTO;
import com.elink.esua.epdc.feign.AdminFeignClient;
import com.elink.esua.epdc.feign.NewsFeignClient;
import com.elink.esua.epdc.feign.PropertyFeignClient;
import com.elink.esua.epdc.service.PropertyService;
import com.elink.esua.epdc.utils.UserTagUtils;
@ -52,6 +55,9 @@ public class PropertyServiceImpl implements PropertyService {
@Autowired
private WxMaSecCheckTask wxMaSecCheckTask;
@Autowired
private NewsFeignClient newsFeignClient;
@Override
public Result<GroupDetailForMobileEndResultDTO> getGroupDetail(TokenDto userDetail, String id) {
if (null == userDetail) {
@ -302,4 +308,10 @@ public class PropertyServiceImpl implements PropertyService {
formDto.setGridId(userDetail.getGridId());
return propertyFeignClient.getDeptPolice(formDto);
}
@Override
public Result<List<EpdcNewsListResultDTO>> listNewsByCategory(TokenDto userDetail, EpdcNewsListByCategoryFromDTO formDto) {
formDto.setDeptId(userDetail.getGridId());
return newsFeignClient.listNewsByCategory(formDto);
}
}

Loading…
Cancel
Save