xiaoCJ 8 months ago
parent fa86d17fba
commit 8783beb041

@ -16,10 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.transaction.annotation.Transactional;
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 org.springframework.web.multipart.MultipartFile;
import java.util.ArrayList;
@ -44,7 +41,7 @@ public class AdminCaseController {
@PostMapping("新增")
@Transactional
ResultEntity<String> add(@RequestBody AdminCaseDto adminCaseDto) {
ResultEntity<String> add(@ModelAttribute AdminCaseDto adminCaseDto) {
if (StringUtils.isBlank(adminCaseDto.getName())) {
return new ResultEntity<>(HttpStatus.OK, "请输入名称!");
}

@ -12,10 +12,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.transaction.annotation.Transactional;
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 org.springframework.web.multipart.MultipartFile;
import java.util.ArrayList;
@ -40,7 +37,7 @@ public class AdminDataController {
@PostMapping("新增")
@Transactional
ResultEntity<String> add(@RequestBody AdminDataDto adminDataDto) {
ResultEntity<String> add(@ModelAttribute AdminDataDto adminDataDto) {
if (StringUtils.isBlank(adminDataDto.getName())) {
return new ResultEntity<>(HttpStatus.OK, "请输入名称!");
}

Loading…
Cancel
Save