From 3e2159e45e12b2b8af058b68eafeaf082cf3fe85 Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期四, 15 九月 2022 09:30:31 +0800
Subject: [PATCH] 2022.9.15 1. 根据微信小程序前端需求,添加各对应后台逻辑

---
 src/main/kotlin/cn/flightfeather/supervision/lightshare/web/CommitmentController.kt |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/CommitmentController.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/CommitmentController.kt
index 17184e8..7862833 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/CommitmentController.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/web/CommitmentController.kt
@@ -1,12 +1,16 @@
 package cn.flightfeather.supervision.lightshare.web
 
 import cn.flightfeather.supervision.lightshare.service.CommitmentService
+import cn.flightfeather.supervision.lightshare.vo.BaseResponse
+import cn.flightfeather.supervision.lightshare.vo.CommitmentVo
 import io.swagger.annotations.Api
 import io.swagger.annotations.ApiOperation
 import io.swagger.annotations.ApiParam
 import io.swagger.annotations.ApiResponse
 import org.springframework.web.bind.annotation.*
 import org.springframework.web.multipart.MultipartFile
+import org.springframework.web.multipart.MultipartHttpServletRequest
+import javax.servlet.http.HttpServletRequest
 import javax.servlet.http.HttpServletResponse
 
 /**
@@ -34,4 +38,17 @@
         @ApiParam(value = "鎵胯涔︿俊鎭痡son") @RequestParam("params") commitmentVoList: String,
         @ApiParam(value = "鎵胯涔﹀浘鐗�") @RequestPart("images") files: Array<MultipartFile>
     ) = commitmentService.uploadLetterOfCommitment(userId, commitmentVoList, files)
+
+    @ApiOperation(value = "鐢熸垚鎵胯涔�")
+    @PostMapping("/letter/create")
+    fun createLetterOfCommitment(request: HttpServletRequest) = if (request is MultipartHttpServletRequest) {
+        val sign = request.getFile("sign")
+        val seal = request.getFile("seal")
+        val userId = request.getParameter("userId")
+        val vo = request.getParameter("coVo")
+
+        commitmentService.createLetterOfCommitment(userId, vo, sign, seal)
+    } else {
+        BaseResponse(false)
+    }
 }
\ No newline at end of file

--
Gitblit v1.9.3