待阅功能
This commit is contained in:
@ -30,7 +30,7 @@ public interface NotificationFeignClient {
|
||||
@ApiOperation(value = "新增待阅", tags = "新增待阅", notes = "新增待阅")
|
||||
@PostMapping("/v1/notification/sendReading")
|
||||
@OperationLogDetail(businessModule = EbtpLogBusinessModule.OTHER,operationType = EbtpLogType.SELECT,detail = "待阅-新增")
|
||||
BaseResponse sendPending(@Valid @RequestBody NoticeReadingPO noticeReadingPO);
|
||||
BaseResponse sendReading(@Valid @RequestBody NoticeReadingPO noticeReadingPO);
|
||||
|
||||
@ApiOperation(value = "待阅更新或删除", tags = "待阅更新或删除", notes = "待阅更新或删除")
|
||||
@PostMapping("/v1/notification/updateReading")
|
||||
|
@ -32,7 +32,7 @@ public class NotificationFeignFallbackFactory implements FallbackFactory<Notific
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse sendPending(@Valid NoticeReadingPO noticeReadingPO) {
|
||||
public BaseResponse sendReading(@Valid NoticeReadingPO noticeReadingPO) {
|
||||
return BaseResponse.fail("云门户-新增待阅失败:" + ExceptionUtil.stacktraceToString(throwable), noticeReadingPO);
|
||||
}
|
||||
|
||||
|
@ -8,16 +8,13 @@ import com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.service.BizReadingS
|
||||
import com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.service.BizSendMsgTemplateService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
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 org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@RestController
|
||||
@Api(tags = "待阅")
|
||||
@RequestMapping("/v1/send/reading")
|
||||
@RequestMapping("/v1/reading")
|
||||
public class BizReadingController {
|
||||
|
||||
@Resource
|
||||
@ -25,13 +22,19 @@ public class BizReadingController {
|
||||
|
||||
@ApiOperation("发送待阅")
|
||||
@PostMapping("save")
|
||||
public BaseResponse sendPending(@RequestBody NoticeReadingPO noticeReadingPO) {
|
||||
return BaseResponse.success(readingService.sendPending(noticeReadingPO));
|
||||
public BaseResponse sendReading(@RequestBody NoticeReadingPO noticeReadingPO) {
|
||||
return readingService.sendReading(noticeReadingPO);
|
||||
}
|
||||
@ApiOperation("待阅更新或删除-readingStatus:0:待阅 1:已阅 d:待阅删除")
|
||||
@PostMapping("update")
|
||||
public BaseResponse updateReading(@RequestBody NoticeReadingUpdateRequestBody noticeReadingUpdateRequestBody) {
|
||||
return BaseResponse.success(readingService.updateReading(noticeReadingUpdateRequestBody));
|
||||
return readingService.updateReading(noticeReadingUpdateRequestBody);
|
||||
}
|
||||
|
||||
@ApiOperation("待阅更新1:已阅")
|
||||
@PostMapping("updateReaded")
|
||||
public BaseResponse updateReaded(@RequestParam String readingCode) {
|
||||
return readingService.updateReaded(readingCode);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -2,10 +2,15 @@ package com.chinaunicom.mall.ebtp.extend.bizshortmessageemail.entity;
|
||||
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
public class NoticeReadingUpdateRequestBody {
|
||||
|
||||
@ApiModelProperty("待阅信息的编号")
|
||||
|
@ -15,7 +15,9 @@ import java.io.IOException;
|
||||
@Component
|
||||
public interface BizReadingService {
|
||||
|
||||
BaseResponse sendPending(NoticeReadingPO noticeReadingPO);
|
||||
BaseResponse sendReading(NoticeReadingPO noticeReadingPO);
|
||||
|
||||
BaseResponse updateReading(NoticeReadingUpdateRequestBody noticeReadingUpdateRequestBody);
|
||||
|
||||
BaseResponse updateReaded(String readingCode);
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author yanss
|
||||
@ -26,8 +27,7 @@ public class BizReadingServiceImpl implements BizReadingService {
|
||||
private IBaseCacheUserService cacheUserService;
|
||||
|
||||
@Override
|
||||
public BaseResponse sendPending(NoticeReadingPO noticeReadingPO) {
|
||||
// noticeReadingPO.setSendCenter("na134");
|
||||
public BaseResponse sendReading(NoticeReadingPO noticeReadingPO) {
|
||||
noticeReadingPO.setSendCenter("ebtp");
|
||||
noticeReadingPO.setSendModule("biz-service-ebtp-extend");
|
||||
if(StringUtils.isBlank(noticeReadingPO.getOperatorType())){
|
||||
@ -37,11 +37,32 @@ public class BizReadingServiceImpl implements BizReadingService {
|
||||
noticeReadingPO.setReadingSourceUserId(cacheUserService.getCacheUser().getUserId());
|
||||
noticeReadingPO.setReadingSourceUserCn(cacheUserService.getCacheUser().getFullName());
|
||||
}
|
||||
return notificationFeignClient.sendPending(noticeReadingPO);
|
||||
BaseResponse baseResponse=notificationFeignClient.sendReading(noticeReadingPO);
|
||||
if(baseResponse.isSuccess() && baseResponse.getCode()==1){
|
||||
BaseResponse.success(baseResponse.getMessage(),null);
|
||||
}
|
||||
return baseResponse;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse updateReading(NoticeReadingUpdateRequestBody noticeReadingUpdateRequestBody) {
|
||||
return notificationFeignClient.updateReading(noticeReadingUpdateRequestBody);
|
||||
BaseResponse baseResponse=notificationFeignClient.updateReading(noticeReadingUpdateRequestBody);
|
||||
if(baseResponse.isSuccess() && baseResponse.getCode()==1){
|
||||
BaseResponse.success(baseResponse.getMessage(),null);
|
||||
}
|
||||
return baseResponse;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseResponse updateReaded(String readingCode) {
|
||||
NoticeReadingUpdateRequestBody noticeReadingUpdateRequestBody=new NoticeReadingUpdateRequestBody();
|
||||
noticeReadingUpdateRequestBody.setReadingCode(readingCode);
|
||||
noticeReadingUpdateRequestBody.setReadingStatus("1");
|
||||
noticeReadingUpdateRequestBody.setReadingType("1");
|
||||
BaseResponse baseResponse=notificationFeignClient.updateReading(noticeReadingUpdateRequestBody);
|
||||
if(baseResponse.isSuccess() && baseResponse.getCode()==1){
|
||||
BaseResponse.success(baseResponse.getMessage(),null);
|
||||
}
|
||||
return baseResponse;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user