-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
1,287 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>com.tang</groupId> | ||
<artifactId>tang-parent</artifactId> | ||
<version>1.6.6</version> | ||
</parent> | ||
|
||
<artifactId>tang-survey</artifactId> | ||
|
||
<description> | ||
tang-survey 调查问卷 | ||
</description> | ||
|
||
<dependencies> | ||
|
||
<dependency> | ||
<groupId>com.tang</groupId> | ||
<artifactId>tang-commons</artifactId> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
</project> |
103 changes: 103 additions & 0 deletions
103
tang-survey/src/main/kotlin/com/tang/survey/controller/SurveyFormController.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
package com.tang.survey.controller | ||
|
||
import org.springframework.security.access.prepost.PreAuthorize | ||
import org.springframework.web.bind.annotation.DeleteMapping | ||
import org.springframework.web.bind.annotation.GetMapping | ||
import org.springframework.web.bind.annotation.PathVariable | ||
import org.springframework.web.bind.annotation.PostMapping | ||
import org.springframework.web.bind.annotation.PutMapping | ||
import org.springframework.web.bind.annotation.RequestBody | ||
import org.springframework.web.bind.annotation.RequestMapping | ||
import org.springframework.web.bind.annotation.RestController | ||
|
||
import com.tang.commons.utils.AjaxResult | ||
import com.tang.commons.utils.page.PageResult | ||
import com.tang.commons.utils.page.PageUtils | ||
import com.tang.survey.entity.SurveyForm | ||
import com.tang.survey.service.SurveyFormService | ||
|
||
/** | ||
* 调查问卷逻辑控制层 | ||
* | ||
* @author Tang | ||
*/ | ||
@RestController | ||
@RequestMapping("/survey/form") | ||
class SurveyFormController(private val surveyFormService: SurveyFormService) { | ||
|
||
/** | ||
* 查询调查问卷列表 | ||
* | ||
* @param surveyForm 调查问卷对象 | ||
* @return 调查问卷列表 | ||
*/ | ||
@PreAuthorize("@auth.hasPermission('survey:form:list')") | ||
@GetMapping("/list") | ||
fun list(surveyForm: SurveyForm): PageResult { | ||
PageUtils.startPage() | ||
val list = surveyFormService.selectSurveyFormList(surveyForm) | ||
return PageUtils.getDataTable(list) | ||
} | ||
|
||
/** | ||
* 通过调查问卷主键查询调查问卷信息 | ||
* | ||
* @param formId 调查问卷主键 | ||
* @return 调查问卷信息 | ||
*/ | ||
@PreAuthorize("@auth.hasPermission('survey:form:list')") | ||
@GetMapping("/{formId}") | ||
fun selectSurveyFormByFormId(@PathVariable formId: Long): AjaxResult { | ||
val surveyForm = surveyFormService.selectSurveyFormByFormId(formId) | ||
return AjaxResult.success(surveyForm) | ||
} | ||
|
||
/** | ||
* 新增调查问卷信息 | ||
* | ||
* @param surveyForm 调查问卷信息 | ||
* @return 影响行数 | ||
*/ | ||
@PreAuthorize("@auth.hasPermission('survey:form:add')") | ||
@PostMapping | ||
fun insertSurveyForm(@RequestBody surveyForm: SurveyForm): AjaxResult { | ||
return AjaxResult.rows(surveyFormService.insertSurveyForm(surveyForm)) | ||
} | ||
|
||
/** | ||
* 通过调查问卷主键修改调查问卷信息 | ||
* | ||
* @param surveyForm 调查问卷信息 | ||
* @return 影响行数 | ||
*/ | ||
@PreAuthorize("@auth.hasPermission('survey:form:edit')") | ||
@PutMapping | ||
fun updateSurveyFormByFormId(@RequestBody surveyForm: SurveyForm): AjaxResult { | ||
return AjaxResult.rows(surveyFormService.updateSurveyFormByFormId(surveyForm)) | ||
} | ||
|
||
/** | ||
* 通过调查问卷主键删除调查问卷信息 | ||
* | ||
* @param formId 调查问卷主键 | ||
* @return 影响行数 | ||
*/ | ||
@PreAuthorize("@auth.hasPermission('survey:form:delete')") | ||
@DeleteMapping("/{formId}") | ||
fun deleteSurveyFormByFormId(@PathVariable formId: Long): AjaxResult { | ||
return AjaxResult.rows(surveyFormService.deleteSurveyFormByFormId(formId)) | ||
} | ||
|
||
/** | ||
* 通过调查问卷主键数组批量删除调查问卷信息 | ||
* | ||
* @param formIds 调查问卷主键数组 | ||
* @return 影响行数 | ||
*/ | ||
@PreAuthorize("@auth.hasPermission('survey:form:delete')") | ||
@DeleteMapping | ||
fun deleteSurveyFormByFormIds(@RequestBody formIds: Array<Long>): AjaxResult { | ||
return AjaxResult.rows(surveyFormService.deleteSurveyFormByFormIds(formIds)) | ||
} | ||
|
||
} |
103 changes: 103 additions & 0 deletions
103
tang-survey/src/main/kotlin/com/tang/survey/controller/SurveyUserAnswerController.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
package com.tang.survey.controller | ||
|
||
import org.springframework.security.access.prepost.PreAuthorize | ||
import org.springframework.web.bind.annotation.DeleteMapping | ||
import org.springframework.web.bind.annotation.GetMapping | ||
import org.springframework.web.bind.annotation.PathVariable | ||
import org.springframework.web.bind.annotation.PostMapping | ||
import org.springframework.web.bind.annotation.PutMapping | ||
import org.springframework.web.bind.annotation.RequestBody | ||
import org.springframework.web.bind.annotation.RequestMapping | ||
import org.springframework.web.bind.annotation.RestController | ||
|
||
import com.tang.commons.utils.AjaxResult | ||
import com.tang.commons.utils.page.PageResult | ||
import com.tang.commons.utils.page.PageUtils | ||
import com.tang.survey.entity.SurveyUserAnswer | ||
import com.tang.survey.service.SurveyUserAnswerService | ||
|
||
/** | ||
* 调查问卷用户答案逻辑控制层 | ||
* | ||
* @author Tang | ||
*/ | ||
@RestController | ||
@RequestMapping("/survey/answer") | ||
class SurveyUserAnswerController(private val surveyUserAnswerService: SurveyUserAnswerService) { | ||
|
||
/** | ||
* 查询调查问卷用户答案列表 | ||
* | ||
* @param surveyUserAnswer 调查问卷用户答案对象 | ||
* @return 调查问卷用户答案列表 | ||
*/ | ||
@PreAuthorize("@auth.hasPermission('survey:answer:list')") | ||
@GetMapping("/list") | ||
fun list(surveyUserAnswer: SurveyUserAnswer): PageResult { | ||
PageUtils.startPage() | ||
val list = surveyUserAnswerService.selectSurveyUserAnswerList(surveyUserAnswer) | ||
return PageUtils.getDataTable(list) | ||
} | ||
|
||
/** | ||
* 通过调查问卷用户答案主键查询调查问卷用户答案信息 | ||
* | ||
* @param answerId 调查问卷用户答案主键 | ||
* @return 调查问卷用户答案信息 | ||
*/ | ||
@PreAuthorize("@auth.hasPermission('survey:answer:list')") | ||
@GetMapping("/{answerId}") | ||
fun selectSurveyUserAnswerByAnswerId(@PathVariable answerId: Long): AjaxResult { | ||
val surveyUserAnswer = surveyUserAnswerService.selectSurveyUserAnswerByAnswerId(answerId) | ||
return AjaxResult.success(surveyUserAnswer) | ||
} | ||
|
||
/** | ||
* 新增调查问卷用户答案信息 | ||
* | ||
* @param surveyUserAnswer 调查问卷用户答案信息 | ||
* @return 影响行数 | ||
*/ | ||
@PreAuthorize("@auth.hasPermission('survey:answer:add')") | ||
@PostMapping | ||
fun insertSurveyUserAnswer(@RequestBody surveyUserAnswer: SurveyUserAnswer): AjaxResult { | ||
return AjaxResult.rows(surveyUserAnswerService.insertSurveyUserAnswer(surveyUserAnswer)) | ||
} | ||
|
||
/** | ||
* 通过调查问卷用户答案主键修改调查问卷用户答案信息 | ||
* | ||
* @param surveyUserAnswer 调查问卷用户答案信息 | ||
* @return 影响行数 | ||
*/ | ||
@PreAuthorize("@auth.hasPermission('survey:answer:edit')") | ||
@PutMapping | ||
fun updateSurveyUserAnswerByAnswerId(@RequestBody surveyUserAnswer: SurveyUserAnswer): AjaxResult { | ||
return AjaxResult.rows(surveyUserAnswerService.updateSurveyUserAnswerByAnswerId(surveyUserAnswer)) | ||
} | ||
|
||
/** | ||
* 通过调查问卷用户答案主键删除调查问卷用户答案信息 | ||
* | ||
* @param answerId 调查问卷用户答案主键 | ||
* @return 影响行数 | ||
*/ | ||
@PreAuthorize("@auth.hasPermission('survey:answer:delete')") | ||
@DeleteMapping("/{answerId}") | ||
fun deleteSurveyUserAnswerByAnswerId(@PathVariable answerId: Long): AjaxResult { | ||
return AjaxResult.rows(surveyUserAnswerService.deleteSurveyUserAnswerByAnswerId(answerId)) | ||
} | ||
|
||
/** | ||
* 通过调查问卷用户答案主键数组批量删除调查问卷用户答案信息 | ||
* | ||
* @param answerIds 调查问卷用户答案主键数组 | ||
* @return 影响行数 | ||
*/ | ||
@PreAuthorize("@auth.hasPermission('survey:answer:delete')") | ||
@DeleteMapping | ||
fun deleteSurveyUserAnswerByAnswerIds(@RequestBody answerIds: Array<Long>): AjaxResult { | ||
return AjaxResult.rows(surveyUserAnswerService.deleteSurveyUserAnswerByAnswerIds(answerIds)) | ||
} | ||
|
||
} |
62 changes: 62 additions & 0 deletions
62
tang-survey/src/main/kotlin/com/tang/survey/entity/SurveyForm.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package com.tang.survey.entity | ||
|
||
import java.time.LocalDate | ||
import java.time.LocalDateTime | ||
|
||
import org.apache.commons.lang3.StringUtils | ||
|
||
import com.tang.commons.base.entity.BaseEntity | ||
|
||
/** | ||
* 调查问卷实体类 qs_survey_form | ||
* | ||
* @author Tang | ||
*/ | ||
class SurveyForm : BaseEntity() { | ||
|
||
companion object { | ||
@java.io.Serial | ||
private val serialVersionUID = 1L | ||
} | ||
|
||
/** | ||
* 问卷ID | ||
*/ | ||
var formId: Long? = null | ||
|
||
/** | ||
* 问卷编码 | ||
*/ | ||
var formCode: Long? = null | ||
|
||
/** | ||
* 问卷名称 | ||
*/ | ||
var formName: String? = null | ||
|
||
/** | ||
* 问卷数据 | ||
*/ | ||
var formData: String? = null | ||
|
||
/** | ||
* 发布状态{0=未发布, 1=已发布} | ||
*/ | ||
var publishStatus: String? = null | ||
|
||
/** | ||
* 发布时间 | ||
*/ | ||
var publishTime: LocalDateTime? = null | ||
|
||
/** | ||
* 关闭时间 | ||
*/ | ||
var closeTime: LocalDateTime? = null | ||
|
||
/** | ||
* 状态{0=正常, 1=停用} | ||
*/ | ||
var status: String? = null | ||
|
||
} |
Oops, something went wrong.