|
@@ -2,12 +2,22 @@ package com.om.controller.admin;
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.om.entity.po.Manual;
|
|
|
+import com.om.entity.vo.ManualVO;
|
|
|
import com.om.service.IManualService;
|
|
|
import com.om.utils.Result;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
+import javafx.print.Collation;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import java.time.LocalDateTime;
|
|
|
+import java.time.ZoneOffset;
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.Collection;
|
|
|
+import java.util.Iterator;
|
|
|
+
|
|
|
/**
|
|
|
* <p>
|
|
|
* 前端控制器
|
|
@@ -31,6 +41,32 @@ public class ManualController {
|
|
|
return Result.succ(manualService.save(manual));
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation("新增多版本使用手册接口")
|
|
|
+ @PostMapping("/savemore")
|
|
|
+ public Result<Object> saveMore(@RequestBody ManualVO manualVO) {
|
|
|
+ Collection<Manual> collection = new ArrayList<>();
|
|
|
+ String title = manualVO.getTitle();
|
|
|
+ LocalDateTime createTime = manualVO.getCreateTime();
|
|
|
+ String[] langs = manualVO.getLang();
|
|
|
+ String[] urls = manualVO.getUrl();
|
|
|
+ String[] fileNames = manualVO.getFileName();
|
|
|
+ Arrays.stream(manualVO.getClientCode()).forEach(client -> {
|
|
|
+ for (int i = 1; i < langs.length; i++) {
|
|
|
+ Manual manual = new Manual();
|
|
|
+ manual.setTitle(title);
|
|
|
+ manual.setLang(langs[i]);
|
|
|
+ manual.setFileName(fileNames[i]);
|
|
|
+ manual.setUrl(urls[i]);
|
|
|
+ manual.setClientCode(client);
|
|
|
+ manual.setCreateTime(createTime);
|
|
|
+ manual.setUpdateTime(LocalDateTime.now());
|
|
|
+ collection.add(manual);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ return Result.succ(manualService.saveBatch(collection));
|
|
|
+ }
|
|
|
+
|
|
|
@ApiOperation("编辑使用手册接口")
|
|
|
@PostMapping("/edit")
|
|
|
public Result<Object> edit(@RequestBody Manual manual) {
|