更改为构造注入并完善方法注释

This commit is contained in:
thinkgem
2025-10-12 14:09:49 +08:00
parent 10820bf441
commit 67b3649c15
98 changed files with 556 additions and 700 deletions

View File

@@ -33,8 +33,7 @@ public class TestDataService extends CrudService<TestDataDao, TestData> {
/**
* 获取单条数据
* @param testData
* @return
* @param testData 主键
*/
@Override
public TestData get(TestData testData) {
@@ -55,9 +54,8 @@ public class TestDataService extends CrudService<TestDataDao, TestData> {
/**
* 查询分页数据
* @param testData
* @param testData 查询条件
* @param testData page 分页对象
* @return
*/
@Override
public Page<TestData> findPage(TestData testData) {
@@ -78,7 +76,6 @@ public class TestDataService extends CrudService<TestDataDao, TestData> {
* 查询子表分页数据
* @param testData 查询条件
* @param testData page 分页对象
* @return
*/
public List<TestDataChild> findSubList(TestDataChild testData) {
return testDataChildDao.findList(testData);
@@ -86,7 +83,7 @@ public class TestDataService extends CrudService<TestDataDao, TestData> {
/**
* 保存数据(插入或更新)
* @param testData
* @param testData 数据对象
*/
@Override
@Transactional
@@ -123,7 +120,7 @@ public class TestDataService extends CrudService<TestDataDao, TestData> {
/**
* 更新状态
* @param testData
* @param testData 数据对象
*/
@Override
@Transactional
@@ -133,7 +130,7 @@ public class TestDataService extends CrudService<TestDataDao, TestData> {
/**
* 删除数据
* @param testData
* @param testData 数据对象
*/
@Override
@Transactional

View File

@@ -23,8 +23,7 @@ public class TestTreeService extends TreeService<TestTreeDao, TestTree> {
/**
* 获取单条数据
* @param testTree
* @return
* @param testTree 主键
*/
@Override
public TestTree get(TestTree testTree) {
@@ -33,8 +32,7 @@ public class TestTreeService extends TreeService<TestTreeDao, TestTree> {
/**
* 查询列表数据
* @param testTree
* @return
* @param testTree 查询条件
*/
@Override
public List<TestTree> findList(TestTree testTree) {
@@ -43,7 +41,7 @@ public class TestTreeService extends TreeService<TestTreeDao, TestTree> {
/**
* 保存数据(插入或更新)
* @param testTree
* @param testTree 数据对象
*/
@Override
@Transactional
@@ -57,7 +55,7 @@ public class TestTreeService extends TreeService<TestTreeDao, TestTree> {
/**
* 更新状态
* @param testTree
* @param testTree 数据对象
*/
@Override
@Transactional
@@ -67,7 +65,7 @@ public class TestTreeService extends TreeService<TestTreeDao, TestTree> {
/**
* 删除数据
* @param testTree
* @param testTree 数据对象
*/
@Override
@Transactional

View File

@@ -4,19 +4,17 @@
*/
package com.jeesite.modules.test.web;
import com.jeesite.common.lang.StringUtils;
import com.jeesite.common.web.BaseController;
import com.jeesite.modules.test.entity.TestData;
import com.jeesite.modules.test.service.TestDataService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import com.jeesite.common.lang.StringUtils;
import com.jeesite.common.web.BaseController;
import com.jeesite.modules.test.entity.TestData;
import com.jeesite.modules.test.service.TestDataService;
/**
* 演示实例Controller
* @author ThinkGem
@@ -26,9 +24,12 @@ import com.jeesite.modules.test.service.TestDataService;
@RequestMapping(value = "${adminPath}/demo")
public class DemoController extends BaseController {
@Autowired
private TestDataService testDataService;
private final TestDataService testDataService;
public DemoController(TestDataService testDataService) {
this.testDataService = testDataService;
}
/**
* 获取数据
*/

View File

@@ -14,7 +14,6 @@ import com.jeesite.modules.test.service.TestDataService;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.annotation.Validated;
@@ -34,9 +33,12 @@ import java.util.List;
@RequestMapping(value = "${adminPath}/test/testData")
public class TestDataController extends BaseController {
@Autowired
private TestDataService testDataService;
private final TestDataService testDataService;
public TestDataController(TestDataService testDataService) {
this.testDataService = testDataService;
}
/**
* 获取数据
*/

View File

@@ -14,7 +14,6 @@ import com.jeesite.modules.test.entity.TestTree;
import com.jeesite.modules.test.service.TestTreeService;
import jakarta.servlet.http.HttpServletRequest;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.annotation.Validated;
@@ -35,9 +34,12 @@ import java.util.Map;
@RequestMapping(value = "${adminPath}/test/testTree")
public class TestTreeController extends BaseController {
@Autowired
private TestTreeService testTreeService;
private final TestTreeService testTreeService;
public TestTreeController(TestTreeService testTreeService) {
this.testTreeService = testTreeService;
}
/**
* 获取数据
*/
@@ -186,7 +188,6 @@ public class TestTreeController extends BaseController {
* 获取树结构数据
* @param excludeCode 排除的Code
* @param isShowCode 是否显示编码true or 1显示在左侧2显示在右侧false or null不显示
* @return
*/
@RequiresPermissions("test:testTree:view")
@RequestMapping(value = "treeData")