提交 b3591d4c 编写于 作者: IBZGIT01's avatar IBZGIT01

ibizdev提交

上级 9eddfd66
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>demo-srv</artifactId>
<name>demo-srv</name>
<packaging>jar</packaging>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.1.RELEASE</version>
</parent>
<properties>
<junit.version>4.12</junit.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
package cn.ibizlab.demo;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.SpringApplication;
import org.mybatis.spring.annotation.MapperScan;
@SpringBootApplication
public class demoMain{
public static void main(String[] args) {
SpringApplication.run(demoMain.class, args);
}
}
\ No newline at end of file
package cn.ibizlab.demo.springboot.domain;
import lombok.Data;
import java.sql.Timestamp;
/**
* 实体[DBET] 数据对象
*/
@Data
public class DBET{
private String dbetname;
private Timestamp createdate;
private String createman;
private String dbetid;
private Timestamp updatedate;
private String updateman;
}
package cn.ibizlab.demo.springboot.service;
import cn.ibizlab.demo.springboot.domain.DBET;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[DBET] 服务对象接口
*/
public interface DBETService extends IService<DBET>{
DBET get(DBET et);
boolean update(DBET et);
boolean checkKey(DBET et);
boolean create(DBET et);
boolean remove(DBET et);
boolean save(DBET et);
boolean getDraft(DBET et);
}
\ No newline at end of file
package cn.ibizlab.demo.springboot.service.impl;
import org.springframework.stereotype.Service;
import cn.ibizlab.demo.springboot.mapper.DBETMapper;
import cn.ibizlab.demo.springboot.domain.DBET;
import cn.ibizlab.demo.springboot.service.DBETService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* 实体[DBET] 服务对象接口实现
*/
@Service
public class DBETServiceImpl extends ServiceImpl<DBETMapper, DBET> implements DBETService{
}
\ No newline at end of file
server:
port: 8080
servlet:
contextPath: /
spring:
datasource:
username: test
password: 'test'
url: jdbc:h2:mem:test;
driver-class-name: org.h2.Driver
logging:
level:
cn.ibizlab.demo: debug
\ No newline at end of file
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import cn.ibizlab.demo.jctaskMain;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.MvcResult;
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = jctaskMain.class)
public class ApplicationTest {
private MockMvc mockMvc;
@Autowired
private WebApplicationContext webApplicationContext;
@Before
public void setUp() {
mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext).build();
}
@Test
public void contextLoads() {
try {
MvcResult mvcResult = mockMvc.perform(MockMvcRequestBuilders.post("/tsweb2/quickstart/qjd")).andReturn();
System.out.println("返回结果为:"+mvcResult.getResponse().getContentAsString());
} catch (Exception e) {
e.printStackTrace();
}
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册