提交 49047d9b 编写于 作者: zhouweidong's avatar zhouweidong

remove

上级 ff2125da
<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>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</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;
@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.rest;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import cn.ibizlab.demo.springboot.domain.DBET;
import org.springframework.beans.factory.annotation.Autowired;
import cn.ibizlab.demo.springboot.service.DBETService;
@RestController
public class DBETController{
@Autowired
private DBETService dbetService;
@PostMapping(value="/demo/springboot/dbet/maineditform/update")
public DBET mainEditFormUpdate(DBET entity){
this.dbetService.update(entity);
return entity;
}
@PostMapping(value="/demo/springboot/dbet/maineditform/remove")
public DBET mainEditFormRemove(DBET entity){
this.dbetService.remove(entity);
return entity;
}
@PostMapping(value="/demo/springboot/dbet/maineditform/getdraft")
public DBET mainEditFormGetDraft(DBET entity){
this.dbetService.getDraft(entity);
return entity;
}
@PostMapping(value="/demo/springboot/dbet/maineditform/get")
public DBET mainEditFormGet(DBET entity){
this.dbetService.get(entity);
return entity;
}
@PostMapping(value="/demo/springboot/dbet/maineditform/create")
public DBET mainEditFormCreate(DBET entity){
this.dbetService.create(entity);
return entity;
}
}
package cn.ibizlab.demo.springboot.service;
import cn.ibizlab.demo.springboot.domain.DBET;
/**
* 实体[DBET] 服务对象接口
*/
public interface DBETService{
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.domain.DBET;
import cn.ibizlab.demo.springboot.service.DBETService;
/**
* 实体[DBET] 服务对象接口实现
*/
@Service
public class DBETServiceImpl implements DBETService{
@Override
public DBET get(DBET et){
System.out.println(String.format("您当前正在调用[%s]的[%s]方法","DBETServiceImpl","get"));
return et;
}
@Override
public boolean update(DBET et){
System.out.println(String.format("您当前正在调用[%s]的[%s]方法","DBETServiceImpl","update"));
return true;
}
@Override
public boolean checkKey(DBET et){
System.out.println(String.format("您当前正在调用[%s]的[%s]方法","DBETServiceImpl","checkKey"));
return true;
}
@Override
public boolean create(DBET et){
System.out.println(String.format("您当前正在调用[%s]的[%s]方法","DBETServiceImpl","create"));
return true;
}
@Override
public boolean remove(DBET et){
System.out.println(String.format("您当前正在调用[%s]的[%s]方法","DBETServiceImpl","remove"));
return true;
}
@Override
public boolean save(DBET et){
System.out.println(String.format("您当前正在调用[%s]的[%s]方法","DBETServiceImpl","save"));
return true;
}
@Override
public boolean getDraft(DBET et){
System.out.println(String.format("您当前正在调用[%s]的[%s]方法","DBETServiceImpl","getDraft"));
return true;
}
}
\ No newline at end of file
import cn.ibizlab.demo.demoMain;
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 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 = demoMain.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("/demo/springboot/dbet/maineditform/get")).andReturn();
System.out.println("返回结果为:"+mvcResult.getResponse().getContentAsString());
} catch (Exception e) {
e.printStackTrace();
}
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册