13 changed files with 268 additions and 4 deletions
@ -0,0 +1,45 @@ |
|||||
|
package com.elink.esua.epdc.controller.v2; |
||||
|
|
||||
|
import com.elink.esua.epdc.common.token.dto.TokenDto; |
||||
|
import com.elink.esua.epdc.commons.api.version.ApiVersion; |
||||
|
import com.elink.esua.epdc.commons.tools.annotation.LoginUser; |
||||
|
import com.elink.esua.epdc.commons.tools.constant.Constant; |
||||
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
||||
|
import com.elink.esua.epdc.dto.epdc.form.v2.EpdcNoticeListV2FormDTO; |
||||
|
import com.elink.esua.epdc.dto.epdc.result.*; |
||||
|
import com.elink.esua.epdc.service.NewsService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* news模块,移动端接口-V2 |
||||
|
* |
||||
|
* @Author:zhangyong |
||||
|
* @Date:2020-05-19 |
||||
|
*/ |
||||
|
@ApiVersion(2) |
||||
|
@RestController("ApiNewsV2Controller") |
||||
|
@RequestMapping("news" + Constant.VERSION_CONTROL) |
||||
|
public class ApiNewsV2Controller { |
||||
|
|
||||
|
@Autowired |
||||
|
private NewsService newsService; |
||||
|
|
||||
|
/* |
||||
|
* 移动端通知列表接口 - v2 |
||||
|
* |
||||
|
* @param userDetail |
||||
|
* @param formDto |
||||
|
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.epdc.result.EpdcNoticeListResultDTO>> |
||||
|
* @Author zhangyong |
||||
|
* @Date 09:46 2020-05-19 |
||||
|
**/ |
||||
|
@GetMapping("notice/list") |
||||
|
public Result<List<EpdcNoticeListResultDTO>> listNotice(@LoginUser TokenDto userDetail, EpdcNoticeListV2FormDTO formDto) { |
||||
|
return newsService.listV2Notice(userDetail, formDto); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,43 @@ |
|||||
|
package com.elink.esua.epdc.dto.epdc.form.v2; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import javax.validation.constraints.NotNull; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* 移动端通知列表,V2查询条件 |
||||
|
* |
||||
|
* @Author:zhangyong |
||||
|
* @Date:2020-05-19 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class EpdcNoticeListV2FormDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 4209188661412055700L; |
||||
|
|
||||
|
/** |
||||
|
* 用户所属网格ID |
||||
|
*/ |
||||
|
@NotNull(message = "用户网格ID不能为空") |
||||
|
private Long deptId; |
||||
|
|
||||
|
/** |
||||
|
* 页码 |
||||
|
*/ |
||||
|
@NotNull(message = "页码不能为空") |
||||
|
private Integer pageIndex; |
||||
|
|
||||
|
/** |
||||
|
* 页容量 |
||||
|
*/ |
||||
|
@NotNull(message = "页容量不能为空") |
||||
|
private Integer pageSize; |
||||
|
|
||||
|
/** |
||||
|
* 通知类别:模块编码(0-政策导航,1-印象,2-味道) |
||||
|
*/ |
||||
|
@NotBlank(message = "通知类别(0-政策导航,1-印象,2-味道)不能为空") |
||||
|
private String noticeCategory; |
||||
|
} |
@ -0,0 +1,66 @@ |
|||||
|
package com.elink.esua.epdc.enums; |
||||
|
|
||||
|
import com.elink.esua.epdc.commons.tools.constant.NumConstant; |
||||
|
|
||||
|
/** |
||||
|
* 消息通知分类枚举 |
||||
|
* |
||||
|
* @author zhangyong |
||||
|
* @date 09:46 2020-05-19 |
||||
|
*/ |
||||
|
public enum AppNoticeCategoryEnum { |
||||
|
|
||||
|
/** |
||||
|
* 0 政策导航 |
||||
|
*/ |
||||
|
NOTICE_NAVIGATION("notice_navigation", NumConstant.ZERO_STR), |
||||
|
/** |
||||
|
* 1 印象 |
||||
|
*/ |
||||
|
NOTICE_IMPRESSION("notice_impression", NumConstant.ONE_STR), |
||||
|
/** |
||||
|
* 2 味道 |
||||
|
*/ |
||||
|
NOTICE_TASTE("notice_taste", NumConstant.TWO_STR), |
||||
|
/** |
||||
|
* 3 硬核 |
||||
|
*/ |
||||
|
NOTICE_HARDCORE("notice_hardcore", NumConstant.THREE_STR), |
||||
|
/** |
||||
|
* 4 档案 |
||||
|
*/ |
||||
|
NOTICE_FILE("notice_file", NumConstant.FOUR_STR); |
||||
|
|
||||
|
private String name; |
||||
|
private String index; |
||||
|
|
||||
|
AppNoticeCategoryEnum(String name, String index) { |
||||
|
this.name = name; |
||||
|
this.index = index; |
||||
|
} |
||||
|
|
||||
|
public static String getName(String index) { |
||||
|
for (AppNoticeCategoryEnum c : AppNoticeCategoryEnum.values()) { |
||||
|
if (c.getIndex().equals(index)) { |
||||
|
return c.name; |
||||
|
} |
||||
|
} |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
public static String getIndex(String name) { |
||||
|
for (AppNoticeCategoryEnum c : AppNoticeCategoryEnum.values()) { |
||||
|
if (c.getName().equals(name)) { |
||||
|
return c.index; |
||||
|
} |
||||
|
} |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
public String getName() { |
||||
|
return name; |
||||
|
} |
||||
|
public String getIndex() { |
||||
|
return index; |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue