Browse Source

发布文章接口参数调整为DTO

dev_shibei_match
jianjun 5 years ago
parent
commit
c92ab030e0
  1. 19
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/PublishArticleFormDTO.java
  2. 9
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java

19
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/PublishArticleFormDTO.java

@ -0,0 +1,19 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* 政府端-发布文章参数
*/
@Data
public class PublishArticleFormDTO implements Serializable {
private static final long serialVersionUID = -1659776209159063672L;
/**
* 要发布的草稿Id
*/
private String draftId;
}

9
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java

@ -208,16 +208,15 @@ public class ArticleController {
/** /**
* desc:发布文章 * desc:发布文章
* @param draftId * @param formDTO
* @throws Exception * @throws Exception
*/ */
@PostMapping("publish") @PostMapping("publish")
@RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH) @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH)
public Result<Boolean> publishArticle(@LoginUser TokenDto tokenDto, String draftId) throws Exception { public Result<Boolean> publishArticle(@LoginUser TokenDto tokenDto, @RequestBody PublishArticleFormDTO formDTO) throws Exception {
Boolean isSuccess = articleService.publish(tokenDto, draftId); Boolean isSuccess = articleService.publish(tokenDto, formDTO.getDraftId());
if (isSuccess){ if (isSuccess){
//TODO 异步校验内容 scanContent(tokenDto,formDTO.getDraftId());
scanContent(tokenDto,draftId);
} }
return new Result<Boolean>().ok(isSuccess); return new Result<Boolean>().ok(isSuccess);
} }

Loading…
Cancel
Save