12 changed files with 302 additions and 0 deletions
@ -0,0 +1,41 @@ |
|||
package com.elink.esua.epdc.controller; |
|||
|
|||
import com.elink.esua.epdc.activity.form.EpdcAppActBannerFormDTO; |
|||
import com.elink.esua.epdc.activity.result.EpdcAppActBannerResultDTO; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; |
|||
import com.elink.esua.epdc.service.ActBannerService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* APP 活动Banner相关接口 |
|||
* |
|||
* @author zhangyong |
|||
* @date 2020/05/25 18:30 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("heart/actbanner") |
|||
public class ApiActBannerController { |
|||
|
|||
@Autowired |
|||
private ActBannerService actBannerService; |
|||
|
|||
/** |
|||
* 获取上架的banner列表 |
|||
* |
|||
* @param formDto |
|||
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.activity.result.EpdcAppActBannerResultDTO>> |
|||
* @Author zhangyong |
|||
* @Date 18:27 2020-05-25 |
|||
**/ |
|||
@GetMapping("banner/list") |
|||
public Result<List<EpdcAppActBannerResultDTO>> bannerList(EpdcAppActBannerFormDTO formDto) { |
|||
ValidatorUtils.validateEntity(formDto); |
|||
return actBannerService.getBannerList(formDto); |
|||
} |
|||
} |
|||
@ -0,0 +1,32 @@ |
|||
package com.elink.esua.epdc.feign; |
|||
|
|||
import com.elink.esua.epdc.activity.form.EpdcAppActBannerFormDTO; |
|||
import com.elink.esua.epdc.activity.result.EpdcAppActBannerResultDTO; |
|||
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.feign.fallback.ActBannerFeignClientFallback; |
|||
import org.springframework.cloud.openfeign.FeignClient; |
|||
import org.springframework.http.MediaType; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* Banner-移动app端 |
|||
* @Author zhangyong |
|||
* @Date 18:27 2020-05-25 |
|||
*/ |
|||
@FeignClient(name = ServiceConstant.EPDC_HEART_SERVER, fallback = ActBannerFeignClientFallback.class) |
|||
public interface ActBannerFeignClient { |
|||
|
|||
/** |
|||
* 获取上架的banner列表 |
|||
* |
|||
* @param formDto |
|||
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.activity.result.EpdcAppActBannerResultDTO>> |
|||
* @Author zhangyong |
|||
* @Date 18:27 2020-05-25 |
|||
**/ |
|||
@GetMapping(value = "heart/epdc-app/actbanner/banner/list", consumes = MediaType.APPLICATION_JSON_VALUE) |
|||
Result<List<EpdcAppActBannerResultDTO>> selectBannerList(EpdcAppActBannerFormDTO formDto); |
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
package com.elink.esua.epdc.feign.fallback; |
|||
|
|||
import com.elink.esua.epdc.activity.form.EpdcAppActBannerFormDTO; |
|||
import com.elink.esua.epdc.activity.result.EpdcAppActBannerResultDTO; |
|||
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.Result; |
|||
import com.elink.esua.epdc.feign.ActBannerFeignClient; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* Banner-移动app端 |
|||
* @Author zhangyong |
|||
* @Date 18:27 2020-05-25 |
|||
*/ |
|||
@Component |
|||
public class ActBannerFeignClientFallback implements ActBannerFeignClient { |
|||
|
|||
@Override |
|||
public Result<List<EpdcAppActBannerResultDTO>> selectBannerList(EpdcAppActBannerFormDTO formDto) { |
|||
return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "selectBannerList", formDto); |
|||
} |
|||
} |
|||
@ -0,0 +1,26 @@ |
|||
package com.elink.esua.epdc.service; |
|||
|
|||
import com.elink.esua.epdc.activity.form.EpdcAppActBannerFormDTO; |
|||
import com.elink.esua.epdc.activity.result.EpdcAppActBannerResultDTO; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* APP 活动Banner相关接口 |
|||
* |
|||
* @author zhangyong |
|||
* @date 2020/05/25 18:30 |
|||
*/ |
|||
public interface ActBannerService { |
|||
|
|||
/** |
|||
* 获取上架的banner列表 |
|||
* |
|||
* @param formDto |
|||
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.activity.result.EpdcAppActBannerResultDTO>> |
|||
* @Author zhangyong |
|||
* @Date 18:27 2020-05-25 |
|||
**/ |
|||
Result<List<EpdcAppActBannerResultDTO>> getBannerList(EpdcAppActBannerFormDTO formDto); |
|||
} |
|||
@ -0,0 +1,23 @@ |
|||
package com.elink.esua.epdc.service.impl; |
|||
|
|||
import com.elink.esua.epdc.activity.form.EpdcAppActBannerFormDTO; |
|||
import com.elink.esua.epdc.activity.result.EpdcAppActBannerResultDTO; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.feign.ActBannerFeignClient; |
|||
import com.elink.esua.epdc.service.ActBannerService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Service |
|||
public class ActBannerServiceImpl implements ActBannerService { |
|||
|
|||
@Autowired |
|||
private ActBannerFeignClient actBannerFeignClient; |
|||
|
|||
@Override |
|||
public Result<List<EpdcAppActBannerResultDTO>> getBannerList(EpdcAppActBannerFormDTO formDto) { |
|||
return actBannerFeignClient.selectBannerList(formDto); |
|||
} |
|||
} |
|||
@ -0,0 +1,30 @@ |
|||
package com.elink.esua.epdc.activity.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.Min; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* banner 列表入参 |
|||
* |
|||
* @author zhangyong |
|||
* @since v1.0.0 2020-05-25 |
|||
*/ |
|||
@Data |
|||
public class EpdcAppActBannerFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 页码 |
|||
*/ |
|||
@Min(value = 1, message = "页码必须大于0") |
|||
private Integer pageIndex; |
|||
|
|||
/** |
|||
* 页容量 |
|||
*/ |
|||
@Min(value = 1, message = "页容量必须大于0") |
|||
private Integer pageSize; |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
package com.elink.esua.epdc.activity.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* banner 列表返回列表 |
|||
* |
|||
* @author zhangyong |
|||
* @since v1.0.0 2020-05-25 |
|||
*/ |
|||
@Data |
|||
public class EpdcAppActBannerResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 3908231797102233188L; |
|||
|
|||
/** |
|||
* banner标题 |
|||
*/ |
|||
private String title; |
|||
|
|||
/** |
|||
* banner图片 |
|||
*/ |
|||
private String bannerImg; |
|||
} |
|||
@ -0,0 +1,52 @@ |
|||
/** |
|||
* 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.form.EpdcAppActBannerFormDTO; |
|||
import com.elink.esua.epdc.activity.result.EpdcAppActBannerResultDTO; |
|||
import com.elink.esua.epdc.commons.tools.constant.Constant; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; |
|||
import com.elink.esua.epdc.modules.activity.service.ActBannerService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
|
|||
|
|||
@RestController |
|||
@RequestMapping(Constant.EPDC_APP + "actbanner") |
|||
public class EpdcActBannerController { |
|||
|
|||
@Autowired |
|||
private ActBannerService actBannerService; |
|||
|
|||
/** |
|||
* 获取上架的banner列表 |
|||
* |
|||
* @param formDto |
|||
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.activity.result.EpdcAppActBannerResultDTO>> |
|||
* @Author zhangyong |
|||
* @Date 18:27 2020-05-25 |
|||
**/ |
|||
@GetMapping("banner/list") |
|||
public Result<List<EpdcAppActBannerResultDTO>> bannerList(@RequestBody EpdcAppActBannerFormDTO formDto) { |
|||
ValidatorUtils.validateEntity(formDto); |
|||
return actBannerService.getBannerList(formDto); |
|||
} |
|||
} |
|||
Loading…
Reference in new issue