parent
b4e494cfcc
commit
e20c9316f1
@ -0,0 +1,59 @@
|
||||
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>opsli-boot-parent</artifactId>
|
||||
<groupId>org.opsliframework.boot</groupId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>opsli-api</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
|
||||
<dependencies>
|
||||
<!-- 引入公共模块 -->
|
||||
<dependency>
|
||||
<groupId>org.opsliframework.boot</groupId>
|
||||
<artifactId>opsli-common</artifactId>
|
||||
<version>${version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- ———————————————————— 集成SwaggerApi - 开始 ———————————————————— -->
|
||||
<!-- Swagger API文档 -->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger2</artifactId>
|
||||
<version>2.9.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
<version>2.9.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>swagger-bootstrap-ui</artifactId>
|
||||
<version>1.9.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-bean-validators</artifactId>
|
||||
<version>2.9.2</version>
|
||||
</dependency>
|
||||
<!-- # 增加两个配置解决 NumberFormatException -->
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-annotations</artifactId>
|
||||
<version>1.5.22</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-models</artifactId>
|
||||
<version>1.5.22</version>
|
||||
</dependency>
|
||||
<!-- ———————————————————— 集成SwaggerApi - 结束 ———————————————————— -->
|
||||
|
||||
</dependencies>
|
||||
</project>
|
@ -1,8 +1,7 @@
|
||||
package org.opsli.common.api;
|
||||
package org.opsli.api.base.result;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.springframework.http.HttpStatus;
|
||||
|
||||
import java.io.Serializable;
|
@ -0,0 +1,96 @@
|
||||
package org.opsli.api.web.test;
|
||||
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.opsli.api.base.result.ResultVo;
|
||||
import org.opsli.api.wrapper.test.TestModel;
|
||||
import org.opsli.common.annotation.ApiRestController;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
|
||||
/**
|
||||
* @BelongsProject: opsli-boot
|
||||
* @BelongsPackage: org.opsli.modulars.test.web
|
||||
* @Author: Parker
|
||||
* @CreateTime: 2020-09-13 17:40
|
||||
* @Description: 测试类
|
||||
*/
|
||||
@ApiRestController("/test")
|
||||
public interface ITestApi {
|
||||
|
||||
|
||||
@ApiOperation(value = "发送邮件", notes = "发送邮件")
|
||||
@GetMapping("/sendMail")
|
||||
ResultVo sendMail();
|
||||
|
||||
|
||||
/**
|
||||
* 发送 Redis 订阅消息
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "发送 Redis 订阅消息", notes = "发送 Redis 订阅消息")
|
||||
@GetMapping("/sendMsg")
|
||||
ResultVo sendMsg();
|
||||
|
||||
|
||||
/**
|
||||
* 发送 Redis 订阅消息
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "发送 Redis 测试", notes = "发送 Redis 测试")
|
||||
@GetMapping("/redisTest")
|
||||
ResultVo redisTest();
|
||||
|
||||
|
||||
/**
|
||||
* 发起 Redis 分布式锁
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "发起 Redis 分布式锁", notes = "发起 Redis 分布式锁")
|
||||
@GetMapping("/testLock")
|
||||
ResultVo testLock();
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "新增数据", notes = "新增数据")
|
||||
@GetMapping("/insert")
|
||||
ResultVo insert(TestModel entity);
|
||||
|
||||
/**
|
||||
* 修改数据
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "修改数据", notes = "修改数据")
|
||||
@GetMapping("/update")
|
||||
ResultVo update(TestModel entity);
|
||||
|
||||
|
||||
/**
|
||||
* 查看对象
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "查看对象", notes = "查看对象")
|
||||
@GetMapping("/get")
|
||||
ResultVo get(TestModel entity);
|
||||
|
||||
|
||||
/**
|
||||
* 删除对象
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "删除对象", notes = "删除对象")
|
||||
@GetMapping("/del")
|
||||
ResultVo del(String id);
|
||||
|
||||
|
||||
/**
|
||||
* 删除全部对象
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "删除全部对象", notes = "删除全部对象")
|
||||
@GetMapping("/delAll")
|
||||
ResultVo delAll();
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package org.opsli.api.wrapper.test;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.opsli.api.base.warpper.ApiWrapper;
|
||||
|
||||
/**
|
||||
* @BelongsProject: opsli-boot
|
||||
* @BelongsPackage: org.opsli.modulars.test.entity
|
||||
* @Author: Parker
|
||||
* @CreateTime: 2020-09-16 17:33
|
||||
* @Description: 测试类
|
||||
*/
|
||||
@Data
|
||||
public class TestModel extends ApiWrapper {
|
||||
|
||||
@ApiModelProperty(value = "名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
Loading…
Reference in new issue