支持表单提交

This commit is contained in:
lizhengwei 2025-11-14 18:22:06 +08:00
parent 3f774d4d16
commit e043d39aec
4 changed files with 14 additions and 14 deletions

View File

@ -162,7 +162,7 @@ public class FormController {
private String formId; private String formId;
/** /**
* 表单数据 * 表单数据 key为字段idvalue为字段值
*/ */
private Map<String, Object> formData; private Map<String, Object> formData;

View File

@ -90,7 +90,7 @@ public class H5GroupController {
@Operation(summary = "创建H5分组") @Operation(summary = "创建H5分组")
@PostMapping @PostMapping
public boolean createH5Group(@RequestBody H5Group h5Group) { public boolean createH5Group(@RequestBody H5Group h5Group) {
long currentTime = System.currentTimeMillis() / 1000; long currentTime = System.currentTimeMillis();
h5Group.setCreateTime(currentTime); h5Group.setCreateTime(currentTime);
h5Group.setUpdateTime(currentTime); h5Group.setUpdateTime(currentTime);
return h5GroupService.save(h5Group); return h5GroupService.save(h5Group);
@ -107,7 +107,7 @@ public class H5GroupController {
@PutMapping("/{id}") @PutMapping("/{id}")
public boolean updateH5Group(@PathVariable Long id, @RequestBody H5Group h5Group) { public boolean updateH5Group(@PathVariable Long id, @RequestBody H5Group h5Group) {
h5Group.setId(id); h5Group.setId(id);
h5Group.setUpdateTime(System.currentTimeMillis() / 1000); h5Group.setUpdateTime(System.currentTimeMillis());
return h5GroupService.updateById(h5Group); return h5GroupService.updateById(h5Group);
} }
@ -122,4 +122,4 @@ public class H5GroupController {
public boolean deleteH5Group(@PathVariable Long id) { public boolean deleteH5Group(@PathVariable Long id) {
return h5GroupService.removeById(id); return h5GroupService.removeById(id);
} }
} }

View File

@ -40,7 +40,7 @@ public class FontServiceImpl extends ServiceImpl<FontDao, Font> implements FontS
} }
// 获取当前时间戳 // 获取当前时间戳
long currentTime = System.currentTimeMillis() / 1000; long currentTime = System.currentTimeMillis();
for (FontContent fontContent : fontContents) { for (FontContent fontContent : fontContents) {
// 保存到MongoDB // 保存到MongoDB
fontContent.setCreateTime(currentTime); fontContent.setCreateTime(currentTime);
@ -71,19 +71,19 @@ public class FontServiceImpl extends ServiceImpl<FontDao, Font> implements FontS
@Override @Override
public IPage<Font> pageFonts(String type, String name, Integer pageNum, Integer pageSize) { public IPage<Font> pageFonts(String type, String name, Integer pageNum, Integer pageSize) {
LambdaQueryWrapper<Font> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<Font> queryWrapper = new LambdaQueryWrapper<>();
// 根据语言类型查询 // 根据语言类型查询
if (StringUtils.hasText(type)) { if (StringUtils.hasText(type)) {
queryWrapper.eq(Font::getLang, type); queryWrapper.eq(Font::getLang, type);
} }
// 根据名称模糊查询 // 根据名称模糊查询
if (StringUtils.hasText(name)) { if (StringUtils.hasText(name)) {
queryWrapper.like(Font::getName, name); queryWrapper.like(Font::getName, name);
} }
queryWrapper.orderByDesc(Font::getCreateTime); queryWrapper.orderByDesc(Font::getCreateTime);
IPage<Font> page = new Page<>(pageNum, pageSize); IPage<Font> page = new Page<>(pageNum, pageSize);
return this.page(page, queryWrapper); return this.page(page, queryWrapper);
} }
@ -97,11 +97,11 @@ public class FontServiceImpl extends ServiceImpl<FontDao, Font> implements FontS
// 先从MySQL查询ID列表 // 先从MySQL查询ID列表
List<Font> fonts = this.list(new LambdaQueryWrapper<Font>() List<Font> fonts = this.list(new LambdaQueryWrapper<Font>()
.in(Font::getFontFamily, fontFamilyList)); .in(Font::getFontFamily, fontFamilyList));
if (CollectionUtils.isEmpty(fonts)) { if (CollectionUtils.isEmpty(fonts)) {
return null; return null;
} }
// 根据ID列表从MongoDB查询详细信息 // 根据ID列表从MongoDB查询详细信息
List<FontContent> fontContents = new ArrayList<>(); List<FontContent> fontContents = new ArrayList<>();
for (Font font : fonts) { for (Font font : fonts) {
@ -110,7 +110,7 @@ public class FontServiceImpl extends ServiceImpl<FontDao, Font> implements FontS
fontContents.add(fontContent); fontContents.add(fontContent);
} }
} }
return fontContents; return fontContents;
} }
@ -118,4 +118,4 @@ public class FontServiceImpl extends ServiceImpl<FontDao, Font> implements FontS
public FontContent getFontDetail(Long id) { public FontContent getFontDetail(Long id) {
return fontContentRepository.findById(id).orElse(null); return fontContentRepository.findById(id).orElse(null);
} }
} }

View File

@ -36,7 +36,7 @@ public class FormServiceImpl extends ServiceImpl<FormSubmissionDao, FormSubmissi
FormSubmission formSubmission = new FormSubmission(); FormSubmission formSubmission = new FormSubmission();
formSubmission.setTemplateFormId(templateFormId); formSubmission.setTemplateFormId(templateFormId);
formSubmission.setFormId(formId); formSubmission.setFormId(formId);
long currentTime = System.currentTimeMillis() / 1000; long currentTime = System.currentTimeMillis();
formSubmission.setSubmitTime(currentTime); formSubmission.setSubmitTime(currentTime);
formSubmission.setIpAddress(ipAddress); formSubmission.setIpAddress(ipAddress);
formSubmission.setUserAgent(userAgent); formSubmission.setUserAgent(userAgent);