init_object,增加了不完全的登录API,完善数据库设计

This commit is contained in:
guo
2024-06-28 22:31:21 +08:00
parent b0deeb58af
commit f1dc42fce5
14 changed files with 417 additions and 0 deletions
@@ -0,0 +1,40 @@
package com.guo.learningprogresstracker;
import com.guo.learningprogresstracker.domain.entity.TestTableEntity;
import com.guo.learningprogresstracker.service.impl.TestTableServiceImpl;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import java.util.HashMap;
import static org.junit.jupiter.api.Assertions.assertTrue;
/**
* 用于测试数据库连接是否成功
*/
@SpringBootTest
public class DataSourceTest {
@Autowired
TestTableServiceImpl testTableService;
@Test
public void testAdd(){
TestTableEntity testTableEntity = new TestTableEntity();
testTableEntity.setIdName("guo_test");
boolean save = testTableService.save(testTableEntity);
assertTrue(save,"创建idName为guo_test的数据成功");
}
@Test
public void testDelete(){
HashMap<String, Object> stringStringHashMap = new HashMap<>();
stringStringHashMap.put("id_name", "guo_test");
boolean delete = testTableService.removeByMap(stringStringHashMap);
assertTrue(delete,"删除idName为guo_test的数据失败");
}
}