Browse Source

王公峰:获取活动打卡地点详情接口

feature/dangjian
wanggongfeng 6 years ago
parent
commit
e95833261a
  1. 15
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActUserRelationController.java
  2. 11
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AppActUserRelationFeignClient.java
  3. 6
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AppActUserRelationFeignClientFallback.java
  4. 9
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActUserRelationService.java
  5. 7
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActUserRelationServiceImpl.java
  6. 61
      esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/AppActInfoDTO.java
  7. 57
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActInfoController.java
  8. 5
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActUserClockLogController.java

15
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActUserRelationController.java

@ -3,6 +3,7 @@ package com.elink.esua.epdc.controller;
import com.elink.esua.epdc.activity.ActUserRelationDTO; import com.elink.esua.epdc.activity.ActUserRelationDTO;
import com.elink.esua.epdc.activity.AppActUserClockLogDTO; import com.elink.esua.epdc.activity.AppActUserClockLogDTO;
import com.elink.esua.epdc.activity.AppClockListDTO; import com.elink.esua.epdc.activity.AppClockListDTO;
import com.elink.esua.epdc.activity.result.AppActInfoDTO;
import com.elink.esua.epdc.common.token.dto.TokenDto; import com.elink.esua.epdc.common.token.dto.TokenDto;
import com.elink.esua.epdc.common.token.util.IdentityNoAnalysisUtil; import com.elink.esua.epdc.common.token.util.IdentityNoAnalysisUtil;
import com.elink.esua.epdc.commons.tools.annotation.LoginUser; import com.elink.esua.epdc.commons.tools.annotation.LoginUser;
@ -151,4 +152,18 @@ public class ApiActUserRelationController {
return result1; return result1;
} }
/**
* 获取活动打卡地点详情
*
* @param actId
* @return com.elink.esua.epdc.commons.tools.utils.Result
* @author wanggongfeng
* @date 2019/12/13 14:41
*/
@GetMapping("clockAddressDetail/{actId}")
public Result<AppActInfoDTO> clockAddressDetail(@PathVariable("actId") String actId) {
return actUserRelationService.clockAddressDetail(actId);
}
} }

11
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AppActUserRelationFeignClient.java

@ -3,6 +3,7 @@ package com.elink.esua.epdc.feign;
import com.elink.esua.epdc.activity.ActUserRelationDTO; import com.elink.esua.epdc.activity.ActUserRelationDTO;
import com.elink.esua.epdc.activity.AppActUserClockLogDTO; import com.elink.esua.epdc.activity.AppActUserClockLogDTO;
import com.elink.esua.epdc.activity.AppClockListDTO; import com.elink.esua.epdc.activity.AppClockListDTO;
import com.elink.esua.epdc.activity.result.AppActInfoDTO;
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; import com.elink.esua.epdc.commons.tools.constant.ServiceConstant;
import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.feign.fallback.AppActUserRelationFeignClientFallback; import com.elink.esua.epdc.feign.fallback.AppActUserRelationFeignClientFallback;
@ -18,7 +19,7 @@ import org.springframework.web.bind.annotation.PathVariable;
* @Authorwanggongfeng * @Authorwanggongfeng
* @Date2019/12/16 17:36 * @Date2019/12/16 17:36
*/ */
@FeignClient(name = ServiceConstant.EPDC_HEART_SERVER, fallback = AppActUserRelationFeignClientFallback.class) @FeignClient(name = ServiceConstant.EPDC_HEART_SERVER, fallback = AppActUserRelationFeignClientFallback.class,url = "http://127.0.0.1:9060")
public interface AppActUserRelationFeignClient { public interface AppActUserRelationFeignClient {
/** /**
@ -53,4 +54,12 @@ public interface AppActUserRelationFeignClient {
@GetMapping(value = "heart/appactuserrelation/selectListActUserRelation/{actId}") @GetMapping(value = "heart/appactuserrelation/selectListActUserRelation/{actId}")
Result<AppClockListDTO> selectListActUserRelation(@PathVariable("actId") String actId); Result<AppClockListDTO> selectListActUserRelation(@PathVariable("actId") String actId);
/**
* 获取活动打卡地点详情
* @param actId
* @return
*/
@GetMapping("heart/appactinfo/clockAddressDetail/{actId}")
Result<AppActInfoDTO> clockAddressDetail(@PathVariable("actId") String actId);
} }

6
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AppActUserRelationFeignClientFallback.java

@ -2,6 +2,7 @@ package com.elink.esua.epdc.feign.fallback;
import com.elink.esua.epdc.activity.ActUserRelationDTO; import com.elink.esua.epdc.activity.ActUserRelationDTO;
import com.elink.esua.epdc.activity.AppActUserClockLogDTO; import com.elink.esua.epdc.activity.AppActUserClockLogDTO;
import com.elink.esua.epdc.activity.result.AppActInfoDTO;
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; import com.elink.esua.epdc.commons.tools.constant.ServiceConstant;
import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; import com.elink.esua.epdc.commons.tools.utils.ModuleUtils;
import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.commons.tools.utils.Result;
@ -34,4 +35,9 @@ public class AppActUserRelationFeignClientFallback implements AppActUserRelation
return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "selectListActUserRelation", actId); return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "selectListActUserRelation", actId);
} }
@Override
public Result<AppActInfoDTO> clockAddressDetail(String actId) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "clockAddressDetail", actId);
}
} }

9
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActUserRelationService.java

@ -3,6 +3,7 @@ package com.elink.esua.epdc.service;
import com.elink.esua.epdc.activity.ActUserRelationDTO; import com.elink.esua.epdc.activity.ActUserRelationDTO;
import com.elink.esua.epdc.activity.AppActUserClockLogDTO; import com.elink.esua.epdc.activity.AppActUserClockLogDTO;
import com.elink.esua.epdc.activity.AppClockListDTO; import com.elink.esua.epdc.activity.AppClockListDTO;
import com.elink.esua.epdc.activity.result.AppActInfoDTO;
import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.commons.tools.utils.Result;
/** /**
@ -44,4 +45,12 @@ public interface ActUserRelationService {
*/ */
Result<AppClockListDTO> getClockList(String actId); Result<AppClockListDTO> getClockList(String actId);
/**
* 获取活动打卡地点详情
* @param actId
* @Author wanggongfeng
* @return
*/
Result<AppActInfoDTO> clockAddressDetail(String actId);
} }

7
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActUserRelationServiceImpl.java

@ -3,6 +3,7 @@ package com.elink.esua.epdc.service.impl;
import com.elink.esua.epdc.activity.ActUserRelationDTO; import com.elink.esua.epdc.activity.ActUserRelationDTO;
import com.elink.esua.epdc.activity.AppActUserClockLogDTO; import com.elink.esua.epdc.activity.AppActUserClockLogDTO;
import com.elink.esua.epdc.activity.AppClockListDTO; import com.elink.esua.epdc.activity.AppClockListDTO;
import com.elink.esua.epdc.activity.result.AppActInfoDTO;
import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.feign.AppActUserRelationFeignClient; import com.elink.esua.epdc.feign.AppActUserRelationFeignClient;
import com.elink.esua.epdc.service.ActUserRelationService; import com.elink.esua.epdc.service.ActUserRelationService;
@ -46,4 +47,10 @@ public class ActUserRelationServiceImpl implements ActUserRelationService {
return result; return result;
} }
@Override
public Result<AppActInfoDTO> clockAddressDetail(String actId) {
Result<AppActInfoDTO> dataResult = actInfoFeignClient.clockAddressDetail(actId);
return dataResult;
}
} }

61
esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/AppActInfoDTO.java

@ -0,0 +1,61 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.activity.result;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 活动信息表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2019-12-11
*/
@Data
public class AppActInfoDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 活动签到打卡地点
*/
private String signinAddress;
/**
* 活动签到打卡位置经度
*/
private BigDecimal signinLongitude;
/**
* 活动签到打卡位置纬度
*/
private BigDecimal signinLatitude;
/**
* 活动签到打卡半径(单位)
*/
private Integer clockRadius;
}

57
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActInfoController.java

@ -0,0 +1,57 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.activity.controller;
import com.elink.esua.epdc.activity.ActInfoDTO;
import com.elink.esua.epdc.activity.result.AppActInfoDTO;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.modules.activity.service.ActInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 活动信息表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2019-12-11
*/
@RestController
@RequestMapping("appactinfo")
public class AppActInfoController {
@Autowired
private ActInfoService actInfoService;
/**
* 获取活动打卡地点详情
* @param actId
* @return
*/
@GetMapping("clockAddressDetail/{actId}")
public Result<AppActInfoDTO> clockAddressDetail(@PathVariable("actId")String actId){
ActInfoDTO actInfoDTO = actInfoService.get(actId);
AppActInfoDTO appActInfoDTO = ConvertUtils.sourceToTarget(actInfoDTO, AppActInfoDTO.class);
return new Result<AppActInfoDTO>().ok(appActInfoDTO);
}
}

5
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActUserClockLogController.java

@ -24,10 +24,7 @@ import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.modules.activity.service.ActUserClockLogService; import com.elink.esua.epdc.modules.activity.service.ActUserClockLogService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/** /**

Loading…
Cancel
Save